My Oracle Support Banner

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 9.2.0.1 and later
Information in this document applies to any platform.

Purpose

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.

Scope

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.

Details

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
Purpose
Scope
Details
References

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