Posts tagged: How to find uncommitted Transaction

Nov 05 2009

How to find uncommitted Transaction

This script shows active transactions… and how many blocks are needed to rollback (it’s good also, when you do a Shutdown Immediate… and don’t know how much time you need to rollback)
(in 9i Rollback appears in v$session_longops)

alter session set sort_area_size=5000000;
set linesize 232
col username format a12;
col sql_text format a40;
col used_ublk format 9999;
col used_urec format 9999;
col log_io format 99999;
col phy_io format 99999;

select
distinct (a.sid), a.username, substr(c.sql_text,1,38) as SQL,
b.start_time as START_DT, b.used_ublk as Blk_RBS, b.used_urec as Recs_RBS,
b.log_io as IO_ReLog, b.phy_io as IO_Phy
from
v$session a, v$transaction b, v$sql c
where
a.saddr=b.ses_addr and a.SQL_HASH_VALUE=c.HASH_VALUE(+);

Alibi3col theme by Themocracy