Knowing how much time left to complete rollback operation
                                                 Last update (2008-02-20 20:53:11)
                                                                                                                   Date added (2008-02-14 14:28:04)

Summary
Knowing how much time left to complete rollback operation The script below is written for Oracle 9+. You can rewrite it for version 8+, but please note it comes without support for killed session lookup. Also lookup for rollbacks continues after issuing of "shutdown abort". *Note: There is known issue with Oracle prior 9i version, that there is a lack of support for "left outer join" statement defined by SQL standard. Preliminaries: fixed view sys.x$ktuxe view: x$ktuxe [k]ernel layer [t]ransaction layer [u]ndo transaction [e]ntry This view holds entry for each active undo slot.
SELECT /*+ USE_NL(S,T,X) */ NVL (s.username, 'session no more exists or running on the other node of RAC' ), 
x.ktuxeusn xid_usn, x.ktuxeslt xid_slot, x.ktuxesqn xid_sqn, x.ktuxesiz 
FROM ((sys.x$ktuxe x LEFT JOIN sys.gv_$transaction t 
ON t.xidusn = x.ktuxeusn AND t.xidslot = x.ktuxeslt 
AND t.xidsqn = x.ktuxesqn AND x.inst_id = t.inst_id) 
LEFT JOIN sys.gv_$session s ON s.saddr = t.ses_addr 
AND s.inst_id = t.inst_id)
WHERE x.ktuxesta = 'ACTIVE' AND x.ktuxesiz > 1;

SELECT SUM (ktuxesiz) FROM sys.x$ktuxe 
WHERE ktuxeusn = xid_usn 
AND ktuxeslt = xid_slot 
AND ktuxesqn = xid_sqn AND ktuxesta = 'ACTIVE';
Reviews
Categories
Oracle DBA-> (147)
  Alertlog (3)
  Archivelog (5)
  Auditing (1)
  Backup - Recovery (19)
  Database files (6)
  Database options (2)
  DB links (2)
  Dependencies (1)
  Dictionary (2)
  Exp-Imp Datapump (6)
  Jobs (2)
  Mview (2)
  Networking (3)
  Objects (7)
  Parameters (2)
  Redologs (6)
  Roles - Grants (2)
  Rollback - Undo (8)
  Segments (3)
  Sequences (2)
  Sessions (14)
  SGA (14)
  Tables (10)
  Tablespaces (10)
  Temp (4)
  Toad (5)
  Transactions (1)
  Upgrade (2)
  Users (3)
Oracle APPS DBA-> (66)
Exadata (1)
Performance Tuning-> (59)
Oracle Real Cases (24)
Oracle Errors (23)
Oracle SQL tricks (32)
Oracle RAC (3)
Oracle Security (8)
Filters
Search