Docstoc

surender sara

Document Sample
surender sara Powered By Docstoc
					                                   Setup RMAN User, Catalog & Register                                    Incremental Backup Script
  MAKE SURE ALL DATABASE have PASSWORD FILE                                                      resync catalog;
                                                                                                 change archivelog all validate;
  sqlplus system/manager@rman <<__1
                                                                                                 run{
   drop user rman_TEST cascade;                                                                  allocate channel c1 type 'SBT_TAPE';
                                                                                                 allocate channel c2 type 'SBT_TAPE';
   create user rman_TEST identified by rman_TEST                                                 backup
     default tablespace users                                                                      format '/intr/cf_t%t_s%s_p%p'
     temporary tablespace ts_temp                                                                  (current controlfile);
     quota unlimited on users                                                                    backup
     quota unlimited on ts_temp ;                                                                  incremental level 0
     grant connect , resource, recovery_catalog_owner to rman_TEST;                                tag db_intr_0
  exit                                                                                             filesperset 5
  __1                                                                                              format '/intr/df_t%t_s%s_p%p'
  # create the catalog                                                                             (database);
  rman catalog rman_TEST/rman_TEST@rman << __2                                                   sql 'alter system archive log current';
  create catalog;                                                                                backup
  exit                                                              SURENDER                       filesperset 20
  __2                                                                 SARA                         format '/intr/rl_t%t_s%s_p%p'
  rman target \"sys/pass9999@TEST as sysdba\" \                                                    (archivelog all delete input);
  catalog rman_TEST/rman_TEST@rman << __3                                                        release channel c1;
  register database ;                                                                            release channel c2;
  EXIT                                                                                           }
  __3
                                      Su

Full Backup Script – Hot Backup – Target DB in Archivelog Mode                                         Full Backup Script – To Tape
                                                                                             run {
         run        {                                                                             allocate channel t1 type 'SBT_TAPE';
                 allocate channel c1 type disk;                                                   backup
                                                re

                 set limit channel c1 kbytes 500000;                                                   format 'db_%d_t%t_s%s_p%p'
                 backup full                                                                           (database);
                 filesperset 2                                                                    sql 'alter system archive log current';
                 (database format '/rman_backup/BACKUP/TEST_data_%U');                            backup
                                                         nd

                 sql "alter system archive log current";                                               format 'arch_%d_t%t_s%s_p%p'
                 backup filesperset 10                                                                 (archivelog all delete input);
                            format '/rman_backup/BACKUP/TEST_arch%U'                         }
                 (archivelog all );                                       SURENDER
                 release channel c1;                                        SARA
                                                           er


                 }
         exit;


                       Recover Specific Datafile
  run
                                                                    Sa


    {
  allocate channel c1 type disk;
  sql 'alter database datafile 2 offline drop';                 RMAN
  restore datafile 2;
  recover datafile 2;
                                                                             ra


  release channel c1;
   }



    COMPLETE RECOVERY script using current controlfile                    COMPLETE RECOVERY script using backup controlfile

            run {                                                                      run {
                        allocate channel d1 type disk;                                            allocate channel d1 type disk;
                        restore database;                                                         restore controlfile;
                        sql 'alter database mount';                                               restore database;
                        recover database;                                                         sql 'alter database mount';
                   }                                                                              recover database;
                                                                                                  sql 'alter database open resetlogs';
                                                                                         }


  INCOMPLETE RECOVERY script using backup controlfile                    INCOMPLETE RECOVERY script using backup controlfile
    -- Required if there are gaps in log sequence                                      -- Required if there are gaps in log sequence
    run {                                                                              run {
                                                                                            # recover database until specific time
          SET UNTIL logseq = 6 thread = 1;                                                  allocate channel dev1 type 'SBT_TAPE';
          allocate channel d1 type disk ;                                                   set until time 'Apr 20 2003 12:15:00';
          restore controlfile;                                                              sql "alter database mount" ;
          restore database;                                                                 restore database;
          sql 'alter database mount';                                                       switch datafile all;
          recover database;                                                                 recover database;
          sql 'alter database open resetlogs';                                              sql "alter database open resetlogs";
     }                                                                                      release channel dev1;
                                                                                          }

				
DOCUMENT INFO
Shared By:
Categories:
Stats:
views:9
posted:8/12/2011
language:Azerbaijani
pages:1