Oracle8i Documentation Addendum
Release 3 (8.1.7)

Part Number A85455-01

Library

Product

Contents

Index

Go to previous page Go to next page

7
Recovery Manager

This chapter describes new and changed features for RMAN in Oracle8i Release 3 (8.1.7). This chapter contains these topics:

Preparing a Standby Database Using RMAN

The procedure for preparing a standby database using RMAN is basically the same as for preparing a duplicate database. The duplication procedure is documented in "Duplicating a Database with RMAN" from Oracle8i Recovery Manager User's Guide and Reference. Nevertheless, you need to amend the duplication procedure to account for the issues specific to a standby database.

The documentation for the preparation and maintenance of standby databases is located in Oracle8i Standby Database Concepts and Administration. Familiarize yourself with what a standby database is and how to create one before you attempt the RMAN creation procedures in this chapter.

This section contains these topics:

About Standby Database Preparation Using RMAN

You can either use manual methods or the Recovery Manager DUPLICATE command to create a standby database. Before you perform the creation procedure, you must prepare the standby instance. You can use RMAN to do the preparation tasks described in Table 7-1.

Table 7-1 Standby Database Preparation Using RMAN
Task  Procedure 

Make a backup of the database to use for creation of standby database. 

Use normal backup procedure as documented in Oracle8i Recovery Manager User's Guide and Reference. 

Create a standby control file (if you do not have one). 

"Creating the Standby Control File Using RMAN" 

Choose filenames for the standby datafiles. 

"Naming the Standby Database Datafiles When Using RMAN" 

Choose filenames for the standby database online redo logs. 

"Naming the Standby Database Online Redo Logs When Using RMAN" 

You cannot use RMAN to perform all necessary standby database preparation. You must manually perform these tasks:

Creating the Standby Control File Using RMAN

In pre-8.1.7 releases, you were required to create the standby control file using the SQL ALTER DATABASE statement. Now, RMAN allows you to create the standby control file using an RMAN command.

Using RMAN, you can create a standby control file in any of the ways described in the following sections:

Creating the Standby Control File Using the BACKUP Command

You have these options for creating the standby control file using the BACKUP command:

To create a backup set containing only a standby control file:

  1. Start RMAN and connect to the target database and, if desired, the recovery catalog database. For example, enter:

    % rman TARGET / CATALOG rman/rman@rcat
    
    
    

    To write the output to a log file, specify the file at startup. For example, enter:

    % rman TARGET / CATALOG rman/rman@rcat LOG "/oracle/log/mlog.f"
    
    
  2. Mount or open the target database. For example, enter:

    RMAN> STARTUP MOUNT
    
    
    
  3. Create the standby control file using the BACKUP ... FOR STANDBY command. This example backs up the standby control file to tape:

    RUN { 
         ALLOCATE CHANNEL ch1 TYPE 'sbt_tape';
         BACKUP CURRENT CONTROLFILE FOR STANDBY;
    }
    
    

    You cannot specify a tag for a standby control file.

  4. If desired, issue a LIST command to see a listing of backup sets and pieces.

    
    

To include the standby control file within another backup:

  1. Start RMAN and connect to the target database and, if desired, the recovery catalog database. For example, enter:

    % rman TARGET / CATALOG rman/rman@rcat
    
    
    

    To write the output to a log file, specify the file at startup. For example, enter:

    % rman TARGET / CATALOG rman/rman@rcat LOG /oracle/log/mlog.f
    
    
  2. Back up the standby database and include a standby control file. This example backs up all the datafiles as well as the standby control file to disk:

    RUN { 
         ALLOCATE CHANNEL ch1 TYPE DISK;
         BACKUP DATABASE 
          INCLUDE CURRENT CONTROLFILE FOR STANDBY;
    }
    
    
    
  3. Issue a LIST command to see a listing of backup sets and pieces.

Creating the Standby Control File Using the COPY Command

You can create a standby control file by using the COPY CURRENT CONTROLFILE command with the FOR STANDBY option.

To create a control file copy that is usable as a standby control file:

  1. Start RMAN and connect to the target database and, if desired, the recovery catalog database. For example, enter:

    % rman TARGET / CATALOG rman/rman@rcat
    
    
    
  2. Use the FOR STANDBY option of the COPY CURRENT CONTROLFILE command to make a copy of the current control file that is usable as a standby control file. For example, enter:

    RUN { 
         ALLOCATE CHANNEL ch1 TYPE DISK;
         # create standby control file by copying current control file of
         # target database
         COPY CURRENT CONTROLFILE FOR STANDBY TO '/oracle/backup/standbycf.f';
    }
    
    
  3. Issue a LIST COPY command to see a listing of image copies.

Creating the Standby Control File by Cataloging a SQL-Generated Control File

You can record a standby control file generated using the ALTER DATABASE statement in the repository.

To catalog a standby control file generated using ALTER DATABASE:

  1. Create a standby control file using the SQL ALTER DATABASE statement. This example creates a standby control file in SQL*Plus:

    SQL> ALTER DATABASE CREATE STANDBY CONTROLFILE AS '/oracle/dbs/stbycf.f';
    
    
    
  2. Use RMAN to connect to the target database and, if desired, the recovery catalog database. For example, enter:

    % rman TARGET / CATALOG rman/rman@rcat
    
    
    
  3. Issue the CATALOG command to add metadata about the standby control file to the recovery catalog. For example, enter:

    RMAN> CATALOG CONTROLFILECOPY '/oracle/dbs/stbycf.f';
    
    

    RMAN considers a control file generated using ALTER DATABASE as a control file copy.

Making Image Copies of Standby Control Files

You can use RMAN to make an image copy of a control file copy that was generated using:

To copy an RMAN-generated control file copy or SQL-generated control file:

  1. Start RMAN and connect to the target database and, if desired, the recovery catalog database. For example, enter:

    % rman TARGET / CATALOG rman/rman@rcat
    
    
    
  2. Copy the standby control file using the COPY CONTROLFILECOPY command. RMAN treats SQL-generated control files and RMAN-generated standby control file copies exactly the same. It inspects the header of the control file and determines whether it is a standby or a normal control file.

    For example, run the following command:

    RUN { 
         ALLOCATE CHANNEL ch1 TYPE DISK;
         # copy standby control file created using ALTER DATABASE    
         COPY CONTROLFILECOPY '/oracle/dbs/sql_generated_cf.f' TO
                              '/backup/standbycf_sql.f';
         # copy standby control file created using RMAN 
         COPY CONTROLFILECOPY '/oracle/dbs/rman _generated_cf.f' TO
                              '/backup/standbycf_rman.f';
    }
    
    
  3. Issue a LIST COPY command to see a listing of image copies.

Naming the Standby Database Datafiles When Using RMAN

A standby database can reside either on the same host as the primary database or on a different host. The following table illustrates the implications for renaming the standby database datafiles depending on whether the directory structures on the hosts are the same or different.

Standby Database Host  Directory Structure  Renaming 

Same host as primary 

Different from primary host 

Necessary 

Same host as primary 

Same as primary host 

Illegal. The standby database cannot exist in the same directories as the primary database on the same host. 

Different host from primary 

Same as primary host 

Not necessary 

Different host from primary 

Different from primary host 

Necessary 

When the directory structures are different for the primary and standby hosts, you have these options for naming the standby datafiles:

When the directory structures are the same for the primary and standby hosts, then you have these naming options:

Because you can specify datafile filenames in the standby control file in multiple ways, a method for prioritizing settings is necessary. Table 7-2 specifies the hierarchy for the naming of datafiles in the standby database.

Table 7-2 Order of Precedence for Naming Datafiles in Standby Database
  Method of Standby Datafile Naming  Requirement 

Issue SET AUXNAME command. 

You must be connected to a recovery catalog, and a not-NULL AUXNAME must be stored in the catalog for the datafile. 

Issue SET NEWNAME command. 

You must issue this command in the RUN block for the creation of the standby database. 

