Script to Monitor SMON Rollback Progress [ID 1352046.1]

In this Document
  Purpose
  Software Requirements/Prerequisites
  Configuring the Script
  Running the Script
  Caution
  Script
  Script. Output


Applies to:

Oracle Database Products > Oracle Database
Information in this document applies to any platform.

Purpose

Script. queries x$ktuxe view to check for dead transactions and repeatedly runs the query every 2 mins

Software Requirements/Prerequisites

Application : SQL

Configuring the Script

Login to sys user and run Monitor_SMON_Rollback.sql

Running the Script


SQL> connect /as sysdba
SQL> @Monitor_SMON_Rollback.sql

Caution

This script. is provided for educational purposes only and not supported by Oracle Support Services. It has been tested internally, however, and works as documented. We do not guarantee that it will work for you, so be sure to test it in your environment before relying on it.

Proofread this script. before using it! Due to the differences in the way text editors, e-mail packages and operating systems handle text formatting (spaces, tabs and carriage returns), this script. may not be in an executable state when you first receive it. Check over the script. to ensure that errors of this type are corrected.

Script

spool SMON_RollBack_Progress.lst
Prompt
Prompt Script. will run for 10 minutes and checks rollback status from x$ktuxe every 2 mins
Prompt -----------------------------------------------------------------------------------
Prompt
set lines 120
col useg format a30
alter session set nls_date_format='dd-mon-yyyy hh24:mi:ss';

select sysdate,b.name useg, b.inst# instid, b.status$ status, a.ktuxeusn
xid_usn, a.ktuxeslt xid_slot, a.ktuxesqn xid_seq, a.ktuxesiz undoblocks
from x$ktuxe a, undo$ b
where a.ktuxesta = 'ACTIVE' and a.ktuxecfl like '%DEAD%'
and a.ktuxeusn = b.us#;

Prompt
Prompt ------------------------------------------------------------------------------------

Prompt sleeping for 2 mins ....
exec dbms_lock.sleep(120);

select sysdate,b.name useg, b.inst# instid, b.status$ status, a.ktuxeusn
xid_usn, a.ktuxeslt xid_slot, a.ktuxesqn xid_seq, a.ktuxesiz undoblocks
from x$ktuxe a, undo$ b
where a.ktuxesta = 'ACTIVE' and a.ktuxecfl like '%DEAD%'
and a.ktuxeusn = b.us#;

Prompt
Prompt ------------------------------------------------------------------------------------

Prompt sleeping for 2 mins ....
exec dbms_lock.sleep(120);

select sysdate,b.name useg, b.inst# instid, b.status$ status, a.ktuxeusn
xid_usn, a.ktuxeslt xid_slot, a.ktuxesqn xid_seq, a.ktuxesiz undoblocks
from x$ktuxe a, undo$ b
where a.ktuxesta = 'ACTIVE' and a.ktuxecfl like '%DEAD%'
and a.ktuxeusn = b.us#;

Prompt
Prompt ------------------------------------------------------------------------------------

Prompt sleeping for 2 mins ....
exec dbms_lock.sleep(120);

select sysdate,b.name useg, b.inst# instid, b.status$ status, a.ktuxeusn
xid_usn, a.ktuxeslt xid_slot, a.ktuxesqn xid_seq, a.ktuxesiz undoblocks
from x$ktuxe a, undo$ b
where a.ktuxesta = 'ACTIVE' and a.ktuxecfl like '%DEAD%'
and a.ktuxeusn = b.us#;

Prompt
Prompt ------------------------------------------------------------------------------------


Prompt sleeping for 2 mins ....
exec dbms_lock.sleep(120);

select sysdate,b.name useg, b.inst# instid, b.status$ status, a.ktuxeusn
xid_usn, a.ktuxeslt xid_slot, a.ktuxesqn xid_seq, a.ktuxesiz undoblocks
from x$ktuxe a, undo$ b
where a.ktuxesta = 'ACTIVE' and a.ktuxecfl like '%DEAD%'
and a.ktuxeusn = b.us#;

Prompt ** END OF SCRIPT. **
spool off




Script. Output


SQL> @Monitor_SMON_Rolllback.sql

Script. will run for 10 minutes and checks rollback status from x$ktuxe every 2 mins
----------------------------------------------------------------------------------

Session altered.


SYSDATE USEG INSTID STATUS XID_USN XID_SLOT XID_SEQ UNDOBLOCKS
-------------------- ------------------------------ ---------- ---------- ---------- ---------- ---------- ----------
24-aug-2011 22:18:05 _SYSSMU3_3382367247$ 0 3 3 31 153 10


-----------------------------------------------------------------------------------
sleeping for 2 mins ....

PL/SQL procedure successfully completed.


SYSDATE USEG INSTID STATUS XID_USN XID_SLOT XID_SEQ UNDOBLOCKS
-------------------- ------------------------------ ---------- ---------- ---------- ---------- ---------- ----------
24-aug-2011 22:20:05 _SYSSMU3_3382367247$ 0 3 3 31 153 8


-----------------------------------------------------------------------------------
sleeping for 2 mins ....


SYSDATE USEG INSTID STATUS XID_USN XID_SLOT XID_SEQ UNDOBLOCKS
-------------------- ------------------------------ ---------- ---------- ---------- ---------- ---------- ----------
24-aug-2011 22:20:05 _SYSSMU3_3382367247$ 0 3 3 31 153 6


-----------------------------------------------------------------------------------
sleeping for 2 mins ....

PL/SQL procedure successfully completed.


SYSDATE USEG INSTID STATUS XID_USN XID_SLOT XID_SEQ UNDOBLOCKS
-------------------- ------------------------------ ---------- ---------- ---------- ---------- ---------- ----------
24-aug-2011 22:20:05 _SYSSMU3_3382367247$ 0 3 3 31 153 4


-----------------------------------------------------------------------------------
sleeping for 2 mins ....


SYSDATE USEG INSTID STATUS XID_USN XID_SLOT XID_SEQ UNDOBLOCKS
-------------------- ------------------------------ ---------- ---------- ---------- ---------- ---------- ----------
24-aug-2011 22:20:05 _SYSSMU3_3382367247$ 0 3 3 31 153 2


** END OF SCRIPT. **

 


Related



 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/38267/viewspace-723068/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/38267/viewspace-723068/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值