Doing a restore from an RMAN backup to a freshly deployed Oracle Database Appliance seems like a conceivable scenario, so I figured it would be nice to have tried it at least once.
For this test, I have a backupset on /s01/backup/testdb/ and no backup catalog. I have deployed the ODA using the parameter file from the original deploy, so that network and grid infrastrcuture configuration as well as database and instance names are the same.
First, we need the DBID of the old database. One place to see it is in the file name of the control file auto backup. The first number is the DBID: testdb_c-60599356-20121022-03
We must also figure out the controfile autobackup format, I have it set to /s01/backup/testdb/testdb_%F
Similarly we need the location of the SPFILE on the new database, which we can find with show parameter spfile. In this case it’s +DATA/testdb/testdb.ora
Now we can shut down the instance on both nodes, and fire up RMAN on node 1 to restore the SPFILE.
set ORACLE_SID=testdb1
rman target /
set DBID = 60599356;
startup nomount;
set CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘/s01/backup/testdb/testdb_%F’;
restore spfile to pfile ‘/tmp/dummy.ora’ from autobackup;
shutdown immediate;
startup nomount pfile=’/tmp/dummy.ora’;
restore spfile to ‘+DATA/testdb/spfiletestdb.ora’ from autobackup;
shutdown immediate;
Ok, we first restored the spfile and converted it to a dummy pfile – just so we could get the newly deployed spfile out of the way, start the database from the pfile, and restore the spfile back to it’s original location. Next up is the control files:
startup nomount;
restore controlfile from autobackup;
shutdown immediate;
startup nomount;
That was rather easy. If you do have archive logs or backup pieces that are newer than the control file snapshot, they should now be cataloged:
catalog archivelog /s01/secondary_archive/2012_10_23_testdb_4445.arc;
I don’t have anything to add, so I’m all set for restore.
alter database mount;
restore database;
recover database;
Since I don’t have a copy of the most current archive log, I must then settle for an incomplete recovery and open the database with resetlogs;
alter database open resetlogs;
Database is back in business. Any changes between time of backup and time of failure are lost.
One Response to Restore database to new or redeployed ODA