My Oracle Support Banner

Roles and Creating Stored Objects / Views (Doc ID 1011899.6)

Last updated on OCTOBER 26, 2023

Applies to:

Oracle Database Cloud Service - Version N/A and later
Oracle Database Backup Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
PL/SQL - Version to
Oracle Database - Enterprise Edition - Version to [Release 7.3.4 to 11.2]
Information in this document applies to any platform.


All roles are disabled in any *named* PL/SQL block that is created in a user schema that does not own the object being referenced in the PL/SQL block can be executed as a user other than the owner of the PL/SQL block This applies to stored procedures and functions, as well as database triggers. You can also see this by selecting from the data dictionary view called SESSION_ROLES.  This view shows all roles that are currently enabled.  If you query SESSION_ROLES from a stored object, the query will not return any rows. This is not true in Oracle8i when the stored object is created with AUTHID CURRENT_USER.




To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.