Datafile filename as currently specified in the standby control file. The standby filename is identical to the primary filename or is renamed using DB_FILE_NAME_CONVERT

If the filename is different, then the DB_FILE_NAME_CONVERT parameter must be set in the standby initialization parameter file. If the filename is the same, then you must specify the NOFILENAMECHECK clause of the DUPLICATE command. 

Naming the Standby Database Online Redo Logs When Using RMAN

Until a standby database is opened read-only or activated, it does not have online redo logs. Because a standby database is updated through archived logs received from the primary database, the online logs are not needed. The online redo logs are created at standby activation, not standby creation. When you perform failover to a standby database, thereby making the standby database a primary database, Oracle accesses the standby control file to obtain the names for the online redo logs, and then creates them.

The only option when naming the online redo logs on the standby database is the filename for the logs as specified in the standby control file. If the standby online log filenames must be different from the primary online log filenames, then specify filenames for the online redo logs by setting LOG_FILE_NAME_CONVERT in the standby initialization parameter file. If you do not set this parameter, then the filenames in the standby control file for the online logs are the same as the log filenames in the primary database.

Note these restrictions when specifying filenames for the standby online redo logs:

Creating a Standby Database Using RMAN

When you create a standby database, the procedure differs depending on whether the standby database is on the same host as the primary database or on a different host. The procedures in this section assume that you have already completed the standby setup and preparation as outlined in Oracle8i Standby Database Concepts and Administration. Do not attempt these procedures until you have made all necessary initialization parameter settings and network configuration.

This section contains these topics:

About Standby Creation Using RMAN

After you have performed the steps necessary for preparing the standby instance, use the Recovery Manager DUPLICATE command to create the standby database. The steps differ depending on whether you specify that RMAN should recover the standby database after creating it.

RMAN Standby Creation Without Recovery

If you do not specify the DORECOVER option of the DUPLICATE command, then RMAN automates these steps of the standby creation procedure during duplication:

  1. RMAN establishes connections both to the primary and standby databases, and the recovery catalog (if used).

  2. RMAN queries the repository, which is either the primary control file or the recovery catalog, to identify the backups of primary database datafiles and the standby control file.

  3. If you use a media manager, then RMAN contacts the media manager on the standby host to request the backup data.

  4. RMAN restores the standby control file to the standby host, thereby creating the standby control file.

  5. RMAN restores the primary datafile backups and copies to the standby host, creating the standby database files.

  6. RMAN leaves the standby database mounted, but does not place the standby database in manual or managed recovery mode. RMAN disconnects and does not perform media recovery of the standby database.

RMAN Standby Creation with Recovery

If you do specify the DORECOVER option of the DUPLICATE command, then RMAN automates these steps of the standby creation procedure during duplication:

  1. RMAN establishes connections both to the primary and standby databases, and the recovery catalog (if used).

  2. RMAN queries the repository, which is either the primary control file or the recovery catalog, to identify the backups of primary database datafiles and the standby control file.

  3. If you use a media manager, then RMAN contacts the media manager on the standby host to request the backup data.

  4. RMAN restores the standby control file to the standby host, thereby creating the standby control file.

  5. RMAN restores the primary datafile backups and copies to the standby host, creating the standby database datafiles.

  6. After all data is restored, then RMAN initiates media recovery. If recovery requires archived redo logs, then RMAN attempts to locate them on the standby host disk drives. If the logs are not there, then RMAN attempts to restore them.

  7. RMAN recovers the standby database to the specified time, system change number (SCN), or log sequence number, or to the latest archived redo log generated if none of the above are specified.

  8. RMAN leaves the standby database mounted after media recovery is complete, but does not place the standby database in manual or managed recovery mode.


    Note:

    After RMAN creates the standby database, you must resolve any gap sequence before placing it in manual or managed recovery mode, or opening it in read-only mode. Oracle8i Standby Database Concepts and Administration discusses gap sequence resolution in detail. 


If you want RMAN to recover the standby database after creating it, then the standby control file must be usable for the desired recovery. Thus, these conditions must be met:

One way to ensure that these conditions are met is to issue the ALTER SYSTEM ARCHIVE LOG CURRENT statement after creating the standby control file. This statement archives the online logs of the primary database. Then, either back up the most recent archived log using RMAN or move the archived log to the standby site.

Whether or not you perform recovery, RMAN does not activate the standby database after creating it. The only way to activate a standby database is to issue the ALTER DATABASE ACTIVATE STANDBY DATABASE statement. After a standby database is activated and the redo logs are reset, all backups and archived logs of the old primary database are invalid for the new incarnation of the database.

See Also :

Oracle8i Standby Database Concepts and Administration to learn how to manage a standby database. 

Restrictions When Creating a Standby Database Using RMAN

For the complete list of DUPLICATE restrictions for creating a standby database using RMAN, see "DUPLICATE".

Starting RMAN and the Standby Instance

No matter which standby creation scenario you choose, you must first start the standby instance and then connect RMAN to this instance. The details of this procedure vary depending on whether the standby and primary sites have a different directory structure.

To start the standby instance:

  1. Use an operating system utility to copy the initialization parameter file from the target host to the standby host. Set all required parameters as described in Oracle8i Standby Database Concepts and Administration. For example, if you are creating the standby on a separate host with a different directory structure, make sure to edit:

    • All initialization parameters that end with _DEST and _PATH and specify a pathname

    • DB_FILE_NAME_CONVERT so that it captures all the target datafiles and converts them appropriately, for example, from tbs_* to sbytbs_*

    • LOG_FILE_NAME_CONVERT so that it captures all the online redo logs and converts them appropriately, for example, log_* to sbylog_*

  2. Use SQL*Plus to start the standby instance without mounting it. For example, enter the following to connect to sbdb1 as SYS (who has SYSDBA privileges) and start the database:

    SQL> CONNECT SYS/sys_pwd@sbdb1 AS SYSDBA
    SQL> STARTUP NOMOUNT PFILE=initSBDB1.ora
    
    
    
  3. Use SQL*Plus to mount or open the target database if it is not already mounted or open. For example, enter the following to connect to prod1 as SYS and start the database:

    SQL> CONNECT SYS/sys_pwd@prod1 AS SYSDBA
    SQL> STARTUP PFILE=initPROD1.ora
    
    

    If you use a recovery catalog, make sure that the catalog database is open. For example, enter the following to connect to rcat as SYS and start the database:

    SQL> CONNECT SYS/sys_pwd@rcat AS SYSDBA
    SQL> STARTUP PFILE=initRCAT.ora
    
    
    
  4. The auxiliary instance must be accessible via Net8. Before proceeding, use SQL*Plus to ensure that you can establish a connection to the auxiliary instance. Note that you must connect to the auxiliary instance with SYSDBA privileges, so a password file must exist.

  5. Use RMAN to connect to the target database, the standby instance, and (if you use one) the recovery catalog database. In this example, connection is established without a recovery catalog using operating system authentication:

    % rman TARGET / AUXILIARY SYS/sys_pwd@sbdb1 NOCATALOG
    
    

    In this example, the user SYS is on both the target and standby databases and has SYSDBA privileges. A net service name is used for the target as follows:

    % rman AUXILIARY sys/sys_pwd@sbdb1 TARGET SYS/sys_pwd@prod1 NOCATALOG
    
    
    

    In this example, RMAN connects to the primary, catalog, and auxiliary databases, all using net service names:

    % rman CATALOG rman/rman@rcat TARGET SYS/sys_pwd@prod1 AUXILIARY SYS/sys_pwd@sbdb1
    

Creating a Standby Database on a Remote Host with the Same Directory Structure

The simplest case is to create the standby database on a different host and to use the same directory structure. In this case, you do not need to set the DB_FILE_NAME_CONVERT or LOG_FILE_NAME_CONVERT parameters in the standby initialization parameter file or set new filenames for the standby datafiles. The primary and standby datafiles and logs have the same filenames.

