〖现象(Symptom)〗
创建触发器时,报告权限不足,具体过程如下。
Step01:system的身份登陆数据库
SQL> connect system@wm
Enter password:
Connected.
Step02:创建触发器trigger_autoadd
SQL> CREATE OR REPLACE TRIGGER trigger_autoadd
2before insert
3on test.autoadd
4for each row
5begin
6select test.SEQ_id.nextval into :new.id from dual;
7end;
8/
Warning: Trigger created with compilation errors
SQL> show error
Errors for TRIGGER SYSTEM.TRIGGER_AUTOADD:
LINE/COL ERROR
-------- ------------------------------------------
2/16PL/SQL: ORA-01031: insufficient privileges
2/4PL/SQL: SQL Statement ignored
在表autoadd上创建触发器trigger_autoadd。
用户system有角色(role)DBA权限,而DBA已经就有CREATE ANY TRIGGER
的权限,因此,system就有create any trigger的权限。
Step03:system