how to grant user to disable/enable trigger in Oracle?

I have Oracle table tableA under schema abc, and has a trigger triggerA associated to tableA .

grant alter on tableA to userA

but userA can not : alter table tableA disable all triggers




SayYou_SayMeAsked:
Who is Participating?
 
slightwv (䄆 Netminder) Commented:
I'm not familiar with a 'grant trigger' priv.

There is a alter any trigger but that is dangerous to grant.  I suggest creating a procedure to enable/disable the trigger and grant execute on that procedure.
0
 
OP_ZaharinCommented:
- try this:
GRANT TRIGGER ON TABLE tblname TO user
0
 
OP_ZaharinCommented:
- you are right slightwv. the GRANT TRIGGER is not available for Oracle (mix up with another db). syntax would be GRANT ADMINISTER DATABASE TRIGGER but as slightwv have mention, this is dangerous as the user are allowed to administer the whole trigger in the database.

GRANT ADMINISTER DATABASE TRIGGER TO user;
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
slightwv (䄆 Netminder) Commented:
>> ADMINISTER DATABASE TRIGGER

I don't think this gives permission to enable/disable triggers.  I'm pretty sure you need 'alter any trigger'.
0
 
OP_ZaharinCommented:
- i agree that slightwv method on 35509678 will work best :)
0
 
htonkovCommented:
If you are NOT performing large DML operations on table you might try:

create some parameter table if you already don't have one:
create table myparameters(key varchar2(30), value number(1));
insert into myparameters values ('FIRE_TRIGGER',1);

and in trigger select value from myparameters where key='FIRE_TRIGGER'
if value=1 then
...
end if;

Or, idea which I also like: check username
if user!='BLAHBLAH' then

end if;

but it depends about detailed problem you need to solve...

Regards,
Hrvoje
0
 
slightwv (䄆 Netminder) Commented:
Can I ask why you selected some of the answers you did since they aren't even valid Oracle syntax or only agree with a previous post?
0
 
slightwv (䄆 Netminder) Commented:
Recommend split:
Accept http:#a35509678
Assist  http:#a35701946
0
 
htonkovCommented:
Agreed with slightwv's recommendations:

Accept http:#a35509678
Assist  http:#a35701946
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.