To create a standby database on a different host with the same directory structure:

  1. Follow the steps in "Starting RMAN and the Standby Instance". Make sure to set all necessary parameters in the standby initialization parameter file.

  2. Perform this step only if you are not using RMAN to recover the standby database (the default option). If you are using RMAN to recover the standby database, then skip to the next step.

    Follow these steps during the duplication to create but not recover the standby datafiles:

    • Allocate at least one auxiliary channel. This channel performs the work of duplication.

    • Specify the NOFILENAMECHECK option in the DUPLICATE command. The NOFILENAMECHECK option is required when the standby and primary datafiles and logs have identical filenames. Otherwise, RMAN signals an error.

    For example, enter the following:

    RUN { 
         ALLOCATE AUXILIARY CHANNEL ch1 TYPE 'sbt_tape';
         DUPLICATE TARGET DATABASE FOR STANDBY 
           NOFILENAMECHECK;
    }
    
    
    
  3. Perform this step only if you are using RMAN to recover the standby database after creating it. Otherwise, skip this step.

    Follow these steps during duplication to restore and recover the standby datafiles:

    • Ensure that the end recovery time is greater than or equal to the checkpoint SCN of the standby control file and that a log containing the checkpoint SCN is available for recovery.

    • If desired, issue a SET command to specify the end time, SCN, or log sequence number for recovery.

    • Allocate at least one auxiliary channel.

    • Specify the NOFILENAMECHECK parameter in the DUPLICATE command, and use the DORECOVER option.

    For example, enter the following at the RMAN prompt:

    # If desired, issue a LIST command to determine the SCN of the standby control file.
    # The SCN to which you recover must be greater than or equal to the standby control 
    # file SCN.
    LIST BACKUP OF CONTROLFILE;
    LIST COPY OF CONTROLFILE;
    
    RUN {
         # If desired, issue a SET command to terminate recovery at a specified point. 
         # SET UNTIL SCN 143508;
    
         ALLOCATE AUXILIARY CHANNEL ch1 TYPE 'sbt_tape';
         DUPLICATE TARGET DATABASE FOR STANDBY 
           NOFILENAMECHECK
    	      DORECOVER;
    }
    
    
    

    RMAN uses all incremental backups, archived log backups, and archived logs to perform incomplete recovery. The standby database is left mounted.

Creating a Standby Database on a Remote Host with a Different Directory Structure

If you create the standby database on a host with a different directory structure, you need to specify new filenames for the standby database datafiles and online redo logs. You can do the following:

When creating the standby database on a host with a different directory structure, follow one of the procedures in the following sections:

Creating a Standby Database Using DB_FILE_NAME_CONVERT

In this procedure, you use DB_FILE_NAME_CONVERT to name the standby datafiles and LOG_FILE_NAME_CONVERT to name the standby online redo logs.

To create a standby database using parameters to name standby files:

  1. Follow the steps in "Starting RMAN and the Standby Instance". Make sure to set all necessary parameters in the standby initialization parameter file.

  2. Perform this step only if you are not using RMAN to recover the standby database (the default option). If you are using RMAN to recover the standby database, then skip to the next step.

    After allocating one or more auxiliary channels, issue the DUPLICATE command. For example, enter the following:

    RUN { 
         ALLOCATE AUXILIARY CHANNEL ch1 TYPE 'sbt_tape';
         DUPLICATE TARGET DATABASE FOR STANDBY;
    }
    
    
    

    After restoring the backups, RMAN leaves the standby database mounted.

  3. Perform this step only if you are using RMAN to recover the standby database after creating it. Otherwise, skip this step.

    Follow these steps:

    • Ensure that the end recovery time is greater than or equal to the checkpoint SCN of the standby control file and that a log containing the checkpoint SCN is available for recovery (as described in "RMAN Standby Creation with Recovery").

    • If desired, issue a SET command to specify the end time, SCN, or log sequence number for recovery.

    • Allocate at least one auxiliary channel.

    • Issue the DUPLICATE command with the DORECOVER option.

    For example, enter the following at the RMAN prompt:

    # If desired, issue a LIST command to determine the SCN of the standby control file.
    # The SCN to which you recover must be greater than or equal to the control file SCN.
    LIST BACKUP OF CONTROLFILE;
    LIST COPY OF CONTROLFILE;
    
    RUN {
         # If desired, issue a SET command to terminate recovery at a specified point.
         # SET UNTIL LOGSEQ 612;
    
         ALLOCATE AUXILIARY CHANNEL ch1 TYPE 'sbt_tape';
         DUPLICATE TARGET DATABASE FOR STANDBY
    	      DORECOVER;
    }
    
    
    

    RMAN uses all incremental backups, archived redo log backups, and archived redo logs to perform incomplete recovery. The standby database is left mounted.

Creating a Standby Database Using SET NEWNAME Commands

In this procedure, you use SET NEWNAME commands to name the standby datafiles.

To create a standby database using the SET NEWNAME command:

  1. Follow the steps in "Starting RMAN and the Standby Instance". Make sure to set all necessary parameters in the standby initialization parameter file.

  2. Perform this step only if you are not using RMAN to recover the standby database (the default option). If you are using RMAN to recover the standby database, then skip to the next step.

    Perform the following operations:

    • Allocate at least one auxiliary channel.

    • Specify new filenames for the standby database datafiles using SET NEWNAME commands.

    • Issue the DUPLICATE command.

    For example, enter the following:

    RUN {  
         # allocate at least one auxiliary channel of type DISK or 'sbt_tape' 
         ALLOCATE AUXILIARY CHANNEL standby1 TYPE 'sbt_tape'; 
         . . . 
         # set new filenames for the datafiles
         SET NEWNAME FOR DATAFILE 1 TO '$ORACLE_HOME/dbs/standby_data_01.f'; 
         SET NEWNAME FOR DATAFILE 2 TO '$ORACLE_HOME/dbs/standby_data_02.f'; 
         . . .
         # issue the DUPLICATE command
         DUPLICATE TARGET DATABASE FOR STANDBY;
    }
    
    
    

    RMAN uses all incremental backups, archived redo log backups, and archived redo logs to perform incomplete recovery.

  3. Perform this step only if you are using RMAN to recover the standby database after creating it. Otherwise, skip this step.

    Follow these steps:

    • Ensure that the end recovery time is greater than or equal to the checkpoint SCN of the standby control file and that a log containing the checkpoint SCN is available for recovery (as described in "RMAN Standby Creation with Recovery").

    • If desired, issue a SET command to specify the end time, SCN, or log sequence number for recovery.

    • Allocate at least one auxiliary channel.

    • Specify new filenames for the standby database datafiles.

    • Issue the DUPLICATE command with the DORECOVER option.

    For example, enter the following at the RMAN prompt:

    # If desired, issue a LIST command to determine the SCN of the standby control file.
    # The SCN to which you recover must be greater than or equal to the control file SCN.
    
    LIST BACKUP OF CONTROLFILE;
    LIST COPY OF CONTROLFILE;
    RUN {
         # If desired, issue a SET command to terminate recovery at a specified point.
         # SET UNTIL TIME 'SYSDATE-7';
    
         ALLOCATE AUXILIARY CHANNEL ch1 TYPE 'sbt_tape';
    
         # Set new filenames for the datafiles
         SET NEWNAME FOR DATAFILE 1 TO '$ORACLE_HOME/dbs/standby_data_01.f'; 
         SET NEWNAME FOR DATAFILE 2 TO '$ORACLE_HOME/dbs/standby_data_02.f'; 
         . . .
         DUPLICATE TARGET DATABASE FOR STANDBY
          DORECOVER;
    }
    
    
    

    RMAN uses all incremental backups, archived redo log backups, and archived redo logs to perform incomplete recovery. The standby database is left mounted.

Creating a Standby Database Using SET AUXNAME Commands

In this procedure, you use SET AUXNAME commands to name the standby datafiles. See the chapter "Creating a Duplicate Database with Recovery Manager" in Oracle8i Recovery Manager User's Guide and Reference.

