Search This Blog

Thursday, 13 October 2016

Recovery Manager – II


Recovery Manager – II

 

Catalog (tables & views)  à Central repository that stores information of backups.

 

Configure catalog:

In a separate box (machine) install Oracle software the version must be same or higher from the Target databases and configure the Listener and do the following:

Steps:

a)       Create a new database for the catalog : test

b)       Create a tablespace: hzts

c)       Create a user: cat and assign the above tablespace hzts as default

d)       Grant connect, resource and recovery_catalog_owner privileges to cat user

i)         Sql>grant connect,resource,recovery_catalog_owner to cat identified by cat;

e)       connect to RMAN and create the catalog:

 

$rman catalog cat/passwd

Rman> create catalog;

 

For each Target database site

 

Configure tns service for recovery catalog:  tocat and register the database

 

$rman target / catalog cat/passwd@tns name

 

        Rman>register database;


Note: Connect to catalog user

        SQL> select * from rc_database    {to check the registered Database Information}


Note: Continue same for other target databases

 

Taking backup of Target db with Catalog

 

From the Target host connect to rman,

 

$export ORACLE_SID=prod

$rman target / catalog hzcat/passwd@tns name

Rman> backup database;

 

     Virtual catalog

-          Catdb (test), target db –> prod

 

     At catalog side –

-          create one more catalog user ( vcat) in Catalog Db

 

From target db  (ex. test)

-          $rman target / catalog cat/passwd@tns name

-          Rman>Register database

-           Rman>grant catalog for database proda to vcat;

Rman > list db_unique_name all;

               EXIT

Note: Connect to Rman through VCAT user
          $rman target / catalog vcat/passwd@tns name

 

          Rman>create virtual catalog;

          Rman > list db_unique_name all;

 

Now for proda database backup information will  be store in virtual catalog as well as base catalog.

Configure commands

Rman> configure controlfile autobackup on;   à on backup of database/datafile controlfile & spfile will auto backedup
               Rman> configure retention policy to redundancy 2; 
                                                             OR
              Rman> configure retention policy to recovery window of 30 days;
              Rman>configure backup Optimization on;

 

 

Run block:

 To execute multiple commands at a time.

       

Eg.

 

Rman>run                                                                             

                  {

                     backup current controlfile;

                     backup datafile 1;

                  }

 

Configure FRA (flash recovery area)

            Configure parameters

                 Db_recovery_file_dest_size

                 Db_recovery_file_dest

          Sql>alter system set db_recovery_file_dest_size=4g scope=both;

          Sql>alter system set db_recovery_file_dest=’/u01/user18/fra’ scope=both;

 

Rman Scripts (Target Side)

 

1. Creating Rman Script:

    Eg:

Rman>create script bkp

{

   Backup database;

   Backup spfile;

   Backup current controlfile;

   Backup archivelog all;

}

2. Executing rman script

   Rman>run

{execute script bkp;}

3. To see the code of script:

Rman>print script bkp;

Rman>delete script bkp;

View: we can check following views to see rman scripts

           rc_stored_script //display scripts name

           rc_stored_script_line // display text of script

Note: we can create rman script in catalog mode only.

 

No comments:

Post a Comment