DBjanitor_old wrote:The synonyms is owned by PUBLIC, not by SYS - so when SYS references v$XXX they access the underlying object, when anyone else references v$XXX they access the synomym, which points to the view owned by SYS, and the view accesses the underlying object owned by SYS.
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.
SQL> grant select on v$session to test_user; grant select on v$session to test_user * ERROR at line 1: ORA-02030: can only select from fixed tables/views
DBjanitor_old wrote:Some are fixed arrays, some are segmented arrays, some are linked lists, some turn into simple calls to the operating system.
Thanks Jonathan. That makes sense; we wouldn't want just anyone directly accessing x$ structures.
By the way, are the x$ structures simply arrays built from Oracle memory structures? We can't accurately call them views or tables could we?
Jonathan Lewis wrote:Oh my gosh. If I remember correctly, a segmented array is a linked list of fixed arrays. Or something. Isn't C a wonderful language? The way I think of the X$ tables is that they are an externalization of the C data structures that make up the Oracle instance. If I'm right, when one queries an X$ table, or a view on one, you are in fact using pointers to read values from memory locations. Hence the impossibility of read consistency: any such action would bypass those mechanisms.
Some are fixed arrays, some are segmented arrays, some are linked lists, some turn into simple calls to the operating system.