Oracle操作审计
因为信安的要求,要对Oracle加审计。看了一下,原来是有开的,类型为DB:
SQL> show parameter audit; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ audit_file_dest string C:\***\ADUMP audit_sys_operations boolean TRUE audit_trail string DB unified_audit_sga_queue_size integer 1048576 unified_audit_systemlog boolean FALSE
用这两个命令看了一下,都没有具体的命令,只有登录信息给记录了。
select * from sys.aud$; SELECT * FROM DBA_COMMON_AUDIT_TRAIL
需要开扩展审计。
扩展这个内容,在网上挺多文章,都用了这样的:
SQL> alter system set audit_trail=db_extended scope=spfile;
事实上,执行时会提示错误,不应该是下划线,是逗号。
SQL> alter system set audit_trail=db_extended scope=spfile; alter system set audit_trail=db_extended scope=spfile ORA-00096: invalid value DB_EXTENDED for parameter audit_trail, must be from among extended, xml, none, os, db SQL> alter system set audit_trail=db,extended scope=spfile; System altered SQL>
这个需要重新启动数据库,不然执行命令会显示SQL_TEXT还是空的。
SELECT * FROM DBA_COMMON_AUDIT_TRAIL a ORDER BY a.extended_timestamp DESC; select EXTENDED_TIMESTAMP,SESSION_ID,SQL_TEXT from DBA_COMMON_AUDIT_TRAIL ORDER BY EXTENDED_TIMESTAMP DESC;
重启后查看就没问题了。