In my previous articles I have given some of the most important issues coming in the oracle. In this article I would like to give brief steps of most common task from DBA – How to grant select access to v$session system view to other users? This is the most common scenario in day to day life. PL/SQL developer’s always requires to analyses and monitor the multiple sessions coming from applications. With using this sessions developers will tackle the issue soon. But most of the time they do not have access to v$session view and requires the access. In this situation developers will ask the DBA’s to provide the select access to monitor those sessions.
What you will see in this article?
Need of V$Session view
How to grant select access to v$session to other users?
You can see detailed description about V$SESSION view on oracle website but i would like to give you few bullet points to remember :
SELECT owner, object_type FROM dba_objects WHERE object_name = 'V$SESSION';
These are some important points to remember!!
In this section we can see how to grant select access to v$session view step by step :
Step 1 : Important Point to remember
We can not grant directly to system view v$session as this is the synonym in oracle.
Example :
If you directly try to give the select grant to view then following error will occure.
Query :
GRANT SELECT ON v$session TO Complexsql;
grant select on v$session to test
*
ERROR at line 1:
ORA-02030: can only select from fixed tables/views
The above error will come.
Step 2 : You can check type of object v$Session
Query :
SELECT owner, object_type FROM dba_objects WHERE object_name = ‘V$SESSION’;
OWNER OBJECT_TYPE
———————— ——————-
PUBLIC SYNONYM
Step 3 : Find the object name ( View/table) associated with the synonym.
select table_owner, table_name FROM dba_synonyms where synonym_name = ‘V$SESSION’;
TABLE_OWNER TABLE_NAME
————– ——————————
SYS V_$SESSION
Step 4 : One can give the grant to V$SESSION as view or as table
You can use following statement :
GRANT SELECT ON V_$SESSION TO Complexsql;
Grant succeeded.
These are multiple steps to grant select access to v$session.
I hope you get clear idea regarding the grant access to v$session as this is synonym. You can also check multiple system tables. If you like this article or if you have issues with the same kindly comment in comments section.
In my previous article I have given details about application support engineer day to day…
In my previous articles I have given the roles and responsibilities of L1,L2 and L3…
In my previous articles i have given the hierarchy of production support in real company…
In this article i would like to provide information about production support organization structure or…
In my previous article I have given roles for L1 and L2 support engineer with…
I have started this new series of how to become application support engineer. This article…