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的SYSTEM 表空間Oracle
- 遷移SYSTEM表空間為本地管理表空間
- 表空間檢測異常的問題診斷
- 將ORACLE資料庫審計相關的表移動到其他表空間Oracle資料庫
- ORACLE的 審計功能Oracle
- system表空間不足的問題分析
- Oracle表空間設計理念Oracle
- Oracle 審計功能Oracle
- oracle審計功能Oracle
- Oracle的home目錄空間佔用異常處理Oracle
- Oracle 本地表空間管理與字典表空間管理Oracle
- Oracle Audit 審計功能的認識與使用Oracle
- 表空間常見的操作
- 【TABLE】Oracle監控異常的表設計Oracle
- system表空間不足的問題分析(二)
- Oracle表空間Oracle
- Oracle FGA審計功能Oracle
- oracle表空間的整理Oracle
- Oracle 表空間的管理Oracle
- Oracle 表空間 的操作Oracle
- ORACLE的SYSAUX 表空間OracleUX
- Oracle的表空間管理Oracle
- 4.2.1.7 規劃 SYSTEM 和 SYSAUX 表空間UX
- system表空間爆滿解決方法
- oracle 臨時表空間基本常識和操作Oracle
- 對oracle資料表空間的計算Oracle
- 初識ORACLE的審計功能Oracle
- 開啟Oracle的審計功能Oracle
- Oracle 表空間與資料檔案Oracle
- ORACLE 11g臨時表空間收縮的功能Oracle
- 從system/sysaux空間轉移TABLE&Index到其它表空間UXIndex
- Java 異常表與異常處理原理Java
- Oracle的邏輯結構(表空間、段、區間、塊)——表空間Oracle
- oracle temp 表空間Oracle
- 增加oracle表空間Oracle
- oracle undo 表空間Oracle
- oracle users 表空間Oracle
- Oracle表空間管理Oracle