系统权限ADMINISTERDATABASETRIGGER的作用
基于database创建一个系统trigger,遇到了权限问题,查了一下原来是需要ADMINISTER DATABASE TRIGGER权限[@more@]SQL> create or replace trigger trigg_db
2 after logon on database
3 -- for each row
4 declare
5 -- local variables here
6 begin
7 insert into t_trace values(sys_context('userenv','ip_address'),
8 sys_context('userenv','terminal'),
9 sys.login_user,
10 sysdate,
11 sys.sysevent);
12 end trigg_db;
13 /
after logon on database
*
第 2 行出现错误:
ORA-01031: 权限不足
--============================
SQL> grant ADMINISTER DATABASE TRIGGER to test;
授权成功。
SQL>
--===========================
SQL> create or replace trigger trigg_db
2 after logon on database
3 -- for each row
4 declare
5 -- local variables here
6 begin
7 insert into t_trace values(sys_context('userenv','ip_address'),
8 sys_context('userenv','terminal'),
9 sys.login_user,
10 sysdate,
11 sys.sysevent);
12 end trigg_db;
13 /
触发器已创建
SQL>
--=========================
To create a trigger on DATABASE, you must have the ADMINISTER DATABASE TRIGGER privilege. If this privilege is later revoked, then you can drop the trigger, but not alter it.
--========================
网站栏目:系统权限ADMINISTERDATABASETRIGGER的作用
转载注明:
http://kswjz.com/article/gehjoe.html
扫二维码与项目经理沟通
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流