Search This Blog

Sunday, August 12, 2007

Control File Recovery

Database Version: 10.1.0.5.0
OS: Windows XP
Archive log ENABLE
Backup Method : RMAN


For CONTROLFILE backup we have to configure below parameters





C:\>set ORACLE_SID=orcl

C:\>rman target=sys

Recovery Manager: Release 10.1.0.5.0 - Production

Copyright (c) 1995, 2004, Oracle. All rights reserved.

target database Password:
connected to target database: ORCL (DBID=1155117244)



RMAN> configure controlfile autobackup on;



using target database controlfile instead of recovery catalog
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored




Note: with above configuration whenever database backup taken that time automatically SPFILE backup generated.


Eg:



Starting Control File and SPFILE Autobackup at 12-AUG-07
piece handle=C:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AREA\ORCL\AUTOBACKUP\2007_0
8_12\O1_MF_S_630440652_3CY60FMB_.BKP comment=NONE
Finished Control File and SPFILE Autobackup at 12-AUG-07






How to recover controlfile when controlfile corrupted.





Error found alert.log file

Mon Aug 13 08:48:06 2007
Errors in file c:\oracle\product\10.1.0\admin\orcl\bdump\orcl_arc1_3508.trc:
ORA-00227: corrupt block detected in controlfile: (block 1, # blocks 1)
ORA-00202: controlfile: 'C:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\CONTROL02.CTL'



Logon to RMAN.


C:\>rman target=sys

Recovery Manager: Release 10.1.0.5.0 - Production

Copyright (c) 1995, 2004, Oracle. All rights reserved.

target database Password:
connected to target database (not started)


RMAN> startup nomount;

Oracle instance started

Total System Global Area 285212672 bytes

Fixed Size 789060 bytes
Variable Size 90961340 bytes
Database Buffers 192937984 bytes
Redo Buffers 524288 bytes


RMAN> restore controlfile from autobackup;

Starting restore at 13-AUG-07
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=160 devtype=DISK

recovery area destination: C:\oracle\product\10.1.0\flash_recovery_area
database name (or lock name space) used for search: ORCL
channel ORA_DISK_1: autobackup found in the recovery area
channel ORA_DISK_1: autobackup found: C:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AR
EA\ORCL\AUTOBACKUP\2007_08_13\O1_MF_S_630492347_3CZRHW01_.BKP
channel ORA_DISK_1: controlfile restore from autobackup complete
output filename=C:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\CONTROL01.CTL
output filename=C:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\CONTROL02.CTL
output filename=C:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\CONTROL03.CTL
Finished restore at 13-AUG-07



RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1


RMAN> run
2> {
3> restore database;
4> recover database;
5> }


Starting restore at 13-AUG-07

[output cut]

Finished restore at 13-AUG-07

Starting recover at 13-AUG-07
using channel ORA_DISK_1

starting media recovery

[output cut]


media recovery complete
Finished recover at 13-AUG-07


RMAN> alter database open resetlogs;

database opened






2 comments:

Anonymous said...

Unquestionably imagine that that you stated.
Your favourite justification appeared to
be at the net the simplest thing to understand of. I say to you, I certainly get annoyed whilst folks
think about worries that they just don't recognize about. You controlled to hit the nail upon the top and outlined out the entire thing with no need side effect , folks can take a signal. Will likely be again to get more. Thanks

Here is my site; password finder

Anonymous said...

It's hard to find experienced people about this subject, however, you seem like you know what you're talking about!
Thanks

Feel free to visit my web blog Dragon Vale hacks 2012