Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Creaste a view based on v_$session
> 1) Why could I select it directly but not from a view that uses that
> same exact select statement? In the end the same user (me) runs both,
> so why should privileges be digfferent?
I'm not sure why you are getting this, but your original post indicated that the user running the query could not see the SYS.V_$SESSION view. This means that the user running the query does not have SELECT privs on that view.
> 2) I am afraid I do not understand. What is the difference betwen V_$
> and V$?
In reality, there are no V$ views. When you create the database, there are numerous V_$ views that are created in the SYS schema. After the V_$ views are created, a synonym is created for the view. The synonym is the V$ item most people access. So when you select from V$SESSION, Oracle sees that V$SESSION is really a synonym for SYS.V_$SESSION. V$ is the synonym and V_$ is the corresponding view.
Since V$ is a synonym, you can't grant SELECT privileges on it. You need to grant SELECT privs on the view, not the synonym. So you have to sign on to the db as SYS and grant SELECT on V_$, not V$.
HTH,
Brian
-- ======================================== Brian Peasland Raytheons Systems at USGS EROS Data Center These opinions are my own and do not necessarily reflect the opinions of my company! ========================================Received on Thu Sep 21 2000 - 00:00:00 CDT