Wednesday, April 14, 2010

RMAN - Restore from backup - Step by Step

  1. Copy and Edit init.ora file (if init.ora cant be found or unavailable then, do strings on the controlfile from rman backup and make up init.ora)
  2. Create required folders like bdump, udump etc (that are referred in init.ora)
  3. Add entry into /etc/oratab file
  4. Add entry into /etc/tnsnames.ora file
  5. set . oraenv
  6. sqlplus / as sysdba
  7. startup nomount (use pfile= option if init.ora file is not located under $ORACLE_HOME/dbs folder)
  8. exit from sqlplus
  9. rman target / nocatalog (once connected to RMAN, pl. note that the “connected to target database:” is the one that you intended to connect and its in “(not mounted)” mode.
  10. set dbid= (find this value from the backup logs);
  11. restore controlfile from ‘full_path_here’;
  12. mount database;
  13. restore database;
  14. recover database;
  15. alter database open resetlogs;

if ORA-39700: database must be opened with UPGRADE option Then,

    1. sqlplus / as sysdba
    2. startup upgrade;
    3. run catupgrd.sql from $ORACLE_HOME/rdbms/admin Folder. To upgrade to 10.2 (latest version if the backup was from previous release)
    4. shutdown immediate
    5. startup
    6. run utlrp.sql from $ORACLE_HOME/rdbms/admin Folder to recompile any invalid objects.