[20220519]完善tpt dash_wait_chains2.sql脚本.txt

来源:这里教程网 时间:2026-03-03 17:38:51 作者:

[20220519]完善tpt dash_wait_chains2.sql脚本.txt --//上午在enq FU - contention等待事件诊断是,使用tpt dash_wait_chains2.sql脚本,遇到链接 --//http://blog.itpub.net/267265/viewspace-2850485/ => [20220102]使用ashtop与dashtop脚本的小问题.txt --//类似问题.实际上主要问题在于dba_hist_active_sess_history视图里面没有inst_id字段,变成了instance_number字段. --//修改脚本显示增加如下字段。            a.instance_number inst_id            ,lower(a.program) program1            ,lower(a.module)  module1            ,session_id sid            ,session_serial# serial           , a.*           , o.* --//另外我自己以前写两个脚本wcx.sql,wcy.sql基于tpt ash_wait_chains2.sql脚本.主要是命令参数太长,我建立了这2个脚本. --//基于其内容,编写了dwcx.sql,dwcy.sql脚本. $ cat wcx.sql @ tpt/ash/ash_wait_chains2 BLOCKING_SESSION||','||BLOCKING_SESSION_SERIAL#||',@'||BLOCKING_INST_ID||'=>'||session_id||','||SESSION_SERIAL#||',@'||inst_id||'=>'||event 1=1  "&&1" "&&2" $ cat wcy.sql @ tpt/ash/ash_wait_chains BLOCKING_SESSION||','||BLOCKING_SESSION_SERIAL#||',@'||BLOCKING_INST_ID||'=>'||session_id||','||SESSION_SERIAL#||',@'||inst_id||'=>'||event "&&3"  "&&1" "&&2" $ cat dwcx.sql @ tpt/ash/dash_wait_chains2 BLOCKING_SESSION||','||BLOCKING_SESSION_SERIAL#||',@'||BLOCKING_INST_ID||'=>'||session_id||','||SESSION_SERIAL#||',@'||inst_id||'=>'||event 1=1  "&&1" "&&2" $ cat dwcy.sql @ tpt/ash/dash_wait_chains BLOCKING_SESSION||','||BLOCKING_SESSION_SERIAL#||',@'||BLOCKING_INST_ID||'=>'||session_id||','||SESSION_SERIAL#||',@'||inst_id||'=>'||event "&&3"  "&&1" "&&2" --//测试例子: > @ dwcy sysdate-3/24 sysdate "event='enq: FU - contention'" -- Display ASH Wait Chain Signatures script v0.6 BETA by Tanel Poder ( https://tanelpoder.com ) %This     SECONDS     AAS #Blkrs WAIT_CHAIN                                                                           FIRST_SEEN          LAST_SEEN ------ ---------- ------- ------ ------------------------------------------------------------------------------------ ------------------- -------------------   55%         120      .0      1 -> 3958,15327,@1=>1131,39041,@2=>enq: FU - contention -> [idle blocker 1,3958,15327] 2022-05-19 08:13:48 2022-05-19 08:15:39   45%         100      .0      1 -> 3958,15327,@1=>5097,42995,@2=>enq: FU - contention -> [idle blocker 1,3958,15327] 2022-05-19 09:13:51 2022-05-19 09:15:22

相关推荐