ITPub博客

首页 > 数据库 > Oracle > Oracle 审计的初步操作

Oracle 审计的初步操作

原创 Oracle 作者:genweihua 时间:2012-11-12 11:55:31 0 删除 编辑
     现在开始学习Oracle数据库,看到审计这块,就想知道审计是怎么回事。看了看,知道了审计就是监控用户对数据库的操作,并把这些操作放到操作系统文件中或者数据库中。
     下边简单演示一下审计操作的步骤:
                 准备数据:
                 我自己在实验的时候,把scott的密码更改为windows。
                  conn scott/windows
                  create table test as select * from emp;

激活审计

Conn / as sysdba

Show parameter audit_sys_operstions

alter system set audit_sys_operations=true scope=spfile;

alter system set audit_trail=db scope=spfile;

startup force

show parameter audit_sys_operations

show parameter audit_trail

定义审计表

execute dbms_fga.add_policy(object_schema=>'scott',object_name=>'test',policy_name=>'chk_test',statement_types=>'insert,update,delete');

grant select on dba_fga_audit_trail to scott;

conn  scott/windows

delete from test where empno=7900;

delete from test where empno=7902;

update test set job='noter' where empno=7934;

查看审计内容

select timestamp,sql_text from sys.dba_fga_audit_trail;

取消审计

conn / as sysdba

execute dbms_fga.drop_policy(object_schema=>'scott',object_name=>'test',policy_name=>'chk_test');

Normal 0 7.8 磅 0 2 false false false EN-US ZH-CN X-NONE

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/22275400/viewspace-749002/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: RMAN 学习(一)
请登录后发表评论 登录
全部评论
事了拂衣去,深藏功与名!

注册时间:2009-08-28

最新文章