triggers – 创建侦听多个表的全局触发器
我想在Oracle 11g中创建一个全局触发器.哪个可用于审计约100个表.多个表可以触发单个触发器.如果是,那么我该如何实现呢? 解决方法
你有没有理由重新发明轮子?为什么不利用Oracle内置的审计? Oracle Base提供了有关如何开始审计的一些基本信息:
AUDIT_TRAIL = { none | os | db | db,extended | xml | xml,extended } 以下列表提供了每个设置的说明: none or false - Auditing is disabled. db or true - Auditing is enabled,with all audit records stored in the database audit trial (SYS.AUD$). db,extended - As db,but the SQL_BIND and SQL_TEXT columns are also populated. xml- Auditing is enabled,with all audit records stored as XML format OS files. xml,extended - As xml,but the SQL_BIND and SQL_TEXT columns are also populated. os- Auditing is enabled,with all audit records directed to the operating system's audit trail. 要启用对数据库审计跟踪的审计,请启用对数据库的审计 SQL> ALTER SYSTEM SET audit_trail=db,extended SCOPE=SPFILE; System altered. 关机&重启db SQL> SHUTDOWN Database closed. Database dismounted. ORACLE instance shut down. SQL> STARTUP ORACLE instance started. 现在,通过用户多维数据集审核SELECTS,INSERTS,UPDATES,DELETES,执行以下操作: CONNECT sys/password AS SYSDBA AUDIT ALL BY cube BY ACCESS; AUDIT SELECT TABLE,UPDATE TABLE,INSERT TABLE,DELETE TABLE BY cube BY ACCESS; 可以通过查询DBA_AUDIT_TRAIL来启动审计日志 进一步阅读: > Auditing (编辑:上饶站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |