Wednesday, October 13, 2010

Recover database until cancel


Quick steps

1. Setup oracle database environment using . oraenv

2. restore controlfile
    $ rman target / nocatalog
    RMAN> set dbid=1185150074;
    RMAN> startup nomount;
    RMAN> run
                {
                restore controlfile from ‘/u01/BACKUP/demo/demo_control_backup.ctl’;
                }


3. mount database
    RMAN> alter database mount;

4. Restore datafiles
      RMAN> restore database;

5. Restore archive log files
Option# 1 – range of archive logs
RMAN> run
{
restore archivelog from sequence 35347 until sequence 35359;
}

Option # 2 – one archive log at a time
RMAN> run
 {
 restore archivelog sequence 35347;
 }

6 Recover and open until cancel
       sqlplus "/ as sysdba"
       recover database using backup controlfile until cancel;
       cancel
       alter database open resetlogs;

7. Add temp file
      alter tablespace temp
        add tempfile '/u01/oracle/admin/demo/demo_temp01.dbf'
        size 2048m reuse autoextend off;


Hope this help. Regards Rupam