Home » RDBMS Server » Backup & Recovery » recovery from RMAN backup
recovery from RMAN backup [message #155167] Thu, 12 January 2006 12:25 Go to next message
vijaychauhan
Messages: 106
Registered: December 2005
Senior Member
I have taken backup using RMAN by backup database command.
After that I shutdown the database. Next time when I startup the database I see that all the control files are corruted, only backup of controlfiles is the one that was taken using RMAN.now how do I recover database.
Re: recovery from RMAN backup [message #155180 is a reply to message #155167] Thu, 12 January 2006 14:18 Go to previous messageGo to next message
fnguy
Messages: 39
Registered: January 2006
Member
Please include the syntax of your backups/ whether you're using a recovery catalog/ version of Oracle.
Re: recovery from RMAN backup [message #155288 is a reply to message #155180] Fri, 13 January 2006 09:07 Go to previous messageGo to next message
vijaychauhan
Messages: 106
Registered: December 2005
Senior Member
I am using Rman for backup, no recovery catalog.
The syntax is backup database.
The Oracle version is 9i release 2.

[Updated on: Fri, 13 January 2006 09:08]

Report message to a moderator

Re: recovery from RMAN backup [message #155296 is a reply to message #155167] Fri, 13 January 2006 10:37 Go to previous messageGo to next message
fnguy
Messages: 39
Registered: January 2006
Member
• Open RMAN but do not log in.
• RMAN> set dbid = DatabaseID
o Find this from the controlfile name backup. (Look in the hot backup folder. The controlfile backup syntax is C-2537975638-20051225-00 The numbers after the C- are the DBID. In this example only it is 2537975638.
• Connect to the target database in RMAN
o RMAN> Connect target sys/syspassword
• RMAN> Run { restore controlfile from autobackup; }


I ***think*** this will restore the most recent controlfile backup.
Re: recovery from RMAN backup [message #155376 is a reply to message #155167] Sun, 15 January 2006 11:30 Go to previous messageGo to next message
vijaychauhan
Messages: 106
Registered: December 2005
Senior Member
Thanks a lot, that worked.
Re: recovery from RMAN backup [message #156152 is a reply to message #155167] Mon, 23 January 2006 02:27 Go to previous message
chj733
Messages: 11
Registered: October 2005
Location: CHINA
Junior Member
Hi,you can try the following script

--restore controlfile
DECLARE
devtype varchar2(256);
done boolean;
BEGIN
devtype := dbms_backup_restore.DeviceAllocate(type => '',ident => 'FUN');
dbms_backup_restore.RestoresetdataFile;
dbms_backup_restore.RestoreControlFileto('D:\ORACLE_BASE\controlfiles\CONTROL01.CTL');
dbms_backup_restore.RestoreBackupPiece('D:\ORACLE_BASE\Rman_Backup\MYDB_DF_BCK0BH1JBVA_1_1',done => done);
dbms_backup_restore.RestoresetdataFile;
dbms_backup_restore.RestoreControlFileto('D:\ORACLE_BASE\controlfiles\CONTROL02.CTL');
dbms_backup_restore.RestoreBackupPiece('D:\ORACLE_BASE\Rman_Backup\MYDB_DF_BCK0BH1JBVA_1_1',done => done);
dbms_backup_restore.RestoresetdataFile;
dbms_backup_restore.RestoreControlFileto('D:\ORACLE_BASE\controlfiles\CONTROL03.CTL');
dbms_backup_restore.RestoreBackupPiece('D:\ORACLE_BASE\Rman_Backup\MYDB_DF_BCK0BH1JBVA_1_1',done => done);
dbms_backup_restore.DeviceDeallocate;
END;
/

--restore datafile
DECLARE
devtype varchar2(256);
done boolean;
BEGIN
devtype := dbms_backup_restore.DeviceAllocate (type => '',ident => 'FUN');
dbms_backup_restore.RestoreSetDatafile;
dbms_backup_restore.RestoreDatafileTo(dfnumber => 1,toname => 'D:\ORACLE_BASE\datafiles\SYSTEM01.DBF');
dbms_backup_restore.RestoreDatafileTo(dfnumber => 2,toname => 'D:\ORACLE_BASE\datafiles\UNDOTBS.DBF');
--dbms_backup_restore.RestoreDatafileTo(dfnumber => 3,toname => 'D:\ORACLE_BASE\datafiles\MYSPACE.DBF');
dbms_backup_restore.RestoreBackupPiece(done => done,handle => 'D:\ORACLE_BASE\RMAN_BACKUP\MYDB_DF_BCK05H2LLQP_1_1', params => null);
dbms_backup_restore.DeviceDeallocate;
END;
/

--restore archived redolog
DECLARE
devtype varchar2(256);
done boolean;
BEGIN
devtype := dbms_backup_restore.DeviceAllocate (type => '',ident => 'FUN');
dbms_backup_restore.RestoreSetArchivedLog(destination=>'D:\ORACLE_BASE\achive\');
dbms_backup_restore.RestoreArchivedLog(thread=>1,sequence=>1);
dbms_backup_restore.RestoreArchivedLog(thread=>1,sequence=>2);
dbms_backup_restore.RestoreArchivedLog(thread=>1,sequence=>3);
dbms_backup_restore.RestoreBackupPiece(done => done,handle => 'D:\ORACLE_BASE\RMAN_BACKUP\MYDB_LOG_BCK0DH1JGND_1_1', params => null);
dbms_backup_restore.DeviceDeallocate;
END;
/

[Updated on: Wed, 12 April 2006 07:41] by Moderator

Report message to a moderator

Previous Topic: online redo logs
Next Topic: How to explant a database from HP-UNIX to Window
Goto Forum:
  


Current Time: Mon Dec 23 03:36:53 CST 2024