Lesson 7 | The SESSION_PRIVS view |
Objective | Determine what privileges you have. |
SESSION_PRIVS View Privileges enabled
What privileges are enabled?
The SESSION_PRIVS
view lists the privileges that you currently have enabled. It returns information only about you, so it only makes
sense to query it for yourself. The SESSION_PRIVS
view has only one column named PRIVILEGES
.
Here is an example of the output that you will get if you query SESSION_PRIVS
while logged in as SYSTEM
.
SQL> SELECT * FROM SESSION_PRIVS;
PRIVILEGE
-----------------------------------
ALTER SYSTEM
AUDIT SYSTEM
CREATE SESSION
ALTER SESSION
RESTRICTED SESSION
CREATE TABLESPACE
ALTER TABLESPACE
MANAGE TABLESPACE
DROP TABLESPACE
UNLIMITED TABLESPACE
CREATE USER
BECOME USER
ALTER USER
This view can be very useful because it always shows you a complete list of current privileges. Rather than being granted directly to a user,
system privileges often are conferred by a role.
The SESSION_PRIVS
view tracks privileges regardless of their origin.
SESSION_PRIVS
SESSION_PRIVS describes the privileges that are currently available to the user.
Column |
Datatype |
NULL |
Description |
PRIVILEGE |
VARCHAR2(40) |
NOT NULL |
Name of the privilege |
SESSION_PRIVS: The Privilege column lists all system privileges available to the session, whether granted directly or via roles.