Hello...
Oracle recommends that we don't use v_$ tables... instead they recommend using v$ views... if I need to use a v_$ table (e.g. v_$backup), is there a danger on doing that?
Thanks
Printable View
Hello...
Oracle recommends that we don't use v_$ tables... instead they recommend using v$ views... if I need to use a v_$ table (e.g. v_$backup), is there a danger on doing that?
Thanks
well v_$ are not tables, they are views
why? ... as in: What is the difference between v$backup and v_$backup?
The differences areQuote:
Originally posted by TomazZ
why? ... as in: What is the difference between v$backup and v_$backup?
1. v$ are synonyms of v_$ views.
2. you cannot give grants on v$ only on v_$ views.
Other than that they are the same and there is no difference AFAIK.
And i don't see any Danger in using v$ or v_$ unless you have given the wrong grants on v_$ views.
yeah, that's what i meant:
why to use v_$backup over v$backup - they are essentially the same.
thanks for additional info, didn't know about point 2.
Maybe the v_$ views are more subject to change - it's just speculation, but perhaps Oracle do not guarantee that columns will not be dropped or renamed from V_$ views. If the v$ viewsd are more stable then that would justify their advice
Even if subjected to change how does it matter, since the v$ are synonyms of v_$ views, so if v_$ changes v$ will change (its just a different name of the same thing without an _ ).
Only benifit i see is that if you use v$ you need not give the prefix of sys where as in v_$ you need to give the prefix sys.v_$
Please dont generalise the statement, there are some V$ views & you can grant on them.Quote:
Originally posted by adewri
1. v$ are synonyms of v_$ views.
2. you cannot give grants on v$ only on v_$ views.
Abhay.Code:US18_DBA> select owner, OBJECT_type, OBJECT_NAME from dba_objects
2 where owner = 'SYS' and object_type='VIEW' and object_name like 'V$%';
OWNER OBJECT_TYPE OBJECT_NAME
------------------------------ ------------------ --------------------------------------
SYS VIEW V$CACHE
SYS VIEW V$CACHE_LOCK
SYS VIEW V$CACHE_TRANSFER
SYS VIEW V$FALSE_PING
SYS VIEW V$LOCK_ACTIVITY
SYS VIEW V$OBJECT_USAGE
SYS VIEW V$PING
SYS VIEW V$XPPOOLSEGS
Thats not called general, thats called exception. And exceptions are always there.Quote:
Originally posted by abhaysk
Please dont generalise the statement, there are some V$ views & you can grant on them.
Maybe they are by default created as synonyms, until the time when the v_$ view changes in a way that would break any existing queries against V$, at which point V$ becomes a view and is constructed to prevent queries against it from being broken by an upgrade.
Personally, if Oracle say use V$ instead of V_$, then I'll use them. don't care why.