To create a standby database using the SET AUXNAME command:

  1. Follow the steps in "Starting RMAN and the Standby Instance". Make sure to set all necessary parameters in the standby initialization parameter file.

  2. Set the auxiliary names for the datafiles. For example, enter the following:

    # set auxiliary names for the datafiles     
    SET AUXNAME FOR DATAFILE 1 TO '/oracle/auxfiles/aux_1.f'; 
    SET AUXNAME FOR DATAFILE 2 TO '/oracle/auxfiles/aux_2.f'; 
    ... 
    SET AUXNAME FOR DATAFILE n TO '/oracle/auxfiles/aux_n.f'; 
    
    
    
  3. Perform this step only if you are not using RMAN to recover the standby database (the default option). If you are using RMAN to recover the standby database, then skip to the next step.

    Allocate at least one auxiliary channel before issuing the DUPLICATE command, as in the following example:

    RUN {  
         # allocate at least one auxiliary channel of type DISK or 'sbt_tape' 
         ALLOCATE AUXILIARY CHANNEL standby1 TYPE 'sbt_tape'; 
         . . . 
         # issue the DUPLICATE command
         DUPLICATE TARGET DATABASE FOR STANDBY;
    }
    
    
    
  4. Perform this step only if you are using RMAN to recover the standby database after creating it. Otherwise, skip this step.

    Follow these steps:

    • Ensure that the end recovery time is greater than or equal to the checkpoint SCN of the standby control file and that a log containing the checkpoint SCN is available for recovery (as described in "RMAN Standby Creation with Recovery").

    • If desired, issue a SET command to specify the end time, SCN, or log sequence number for recovery.

    • Allocate at least one auxiliary channel.

    • Issue the DUPLICATE TARGET DATABASE for standby command.

    For example, enter the following at the RMAN prompt:

    # If desired, issue a LIST command to determine the SCN of the standby control file.
    # The SCN to which you recover must be greater than or equal to the control file SCN.
    LIST BACKUP OF CONTROLFILE;
    LIST COPY OF CONTROLFILE;
    
    RUN {
         # If desired, issue a SET command to terminate recovery at a specified point.
         # SET UNTIL SCN 1000;
    
         ALLOCATE AUXILIARY CHANNEL ch1 TYPE 'sbt_tape';
         DUPLICATE TARGET DATABASE FOR STANDBY
    	      DORECOVER;
    }
    
    
    

    RMAN uses all incremental backups, archived redo log backups, and archived redo logs to perform incomplete recovery. The standby database is left mounted.

  5. Unspecify the auxiliary names for the datafiles so that they are not overwritten by mistake. For example, enter the following at the RMAN prompt:

    # un-specify auxiliary names for the datafiles
    SET AUXNAME FOR DATAFILE 1 TO NULL; 
    SET AUXNAME FOR DATAFILE 2 TO NULL; 
    ... 
    SET AUXNAME FOR DATAFILE n TO NULL; 
    

Creating a Standby Database on the Local Host

When creating a standby database on the same host as the target database, follow the same procedure as for duplicating to a remote host with a different directory structure ("Creating a Standby Database on a Remote Host with a Different Directory Structure").

Note that you can create the standby database in the same Oracle home as the target database, but you must convert the filenames using the same methods used for conversion on a separate host. In other words, you must treat a standby database in the same Oracle home as if it were a database on a separate host with a different directory structure. You must not use the same names for standby and primary database files when the two databases are on the same machine.


Caution:

Do not use the NOFILENAMECHECK option when creating the standby database in the same Oracle home as the primary database. If you do, then you may overwrite the target database files or cause the DUPLICATE command to fail with an error. 


Using Image Copies to Create a Standby Database

The main restriction when using RMAN image copies to create the standby datafiles is that the image copy filenames for datafiles and archived redo logs on the primary and standby hosts must be the same. For example, assume that datafile 1 is named /oracle/dbs/df1.f on the primary host. If you use the RMAN COPY command to copy this datafile to /data/df1.f, then this image copy must exist on the standby host with the same filename of /data/df1.f. Otherwise, RMAN cannot locate the metadata for the standby image copy in its repository.

You have two main ways of populating the standby host with the image copies:

When you use the NFS mount method, you can create a directory on the primary host that maps to a directory on the standby host. If you use this method, then the NFS mount point on both machines must have the same directory name. For example, you can map /data on the primary host to /data on the standby host, but you cannot map /data on the primary host to /dir on the standby host (unless you use functionality such as symbolic links in UNIX or logical drives on Windows).

The filename of the image copy on the standby host must be the same as the filename of the image copy on the primary host. Nevertheless, you can specify a different pathname for the standby datafile by using SET NEWNAME commands or the DB_FILE_NAME_CONVERT initialization parameter.

For example, although the image copy of datafile 1 is named /data/df1.f on the standby host, you can specify the pathname /oracle/sb/df1.f in the standby control file using initialization parameters or RMAN commands. Note that you do not manually rename the physical image copy. When you issue the DUPLICATE command, RMAN restores the image copy /data/df1.f and creates the standby datafile 1 as /oracle/sb/df1.f based on the information in the initialization parameters or RMAN commands.

Table 7-3 illustrates two scenarios for creating a standby database with one datafile using NFS.

Table 7-3 Using Image Copies to Create a Standby Database: Scenario
NFS Mount Point  Primary Datafile Filename  Image Copy Filename  Standby Datafile Filename  Procedure 

/data (same on both hosts) 

/oracle/dbs/df1.f 

/data/df1.f 

/data/df1.f

(same pathname as image copy) 

"Creating the Standby Database When Image Copies and Standby Datafiles Share the Same Filenames" 

/data (same on both hosts) 

/oracle/dbs/df1.f 

/data/df1.f 

/oracle/sb/df1.f

(different pathname from image copy) 

"Creating the Standby Database When Image Copies and Standby Datafiles Do Not Share the Same Filenames" 

Table 7-3 assumes that the standby directory structure is mounted on the primary host, and that the mount point is /data on both hosts. Because the primary host mounts the standby host directory structure, when you create the image copy /data/df1.f on the primary host, you are actually creating the image copy /data/df1.f on the standby host.

In the first scenario, you name the standby datafiles using the same filenames as the image copies. This case is the simplest because you do not need to use RMAN at all to create the standby database. First, set the DB_FILE_NAME_CONVERT parameter in the standby initialization parameter file to convert the primary datafile filename /oracle/dbs/df1.f to the standby filename /data/df1.f. Then, copy the files to the standby host, and mount the standby database.

In the second scenario, you use different filenames for the standby datafiles and the image copies. To create this standby database, use the DUPLICATE command. The DUPLICATE command restores the image copy of datafile 1 and renames it according to either SET NEWNAME commands or DB_FILE_NAME_CONVERT.

Creating the Standby Database When Image Copies and Standby Datafiles Share the Same Filenames

This procedure assumes that you are using the same filenames for the standby datafiles and the image copies of the primary datafiles.

To create a standby database when the copies and standby datafiles have the same names:

  1. Start RMAN and connect to the target database and, if desired, the recovery catalog database. For example, enter:

    % rman TARGET / CATALOG rman/rman@rcat
    
    
    
  2. Mount but do not open the target database and ensure that the database was closed cleanly prior to mounting. For example, enter:

    RMAN> STARTUP MOUNT PFILE=init.ora;
    
    
  3. Make sure that you set DB_FILE_NAME_CONVERT in the standby initialization parameter file so that standby datafile filenames are translated from the primary datafile filenames. For example:

    DB_FILE_NAME_CONVERT = ('/oracle/dbs', '/dsk2/oracle')
    
    
  4. Copy all of the datafiles and the standby control file. For example, enter:

    RUN { 
         ALLOCATE CHANNEL ch1 TYPE DISK;
         COPY 
           DATAFILE 1 TO '/dsk2/oracle/df_1.f',
           DATAFILE 2 TO '/dsk2/oracle/df_2.f',
           DATAFILE 3 TO '/dsk2/oracle/df_3.f',
           DATAFILE 4 to '/dsk2/oracle/df_4.f',
           CURRENT CONTROLFILE FOR STANDBY TO '/dsk2/oracle/cf.f';
    }
    
    
  5. Start the auxiliary instance and mount the standby control file. For example, enter:

    SQL> STARTUP NOMOUNT PFILE=/dsk2/oracle/dbs/initSTANDBY1.ora
    SQL> ALTER DATABASE MOUNT STANDBY DATABASE;
    

