基于database創(chuàng)建一個系統(tǒng)trigger,遇到了權(quán)限問題,查了一下原來是需要ADMINISTER DATABASE TRIGGER權(quán)限[@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 行出現(xiàn)錯誤:
ORA-01031: 權(quán)限不足
--============================
SQL> grant ADMINISTER DATABASE TRIGGER to test;
授權(quán)成功。
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 /
觸發(fā)器已創(chuàng)建
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.
--========================
網(wǎng)頁題目:系統(tǒng)權(quán)限ADMINISTERDATABASETRIGGER的作用
文章路徑:
http://weahome.cn/article/gehjoe.html