How does Oracle let one user query other users ' trigger?

Source: Internet
Author: User

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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.