0
votes

after a crash of my database, i try to restore my backupset. 1. Create a new Database with the same name as the old database 2. Set the flash_recovery_area to the folder where the backupset from the old database is stored 3. rman -> connect target / -> restore database;

RMAN says: no data found.

How can i say the db where the backupset is stored?

Thank you!

2

2 Answers

0
votes

We cannot directly restore the database if it is a new db or different server, we need to first catalog the backupset if it is a new server and make RMAN aware of its location.

 RMAN> CATALOG START WITH '/<path>/';
 RMAN> SET DBID <DBID>
 RMAN> RESTORE CONTROLFILE 
 RMAN> RESTORE DATABASE ;
0
votes

Assuming you have at least one good copy of controlfile (or controlfile autobackup), you know DB_NAME, you know your DBID

1) install exact the same Oracle DB version (only binaries)
2) in $ORACLE_HOME/dbs create "initSID.ora" file with just 1 line DB_NAME=YouDbName (on Linux)
3) SQL> startup nomount
4) 
RMAN> run{
RMAN> set DBID 104183017;
RMAN> SET CONTROLFILE AUTOBACKUP FORMAT  FOR DEVICE TYPE DISK TO '/u01/app/oracle/product/12.1.0.2/dbhome_1/dbs/%F';
RMAN> restore controlfile from autobackup;
RMAN> }

5)     SQL> alter database mount;

6)     RMAN> restore database;
7)     RMAN> recover database;
8)     SQL> alter database open resetlogs;

In case you have a controlfile backup you do not need to CATALOG otherwise you need it.