Wednesday, March 10, 2021

Alter a trigger by a procedure ORA-01031: insufficient privileges

Tried to disable and enable a trigger (which is own by another user)  by a procedure but we are getting error  "ORA-01031: insufficient privileges" event though calling user(current user) have all the neccesary proviliges like "alter any trigger"

Solution:

I hav added  "AUTHID CURRENT_USER" clause in the procedure then it started working as below - 

Just as example-

CREATE OR REPLACE PROCEDURE test
   AUTHID CURRENT_USER  ----set Invoker Rights not
definer rights
is

begin

EXECUTE IMMEDIATE 'alter trigger tri_name disable'; 
.......
........
EXECUTE IMMEDIATE 'alter trigger tri_name enable'; 

 end ; 


  For Details

No comments: