Search This Blog

Wednesday, August 11, 2021

Configure RMAN using Catalog

 

Configure RMAN using Catalog

1.  Modify tnsnames.ora file

 

Target DB

Catalog DB

TARGET =

  (DESCRIPTION =

     (ADDRESS = (PROTOCOL = TCP)(HOST = TARGET)(PORT = 1521))

      (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = TARGETDB)

    )

  )

 

CATALOG =

  (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = CATALOG)(PORT = 1521))

    (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = CATALOGDB)

    )

  )

 

TARGET =

  (DESCRIPTION =

     (ADDRESS = (PROTOCOL = TCP)(HOST = TARGET)(PORT = 1521))

      (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = TARGETDB)

    )

  )

 

CATALOG =

  (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = CATALOG)(PORT = 1521))

    (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = CATALOGDB)

    )

  )

 

 

 

2. Startup DB on archivelog mode with Target DB

               -    set parameter

                  LOG_ARCHIVE_DEST_1=’LOCATION=/ARC/’

                           LOG_ARCHIVE_STATE_1=enable

                           LOG_ARCHIVE_START=TRUE 

                           LOG_ARCHIVE_FORMAT= %t_%s_%r.dbf

-       startup database on archivelog mode

$sqlplus /nolog

Sql> connect / as sysdba

Sql> startup mount;

Sql> alter database archivelog;

Sql> alter database open

 

3. Create user for catalog on Catalog DB

Sql> create tablespace RMAN datafile ‘/oradata/catalog/rman01.dbf’ size 50M auto extend on next 5M;

Sql> create user rman identified by rman default tablespace rman temporary tablespace temp quota unlimited on RMAN;

Sql> grant recovery_catalog_owner, connect, resource to rman;

  

4. Start rman and connect to the Target DB (do on target DB)

               $ export ORACLE_SID=TARGET

               $ rman target / catalog rman/rman@catalog

               Rman> create catalog tablespace “RMAN”;

               Rman> register database;

5. Configure parameters on RMAN

               $ export ORACLE_SID=TARGET

               $ rman target / catalog rman/rman@catalog

               Rman> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/oradata/dbfile2/backup-cf/%F';

               Rman> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT   '/oradata/dbfile2/backup-db2/%U';

               Rman> CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/oracle/product/10.1.0/db/dbs/snapcf_cmddb1.f';

               Rman> CONFIGURE CONTROLFILE AUTOBACKUP ON;

 

6. Create resync script (resync every hours)

               $ vi /oracle/resync.sh

               #!/bin/sh

export ORACLE_SID=TARGET

export ORACLE_BASE=/oracle

export ORACLE_HOME=/oracle/product/10.1.0/db

 

/oracle/product/10.1.0/db/bin/rman target / catalog rman/rman@catalog <<EOF

resync catalog;

EOF                

               --------------

               $ chmod 750 /oracle/resync.sh

   And add script to crontab

               0 0 * * * /oracle/rtlstenlog.sh > /dev/null 2>&1

 

No comments:

Post a Comment

Transportable tablespace refresh

  1.check tablespace for the user which need to refresh -------------------------------------------------------------------  SQL> select ...