Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Dynamic Performance View question

DB_JanitorFeb 3 2013 — edited Feb 3 2013
So, Oracle maintains dynamic performance tables. Views are created off of them, and then public synonyms are created off of those views and they begin with V$. Very good. But something doesn't make sense to me.

V$DATAFILE is a synonym that references a view named V_$DATAFILE:
SQL> select dbms_metadata.get_ddl('SYNONYM', 'V$DATAFILE', 'PUBLIC') from dual;

DBMS_METADATA.GET_DDL('SYNONYM','V$DATAFILE','PUBLIC')
--------------------------------------------------------------------------------

CREATE OR REPLACE PUBLIC SYNONYM "V$DATAFILE" FOR "SYS"."V_$DATAFILE"

SQL> select object_type from dba_objects where object_name='V_$DATAFILE';

OBJECT_TYPE
-------------------
VIEW

But the definition of the view references the.... synonym itself?
SQL> select dbms_metadata.get_ddl('VIEW', 'V_$DATAFILE', 'SYS') from dual;

DBMS_METADATA.GET_DDL('VIEW','V_$DATAFILE','SYS')
--------------------------------------------------------------------------------

CREATE OR REPLACE FORCE VIEW "SYS"."V_$DATAFILE" ("FILE#", "CREATION_CHANGE#",
"CREATION_TIME", "TS#", "RFILE#", "STATUS", "ENABLED", "CHECKPOINT_CHANGE#", "C
HECKPOINT_TIME", "UNRECOVERABLE_CHANGE#", "UNRECOVERABLE_TIME", "LAST_CHANGE#",
"LAST_TIME", "OFFLINE_CHANGE#", "ONLINE_CHANGE#", "ONLINE_TIME", "BYTES", "BLOCK
S", "CREATE_BYTES", "BLOCK_SIZE", "NAME", "PLUGGED_IN", "BLOCK1_OFFSET", "AUX_NA
ME", "FIRST_NONLOGGED_SCN", "FIRST_NONLOGGED_TIME", "FOREIGN_DBID", "FOREIGN_CRE
ATION_CHANGE#", "FOREIGN_CREATION_TIME", "PLUGGED_READONLY", "PLUGIN_CHANGE#", "
PLUGIN_RESETLOGS_CHANGE#", "PLUGIN_RESETLOGS_TIME") AS
select "FILE#","CREATION_CHANGE#","CREATION_TIME","TS#","RFILE#","STATUS","ENA
BLED","CHECKPOINT_CHANGE#","CHECKPOINT_TIME","UNRECOVERABLE_CHANGE#","UNRECOVERA
BLE_TIME","LAST_CHANGE#","LAST_TIME","OFFLINE_CHANGE#","ONLINE_CHANGE#","ONLINE_
TIME","BYTES","BLOCKS","CREATE_BYTES","BLOCK_SIZE","NAME","PLUGGED_IN","BLOCK1_O
FFSET","AUX_NAME","FIRST_NONLOGGED_SCN","FIRST_NONLOGGED_TIME","FOREIGN_DBID","F
OREIGN_CREATION_CHANGE#","FOREIGN_CREATION_TIME","PLUGGED_READONLY","PLUGIN_CHAN
GE#","PLUGIN_RESETLOGS_CHANGE#","PLUGIN_RESETLOGS_TIME" from v$datafile

So the view definition references a synonym, and the synonym references the same view... seems circular. Is this Oracle Corp's way of telling me to bugger off? I just wanted to look up the name of the dynamic performance table out of curiosity.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 3 2013
Added on Feb 3 2013
7 comments
614 views