Undo Recovery Archive Mode With Last Shutdown Abort
Undo Recovery Archive Mode With Last Shutdown Abort
Undo Recovery Archive Mode With Last Shutdown Abort
com
It’s encouraged to restore and recover database using archive files as possible.
Without having any Backup to restore and recovery, let’s test recovery from corrupted undo datafile
using Hidden parameters (_OFFFLINE/CORRUPTED_ROLLBACK_SEGMENTS) in Archive Mode, which
should be your last option for recovery, as this would have data Inconsistency.
It is imperative that these parameters are not used without contacting Oracle first.
Contents
1) Check Archive mode of DB, follow steps for Archive Mode. .............................................................. 2
2) Check Undo segment Status for any Active transaction. ................................................................... 2
3) Run update on EMP to generate undo data in undo/rollback segments of UNDOTBS1 tablespace. 3
4) Check the active undo segments ........................................................................................................ 3
5) Simulate Instance Crash and Corrupt the UNDO datafile................................................................... 5
6) Now Start the DB to Offline the corrupted/deleted datafile and try to open the DB. ....................... 6
7) Set undo_management to manual, hidden parameter to open the Database. ................................. 7
8) Drop corrupted rollback Segments along with undo tablespace. .................................................... 10
9) Unset Hidden parameter and Re-create undo tablespace and restart the DB. ............................... 11
10) Re-check if the Parameters were unset.......................................................................................... 12
11) Verify the user data and database.................................................................................................. 13
12) Reference ........................................................................................................................................ 14
Page 1 of 15
Gummula_malesh@yahoo.com
11 rows selected.
10 rows selected.
Note: 0 indicates No Active transaction
Page 2 of 15
Gummula_malesh@yahoo.com
1 row updated.
DBA session2:
1 row updated.
DBA session2:
Page 3 of 15
Gummula_malesh@yahoo.com
OR
10 rows selected.
10 rows selected.
Page 4 of 15
Gummula_malesh@yahoo.com
C:\Oracle\oradata\d041>dbv FILE=UNDOTBS01.DBF
OR
If you Edit using the Edit plus , and delete some content from middle of file.
C:\Oracle\oradata\d041>dbv FILE=UNDOTBS01.DBF
DBVERIFY: Release 11.2.0.1.0 - Production on Tue Dec 31 14:42:39 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
DBV-00102: File I/O error on FILE (C:\ORACLE\ORADATA\D041\UNDOTBS01.DBF) during end read operation (7680)
Page 5 of 15
Gummula_malesh@yahoo.com
Whenever DB shuts cleanly, CHECKPOINT_CHANGE# and LAST_CHANGE# must always be sync else the
shutdown was not clean and they need to do crash/media recovery, as below
NAME OPEN_MODE
---------- --------------------
D041 MOUNTED
Database altered.
To use this form of the ALTER DATABASE statement, the database must be in ARCHIVELOG mode.
This requirement prevents you from accidentally losing the datafile, since taking the datafile
offline while in NOARCHIVELOG mode is likely to result in losing the file.
Page 6 of 15
Gummula_malesh@yahoo.com
Page 7 of 15
Gummula_malesh@yahoo.com
System altered.
SQL> alter system set rollback_segments=SYSTEM scope=spfile;
System altered.
Session altered.
SQL> alter system set events '1092 trace name errorstack level 3';
System altered.
SQL> alter database open; this would generate the trace file having Rollback.
alter database open
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00604: error occurred at recursive SQL level 1
ORA-00376: file 3 cannot be read at this time
ORA-01110: data file 3: 'C:\ORACLE\ORADATA\D041\UNDOTBS01.DBF'
Process ID: 3296
Session ID: 191 Serial number: 1
cd c:\Oracle\diag\rdbms\d041\d041\trace
c:\Oracle\diag\rdbms\d041\d041\trace>type d041_ora_3296_Trace_1092_undo_seg.trc |FIND /N "SYSSMU"
Page 8 of 15
Gummula_malesh@yahoo.com
_SYSSMU1_1518548437$
_SYSSMU2_2082490410$
_SYSSMU3_991555123$
_SYSSMU4_2369290268$
_SYSSMU5_1018230376$
_SYSSMU6_1834113595$
_SYSSMU7_137577888$
_SYSSMU8_1557854099$
_SYSSMU9_1126410412$
_SYSSMU10_3176102001$
System altered.
System altered.
Page 9 of 15
Gummula_malesh@yahoo.com
Database altered.
'DROPROLLBACKSEGMENT'||SEGMENT_NAME||';'
-----------------------------------------------------------------------
drop rollback segment "_SYSSMU1_1518548437$";
drop rollback segment "_SYSSMU2_2082490410$";
drop rollback segment "_SYSSMU3_991555123$";
drop rollback segment "_SYSSMU4_2369290268$";
drop rollback segment "_SYSSMU5_1018230376$";
drop rollback segment "_SYSSMU6_1834113595$";
drop rollback segment "_SYSSMU7_137577888$";
drop rollback segment "_SYSSMU8_1557854099$";
drop rollback segment "_SYSSMU9_1126410412$";
drop rollback segment "_SYSSMU10_3176102001$";
10 rows selected.
Page 10 of 15
Gummula_malesh@yahoo.com
Tablespace dropped.
System altered.
System altered.
System altered.
System altered.
Tablespace created.
SQL> startup
ORACLE instance started.
Page 11 of 15
Gummula_malesh@yahoo.com
11 rows selected.
10 rows selected.
Page 12 of 15
Gummula_malesh@yahoo.com
14 rows selected.
NAME STATUS
--------------------------------------------- -------
C:\ORACLE\ORADATA\D041\SYSTEM01.DBF SYSTEM
C:\ORACLE\ORADATA\D041\SYSAUX01.DBF ONLINE
C:\ORACLE\ORADATA\D041\UNDOTBS01.DBF ONLINE
C:\ORACLE\ORADATA\D041\USERS01.DBF ONLINE
C:\ORACLE\ORADATA\D041\EXAMPLE01.DBF ONLINE
Page 13 of 15
Gummula_malesh@yahoo.com
12) Reference
It is imperative that these parameters are not used without contacting Oracle
first.
SQL> startup
ORACLE instance started.
Alert.log:
================
SMON: enabling tx recovery
Database Characterset is WE8MSWIN1252
Errors in file c:\oracle\diag\rdbms\d041\d041\trace\d041_smon_7296.trc:
ORA-00604: error occurred at recursive SQL level 1
ORA-00376: file 3 cannot be read at this time
Page 14 of 15
Gummula_malesh@yahoo.com
Trace file(c:\oracle\diag\rdbms\d041\d041\trace\d041_smon_7296.trc)
=======================================================================
SMON: about to recover undo segment 1
SMON: mark undo segment 1 as needs recovery
SMON: about to recover undo segment 2
SMON: mark undo segment 2 as needs recovery
SMON: about to recover undo segment 3
SMON: mark undo segment 3 as needs recovery
SMON: about to recover undo segment 4
SMON: mark undo segment 4 as needs recovery
SMON: about to recover undo segment 5
SMON: mark undo segment 5 as needs recovery
SMON: about to recover undo segment 6
SMON: mark undo segment 6 as needs recovery
SMON: about to recover undo segment 7
SMON: mark undo segment 7 as needs recovery
SMON: about to recover undo segment 8
SMON: mark undo segment 8 as needs recovery
SMON: about to recover undo segment 9
SMON: mark undo segment 9 as needs recovery
SMON: about to recover undo segment 10
SMON: mark undo segment 10 as needs recovery
Page 15 of 15