Wednesday, January 9, 2008

Restore 11g database from only a flash recovery area

Wednesday, January 09, 2008 Posted by Andre Broers 3 comments
In my home situation I have a server (sandbox) which changes frequently. I had an oracle 10g database on it which was backup'd every day to the flash_recovery_area with the default settings from enterprise manager. Nothing special in it, so when I reinstalled the server the only thing I did was save a tar from the flash_recovery_area. Must be enough.

After reinstalling the server I used the following to restore the database.

First I installed a fresh 11g oracle home.

The commands I isued are the following:

export ORACLE_SID=orcl

rman target /

startup nomount

restore spfile from autobackup db_recovery_file_dest='<restored flash recovery dir>' db_name='orcl';

restore controlfile from autobackup db_recovery_file_dest='<restored flash recovery dir>' db_name='orcl';

copy the controlfile from the dbs directory to the destinations in the spfile.

create the $ORACLE_BASE/admin/orcl/adump directory.

create the $ORACLE_BASE/oradata/orcl directory.

copy the flash_recovery_area to the original location.

in rman:

startup force mount;

restore database;

recover database;

alter database open resetlogs;

now the database is up and running. Now it is time to configure and start the listener with netca.

After this we have to regenerate the enterprise manager repository. This will be covered in the next blog.

3 comments: