ORACLE SYSTEM表空間異常與審計的功能
背景說明:
剛接手一個資料庫的時候,發現該資料庫的system表空間居然有21G,按照之前的資料庫管理經驗,目前管理過2TB的資料,SYSTEM表空間也沒有超過2GB,所以出於謹慎的態度,對當前system的表空間的內容進行了相應的瞭解。
問題排查:
通過執行以下語句可以檢視每個表空間所存放資料段的情況,指令碼如下:
select A.SEGMENT_NAME,SUM(A.BYTES)/1024/1024/1024 GB,A.SEGMENT_TYPE
from dba_extents a,v$datafile b,v$tablespace C
where b.TS#=C.TS# AND C.NAME='SYSTEM' AND A.FILE_ID=B.FILE#
GROUP BY A.SEGMENT_NAME,A.SEGMENT_TYPE ORDER BY GB DESC
終於找到真相了,表AUD$佔用了20.4G的空間;
深入瞭解:關於aud$表
1、AUD$的介紹
When standard auditing is enabled (that is, you set AUDIT_TRAIL to DB or DB,EXTENDED), Oracle Database audits all data manipulation language (DML) operations, such as INSERT, UPDATE, MERGE, and DELETE on the SYS.AUD$ and SYS.FGA_LOG$ tables by non-SYS users. (It performs this audit even if you have not set audit options for the AUD$ and FGA_LOGS$ tables.) Typically, non-SYS users do not have access to these tables, except if they have been explicitly granted access. If a non-SYS user tampers with the data in the SYS.FGA_LOG$ and SYS.AUD$ tables, then Oracle Database writes an audit record for each action.Oracle Database audits SYS user's DELETE, INSERT, UPDATE, and MERGE operations on the SYS.FGA_LOG$ and SYS.AUD$ tables if you have set the AUDIT_SYS_OPERATIONS initialization parameter to TRUE. In this case the audit records of all SYS operations are written to whatever directory the AUDIT_FILE_DEST initialization parameter points to. If AUDIT_FILE_DEST is not set, then it writes the records to an operating system-dependent location.
AUD$是資料庫開啟審計後,記錄所有相關操作的表,所以可以確定資料庫開啟了審計的功能;
2、檢視資料庫的審計,show parameter aud;
發現資料庫啟用了DB級別的審計功能,相關審計級別如下:
None:是預設值,不做審計;
DB:將audit trail 記錄在資料庫的審計相關表中,如aud$,審計的結果只有連線資訊;
DB,Extended:這樣審計結果裡面除了連線資訊還包含了當時執行的具體語句;
OS:將audit trail 記錄在作業系統檔案中,檔名由audit_file_dest引數指定;
XML:10g裡新增的。
備註:ORACLE11G中審計是預設開啟的,而且是對DB進行審計;
解決方法:
1、關閉資料庫的審計功能,一般都不建議在資料庫層面開啟審計功能,除非有要求;
關閉指令碼:alter system set audit_trail=none scope=spfile; 該引數為靜態引數,需要重啟;
2、完成後可以對整個表空間進行收縮,具體的操作方法,請檢視另外一個文件.......................................
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12679300/viewspace-1134826/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle表空間Oracle
- oracle 表空間Oracle
- Oracle Audit 審計功能的認識與使用Oracle
- 【TABLE】Oracle監控異常的表設計Oracle
- oracle表空間的整理Oracle
- 增加oracle表空間Oracle
- oracle temp 表空間Oracle
- 2.5.3 建立本地管理的SYSTEM表空間
- oracle 表移動表空間Oracle
- Oracle表移動表空間Oracle
- Oracle審計--AUD$佔用空間較大處理方案Oracle
- 4.2.1.7 規劃 SYSTEM 和 SYSAUX 表空間UX
- Oracle 批量建表空間Oracle
- Oracle清理SYSAUX表空間OracleUX
- Oracle的表空間quota詳解Oracle
- Oracle OCP(47):表空間的建立Oracle
- SYSTEM 表空間管理及備份恢復
- Oracle Temp 表空間切換Oracle
- Oracle 表空間增加檔案Oracle
- Oracle OCP(49):表空間管理Oracle
- Oracle表空間收縮方案Oracle
- Oracle RMAN 表空間恢復Oracle
- Oracle中表空間、表、索引的遷移Oracle索引
- Oracle新建使用者、表空間、表Oracle
- Java 異常表與異常處理原理Java
- OGG相關的CPATURE導致SYSAUX表空間異常暴增處理UX
- oracle建立臨時表空間和資料表空間以及刪除Oracle
- oracle臨時表空間相關Oracle
- oracle sql 表空間利用率OracleSQL
- 【Oracle 恢復表空間】 實驗Oracle
- 【TABLESPACE】Oracle表空間最佳實踐Oracle
- MySQL 中的共享表空間與獨立表空間如何選擇MySql
- Oracle資料庫審計功能介紹Oracle資料庫
- oracle 11g 系統審計功能Oracle
- oracle 異常Oracle
- oracle 建立表空間和使用者Oracle
- Oracle建立表空間和使用者Oracle
- Oracle中新建表空間、使用者Oracle
- ORACLE線上切換undo表空間Oracle