recovery from RMAN backup [message #155167] |
Thu, 12 January 2006 12:25 |
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 #155296 is a reply to message #155167] |
Fri, 13 January 2006 10:37 |
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 #156152 is a reply to message #155167] |
Mon, 23 January 2006 02:27 |
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
|
|
|