oracle 10g SYSAUX表空間快速增長之WRH$_SQL_PLAN篇
通過分析oracle sysaux表空間下的各模組資訊:
SELECT t.OCCUPANT_NAME,SUM(t.SPACE_USAGE_KBYTES)/1024/1024
FROM gV$SYSAUX_OCCUPANTS t
GROUP BY t.OCCUPANT_NAME
ORDER BY 2 DESC;
OCCUPANT_NAME | SUM(t.SPACE_USAGE_KBYTES)/1024/1024 |
SM/AWR | 16.33325195 |
SM/OPTSTAT | 1.88671875 |
SM/ADVISOR | 0.661987305 |
EM | 0.365966797 |
XDB | 0.094116211 |
SDO | 0.080078125 |
SM/OTHER | 0.05871582 |
XSOQHIST | 0.05090332 |
AO | 0.05090332 |
LOGMNR | 0.034179688 |
STREAMS | 0.031005859 |
XSAMD | 0.030395508 |
JOB_SCHEDULER | 0.015991211 |
WM | 0.013916016 |
TEXT | 0.009033203 |
EXPRESSION_FILTER | 0.007080078 |
EM_MONITORING_USER | 0.003051758 |
LOGSTDBY | 0.001708984 |
ORDIM | 0.000976563 |
TSM | 0.000488281 |
ODM | 0.000488281 |
ORDIM/PLUGINS | 0 |
STATSPACK | 0 |
ULTRASEARCH_DEMO_USER | 0 |
ORDIM/SQLMM | 0 |
ULTRASEARCH | 0 |
上面就是oracle中佔據sysaux表空間的各模組情況。
通過以下sql分析sysaux表空間的使用情況:
WITH
ts_total_space AS (SELECT
TableSpace_name,
SUM(bytes) as bytes,
SUM(blocks) as blocks,
SUM(maxbytes) as maxbytes
FROM dba_data_files
GROUP BY TableSpace_name),
ts_free_space AS (SELECT
ddf.TableSpace_name,
NVL(SUM(dfs.bytes),0) as bytes,
NVL(SUM(dfs.blocks),0) as blocks
FROM
dba_data_files ddf,
dba_free_space dfs
WHERE ddf.file_id = dfs.file_id(+)
GROUP BY ddf.TableSpace_name),
ts_total_segments AS (SELECT
TableSpace_name,
SUM(bytes) as bytes,
SUM(blocks) as blocks
FROM dba_segments
GROUP BY TableSpace_name),
ts_total_extents AS (SELECT
TableSpace_name,
SUM(bytes) as bytes,
SUM(blocks) as blocks
FROM dba_extents
GROUP BY TableSpace_name)
SELECT
dt.TableSpace_name as "TSname",
dt.status as "TSstatus",
ROUND(ttsp.bytes/1024/1024,0) as "TSSizeMb",
ROUND((ttsp.bytes-tfs.bytes)/1024/1024,0) as "TSUsedMb",
ROUND(tfs.bytes/1024/1024,0) as "TSFreeMb",
ROUND((ttsp.bytes-tfs.bytes)/ttsp.bytes*100,0) as "TSUsedPrct",
ROUND(tfs.bytes/ttsp.bytes*100,0) as "TSFreePrct",
ROUND(ttse.bytes/1024/1024,0) as "TSSegUsedMb",
ROUND(tte.bytes/1024/1024,0) as "TSExtUsedMb",
CASE
WHEN ttsp.maxbytes = 0 THEN 'No' ELSE 'Yes'
END as "AutoExtFile",
CASE
WHEN ttsp.maxbytes = 0 THEN '-' ELSE TO_CHAR(ROUND(ttsp.maxbytes/1024/1024,0))
END as "TSMaxSizeMb",
CASE
WHEN ttsp.maxbytes = 0 THEN '-' ELSE TO_CHAR(ROUND((ttsp.bytes-tfs.bytes)/ttsp.maxbytes*100,0))
END as "TSMaxUsedPrct",
CASE
WHEN ttsp.maxbytes = 0 THEN '-' ELSE TO_CHAR(ROUND((ttsp.maxbytes-(ttsp.bytes-tfs.bytes))/ttsp.maxbytes*100,0))
END as "TSMaxFreePrct"
FROM
dba_TableSpaces dt,
ts_total_space ttsp,
ts_free_space tfs,
ts_total_segments ttse,
ts_total_extents tte
WHERE dt.TableSpace_name = ttsp.TableSpace_name(+)
AND dt.TableSpace_name = tfs.TableSpace_name(+)
AND dt.TableSpace_name = ttse.TableSpace_name(+)
AND dt.TableSpace_name = tte.TableSpace_name(+)
AND dt.TableSpace_name = 'SYSAUX';
或者通過sql分析sysaux表空間下的各segments情況:
SELECT
ROUND(SUM(ds.bytes)/1024/1024,0) as "SgmntSize",
ds.TableSpace_name as "TSname",
ds.owner as "SgmntOwner",
ds.segment_name as "SgmntName",
ds.segment_type as "SgmntType"
FROM dba_segments ds
WHERE ds.segment_type IN ('TABLE','INDEX','LOBSEGMENT')
AND TableSpace_name = 'SYSAUX'
GROUP BY
ds.TableSpace_name,
ds.owner,
ds.segment_name,
ds.segment_type
ORDER BY "SgmntSize" DESC;
發現有這張表:WRH$_SQL_PLAN也佔據了此表空間很大的一部分,
分析metalink文章:Wrh$_sql_plan table growth causes Sysaux Tablespace size increase continuously [ID 1243058.1]
發現此乃oracle的一個bug,通過修補補丁patch 6394861
可以解決。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12129601/viewspace-714271/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORACLE 10g SYSAUX表空間快速增長之WRH$_ACTIVE_SESSION_HISTORY篇Oracle 10gUXSession
- oracle 10g SYSAUX表空間快速增長之WRI$_OPTSTAT_HISTGRM_HISTORY篇Oracle 10gUX
- oracle 10g SYSAUX表空間快速增長之STREAMS$_APPLY_SPILL_MESSAGES篇Oracle 10gUXAPP
- oracle之 SYSAUX表空間維護OracleUX
- Oracle清理SYSAUX表空間OracleUX
- ORACLE的SYSAUX 表空間OracleUX
- 10g ORACLE_HOME空間滿導致SYSAUX表空間離線OracleUX
- 10G 新特性系列: SYSAUX 表空間UX
- SYSAUX表空間清理之SM/OPTSTATUX
- 32、SYSAUX表空間UX
- 11gr2 rac WRH$_ACTIVE_SESSION_HISTORY未自動清理導致SYSAUX空間過度增長SessionUX
- oracle表空間增長趨勢分析Oracle
- AWR資料導致SYSAUX表空間一直增長的問題UX
- oracle10g的sysaux空間暴增與空間回收-轉載OracleUX
- WRH$_SQL_PLAN 被鎖SQL
- oracle 表空間關閉自增長 autoextend offOracle
- 2.5.4.1 關於SYSAUX表空間UX
- 認識 SYSAUX 表空間(zt)UX
- oracle sysaux表空間滿了處理辦法OracleUX
- oracle 10g表空間操作Oracle 10g
- AWR佔用sysaux表空間太大UX
- SYSAUX表空間管理及恢復UX
- Oracle SYSAUX表空間使用率超過警戒閥值OracleUX
- 收縮表空間 for Oracle 10gOracle 10g
- 4.2.1.7 規劃 SYSTEM 和 SYSAUX 表空間UX
- sysaux 表空間爆滿處理方法UX
- sysaux 表空間不足問題處理UX
- 修復受損的SYSAUX表空間UX
- Oracle10g以上sysaux表空間的維護和清理OracleUX
- Clean WRH$_ACTIVE_SESSION_HISTORY in SYSAUXSessionUX
- Oracle 10g大檔案表空間Oracle 10g
- 從system/sysaux空間轉移TABLE&Index到其它表空間UXIndex
- oracle UNDO表空間一個bug——undo表空間快速擴充套件Oracle套件
- oracle 10g以後查詢表空間使用率的快速方法Oracle 10g
- Oracle SYSAUX 表空間使用率100% 導致的DB 故障OracleUX
- Oracle 10g大檔案表空間(轉)Oracle 10g
- [Oracle 10g] 大檔案表空間(zt)Oracle 10g
- OGG相關的CPATURE導致SYSAUX表空間異常暴增處理UX