Wednesday, March 10, 2021

Alter Trigger fails with ORA-01031: insufficient privileges in Oracle

A small thing but if you don't know it might make you confused and need to spend lots of times.

 Today, we are trying to disable a trigger which is own by a differen user but we are keep geting error "ORA-01031: insufficient privileges" even though we are trying with SYS user.  

The Trigger was a "after logon on database"  trigger and database version 19c

Cause:   

Oracle enforced administer database trigger for both Current_User and Trigger Owner (provably from oracle database 12.2 onwards) .

 

Solution:  

Need to provide a direct grant of "administer database trigger" for the trigger owner and may be also for current user.     

In our case below example worked. 

example- 

Trigger owner:  SCOTT     

Then scott needs have below privilage directly (even from a ROLE which has this privilege won't work, need to provide directly)

SQL> grant administer database trigger to SCOTT ;  


 

 

 

 

 

No comments: