Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5265
  • Last Modified:

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




0
SayYou_SayMe
Asked:
SayYou_SayMe
  • 4
  • 3
  • 2
2 Solutions
 
OP_ZaharinCommented:
- try this:
GRANT TRIGGER ON TABLE tblname TO user
0
 
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:
- 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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
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

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now