Oracle常用dump命令,記錄一下備查。
更新時(shí)間:2008年06月06日 19:35:06 作者:
Oracle下常用的dump命令記錄,方便以后使用查詢。
一.Memory Dumps
1).Global Area
ALTER SESSION SET EVENTS ‘immediate trace name global_area level n';
1 包含PGA
2 包含SGA
4 包含UGA
8 包含indrect memory
2).Library Cache
ALTER SESSION SET EVENTS ‘immediate trace name library_cache level n';
1 library cache統(tǒng)計(jì)信息
2 包含hash table histogram
3 包含object handle
4 包含object結(jié)構(gòu)(Heap 0)
3).Row Cache
ALTER SESSION SET EVENTS ‘immediate trace name row_cache level n';
1 row cache統(tǒng)計(jì)信息
2 包含hash table histogram
8 包含object結(jié)構(gòu)
4).Buffers
ALTER SESSION SET EVENTS ‘immediate trace name buffers level n';
1 buffer header
2 level 1 + block header
3 level 2 + block contents
4 level 1 + hash chain
5 level 2 + hash chain
6 level 3 + hash chain
8 level 4 + users/waiters
9 level 5 + users/waiters
10 level 6 + users/waiters
5).Buffer
ALTER SESSION SET EVENTS ‘immediate trace name buffer level n';
n為某個(gè)指定block的rdba,該命令可以轉(zhuǎn)儲(chǔ)某個(gè)block在buffer中的所有版本。
6).Heap
ALTER SESSION SET EVENTS ‘immediate trace name heapdump level level';
1 PGA摘要
2 SGA摘要
4 UGA摘要
8 Current call(CGA)摘要
16 User call(CGA)摘要
32 Large call(LGA)摘要
1025 PGA內(nèi)容
2050 SGA內(nèi)容
4100 UGA內(nèi)容
8200 Current call內(nèi)容
16400 User call內(nèi)容
32800 Large call內(nèi)容
7).Sub Heap
Oracle 9.0.1版本之前
ALTER SESSION SET EVENTS ‘immediate trace name heapdump_addr level n';
若n為subheap的地址,轉(zhuǎn)儲(chǔ)的是subheap的摘要信息
若n為subheap的地址+1,轉(zhuǎn)儲(chǔ)的則是subheap的內(nèi)容
Oracle 9.2.0版本之后
ALTER SESSION SET EVENTS ‘immediate trace name heapdump_addr level n, addr m';
其中m為subheap的地址
n為1轉(zhuǎn)儲(chǔ)subheap的摘要,n為2轉(zhuǎn)儲(chǔ)subheap的內(nèi)容
8).Process State
ALTER SESSION SET EVENTS ‘immediate trace name processstate level n';
9).System State
ALTER SESSION SET EVENTS ‘immediate trace name systemstate level n';
10).Error State
ALTER SESSION SET EVENTS ‘immediate trace name errorstack level n';
0 Error stack
1 level 0 + function call stack
2 level 1 + process state
3 level 2 + context area
11).Hang Analysis
ALTER SESSION SET EVENTS ‘immediate trace name hanganalyze level n';
12).Work Area
ALTER SESSION SET EVENTS ‘immediate trace name workareatab_dump level n';
1 SGA信息
2 Workarea Table摘要信息
3 Workarea Table詳細(xì)信息
13).Latches
ALTER SESSION SET EVENTS ‘immediate trace name latches level n';
1 latch信息
2 統(tǒng)計(jì)信息
14).Events
ALTER SESSION SET EVENTS ‘immediate trace name events level n';
1 session
2 process
3 system
15).Locks
ALTER SESSION SET EVENTS ‘immediate trace name locks level n';
16).Shared Server Process
ALTER SESSION SET EVENTS ‘immediate trace name shared_server_state level n';
n取值為1~14
17).Background Messages
ALTER SESSION SET EVENTS ‘immediate trace name bg_messages level n';
n為pid+1
二.File Dumps
1).Block
Oracle 7之前
ALTER SESSION SET EVENTS ‘immediate trace name blockdump level n';
n為block的rdba
Oracle8以后
ALTER SYSTEM DUMP DATAFILE file# BLOCK block#;
ALTER SYSTEM DUMP DATAFILE file#
BLOCK MIN minimum_block#
BLOCK MAX maximum_block#;
2).Tree Dump
ALTER SESSION SET EVENTS ‘immediate trace name treedump level n';
n為object_id
3).Undo Segment Header
ALTER SYSTEM DUMP UNDO_HEADER 'segment_name';
4).Undo for a Transaction
ALTER SYSTEM DUMP UNDO BLOCK 'segment_name' XID xidusn xidslot xidsqn;
5).File Header
ALTER SESSION SET EVENTS ‘immediate trace name file_hdrs level n';
1 控制文件中的文件頭信息
2 level 1 + 文件頭信息
3 level 2 + 數(shù)據(jù)文件頭信息
10 level 3
6).Control file
ALTER SESSION SET EVENTS ‘immediate trace name controlf level n';
1 文件頭信息
2 level 1 + 數(shù)據(jù)庫信息 + 檢查點(diǎn)信息
3 level 2 + 可重用節(jié)信息
10 level 3
7).Redo log Header
ALTER SESSION SET EVENTS ‘immediate trace name redohdr level n';
1 控制文件中的redo log信息
2 level 1 + 文件頭信息
3 level 2 + 日志文件頭信息
10 level 3
8).Redo log
ALTER SYSTEM DUMP LOGFILE ‘FileName';
ALTER SYSTEM DUMP LOGFILE ‘FileName'
SCN MIN MinimumSCN
SCN MAX MaximumSCN
TIME MIN MinimumTime
TIME MAX MaximumTime
LAYER Layer
OPCODE Opcode
DBA MIN FileNumber . BlockNumber
DBA MAX FileNumber . BlockNumber
RBA MIN LogFileSequenceNumber . BlockNumber
RBA MAX LogFileSequenceNumber . BlockNumber;
其中time = (((((yyyy - 1988)) * 12 + mm - 1) * 31 + dd - 1) * 24 + hh) * 60 + mi) * 60 + ss;
9).Loghist
ALTER SESSION SET EVENTS ‘immediate trace name loghist level n';
1 dump控制文件中最早和最遲的日志歷史項(xiàng)
1 dump 2^n個(gè)日志歷史項(xiàng)
1).Global Area
ALTER SESSION SET EVENTS ‘immediate trace name global_area level n';
1 包含PGA
2 包含SGA
4 包含UGA
8 包含indrect memory
2).Library Cache
ALTER SESSION SET EVENTS ‘immediate trace name library_cache level n';
1 library cache統(tǒng)計(jì)信息
2 包含hash table histogram
3 包含object handle
4 包含object結(jié)構(gòu)(Heap 0)
3).Row Cache
ALTER SESSION SET EVENTS ‘immediate trace name row_cache level n';
1 row cache統(tǒng)計(jì)信息
2 包含hash table histogram
8 包含object結(jié)構(gòu)
4).Buffers
ALTER SESSION SET EVENTS ‘immediate trace name buffers level n';
1 buffer header
2 level 1 + block header
3 level 2 + block contents
4 level 1 + hash chain
5 level 2 + hash chain
6 level 3 + hash chain
8 level 4 + users/waiters
9 level 5 + users/waiters
10 level 6 + users/waiters
5).Buffer
ALTER SESSION SET EVENTS ‘immediate trace name buffer level n';
n為某個(gè)指定block的rdba,該命令可以轉(zhuǎn)儲(chǔ)某個(gè)block在buffer中的所有版本。
6).Heap
ALTER SESSION SET EVENTS ‘immediate trace name heapdump level level';
1 PGA摘要
2 SGA摘要
4 UGA摘要
8 Current call(CGA)摘要
16 User call(CGA)摘要
32 Large call(LGA)摘要
1025 PGA內(nèi)容
2050 SGA內(nèi)容
4100 UGA內(nèi)容
8200 Current call內(nèi)容
16400 User call內(nèi)容
32800 Large call內(nèi)容
7).Sub Heap
Oracle 9.0.1版本之前
ALTER SESSION SET EVENTS ‘immediate trace name heapdump_addr level n';
若n為subheap的地址,轉(zhuǎn)儲(chǔ)的是subheap的摘要信息
若n為subheap的地址+1,轉(zhuǎn)儲(chǔ)的則是subheap的內(nèi)容
Oracle 9.2.0版本之后
ALTER SESSION SET EVENTS ‘immediate trace name heapdump_addr level n, addr m';
其中m為subheap的地址
n為1轉(zhuǎn)儲(chǔ)subheap的摘要,n為2轉(zhuǎn)儲(chǔ)subheap的內(nèi)容
8).Process State
ALTER SESSION SET EVENTS ‘immediate trace name processstate level n';
9).System State
ALTER SESSION SET EVENTS ‘immediate trace name systemstate level n';
10).Error State
ALTER SESSION SET EVENTS ‘immediate trace name errorstack level n';
0 Error stack
1 level 0 + function call stack
2 level 1 + process state
3 level 2 + context area
11).Hang Analysis
ALTER SESSION SET EVENTS ‘immediate trace name hanganalyze level n';
12).Work Area
ALTER SESSION SET EVENTS ‘immediate trace name workareatab_dump level n';
1 SGA信息
2 Workarea Table摘要信息
3 Workarea Table詳細(xì)信息
13).Latches
ALTER SESSION SET EVENTS ‘immediate trace name latches level n';
1 latch信息
2 統(tǒng)計(jì)信息
14).Events
ALTER SESSION SET EVENTS ‘immediate trace name events level n';
1 session
2 process
3 system
15).Locks
ALTER SESSION SET EVENTS ‘immediate trace name locks level n';
16).Shared Server Process
ALTER SESSION SET EVENTS ‘immediate trace name shared_server_state level n';
n取值為1~14
17).Background Messages
ALTER SESSION SET EVENTS ‘immediate trace name bg_messages level n';
n為pid+1
二.File Dumps
1).Block
Oracle 7之前
ALTER SESSION SET EVENTS ‘immediate trace name blockdump level n';
n為block的rdba
Oracle8以后
ALTER SYSTEM DUMP DATAFILE file# BLOCK block#;
ALTER SYSTEM DUMP DATAFILE file#
BLOCK MIN minimum_block#
BLOCK MAX maximum_block#;
2).Tree Dump
ALTER SESSION SET EVENTS ‘immediate trace name treedump level n';
n為object_id
3).Undo Segment Header
ALTER SYSTEM DUMP UNDO_HEADER 'segment_name';
4).Undo for a Transaction
ALTER SYSTEM DUMP UNDO BLOCK 'segment_name' XID xidusn xidslot xidsqn;
5).File Header
ALTER SESSION SET EVENTS ‘immediate trace name file_hdrs level n';
1 控制文件中的文件頭信息
2 level 1 + 文件頭信息
3 level 2 + 數(shù)據(jù)文件頭信息
10 level 3
6).Control file
ALTER SESSION SET EVENTS ‘immediate trace name controlf level n';
1 文件頭信息
2 level 1 + 數(shù)據(jù)庫信息 + 檢查點(diǎn)信息
3 level 2 + 可重用節(jié)信息
10 level 3
7).Redo log Header
ALTER SESSION SET EVENTS ‘immediate trace name redohdr level n';
1 控制文件中的redo log信息
2 level 1 + 文件頭信息
3 level 2 + 日志文件頭信息
10 level 3
8).Redo log
ALTER SYSTEM DUMP LOGFILE ‘FileName';
ALTER SYSTEM DUMP LOGFILE ‘FileName'
SCN MIN MinimumSCN
SCN MAX MaximumSCN
TIME MIN MinimumTime
TIME MAX MaximumTime
LAYER Layer
OPCODE Opcode
DBA MIN FileNumber . BlockNumber
DBA MAX FileNumber . BlockNumber
RBA MIN LogFileSequenceNumber . BlockNumber
RBA MAX LogFileSequenceNumber . BlockNumber;
其中time = (((((yyyy - 1988)) * 12 + mm - 1) * 31 + dd - 1) * 24 + hh) * 60 + mi) * 60 + ss;
9).Loghist
ALTER SESSION SET EVENTS ‘immediate trace name loghist level n';
1 dump控制文件中最早和最遲的日志歷史項(xiàng)
1 dump 2^n個(gè)日志歷史項(xiàng)
相關(guān)文章
Oracle 中 table 函數(shù)的應(yīng)用淺析
表函數(shù)可接受查詢語句或游標(biāo)作為輸入?yún)?shù),并可輸出多行數(shù)據(jù)。這篇文章主要介紹了Oracle 中 table 函數(shù)的應(yīng)用淺析,需要的朋友可以參考下2016-12-12Oracle連接遠(yuǎn)程數(shù)據(jù)庫的四種方法
這篇文章主要為大家詳細(xì)介紹了Oracle連接遠(yuǎn)程數(shù)據(jù)庫的四種設(shè)置方法和注意事項(xiàng),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-05-05PLSQL一些常用知識(shí)點(diǎn)梳理總結(jié)
這篇文章主要為大家介紹了PLSQL一些常用的知識(shí)點(diǎn)梳理總結(jié),有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-05-05優(yōu)化Oracle庫表設(shè)計(jì)的若干方法
優(yōu)化Oracle庫表設(shè)計(jì)的若干方法...2007-03-03基于oracle小數(shù)點(diǎn)前零丟失的問題分析
本篇文章是對(duì)oracle小數(shù)點(diǎn)前零丟失的問題進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下2013-05-05Oracle中直方圖對(duì)執(zhí)行計(jì)劃的影響詳解
這篇文章主要給大家介紹了關(guān)于Oracle數(shù)據(jù)庫中直方圖對(duì)執(zhí)行計(jì)劃的影響的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧。2017-09-09Oracle中在pl/sql developer修改表的2種方法
Oracle中在pl/sql developer修改表的2種方法,需要的朋友可以參考一下2013-03-03Oracle在表中有數(shù)據(jù)的情況下修改字段類型或長(zhǎng)度的解決方法
這篇文章主要介紹了Oracle在表中有數(shù)據(jù)的情況下修改字段類型或長(zhǎng)度,修改其某個(gè)字段的類型或改變他的長(zhǎng)度,由于表中有數(shù)據(jù),不能直接修改,需要換個(gè)方法,接下來通過本文給大家介紹下解決方法,需要的朋友可以參考下2022-10-10oracle查看會(huì)話鎖定的所有對(duì)象代碼分享
oracle查看會(huì)話鎖定的所有對(duì)象2014-01-01