查看数据是否开启审计:
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突击一书