审计是记录数据库上方方面面操作、事件等信息,是数据安全管理的重要手段。
开启审计,虽然不同级别的审计会有不同,但是对数据库的性能是有影响的,并且占用存储空间。
--1、创建审计数据专用表空间
create tablespace tbs_audit datafile '/u01/app/oracle/oradata/audit/df_audit01.dbf' size 2g autoextend on next 128m maxsize 30g;
alter tablespace tbs_audit add datafile '/u01/app/oracle/oradata/audit/df_audit02.dbf' size 2g autoextend on next 128m maxsize 30g;
--2、查看审计表、索引所在表空间
select table_name,tablespace_name from dba_tables where table_name='AUD$';
select COLUMN_NAME,SEGMENT_NAME,tablespace_name from dba_lobs where table_name ='AUD$';
select index_name,tablespace_name from dba_indexes where table_name ='AUD$';
--3、在线移动至新的表空间
alter table aud$ move tablespace tbs_audit;
alter table AUD$ move lob(SQLBIND) store as SYS_LOB0000000407C00040$$ (tablespace tbs_audit);
alter table AUD$ move lob(SQLTEXT) store as SYS_LOB0000000407C00041$$(tablespace tbs_audit);
--4、开启审计
alter system set audit_sys_operations=true scope=spfile;
alter system set audit_trail=db,extended scope=spfile;
--5、重启库生效
--6、相关数据字典
AUD$
DBA_AUDIT_TRAIL
DBA_COMMON_AUDIT_TRAIL
DBA_FGA_AUDIT_TRAIL
Oracle使用大量不同的审计方法来监控使用何种权限,以及访问哪些对象。审计不会防止使用这些权限,但可以提供有用的信息,用于揭示权限的滥用和误用。
--7、模式对象审计举例
audit select,update,delete on tab_1 by access whenever successful;