Creating the Standby Database When Image Copies and Standby Datafiles Do Not Share the Same Filenames

This procedure assumes that you are using different filenames for the standby datafiles and the image copies of the primary datafiles.

To create a standby database when the copies and standby datafiles have different names:

  1. Start RMAN and connect to the target database, auxiliary instance, and, if desired, the recovery catalog database. For example, enter:

    % rman TARGET / CATALOG rman/rman@rcat AUXILIARY sys/pwd@sbdb
    
    
    
  2. Mount but do not open the target database and ensure that the database was closed cleanly prior to mounting. For example, enter:

    RMAN> STARTUP MOUNT PFILE=init.ora
    
    
  3. Either set DB_FILE_NAME_CONVERT in the standby initialization parameter file so that standby datafile filenames are translated from the primary datafile filenames, or issue SET NEWNAME commands. For example, set the DB_FILE_NAME_CONVERT parameter as follows:

    DB_FILE_NAME_CONVERT = ('/oracle/dbs', '/dsk2/oracle')
    
    
  4. Perform this step only if you are not using RMAN to recover the standby database (the default option). If you are using RMAN to recover the standby database, then skip to the next step.

    Perform these steps:

  5. Allocate at least one disk channel for the copies and one auxiliary channel for the duplication.

  6. Copy all of the datafiles and the standby control file.

  7. Issue the DUPLICATE command.

    For example, enter:

    RUN { 
         ALLOCATE CHANNEL ch1 TYPE DISK;
         ALLOCATE AUXILIARY CHANNEL ch2 TYPE DISK;
         COPY 
           DATAFILE 1 TO '/dsk2/oracle/df_1.f',
           DATAFILE 2 TO '/dsk2/oracle/df_2.f',
           DATAFILE 3 TO '/dsk2/oracle/df_3.f',
           DATAFILE 4 TO '/dsk2/oracle/df_4.f',
           CURRENT CONTROLFILE FOR STANDBY TO '/dsk2/oracle/cf.f';
           # To ensure that the control file checkpoint is archived, archive the current
           # redo log
           SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT'; 
         DUPLICATE TARGET DATABASE FOR STANDBY;
    }
    
    
  8. Perform this step only if you are using RMAN to recover the standby database after creating it. Otherwise, skip this step.

    Follow these steps:

    1. Ensure that the end recovery time is greater than or equal to the checkpoint SCN of the standby control file and that a log containing the checkpoint SCN is available for recovery (as described in "RMAN Standby Creation with Recovery").

    2. If desired, issue a SET command to specify the end time, SCN, or log sequence number for recovery.

    3. Allocate at least one disk channel for the copies, and one auxiliary channel for the duplication.

    4. Copy every datafile and the standby control file.

    5. Archive the current redo logs.

    6. Issue the DUPLICATE command with the DORECOVER option.

    For example, enter the following:

    RUN { 
         ALLOCATE CHANNEL ch1 TYPE DISK;
         ALLOCATE AUXILIARY CHANNEL ch2 TYPE DISK;
         COPY 
           DATAFILE 1 TO '/dsk2/oracle/df_1.f',
           DATAFILE 2 TO '/dsk2/oracle/df_2.f',
           DATAFILE 3 TO '/dsk2/oracle/df_3.f',
           DATAFILE 4 TO '/dsk2/oracle/df_4.f',
           CURRENT CONTROLFILE FOR STANDBY TO '/dsk2/oracle/cf.f';
           SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT'; 
         DUPLICATE TARGET DATABASE FOR STANDBY
         DORECOVER;
    }
    
    

    RMAN uses all incremental backups, archived redo log backups, and archived redo logs to perform incomplete recovery. The standby database is left mounted.

Backing Up Files at the Standby Site Using RMAN

This section contains these topics:

About RMAN Backups of Standby Database Datafiles and Archived Logs

RMAN can back up the standby database and its associated archived redo logs. Standby backups of datafiles and archived redo logs are fully interchangeable with primary database backups. In other words, you can issue the RESTORE command to restore a backup of a standby datafile to the primary database, and you can restore a backup of a primary datafile to the standby database. The standby control file and primary control file, however, are not interchangeable.

Backing up standby files is often better than backing up the production files, for the following reasons:

If you activate a standby database using ALTER DATABASE ACTIVATE STANDBY DATABASE, then the standby database becomes the new primary database. Because a RESETLOGS must be performed at standby activation, RMAN creates a new incarnation record for the new primary database. Backups of this new incarnation of the primary database are not different from backups of the primary database after a RESETLOGS operation.

See Also:

"Opening the Database After Media Recovery" in "Chapter 5, Performing Media Recovery" from Oracle8i Backup and Recovery Guide to learn about RESETLOGS operations 

Restrictions When Making RMAN Standby Database Backups

Note these restrictions when making backups of a standby database:

Interpreting the RC_ARCHIVED_LOG View

If you are making archived log backups on the standby site, you must ensure that all necessary archived logs are available on the primary site in the event of a failure. The situation can be confusing because archived logs can be:

The recovery catalog view RC_ARCHIVED_LOG indicates when an archived redo log is located at the primary site and when it is located at the standby site. This information is important because you need to know when you must back up a log or copy it to the primary site from the standby site.

For example, assume that you connect to the recovery catalog and issue this query:

SQL> SELECT SEQUENCE#, IS_STANDBY FROM RC_ARCHIVED_LOG; 

   SEQUENCE# IS_ 
  ---------- --- 
         113 YES
         114 NO
         115 NO
         116 YES
         116 NO
         117 NO 
         118 NO 
         119 NO 
         120 NO

The IS_STANDBY column indicates whether the log is located at the standby site (YES) or at the primary site (NO). If the same log sequence number has IS_STANDBY set to both YES and NO, then the log is located at both the standby and primary sites. For example, sequence number 116 has both a YES and NO value for IS_STANDBY, so it is at the primary and standby sites.

To understand how an archived log can be located at both sites, assume that you have a primary database, a recovery catalog database, and a standby database in managed recovery mode. The following sequence of events occurs:

  1. The primary database archives log 113 and transfers it automatically to the standby site. The standby database applies archived log 113 during managed recovery.

  2. At the primary site, you issue the following RMAN command:

    RUN {
         ALLOCATE CHANNEL c1 TYPE 'sbt_tape';
         BACKUP ARCHIVELOG ALL 
           DELETE INPUT;  
    }
    
    
    

    This command backs up archived log 113 and deletes it from the primary site.

  3. You query the recovery catalog as follows:

    SELECT SEQUENCE#, IS_STANDBY 
    FROM RC_ARCHIVED_LOG 
    WHERE SEQUENCE#=113;
    
    
         SEQUENCE# IS_ 
        ---------- --- 
               113 YES 
    
    
    
    

    This query returns only one row, 113 YES, because the primary site copy of the archived log has been removed. Only the copy of log 113 at the standby site is available.

    Consequently, you cannot use log 113 to perform media recovery at the primary site unless RMAN has backed it up. If you try to perform recovery of the primary database without either using the backup of the log just taken or moving the standby copy to the primary site, then RMAN stops media recovery at log 112 because it cannot locate log 113.

  4. Later, the primary database generates a new archived log, sequence 120. You query RC_ARCHIVED_LOG and see the following row:

         SEQUENCE# IS_ 
        ---------- --- 
               120 NO 
    

  1. After the archiver automatically transmits log 120 to the standby site, a new query of RC_ARCHIVED_LOG (after resynchronization of the recovery catalog) shows:

         SEQUENCE# IS_ 
        ---------- --- 
               120 NO 
               120 YES 
    

    This result indicates that archived log 120 is located at both sites.

  1. At the primary site, you back up all archived logs to the tape drive attached to the primary host and remove the input archived logs:

    RUN {
         ALLOCATE CHANNEL c1 TYPE 'sbt_tape';
         BACKUP ARCHIVELOG ALL 
           DELETE INPUT;  
    }
    
    
  2. You query RC_ARCHIVED_LOG again and see only one row for log sequence number 120, indicating that the log is only available at the standby site:

         SEQUENCE# IS_ 
        ---------- --- 
               120 YES 
    

  1. At the standby site, you back up all archived logs to the tape drive attached to the standby host and delete the logs on disk:

    RUN {
         ALLOCATE CHANNEL c1 TYPE 'sbt_tape';
         BACKUP ARCHIVELOG ALL 
           DELETE INPUT;  
    }
    
    

