An example to show one cause of an "ORA-01031: insufficient privileges" error from a stored procedure
(Doc ID 391087.1)
Last updated on JULY 03, 2023
Applies to:PL/SQL - Version 220.127.116.11 and later
Information in this document applies to any platform.
The "ORA-01031: insufficient privileges" error is a fairly common yet misunderstood error due to how Oracle handles privileges granted directly and privileges granted via a Role in conjunction to Stored Procedures.
This Note should help illustrate the difference.
The example provided within creates two users where User1 owns a table. USER2 owns a stored procedure that attempts to Delete from the table owned by User1.
Although User2 can access the table from the SQL prompt, attempting to access the same table via a stored procedure fails with the error listed above.
Execution of the procedure fails when the privileges to the tables are granted via a Role, but works when granted directly.
To view full details, sign in with your My Oracle Support account.
Don't have a My Oracle Support account? Click to get started!
In this Document