Restoring an oracle database, very basic.

Assuming you have a backup which is valid, you should be able to follow these simple steps to restore your database from scratch.

If your spfile is missing, you can restore from an autobackup. This should have been setup for your database.

RMAN> restore spfile from autobackup;

This will restore your spfile to the $ORACLE_HOME/dbs directory.

If your controlfiles are missing, restore those first.

SQL> startup nomount; 
RMAN> restore controlfile from '<path>/<backup piece>';
SQL> alter database mount;

This will place the controlfiles in the locations specified in the spfile parameter control_files.

Restore your database.

SQL> startup mount; 
RMAN> restore database; 
RMAN> recover database;

If you want to do this to a different point in time that the lastest backup, you can specify the time for restoration.

SQL> startup mount; 
RMAN> set until time '10-01-2012';
RMAN> restore database; 
RMAN> recover database;

Now you should be able to open the database.

SQL> alter database open;

If your online redo log files are not available, then you should open with resetlogs.

SQL> alter database open resetlogs;

That’s it, this though is just the very basic process, assuming your backup is valid.

Leave a Reply