When you query RC_ARCHIVED_LOG, the catalog shows no more rows for sequence number 120.

Determining When to Back Up Standby Database Archived Redo Logs

If you are making all your backups at the standby site, then you must ensure that you have backed up all the archived logs needed for recovery of the primary database. You have two methods for determining whether you need to back up a standby database archived log so that RMAN can use it for recovery.

Using the LIST Command to Determine When to Back Up Standby Logs

Use the LIST command to determine which logs RMAN has backed up.

To determine whether a log backup is needed by using the LIST command:

  1. Query the recovery catalog to determine the locations of the archived redo logs. For example, issue:

    SQL> SELECT SEQUENCE#, IS_STANDBY FROM RC_ARCHIVED_LOG;
    
    
         SEQUENCE# IS_ 
        ---------- ---
               113 YES 
               114  NO
               115  NO
               116  NO
    
    

    This output indicates that log sequence 113 is at the standby site but not at the primary site, and archived logs 114 - 116 are at the primary site but not the standby site.

  2. Determine which archived logs are backed up by connecting RMAN to the recovery catalog and issuing a LIST BACKUP command. For example, issue the following:

    RMAN> LIST BACKUP OF ARCHIVELOG ALL;
    
    RMAN-03022: compiling command: list
    RMAN-03025: performing implicit partial resync of recovery catalog
    RMAN-03023: executing command: partial resync
    RMAN-08003: starting partial resync of recovery catalog
    RMAN-08005: partial resync complete
    
    List of Backup Sets
    Key     Recid      Stamp      LV Set Stamp  Set Count  Completion Time
    ------- ---------- ---------- -- ---------- ---------- ----------------------
    319     4          394624547  0  394624546  5          11-APR-00
    
        List of Backup Pieces
        Key     Pc# Cp# Status      Completion Time        Piece Name
        ------- --- --- ----------- ---------------------- ------------------------
        320     1   1   AVAILABLE   11-APR-00              /vobs/oracle/dbs/05boavh2_1_1
    
        List of Archived Logs Included
        Thrd Seq     Low SCN    Next SCN   Low Time        Next Time
        ---- ------- ---------- ---------- --------------- ---------------
        1    116     95153      95156      07-APR-00       07-APR-00
    
    
    

    This output shows that RMAN has backed up archived log 116, but has not backed up archived log 113. Because log 113 exists only at the standby site, you should either back up this log or copy it to the primary site.

Querying RC_ARCHIVED_LOG to Determine When to Back Up Standby Logs

You can query the recovery catalog to determine which logs RMAN has backed up.

