How to list current active roles for a user in a session?

Using SESSION_ROLES it will retrieve the current roles that are active for a user in a session.

Example:
SQL> connect test/…
SQL> select * from session_roles;

ROLE
——————————
DELETE_CATALOG_ROLE

Using “SET ROLE” one can change the roles active in the current session.
Example:
SQL> select * from session_roles;
ROLE
——————————
TEST11

Enable specific set of roles in the current session
SQL> set role test11, delete_catalog_role;
Role set.

SQL> select * from session_roles;
ROLE
——————————
DELETE_CATALOG_ROLE
TEST11

Enable all roles in the current session
SQL> set role all;
Role set.

One comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.