美文网首页
ORACLE 11G audio 開啟

ORACLE 11G audio 開啟

作者: 轻飘飘D | 来源:发表于2020-07-01 11:57 被阅读0次

1.查詢當前配置

connect / as sysdba;

select a.table_name,a.tablespace_name,a.num_rows  from user_tables a where a.table_name in('AUD$','AUDIT$','AUDIT_ACTIONS')

select b.index_name,b.index_type,b.table_name,b.tablespace_name from user_indexes b where b.table_name in('AUD$','AUDIT$','AUDIT_ACTIONS')

-- SELECT FILE_NAME FROM DBA_DATA_FILES;

2.創建專用表空間

create tablespace tb_sys_aud datafile 
'/u02/oradata/MPPAYUAT/sys_aud_1.dbf' size 128M AUTOEXTEND ON NEXT 256M MAXSIZE UNLIMITED
default storage (initial 128K next 2M pctincrease 0);

create tablespace tb_sys_aud_i datafile 
'/u02/oradata/MPPAYUAT/sys_aud_i_1.dbf' size 64M AUTOEXTEND ON NEXT 128M MAXSIZE UNLIMITED
default storage (initial 128K next 2M pctincrease 0);

3.遷移審計表的表空間

alter table sys.aud$ move tablespace tb_sys_aud;
alter table sys.aud$ move lob(sqlbind) store as( tablespace tb_sys_aud);
alter table sys.aud$ move lob(SQLTEXT) store as( tablespace tb_sys_aud);
-- alter index sys.I_AUD1 rebuild tablespace tb_sys_aud_i;

alter table audit$ move tablespace tb_sys_aud;
alter index i_audit rebuild online tablespace tb_sys_aud_i;

alter table audit_actions move tablespace tb_sys_aud;
alter index i_audit_actions rebuild online tablespace tb_sys_aud_i;

4.查詢及修改當前設置

 show parameter audit; 

----alter system set sql92_security=TRUE spfile =spfile; 
alter system set audit_trail = DB,Extended scope = spfile;

AUDIT SELECT TABLE,INSERT TABLE,UPDATE TABLE,DELETE TABLE by MPOP by access;

grant select on sys.DBA_AUDIT_TRAIL to MPOP;

truncate table SYS.AUD$;

5.查詢

审计跟踪视图
刚才使用的视图为user_audit_trail,其实还有很多其他的视图:

●user_audit_object
显示当前用户可访问的所有对象的审计记录

●user_audit_session
显示当前用户连接到数据库和断开数据库连接的审计记录

●user_audit_statement
显示由当前用户发出的grant, remove, audit, noaudit和alter system语句的审计记录

●user_audit_trail
显示当前用户相关的所有跟踪条目
————————————————

相关文章

网友评论

      本文标题:ORACLE 11G audio 開啟

      本文链接:https://www.haomeiwen.com/subject/specqktx.html