Thursday, December 29, 2011

Failure Scenarios and Recovery cases

                                                             Recovery  Types



Case 1:

No archive log mode
Cycle not completed
Data file lost

Sol :

    Restore datafile manuallu
    Startup mount
    Recover automatic datafile

Case 2:

No archive log mode
Cycle completed
Datafile lost

Sol :

    Restore datafile manually
    Startup mount
    Alter tablespace datafile offline drop


Case 3:

  System datafile lost archive log mode

Sol:

    Startup Mount
    Connect  rman
    Run
    {

         Restore tablespace system
         Recover tablespace system

    }

    Alter databse open;


Case 4:

Archive log mode
Datafile lost

Sol:

    Startup mount
    Connect rman
    Restore datafile
    Recover datafile
    Alter database open

Case 5:

Archive log
Unbackuped datafile lost
All archive log file available from that tablespace created

Sol:

    Startup mount
    Create dummy datafile
    Recover automatic datafile

Case 6:
Single control file lost

Sol:

     Copy of one another Controlfile
         Rename it to lost controlfile

Case 7:

All control files lost and have a backup

Sol:

      Startup no mount
      Rman> restore control file from backup
      Rman>alter database mount
      Rman>recover database
      Rman>alter database open resetlogs

Case 8:
  All controlfile lost and no backup

Sol:

    User mgd:
      Startup no mount
      >alter database backup controlfile to trace;
      Open backup control file command  in trace folder
      Execute Create control file
      Recover database
      Open database

Case 9:

  All control files lost along with online current redo log file and no backup

Sol:

      Startup mount
      Execute Create control file reset logs
      Restore most recent full backup
      Recover database using backup control file
      Open database reset logs

Case 10:

  In active redo log file lost

Sol

      (Automatic instance shutdown)        
      Startup mount
      Drop log file
      Create group add log file

Case 11:

  Group member lost inactive or current or active

Sol:

      No problem to instance
      Drop that member
      Recreate that member

Case 12:

  Current redo log file lost

Sol:

      Startup mount
      Rman> restore database
      Run
         {
        Set until sequence 13 thread 1
        Recover database
         }
      Alter database open reset logs

Case 13:

  Recover to a perticular time and all redolog files have

Sol:

      Startup mount
      Run
         {
       Set until time ‘ ‘
       Restore database
       Recover database
         }
      Open reset logs;

Case 14 :

  All redo log files lost
  Archive log file lost along with one datafile
  Un archived  log file lost

Sol:

    Same as active redo log file.

Case 15:

  One of the sequence number lost in backup archive log files

Sol:

    Apply recovery upto before the sequecne of lost archive log file

 Case 16:

  Password file lost

Sol:

      In cmd prompt create pwd file using following command
        Orapwd file=d:\pworcl.ora

Case 17:

 Pfile and spfile lost

Sol:

    restore spfile from previous backup
    Take pfile from another database and make chages to it and run

Case 17:

  Temporary tablespace lost

Sol:

    No problem to instance
    Create temporary tablespace temp2 tempfile ‘c:\tmep2.dbf’ size 100m
    Alter database default temporary tablespace temp2;

Case 18:

  Undo tablepace lost

Sol:

    No problem to instance
    Create undo tablespace undots datafile ‘c:\undotbs.dbf ‘ size 100m;
    Alter system set undo_tablespace=undots;


Case 19:

  Block corruption

Sol:

    Rman > recover corruption list;
    Or
    Rman> block recover  datafile  file#  block block#;

Case 20:

your database corrupted/lost after adding a datafile to database you are only  having the backup of
database before adding the datafile, the newly added datafile is not available in the backupset ,
what will happen how will you recover? Is the new added datafile will be available after the
restore backup command?

Sol :

The answer is yes the control contains the information about the newly added datafile so RMAN creates a new datafile  with the same name and location and applies logs to the datafile to recover. it is similar to sql statement  alter database create datafile statement.

No comments: