The goal of this exercise is to practice backup and recovery of Tier 1 databases. Due to very limited time only 1 recovery scenario (i.e. full database point in time recovery) will be exercised. This scenario has been choosen as the most useful and most probable to happen in reality in the database environment with SAME implementation.

Backup procedure

1. Perform a full backup of your database. If you have any backup infrastructure in place use it to perform the backups. If you perform backups by hand do the follwing:

  • login to one node of the cluster. Make sure that ORACLE_SID and ORACLE_HOME environment variables are set correctly
  • start RMAN, connect to the target database and to the catalog (if you use one):
          rman target / [catalog usrname@TNS_descriptor]
       
  • Configure controlfile autobackup:
          configure controlfile autobackup on;
       
  • Performa a full database backup, use tape system if you have one in place:
          run
          {
             allocate channel c1 device type disk|sbt;
             allocate channel c1 device type disk|sbt;
             backup as backupset database plus archivelog;
             backup current controlfile;
           }
       
2. Write down the dbid of the database:
      sqlplus "/ as sysdba"
      select dbid from v$database;
      exit
   
3. Find and write down your spfile location:
      sqlplus "/ as sydba"
      show parameter spfile;
      exit
   
4. Just before failure simulation connect to RMAN and backup archivelogs:
     run
      {
         allocate channel c1 device type disk|sbt;
         allocate channel c1 device type disk|sbt;
         backup archivelog all;
       }
  
5. As a safety net make an additional manual backup of your controlfile and the parameter files:
      mkdir $HOME/backup_dir
      cd $HOME/backup_dir
      pwd
      sqlplus "/ as sysdba"
      create pfile='path_to_your_backup_directory/initDB.ora' from spfile;
      alter database backup controlfile to 'path_to_your_backup_directory/controlfile.ctl';
      exit;
   

Checks

1. Make sure that you still have pfile and control file backups in '$HOME/backup_dir' directory

2. Make sure that ORACLE_SID and ORACLE_HOME environment variables are set correctly, connect to RMAN and check whether your DB is recoverable:

      rman target / [catalog usrname@TNS_descriptor]
      run
      {
         allocate channel c1 device type disk|sbt;
         allocate channel c1 device type disk|sbt;
         set until time 'sysdate-1/240';
         restore database check readonly preview;
       }
       list archivelog all completed after 'sysdate-1';
   
Note: Make sure that you have used the same backup device as during the backup.

Failure simulation

1. Stop all cluster nodes.

2. Remove all datafiles, controlfiles, and the spfile. Do not touch archived redo logs or backup sets if there are any. For ASM use the 'asmcmd' tool.

Recovery procedure


This topic: PSSGroup > PhysicsDatabasesSection > LCG3DWiki > ServiceDocs > HandsOnExercises
Topic revision: r2 - 2007-06-08 - JacekWojcieszuk
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback