oracle9i審計功能的開啟和審計策略的設定方法

xsdan發表於2013-05-16
作業系統:solaris9
資料庫:oracle9i
1、檢視審計功能是否開啟

[@more@]SQL> show parameter audit;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
audit_file_dest string ?/rdbms/audit
audit_sys_operations boolean FALSE
audit_trail string FALSE
transaction_auditing boolean TRUE
由於audit_trail的value值為FALSE,說明審計功能沒有開啟
2、開啟審計功能
SQL> alter system set audit_trail='TRUE' scope=spfile;
System altered.
3、重新啟動資料庫使審計功能生效
SQL> conn / as sysdba;
Connected.
SQL> shutdown normal;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 171966464 bytes
Fixed Size 787988 bytes
Variable Size 144964076 bytes
Database Buffers 25165824 bytes
Redo Buffers 1048576 bytes
Database mounted.
Database opened.
4、檢視審計功能是否開啟
SQL> show parameter audit;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
audit_file_dest string ?/rdbms/audit
audit_sys_operations boolean FALSE
audit_trail string TRUE
transaction_auditing boolean TRUE
5、設定審計策略
SQL>audit session;
SQL>audit delete any table by session;
SQL>audit create table by session;
SQL>audit table by session;
SQL>audit create user by session;
SQL>audit alter user by session;
SQL>audit index by session
SQL>audit create view by session;
SQL>audit create procedure by session;
6、查詢審計的項是否跟設定的相同
SQL> select * from DBA_STMT_AUDIT_OPTS;
USER_NAME PROXY_NAME
------------------------------ ------------------------------
AUDIT_OPTION SUCCESS FAILURE
---------------------------------------- ---------- ----------
CREATE SESSION BY ACCESS BY ACCESS
TABLE BY ACCESS BY ACCESS
DELETE ANY TABLE BY SESSION BY SESSION
CREATE TABLE BY ACCESS BY ACCESS
CREATE USER BY ACCESS BY ACCESS
ALTER USER BY ACCESS BY ACCESS
INDEX BY ACCESS BY ACCESS
CREATE VIEW BY ACCESS BY ACCESS
CREATE PROCEDURE BY ACCESS BY ACCESS
7、審計日誌查詢
SQL>select * from DBA_AUDIT_TRAIL where where rownum<10;
說明:where rownum<10 顯示前10行

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/262387/viewspace-1060509/,如需轉載,請註明出處,否則將追究法律責任。

相關文章