Oracle审计设置

查看数据是否开启审计:

16:04:08 SQL> show parameter audit

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
audit_file_dest                      string      /u01/app/oracle/admin/ora11g/adump
audit_sys_operations                 boolean     FALSE
audit_syslog_level                   string
audit_trail                          string      DB

audit_trail取值说明:

  none 禁用数据库审计

  os 启用数据库审计,并将数据库审计记录定向到操作系统审计记录

  db 启用数据库审计,并将数据库所有审计记录定向到数据库的SYS.AUD$表

  db,extended 启用数据库审计,并将数据库所有审计记录定向到数据库的SYS.AUD$表。另外,填充SYS.AUD$表的SQLBIND 列和SQLTEXT CLOB 列。

  xml 启用数据库审计,并将所有记录写到XML格式的操作系统文件中。

  xml,extended 启用数据库审计,输出审计记录的所有列,包括SqlText和SqlBind的值。

  你可以使用SQL语句AUDIT来设置审计选项,不管如何设置此参数

、可关闭审计,重启生效

15:29:43 SQL> alter system set audit_trail=none scope=spfile;

System altered.

二、为减少系统表空间的使用可将审计所涉及的三张表移动到别的表空间

审计表移动到users表空间:

select table_name,tablespace_name from dba_tables where table_name like 'AUD%';
alter table sys.aud$ move tablespace users;
alter table sys.audit$ move tablespace users;
alter table sys.audit_actions move tablespace users;
移动审计信息索引:
select l.table_name,
       l.column_name,
       l.segment_name,
       l.index_name,
       s.tablespace_name,
       i.tablespace_name
  from dba_lobs l, dba_segments s, dba_indexes i;
alter table aud$ move lob(sqltext) store as (tablespace users);
alter table aud$ move lob(sqlbind) store as (tablespace users);
重新编绎审计索引:
select table_name,index_name,status,tablespace_name from dba_indexes where table_name like 'AUD%';   
alter index sys.i_audit rebuild online tablespace users;
alter index i_audit_actions rebuild online tablespace users;
转于DBA突击一书

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值