Practice:Creating the Recovery Catalog

This practice covers the creation of the recovery catalog.

Instructions

 

1.      Create the RMAN_TS tablespace as shown below to be used for the recovery catalog.

 

 

 

SQL> create tablespace rman_ts datafile

  2   '/home4/user44/ORADATA/u05/rman01.dbf'

  3     size 20M default storage

  4   (initial 100K next 100K pctincrease 0); 

  Tablespace created.

 

 

2.      Create a user and schema for the recovery catalog and grant the roles and privileges to this user to maintain the recovery catalog and perform the backup and recovery operations.

 

 

SQL> create user rman identified by rman

  2  default tablespace rman_ts

   3  quota unlimited on rman_ts; 

 

User created.

 

SQL> grant recovery_catalog_owner to rman;

 

Grant succeeded.

 

SQL> grant connect, resource to rman;

 

  Grant succeeded.

 


3.      Connect to the recovery catalog database using RMAN.  Create the catalog in the rman_ts tablespace

 

 

 

user44 ksh > rman catalog rman/rman

 

Recovery Manager: Release 9.0.1.0.0 - Production

 

(c) Copyright 2001 Oracle Corporation.  All rights reserved.

 

connected to recovery catalog database

recovery catalog is not installed

 

RMAN> create catalog;

 

recovery catalog created

        

 

 

4.      Connect to your target database and then to the recovery catalog database using RMAN. 

 

 

user44 ksh > rman target /

 

Recovery Manager: Release 9.0.1.1.1 - Production

 

(c) Copyright 2001 Oracle Corporation.  All rights reserved.

 

connected to target database: U45 (DBID=3557466756)

 

 

RMAN> connect catalog rman/rman@U44

 

connected to recovery catalog database

 

RMAN>          

 

 

 

This ends this practice.

 

 

 

 

 

 

Practice #<number>: <topic title>

Practice: Using RMAN to Register, Resynchronize, and Reset a Database

 

This practice covers using RMAN to register, resynchronize, and reset a database

 

Instructions:

 

1.      Execute the command to resynchronize the control file and recovery catalog.  What happened?  Why?

 

 

 

user45 ksh > rman target / catalog rman/rman@u44

 

Recovery Manager: Release 9.0.1.0.0 - Production

 

(c) Copyright 2001 Oracle Corporation. All rights reserved.

 

connected to target database: U45 (DBID=2607302401)

connected to recovery catalog database

 

RMAN> resync catalog;

 

RMAN-00571: ==========================================================

RMAN-00569: ===== ERROR MESSAGE STACK FOLLOWS ============

RMAN-00571: ==========================================================

RMAN-00579: the following error occurred at 03/13/2002 18:13:59

RMAN-03006: non-retryable error occurred during execution of command: resync

RMAN-12004: unhandled exception during command execution on channel default

RMAN-20003: target database incarnation not found in recovery catalog

 

RMAN>

 

 

            You got the error because the target database is not registered in the database.

 

2.       Register the target database in the recovery catalog at the RMAN prompt.

 

 

RMAN> register database;

database registered in recovery catalog

starting full resync of recovery catalog

 

full resync complete

 

 

 

 

3.      Using RMAN, list all of the database incarnations registered in the catalog.

 

 

 

RMAN> list incarnation of database;

 

starting full resync of recovery catalog

full resync complete

 

List of Database Incarnations

DB Key Inc Key DB Name  DB ID     CUR Reset SCN  Reset Time

------ ------- ------- ---------- -_- --------- ----------

1      2       U44     2607302401 NO  90827     09-MAR-02

1      19      U45     2607302401 YES 90827     09-MAR-02

 

RMAN>

 

4.      Enter the RESET DATABASE command at the RMAN prompt.  What happens?

 

 

 

RMAN> reset database;

 

RMAN-00571: ==========================================================

RMAN-00569: ========= ERROR MESSAGE STACK FOLLOWS ========

RMAN-00571: ==========================================================

RMAN-00579: the following error occurred at 03/13/2002 18:33:17

RMAN-03006: non-retryable error occurred during execution of command: reset

RMAN-12004: unhandled exception during command execution on channel default

RMAN-20009: database incarnation already registered

 

RMAN>

 

 

This ends this practice.

 

 

 

Practice #<number>: <topic title>

Practice: Managing Scripts

 

This practice covers using a RMAN catalog to managed stored scripts.

 

 

Instructions:

 

1.      Create a script to make a whole database backup with following information:

     Name of script: nightback

     Channel name: disk1

     Channel type: Disk

     Format: $HOME/BACKUP/RMAN/%b%d%s%p

     Level: Database (No archivelogs)

     tag  nback

 

     DO NOT RUN THIS SCRIPT NOW.

 

 

 

user45 ksh > rman target / catalog rman/rman@u44

 

RMAN> CREATE SCRIPT nightback {

   2>     allocate channel db01D type disk;

   3>     backup format '$HOME/BACKUP/RMAN/%d%s%p'

   4>     (database);

   5>     release channel db01D;

   6>      }

 

created script nightback                          

 

 

2.       Register the target database in the recovery catalog at the RMAN prompt.

 

 

RMAN> print script nightback;

 

printing stored script: nightback

 {

allocate channel db01D type disk;

backup format '$HOME/BACKUP/RMAN/%d%s%p'

(database);

release channel db01D;

}

 

RMAN>                                       

 

 

 

 

This ends this practice.

1