Oracle Consulting, Oracle Support and Oracle Training by Spyridon N. Kaparelis
osCommerce

Oracle

My Account      
  Oracle Scripts (Search) » Categories » Administration » Rollback - Undo » My Account          
Categories
Free Oracle Support (1)
Administration-> (120)
  Alertlog (3)
  Archivelog (5)
  Auditing (1)
  Backup - Recovery (11)
  Database files (5)
  Database options (2)
  DB links (2)
  Dependencies (1)
  Dictionary (2)
  Export Import Datapump (2)
  Jobs (2)
  Mview (2)
  Networking (2)
  Objects (7)
  Parameters (2)
  Redologs (6)
  Roles (1)
  Rollback - Undo (8)
  Segments (2)
  Sequences (2)
  Sessions (14)
  SGA (10)
  Tables (10)
  Tablespaces (9)
  Temp (5)
  Transactions (1)
  Users (3)
FlexCube (4)
ORA errors (14)
Oracle Application Server (1)
Oracle APPS DBA-> (38)
Oracle APPS DBA jobs (1)
Oracle Books (18)
Oracle RAC (3)
Oracle Real Cases (29)
Oracle Security (6)
Oracle SQL tricks (32)
Other Oracle sites (3)
Performance Tuning-> (53)
Site info
About Spyridon N. Kaparelis
Privacy Notice & Disclaimer
Buy Oracle APPS DBA Books
Ask for Free Oracle Support
Recovery after killing a large transaction

Summary
After killing a large running transaction, either by killing the process or aborting the database, the database may appear to hang and/or the SMON background process is taking all the available cpu. Basically SMON is in the progress of rolling back this terminated large transaction, which can be time consuming. As a result of this users often try to restart the database, but because a shutdown immediate will hang, the database is often aborted. Please note that stopping the database will actually make things worse and will not decrease the amount of work SMON needs to perfom to complete the rollback.

The message 'Waiting for smon to disable tx recovery' will posted in the alert log as well.

First we need to determine the progress SMON is making. It is very possible the SMON process to work with one rollback segment. You can find it using the following query:

SELECT r.NAME "RB Segment Name", dba_seg.size_mb,
DECODE(TRUNC(SYSDATE - LOGON_TIME), 0, NULL, TRUNC(SYSDATE - LOGON_TIME) || ' Days' || ' + ') || 
TO_CHAR(TO_DATE(TRUNC(MOD(SYSDATE-LOGON_TIME,1) * 86400), 'SSSSS'), 'HH24:MI:SS') LOGON, 
v$session.SID, v$session.SERIAL#, p.SPID, v$session.process,
v$session.USERNAME, v$session.STATUS, v$session.OSUSER, v$session.MACHINE, 
v$session.PROGRAM, v$session.module, action 
FROM v$lock l, v$process p, v$rollname r, v$session, 
(SELECT segment_name, ROUND(bytes/(1024*1024),2) size_mb FROM dba_segments 
WHERE segment_type = 'TYPE2 UNDO' ORDER BY bytes DESC) dba_seg 
WHERE l.SID = p.pid(+) AND 
v$session.SID = l.SID AND 
TRUNC (l.id1(+)/65536)=r.usn AND 
l.TYPE(+) = 'TX' AND 
l.lmode(+) = 6 
AND r.NAME = dba_seg.segment_name
--AND v$session.username = 'SYSTEM'
--AND status = 'INACTIVE'
ORDER BY size_mb DESC;
After killing the shadow process or aborting the database the v$transaction entry is lost, so you cannot estimate by examining v$transaction.used_ublk how the rollback procedure proceeds.

The following queries are available to monitor the progress of the transaction recovery:
SQL> alter session set NLS_DATE_FORMAT='DD-MON-YYYY HH24:MI:SS'; 

SELECT usn, state, undoblockstotal "Total", undoblocksdone "Done", 
undoblockstotal-undoblocksdone "ToDo", 
DECODE(cputime,0,'unknown',SYSDATE+(((undoblockstotal-undoblocksdone) / (undoblocksdone / cputime)) / 86400)) 
"Finish at" 
FROM v$fast_start_transactions; 

       USN STATE                 Total       Done       ToDo Finish at
---------- ---------------- ---------- ---------- ---------- --------------------
        88 RECOVERED             36591      36591          0 17-NOV-2008 17:02:44
        36 RECOVERING              464        100        364 10-DEC-2008 03:32:06
        71 RECOVERING              309        193        116 20-NOV-2008 19:19:23
         8 RECOVERING          2350785     189363    2161422 18-NOV-2008 00:51:51
Run the above query several times in a row, this will give you a good idea on how SMON is progressing.

- In some versions the cputime does not work (always 0), hence the estimated completion time will not be displayed
- In some cases the v$fast_start_transactions view will not work. If this is the case then you can query the internal data dictionary
view x$ktuxe, the 'ktuxesiz' column represents the remaining number of undo blocks required for rollback:
   select ktuxeusn, to_char(sysdate,'DD-MON-YYYY HH24:MI:SS') "Time", ktuxesiz, ktuxesta
   from x$ktuxe
   where ktuxecfl = 'DEAD'; 

Added by Spyridon N. Kaparelis at Monday 17 November, 2008
Notifications more
NotificationsNotify me of updates to Recovery after killing a large transaction
Tell A Friend
 
Reviews more
Write ReviewWrite review for the script
Read Latest Oracle News
Search at the site
 
Press Enter to search

Advanced Search
Search Error Messages

Oracle8i
Oracle9i
Oracle10g
Oracle11g
Search Oracle Docs

Metalink
Oracle8i
Oracle9i
Oracle10g
Oracle11g


osCommerce
Oracle APPS DBA Kaparelis | Oracle RAC | Oracle PLSQL | Oracle Tips | Oracle Consulting | Oracle Metalink | Oracle Support Oracle Training | Oracle Certification | Oracle Articles | Oracle DBA | Oracle Magazine | Oracle User Groups Oracle 7.3 Oracle 8 Oracle 8i Oracle9i Oracle10g Oracle11g EBS E-Business Suite 11.5.10 Oracle Apps Tuning Oracle SGA tuning sql tracing oracle session oracle errros ORA error ORA-600 Ora-00600 oracle jobs dba jobs apps dba jobs oracle experts oracle guru oracle oracle real application cluster oracle index oracle optimazation query oracle explain plan query optimization oracle I/O oracle memory tuning oracle xstress test oracle education oracle university oracle certification OCP OCA oracle support contracts oracle monitoring RAC interconnect developer oracle forms reports oracle application server Rman spyros dba oracle backup Veritas recovery catalog rcvcat oracle Σπυρίδων Καπαρέλης Ora-00600:[] Sp???d?? ?. ?apa????? oracle monitor daily operations free oracle support free consulting oracle seminars oracle arhitecture Unix linux HP-UX AIX Sun Solaris Windows TAR Service Request Metalink oracle disaster recovery oracle Data Guard Oracle Database Administrator Oracle Services low cost oracle support oracle patches upgrades apps dba spyros patch upgrade oracle opatch OUI export import oracle data pump ADDM ASM oracle OAS PGA shared pool ?p?st????? Oracle Application Server 10g consultans Oracle ERP CRM Apache WebUtil oracle 10g 11g 12g New Features Oracle courses development Oracle News forums Oracle Technical Docs FAQ Oracle Professionals Oracle DataCenter Data Center IT Oracle prices oracle software pricelist oracle carriers Oracle RDBMS Oracle Σπύρος Καπαρέλης Oracle Fusion Spiros Kaparelis oracle Spyros Kaparelis