1.数据库开启审计
alter system set audit_trail=db,extended scope=spfile;
shutdown immediate
startup
2.对某个表进行审计
connect / as sysdba
SQL> show user;
USER is "SYS"
SQL> audit select table by hxl by session;
Audit succeeded.
以上语句执行后在 dba_stmt_audit_opt 视图会有相应的记录
SQL> set linesize 1000;
SQL> select user_name, audit_option, success, failure from dba_stmt_audit_opts;
USER_NAME AUDIT_OPTION SUCCESS FAILURE
------------------------------ ---------------------------------------- ---------- ----------
HXL SELECT TABLE BY SESSION BY SESSION
3.使用hxl用户登录,查询该用户下的一个表
SQL> connect hxl/oracle
Connected.
SQL> select count(1) from tb_test;
COUNT(1)
----------
18
然后查询审计日志表,发现已经有记录了
SQL> Select Count(1) From dba_audit_trail Where obj_name In ('TB_TEST');
COUNT(1)
----------
1
4.取消审计
若我想把上面的审计取消,步骤如下
connect / as sysdba
SQL> noaudit select table by hxl;
Noaudit succeeded.
发现配置表dba_stmt_audit_opt相应的记录已经取消
退出原有的hxl查询会话(必须退出,pl/sql需要关闭再登录,否则还会一直有审计),再次登陆查询就不会有审计记录了.
-- The End --
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
The Little MLer
Matthias Felleisen、Daniel P. Friedman、Duane Bibby、Robin Milner / The MIT Press / 1998-2-19 / USD 34.00
The book, written in the style of The Little Schemer, introduces instructors, students, and practicioners to type-directed functional programming. It covers basic types, quickly moves into datatypes, ......一起来看看 《The Little MLer》 这本书的介绍吧!