[20151111]跟蹤除錯rman.txt
[20151111]跟蹤除錯rman.txt
-- 上午查詢在rman下執行list backup慢的問題,總結收集一些除錯技巧,順便在檢視問題:
1.方法1,使用debug trace 引數:
--執行如下:
$ rman target / debug trace /tmp/aaa.txt
--為了顯示的好看,我格式化其中一行.
DBGMISC: EXITED krmkgal with status Done [10:52:04.659] elapsed time [00:00:00:00.031]
DBGMISC: ENTERED krmkgal [10:52:04.659]
DBGSQL: TARGET>
DECLARE
thread NUMBER;
sequence NUMBER;
recid NUMBER;
alRec dbms_rcvman.alRec_t;
BEGIN
dbms_rcvman.getArchivedLog (alRec => alRec);
IF ( :rlscn = alRec.rlgSCN
AND :stopthr = alRec.thread
AND ( (alRec.sequence >= :stopseq AND :toclause = 0)
OR (alRec.sequence > :stopseq AND :toclause = 1)))
THEN
:flag := 1;
ELSE
:flag := 0;
:al_key:al_key_i := alRec.key;
:recid:recid_i := alRec.recid;
:stamp:stamp_i := alRec.stamp;
:thread := alRec.thread;
:sequence := alRec.sequence;
:fileName:fileName_i := alRec.fileName;
:lowSCN := alRec.lowSCN;
:lowTime := alRec.lowTime;
:nextSCN := alRec.nextSCN;
:nextTime := NVL (alRec.nextTime, TO_DATE ('12/31/9999', 'MM/DD/YYYY'));
:rlgSCN := alRec.rlgSCN;
:rlgTime := alRec.rlgTime;
:blocks := alRec.blocks;
:blockSize := alRec.blockSize;
:status := alRec.status;
:compTime:compTime_i := alRec.compTime;
:duplicate := alRec.duplicate;
:compressed:compressed_i := alRec.compressed;
:isrdf:isrdf_i := alRec.isrdf;
:stby := alRec.stby;
:terminal := alRec.terminal;
:site_key:site_key_i := alRec.site_key;
:source_dbid := alRec.source_dbid;
END IF;
END;
DBGSQL: sqlcode = 0
DBGSQL: B :flag = 0
DBGSQL: B :al_key = 5545
DBGSQL: B :recid = 5545
DBGSQL: B :stamp = 891060419
DBGSQL: B :thread = 1
DBGSQL: B :sequence = 3705
DBGSQL: B :fileName = NULL
DBGSQL: B :lowSCN = 13202585849
DBGSQL: B :lowTime = "2015-09-21 22:01:36"
DBGSQL: B :nextSCN = 13202624095
DBGSQL: B :nextTime = "2015-09-22 04:46:58"
DBGSQL: B :rlgSCN = 3011113647
DBGSQL: B :rlgTime = "2012-11-05 11:58:00"
DBGSQL: B :blocks = 75872
DBGSQL: B :blockSize = 512
DBGSQL: B :status = D
DBGSQL: B :compTime = "2015-09-22 04:46:59"
DBGSQL: B :duplicate = 0
DBGSQL: B :compressed = NO
DBGSQL: B :isrdf = NO
DBGSQL: B :stby = N
DBGSQL: B :terminal = NO
DBGSQL: B :site_key = 0
DBGSQL: B :source_dbid = 0
DBGSQL: B :rlscn = 3011113647
DBGSQL: B :stopthr = 0
DBGSQL: B :stopseq = 0
DBGSQL: B :toclause = 0
DBGRCVMAN: ENTERING getArchivedLog
DBGRCVMAN: getArchivedLog - resetscn=3011113647 thread=1 seq=3705 lowscn=13202585849 nextscn=13202624095 terminal=NO site_key_order_col=0 isrdf=NO stamp=891060419
DBGRCVMAN: getArchivedLogLast(translateArcLogSCNRange2) := local
DBGRCVMAN: getArchivedLogLast := local
DBGRCVMAN: EXITING getArchivedLog
DBGMISC: EXITED krmkgal with status Done [10:52:05.124] elapsed time [00:00:00:00.465]
DBGMISC: ENTERED krmkgal [10:52:05.124]
--上下對比時間10:52:04.659,10:52:05.124 ,說明單獨執行一次需要: 5.124-4.659=0.465秒,真不知道為什麼這麼慢?
$ grep "DBGMISC: EXITED krmkgal with status Done" /tmp/aaa.txt
DBGMISC: EXITED krmkgal with status Done [15:55:15.831] elapsed time [00:00:00:00.007]
DBGMISC: EXITED krmkgal with status Done [15:55:16.283] elapsed time [00:00:00:00.452]
DBGMISC: EXITED krmkgal with status Done [15:55:16.778] elapsed time [00:00:00:00.495]
DBGMISC: EXITED krmkgal with status Done [15:55:17.249] elapsed time [00:00:00:00.470]
DBGMISC: EXITED krmkgal with status Done [15:55:17.726] elapsed time [00:00:00:00.477]
DBGMISC: EXITED krmkgal with status Done [15:55:18.197] elapsed time [00:00:00:00.470]
--而dg上執行相同的命令:
DBGMISC: EXITED krmkgal with status Done [15:52:31.585] elapsed time [00:00:00:00.003]
DBGMISC: EXITED krmkgal with status Done [15:52:31.588] elapsed time [00:00:00:00.003]
DBGMISC: EXITED krmkgal with status Done [15:52:31.591] elapsed time [00:00:00:00.003]
DBGMISC: EXITED krmkgal with status Done [15:52:31.594] elapsed time [00:00:00:00.003]
DBGMISC: EXITED krmkgal with status Done [15:52:31.598] elapsed time [00:00:00:00.003]
DBGMISC: EXITED krmkgal with status Done [15:52:31.601] elapsed time [00:00:00:00.003]
DBGMISC: EXITED krmkgal with status Done [15:52:31.604] elapsed time [00:00:00:00.003]
DBGMISC: EXITED krmkgal with status Done [15:52:31.607] elapsed time [00:00:00:00.003]
DBGMISC: EXITED krmkgal with status Done [15:52:31.611] elapsed time [00:00:00:00.003]
DBGMISC: EXITED krmkgal with status Done [15:52:31.614] elapsed time [00:00:00:00.003]
--兩者執行時間上相差也太大.不過dg上的cpu,磁碟都強健許多,但是差距也太大.相差100倍以上.
2.使用10046跟蹤:
--在rman下呼叫如下:
sql "alter session set events ''10046 trace name context forever, level 12''";
list backupset;
--也可以這樣呼叫:
run
{
allocate channel c1 type disk ;
sql "alter session set events ''10046 trace name context forever, level 12''";
backup spfile;
##list backup;
release channel c1 ;
}
--不過奇怪的是不能run裡面執行list backup的命令.
RMAN> run
2> {
3> list backup;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "list": expecting one of: "advise, allocate, alter, backup, @, catalog, change,
configure, convert, copy, crosscheck, delete, duplicate, execute, flashback, host, mount, open, recover, release,
repair, report, restore, resync, send, set, show, shutdown, sql, startup, switch, transport, validate, "
RMAN-01007: at line 3 column 1 file: standard input
--但是執行如下,沒有問題,真搞不懂oracle rman的語法.
run
{
report schema ;
}
總結:
--依舊無法定位,暫時放棄.上午的測試僅僅減少了迴圈的次數,但是每次的執行時間依舊不變,目前僅僅手工清除記錄在控制檔案的archivelog資訊.
-- execute dbms_backup_restore.resetcfilesection(11);
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-1828852/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 除錯跟蹤利器---strace除錯
- 使用Linux Strace跟蹤除錯Oracle程式程式Linux除錯Oracle
- PHP 程式碼除錯跟蹤工具 YtracePHP除錯
- git刪除未跟蹤檔案Git
- 跟蹤oracle特定報錯 errorstackOracleError
- 視覺化程式碼跟蹤除錯與STM32應用設計視覺化除錯
- JBuilder Debug時不能進入源程式檔案視窗跟蹤除錯?UI除錯
- [zt] oracle跟蹤檔案與跟蹤事件Oracle事件
- oracle跟蹤檔案與跟蹤事件(zt)Oracle事件
- oracle跟蹤檔案和跟蹤事件(zt)Oracle事件
- 使用ErrorStack進行錯誤跟蹤及診斷Error
- 使用ErrorStack進行錯誤跟蹤及診斷!Error
- 依據錯誤號來跟蹤sql語句SQL
- 使用Error Stack跟蹤Oracle錯誤堆疊資訊ErrorOracle
- sqlnet跟蹤SQL
- ORACLE 跟蹤工具Oracle
- 刪除git已經跟蹤的檔案或者目錄Git
- 記一次除錯YOLOv5+DeepSort車輛跟蹤專案的經過除錯YOLO
- 利用errorstack事件進行錯誤跟蹤和診斷Error事件
- 使用ErrorStack進行Oracle錯誤跟蹤及診斷ErrorOracle
- 使用ERRORSTACK進行錯誤跟蹤及診斷(轉)Error
- 基於行跟蹤的ROWDEPENDENCIES實現資訊變化跟蹤
- 【Longkin】ASP.NET應用程式跟蹤---(一)跟蹤頁面ASP.NET
- 反跟蹤技術
- 【TRACE】Oracle跟蹤事件Oracle事件
- Oracle跟蹤會話Oracle會話
- Oracle 跟蹤事件【轉】Oracle事件
- Oracle跟蹤檔案Oracle
- 主力跟蹤戰法
- Java開發者應該知道的五款錯誤跟蹤工具Java
- sp_trace_setfilter sqlserver篩選跟蹤或跟蹤過濾FilterSQLServer
- git的跟蹤分支和遠端跟蹤分支學習筆記Git筆記
- ORACLE 10046 設定跟蹤事件後無跟蹤檔案Oracle事件
- 在 Visual C# .NET 中跟蹤和除錯C#除錯
- Oracle 開啟SQL跟蹤執行SET AUTOTRACE ON命令時出錯OracleSQL
- SQLServer進行SQL跟蹤SQLServer
- 會話跟蹤技術會話
- 跟蹤執行命令T