Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-01031: insufficient privileges

Dennies JohnFeb 12 2018 — edited Feb 12 2018

Dear all,

I want to use

EXECUTE IMMEDIATE 'alter session set events=''31156 trace name context forever, level 0x2'''

in a procedure. But while running, I am getting the message as ORA-01031: insufficient privileges

I have DBA privs on this DB

The database version

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

PL/SQL Release 11.2.0.4.0 - Production

"CORE 11.2.0.4.0 Production"

TNS for 64-bit Windows: Version 11.2.0.4.0 - Production

NLSRTL Version 11.2.0.4.0 - Production

I am connected as DENNIS and Pls see the attached screenshot for the user creation

And also, I can run this statement at sql prompt directly without EXECUTE IMMEDIATE. I am using the given statement in a package. I can use other alter statements in the package with EXECUTE IMMEDIATE!!!!

Dennis John

This post has been answered by Paul Horth on Feb 12 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 12 2018
Added on Feb 12 2018
6 comments
773 views