To determine whether a log backup is needed by querying the catalog:

  1. Query the RC_ARCHIVED_LOG recovery catalog view to determine whether all archived logs necessary for recovery are on disk. For example, issue the following query, where first_log_needed_for_recovery is the sequence number of the log that begins recovery and expected_num_of_logs is the number of logs that should be applied during complete recovery:

    SELECT 1 FROM RC_ARCHIVED_LOG 
    WHERE SEQUENCE# >= first_log_needed_for_recovery 
    AND IS_STANDBY='NO' 
    AND STATUS='A' 
    HAVING COUNT(*) = expected_num_of_logs;
    
    

    If the query returns no rows, then you do not have all logs necessary for complete recovery on disk. If the query does return rows, then you do have the necessary logs for complete recovery on disk.

  2. Query the RC_BACKUP_REDOLOG view to determine whether you have backups of the logs necessary for complete recovery. For example, issue the following query, where first_log_needed_for_recovery is the sequence number of the log that begins recovery and expected_num_of_logs is the number of logs that should be applied during complete recovery:

    SELECT 1 FROM RC_BACKUP_REDOLOG 
    WHERE SEQUENCE# >= first_log_needed_for_recovery 
    AND STATUS='A' 
    HAVING COUNT(DISTINCT SEQUENCE#) = expected_num_of_logs;
    
    

    If the query returns no rows, then you do not have backups of all logs necessary for complete recovery. If the query does return rows, then you do have backups of all logs necessary for complete recovery.

Backing Up a Standby Database Using RMAN

Use the RMAN BACKUP command to back up the standby database. A backup of the standby database is exactly the same as a backup of the primary database, except that the backup takes place on the standby site. The primary database has no influence on the backup of the standby database. Note that when you connect to the standby database to perform the backup, you connect using the TARGET keyword and not the AUXILIARY keyword.

As the following table illustrates, whether the standby database backup is consistent or inconsistent depends on the state of the standby database when the backup is made. Only a consistent backup can be restored without performing media recovery.

Standby Database State  Consistency of Backup 

Shutdown cleanly and then mounted (but not placed in recovery mode) 

Consistent 

Mounted after crash or abort 

Inconsistent 

Manual recovery mode 

Inconsistent 

Managed recovery mode 

Inconsistent 

Read-only mode 

Inconsistent 

To make a whole database backup of a standby database:

  1. Start RMAN and connect to the standby database using the TARGET keyword (not the AUXILIARY keyword) and the recovery catalog database. You must be connected to the recovery catalog. For example, enter:

    % rman TARGET SYS/change_on_install@sbdb1 CATALOG rman/rman@rcat
    
    
  2. To make a consistent backup of the standby database, make sure that the last shutdown of the standby was clean and that it was not placed in recovery mode after that time, and then mount the control file. For example, enter:

    % SQLPLUS sys/change_on_install@sbdb1
    SQL> SHUTDOWN IMMEDIATE
    SQL> STARTUP MOUNT PFILE=initSTANDBY.ora
    
    

    You can back up the standby database when it is in any other mode, but the backups will be inconsistent.

  3. Allocate one or more channels of type DISK or type 'sbt_tape'. This example backs up all the datafiles as well as the control file:

    RUN { 
         ALLOCATE CHANNEL ch1 TYPE 'sbt_tape';
         BACKUP DATABASE;
         BACKUP ARCHIVELOG ALL;
    }
    
    
    

    If desired, use the FORMAT parameter to specify a filename for the backup piece. For example, enter:

    RUN { 
         ALLOCATE CHANNEL ch1 TYPE 'sbt_tape';
         BACKUP DATABASE
           FORMAT '/oracle/backup/standby_%U';  # %U generates a unique filename
    }
    
    
    

    If desired, use the TAG parameter to specify a tag for the backup. For example, enter:

    RUN { 
         ALLOCATE CHANNEL ch1 TYPE 'sbt_tape';
         BACKUP DATABASE
           TAG = 'weekly_standby_backup';   # gives the standby backup a tag identifier
    }
    
    
    
  4. If desired, issue a LIST command to see a listing of backup sets and pieces.

Performing a Test Backup Using RMAN

You can use the VALIDATE keyword of the BACKUP command to do the following:

RMAN does not actually produce backup sets, but scans the specified files to determine whether they can be backed up. In this sense, the BACKUP VALIDATE command is similar to the RESTORE VALIDATE command, except for backups rather than restore jobs.

For example, you can validate that all database files and archived redo logs can be backed up by issuing a command as follows:

RUN { 
     ALLOCATE CHANNEL ch1 TYPE 'sbt_tape';
     BACKUP VALIDATE 
        DATABASE
        ARCHIVELOG ALL;
}

Note that you cannot use the MAXCORRUPT or PROXY parameters with the VALIDATE option.

See Also:

"BACKUP" 

Setting the Default Location of the RMAN Snapshot Control File

Use the SET SNAPSHOT CONTROLFILE LOCATION TO DEFAULT command to set the default filename that is used for the snapshot control file. This default value is platform-specific and depends on the Oracle home. For example, the default filename on some UNIX platforms in release 8.1.7 is $ORACLE_HOME/dbs/snapcf_@.f.

If you upgrade to the current release from a previous release, for example, to release 8.1.7 from release 8.1.6, then the snapshot control file location is not set to the default value. RMAN uses the snapshot location that is already stored in the control file. In this case, the snapshot control file location does not change if you change the Oracle home.

If you create a new database in release 8.1.7, then the snapshot control file location does have the default value. In this case, the default snapshot control file location changes if you change the Oracle home.

Crosschecking and Deleting on Multiple RMAN Channels

This section contains these topics:

About Allocating Multiple RMAN Channels for Maintenance Commands

You can allocate multiple maintenance channels before issuing one of these commands:

RMAN checks on all channels that have the same device type as the channel used to create the backup. Because the multi-channel feature does not parallelize maintenance operations, you should only use this feature in these scenarios:

This feature uses the existing RMAN syntax. No new syntax options are required.

How RMAN Crosschecks and Deletes on Multiple Channels

When you allocate multiple maintenance channels before a CROSSCHECK, DELETE EXPIRED, or CHANGE ... DELETE command, RMAN performs the crosscheck or delete on all channels that have the appropriate device type. For example, assume that you do not use a media manager, and have created only one backup of a database as follows:

RUN {
   ALLOCATE CHANNEL ch1 TYPE DISK CONNECT 'x/x@node2';
   BACKUP DATABASE;
}

Assume that you issue the following series of commands at the RMAN prompt:

ALLOCATE CHANNEL FOR MAINTENANCE TYPE DISK CONNECT 'x/x@node1';
alLOCATE CHANNEL FOR MAINTENANCE TYPE DISK CONNECT 'x/x@node2';
ALLOCATE CHANNEL FOR MAINTENANCE TYPE 'sbt_tape';
CROSSCHECK BACKUP OF DATABASE;

RMAN checks the first two channels because they both have the device type of disk and finds the backup on the second channel. RMAN does not perform a crosscheck on the third channel because you did not make backups using a media manager.

This feature adds the following new restrictions when deleting backup pieces or proxy copies:

Crosschecking Simultaneously on Disk and Tape Channels: Example

RMAN can perform crosschecks on more than one media at the same time. For example, you can perform a crosscheck for backups of the database on disk and tape channels as follows:

RMAN> ALLOCATE CHANNEL FOR MAINTENANCE TYPE DISK;
RMAN> ALLOCATE CHANNEL FOR MAINTENANCE TYPE 'sbt_tape';
RMAN> CROSSCHECK BACKUP OF DATABASE;

Crosschecking on Multiple OPS Nodes: Example

This feature is useful in an OPS configuration in which tape backups exist on various nodes in the cluster. For example, you can perform a crosscheck on two nodes of an OPS cluster as follows:

RMAN> ALLOCATE CHANNEL node_1 TYPE DISK CONNECT 'sys/sys_pwd@node_1';
RMAN> ALLOCATE CHANNEL node_2 TYPE DISK CONNECT 'sys/sys_pwd@node_2';
RMAN> CROSSCHECK BACKUP;

Deleting Simultaneously on Disk and Tape Channels: Example

You can also perform deletions on all allocated channels as in this example:

RMAN> ALLOCATE CHANNEL FOR MAINTENANCE TYPE DISK;
RMAN> ALLOCATE CHANNEL FOR MAINTENANCE TYPE 'sbt_tape';
RMAN> CHANGE BACKUPSET 1,2,3,4,5 DELETE;

RMAN searches for the specified backup sets on all channels and deletes any that it finds.

Releasing Multiple Channels with One Command: Example

You can release all allocated maintenance channels currently allocated by using this command:

RMAN> RELEASE CHANNEL;

Connecting RMAN to a Target Database in an OPS Cluster

RMAN can only connect to one instance in an Oracle Parallel Server (OPS) cluster at a time. For example, assume that inst1, inst2, and inst3 are net services names for the three instances in an OPS cluster. In this case, you can connect to the target database using only one of these net service names. For example, you can connect as follows:

% rman TARGET SYS/sys_pwd@inst2 CATALOG rman/cat_pwd@cat_str 

Each net service name must specify one and only instance. You cannot specify a net service name that is used by all three instances in the cluster.

Note that the fact that RMAN connects to only one instance does not preclude running a backup using all three instances. For example, you can run a backup job as follows:

RUN { 
       ALLOCATE CHANNEL c1 TYPE DISK CONNECT = 'SYS/sys_pwd@inst1'; 
       ALLOCATE CHANNEL c2 TYPE DISK CONNECT = 'SYS/sys_pwd@inst2'; 
       ALLOCATE CHANNEL c3 TYPE DISK CONNECT = 'SYS/sys_pwd@inst3'; 
       BACKUP DATABASE; 
  } 

Selected RMAN Maintenance Commands No Longer Require a Catalog

The RMAN maintenance commands are as follows:

In release 8.1.6, several uses of these commands required a recovery catalog. In release 8.1.7, fewer maintenance commands require the use of a recovery catalog.

The only options of the CHANGE command that now require a recovery catalog are the following:

The CROSSCHECK and DELETE EXPIRED commands no longer require a recovery catalog in release 8.1.7.

Troubleshooting RMAN Character Set Errors: Scenario

In this scenario, you are connected to the target database while it is not open and attempt to perform an RMAN operation. You receive the following error message:

PLS-00553: character set name is not recognized

Diagnosis of Cause

Typically, this error message means that the character set value in the client environment, that is, the environment in which you are running the RMAN executable, is different from the character set value in the target database environment.

Solution

  1. Determine the character set values in the client and server and environments. For example, on a UNIX system you could query the NLS_LANG variable on the client and server:

    % echo $NLS_LANG
    
    
  2. Set the character set environment variable in the client to the same value as the variable in the server. For example, you can set the NLS_LANG environment variable on a UNIX system as follows:

    % setenv NLS_LANG WE8ISO8859P1
    

Setting Recovery Catalog Compatibility Level No Longer Required

In Oracle8i Release 2 (8.1.6), the CONFIGURE COMPATIBLE command set the compatibility level in the recovery catalog. This command helped to solve problems resulting from the way in which RMAN updated and deleted catalog records. In Oracle8i Release 3 (8.1.7), these problems are solved, so the CONFIGURE COMPATIBLE command is deprecated.

In release 8.1.6, if you set CONFIGURE COMPATIBLE to 8.1.5 or lower, then RMAN updated the associated record to status DELETED when you issued CHANGE ... DELETE. RMAN did not remove the record, but only changed its status. In release 8.1.7, RMAN always removes the recovery catalog record when you issue CHANGE ... DELETE.

Recovery Catalog Compatibility Changes

This section contains these topics:

About RMAN Compatibility

The RMAN environment can contain the following components:

Each component has a release number. For example, you can use a release 8.1.5 RMAN executable with:

RMAN Compatibility Matrix

In general, the rules of RMAN compatibility are as follows:

Table 7-4 shows version requirements for RMAN components.

Table 7-4 RMAN Compatibility Table
Target/Auxiliary Database  RMAN Executable  Catalog Database  Catalog Schema 

8.0.3 

8.0.3 

8.x 

8.0.3 

8.0.4 

8.0.4 

8.x 

>= 8.0.4, see "Note: 8.1 Catalog Schemas and 8.0 Targets" 

8.0.5 

8.0.5 

8.x 

>= 8.0.5, see "Note: 8.1 Catalog Schemas and 8.0 Targets" 

8.0.6 

8.0.6 

8.x 

8.0.6 

8.0.6 

8.0.6 

8.1.x 

8.1.x 

8.1.5 

8.1.5 

8.1.x 

>= 8.1.5 

8.1.6 

8.0.6.1 

8.x 

8.0.6 

8.1.6 

8.0.6.1 

8.1.x 

>= RMAN executable 

8.1.6 

>= 8.1.5 

8.1.x 

>= RMAN executable 

8.1.7 

8.0.6.1 

8.x 

8.0.6 

8.1.7 

8.0.6.1 

8.1.x 

8.1.x 

8.1.7 

>= 8.1.5 

8.1.x 

>= RMAN executable 

Note: 8.0 Catalog Schemas and 8.1 Targets

RMAN cannot create 8.1 catalog schemas in 8.0 catalog databases.

Note: 8.1 Catalog Schemas and 8.0 Targets

Restore operations for an 8.0.4 or 8.0.5 target with an 8.1 catalog schema do not work when both these conditions are met:

If any of these conditions is not met, then you can use an 8.1 catalog schema with an 8.0.4 or 8.0.5 target database

Note: 8.1.6 Catalog Schema with Pre-8.1.6 RMAN Executable

Using a pre-8.1.6 release of the RMAN executable with recovery catalog schema of release 8.1.6 (newly created by 8.1.6 RMAN executable using the CREATE CATALOG command) requires the following update at the catalog database:

SQL> UPDATE CONFIG SET VALUE='080004' WHERE NAME='COMPATIBLE'; 

RMAN Compatibility: Scenario

Assume that you maintain four production databases of the following releases:

You want to record metadata about these databases in a single recovery catalog database. According to Table 7-4, you can use a single 8.1.7 recovery catalog database, but you must use two different catalog schemas. You must use an 8.0.5 catalog schema to register the 8.0.5 target database, but you can use an 8.1.7 catalog schema to register the 8.0.6, 8.1.6, and 8.1.7 target databases. The 8.0.5 catalog schema and 8.1.7 catalog schema can co-exist in a single 8.1.7 catalog database.

Note that you cannot use a single RMAN executable to back up all the databases. You must use an 8.0.5 executable to back up the 8.0.5 target database, but you can use an 8.0.6.1 RMAN executable to back up the other databases.

RMAN Syntax Diagram Changes

The following RMAN syntax diagrams have changed for release 8.1.7:


BACKUP

Syntax


Text Description of backup.gif follows
Text description of the illustration backup.gif
backupSpec::=

Text Description of backupsp.gif follows
Text description of the illustration backupsp.gif

Changed Keywords and Parameters

VALIDATE 

causes RMAN to scan the specified files and verify their contents. This operation creates no output files. Use this command periodically to check for physical and logical errors in database files. 

CURRENT CONTROLFILE 

backs up the current control file. 

 

FOR STANDBY 

makes a backup of the current control file that can be used with a standby database. A standby control file can also be used as an ordinary control file backup, so you can restore it in the target database if necessary. 


COPY

Syntax


Text Description of copy.gif follows
Text description of the illustration copy.gif

copy_inputfile::=
Text Description of copy_inp.gif follows
Text description of the illustration copy_inp.gif

Changed Keywords and Parameters

CURRENT CONTROLFILE 

backs up the current control file. 

 

FOR STANDBY 

makes an image copy of the current control file that can be used with a standby database. A standby control file can also be used as an ordinary control file backup, so you can restore it in the target database if necessary. 


DEBUG

Syntax


Text Description of debug.gif follows
Text description of the illustration debug.gif

Changed Keywords and Parameters

No keywords or parameters have changed, but the semi-colon is now optional.


DUPLICATE

Syntax


Text Description of duplicat.gif follows
Text description of the illustration duplicat.gif
dupOptionList::=

Text Description of dupoptio.gif follows
Text description of the illustration dupoptio.gif
dupsbyOptionList::=

Text Description of dupsbyop.gif follows
Text description of the illustration dupsbyop.gif

Changed Restrictions

Note the following restrictions involved when using the DUPLICATE command to create a standby database:

Changed Keywords and Parameters

FOR STANDBY 

creates a standby database rather than a duplicate database. Specify this keyword only when creating a standby database. If you do not specify the DORECOVER keyword, then RMAN creates the standby database and then leaves it mounted. 

 

DORECOVER 

specifies that RMAN should recover the database after creating it. If you specify an untilClause, then RMAN recovers to the specified point and leaves the database mounted.  


SET

Syntax


Text Description of set.gif follows
Text description of the illustration set.gif

Changed Keywords and Parameters

SNAPSHOT CONTROLFILENAME TO  

sets the snapshot control file filename to either 'filename' or the DEFAULT value. The default value is platform-specific and dependent on the Oracle home. For example, the default on some UNIX system is $ORACLE_HOME/dbs/snapcf_@.f. Note that if you set the control file name using the DEFAULT keyword, and you change the Oracle home, then the default location of the snapshot control file changes as well.

If you upgrade to the current release from a previous release (for example, release 8.1.6), then the snapshot control file is not automatically set to the default value. RMAN uses the snapshot filename that is already stored in the control file. In this case, the snapshot filename does not change if you change the Oracle home. If you create a new database in release 8.1.7, however, then the snapshot filenames does automatically have the platform-specific default value. The default snapshot control file location changes when you change the Oracle home. 

Recovery Catalog View Changes

The recovery catalog views are unchanged except for new columns that are added to the following views.

View  New Column  Datatype  Null  Description 

RC_ARCHIVED_LOG 

IS_STANDBY 

VARCHAR2(1) 

NOT NULL

 

The location of archived log: Y (located on the standby database host) or N (located on the primary database). A standby log cannot be used for recovery of the primary unless it is first backed up by RMAN. 

RC_BACKUP_CONTROLFILE 

CONTROLFILE_TYPE 

VARCHAR2(1) 

NOT NULL

 

The type of control file backup: B (normal backup) or S (standby backup). 

RC_BACKUP_SET 

CONTROLFILE_INCLUDED 

VARCHAR2(1) 

NOT NULL 

Possible values are NONE (backup set does not include a control file), BACKUP (backup set includes a normal control file), and STANDBY (backup set includes a standby control file). 

RC_CONTROLFILE_COPY 

CONTROLFILE_TYPE 

VARCHAR2(1) 

NOT NULL 

The type of control file copy: B (normal) or S (standby). 

RC_PROXY_CONTROLFILE 

CONTROLFILE_TYPE 

VARCHAR2(1) 

NOT NULL 

The type of control file copy: B (normal) or S (standby). 

Backup and Recovery Dynamic Performance View Changes

The following changes to V$ views are relevant for RMAN operations involving the standby database.

View  New Column  Datatype  Null  Description 

V$ARCHIVED_LOG 

CREATOR 

VARCHAR2(4) 

NOT NULL

 

The database process that generated the archived log: ARCH, FGRD (foreground process), LGWR, or RMAN

V$ARCHIVED_LOG 

REGISTAR 

VARCHAR2(3) 

NOT NULL

 

The database process that writes the archived log record: ARCH, FGRD (foreground process), LGWR, RFS, RMAN (if registered by RMAN at the primary), and SRMN (if registered by RMAN at a standby database). Only RFS and SRMN write to the standby database: all other processes write to the primary database. 

V$ARCHIVED_LOG 

STANDBY_DEST 

VARCHAR2(3) 

NOT NULL

 

Y if the name of the log is a standby net service name and N if the name of the log is an archived log filename. 


Go to previous page Go to next page
Oracle
Copyright © 1996-2000, Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index