Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: controlfile recovery
Dennis,
There is a procedure within the standard Oracle 8i documentation that shows you how to recover the control file from a backup peice. I've included the procedure below. When recovering the database without a backup catalog, the trick is to ensure that the controlfile is the LAST thing that is backed up. The last backup command "backup current controlfile" ensures that it is possible to recover all the archive logs backed up in the previous command. That is, the control contains the details about the archive log backup (note, the "...include current controlfile" does not contain details about the archive log backup).
run
{
# # Perform a full, complete, hot backup of the database # followed by a backup of the archived logs. # We backup the controlfile as the last step to allow # us to recover the last archived log if we ever have # to recover the database without a recovery catalog. # allocate channel t1 type 'sbt_tape' format '%d_%U'; backup ( database include current controlfile ); sql 'alter system archive log current'; backup ( archivelog all delete input ); backup current controlfile; release channel t1;
The PL/SQL block that I use to recover the controlfile is below. You need to know the name of the backup peice that contains the controlfile backup to use it.
DECLARE
devtype varchar2(256);
done boolean;
BEGIN
--devtype := dbms_backup_restore.deviceallocate('devtype', params=>'');
devtype := dbms_backup_restore.deviceallocate('sbt_tape', params=>'');
dbms_backup_restore.restoresetdatafile;
dbms_backup_restore.restorecontrolfileto('/tmp/control01.ctl');
dbms_backup_restore.restorebackuppiece('/SID_5ge4ps5m_1_1',done=>done);
END;
/
Cheers,
Craig.
-----Original Message-----
Sent: Saturday, 26 April 2003 8:22 AM
To: Multiple recipients of list ORACLE-L
AK - Congratulations on getting Robert's book. This issue of recovering the controlfile depends somewhat on which Oracle version you are using. I think this is easier in Oracle 9i. I started working on Oracle 8i recovery before Robert's book was available. I was not able to recover the controlfile from the RMAN backup. I found it easier to ALTER DATABASE BACKUP CONTROLFILE TO 'XXX'; after the RMAN backup. I included that in my RMAN script and have been able to recover databases on another server.
Dennis Williams
DBA, 40%OCP, 100% DBA
Lifetouch, Inc.
dwilliams_at_lifetouch.com
-----Original Message-----
Sent: Friday, April 25, 2003 4:32 PM
To: Multiple recipients of list ORACLE-L
Can you reply to this before heading to IOUG .
I am testing restoration controlfile from RMAN backup . with nocatalog option .
Is there any way you can recover controlfile if database is not mounted .
I used dbms_backup_recovery package as described in Robert's book . But
looks like lost somewhere because after restoring control file database
complains system01.dbf is from past backup .
Logically seems okay , scn in control file might be different then what is
in datafile header . But now what ?
I try to recover database and it is saying recovery using backup controlfile
must be done.
I am lost . any I idea what I am doing wrong here .
thanks,
-ak
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: DENNIS WILLIAMS INET: DWILLIAMS_at_LIFETOUCH.COM Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Craig Munday INET: Craig.Munday_at_ecard.com.au Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Sun Apr 27 2003 - 21:42:44 CDT
![]() |
![]() |