During the work, sometimes this requirement is met, and a user's trigger query permission is granted to other users.
How to grant a user's trigger query permission to other users?
Method One:
Grant the Create any trigger permission. This privilege is too large to be considered for granting this permission
Method Two:
Grant the Bebug permissions of the table to other users. This will enable you to see the trigger on the user table.
Test:
[Email protected] ~]$ Sqlplus/as SYSDBA
Sql*plus:release 11.2.0.1.0 Production on Thu June 14 10:37:08 2018
Copyright (c) 1982, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production
With the partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real application testing options
Sql> Grant connect to Erwa identified by Erwa;
Grant succeeded.
Sql> Select Owner,trigger_name from all_triggers where owner= ' SCOTT ';
No rows selected
Sql>
Create a trigger in other sessions
[Email protected] ~]$ Sqlplus Scott/tiger
Sql*plus:release 11.2.0.1.0 Production on Thu June 14 11:23:18 2018
Copyright (c) 1982, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production
With the partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real application testing options
Sql> Create or Replace trigger test
2 before delete on EMP
3 for each row
4 DECLARE
5--Local variables here
6 begin
7 dbms_output.put_line (' Test ');
8 End test;
9/
Trigger created.
Sql>
Grant debug permissions for a table to Erwa
Sql> Grant Debug on EMP to Erwa;
Grant succeeded.
Sql>
Check again to see the newly created trigger under Scott
Sql> Show User
USER is "ERWA"
Sql> Select Owner,trigger_name from all_triggers where owner= ' SCOTT ';
OWNER trigger_name
------------------------------ ------------------------------
SCOTT TEST
Sql>
How does Oracle let one user query other users ' trigger?