Oracle® Real Application Clusters Administration and Deployment Guide 11g Release 1 (11.1) Part Number B28254-01 |
|
|
View PDF |
This chapter explains how to configure Recovery Manager (RMAN) for use in Oracle Real Application Clusters (Oracle RAC) environments. This chapter also provides procedures for using RMAN for archiving in Oracle RAC environments and discusses online redo log and archived redo log considerations.
The topics in this chapter include:
Overview of Configuring RMAN for Oracle Real Application Clusters
Configuring RMAN to Automatically Backup the Control File and SPFILE
Crosschecking on Multiple Oracle Real Application Clusters Nodes
Configuring Channels for RMAN in Oracle Real Application Clusters
Managing Archived Redo Logs Using RMAN in Oracle Real Application Clusters
Archived Redo Log File Conventions in Oracle Real Application Clusters
Changing the Archiving Mode in Oracle Real Application Clusters
RMAN enables you to back up, restore, and recover datafiles, control files, server parameter files (SPFILEs) and archived redo log files. RMAN is included with the Oracle Database and does not require separate installation. You can run RMAN from the command line or use RMAN in the Backup Manager in Oracle Enterprise Manager.
Tip:
When should you perform a backup? Oracle recommends performing a backup immediately after running theroot.sh
script. Also, after running the addNode.sh
or rootdelete.sh
scripts you should back up the voting disk (or disks).The snapshot control file is a copy of a database control file created in an operating system-specific location by Recovery Manager. RMAN creates the snapshot control file so that it has a consistent version of a control file to use when either resynchronizing the recovery catalog or backing up the control file. In Oracle RAC, the snapshot control file is only needed on the nodes on which RMAN performs backups; the snapshot control file does not need to be globally available to all instances in an Oracle RAC environment.
You can specify a cluster file system file or a raw device destination for the location of your snapshot control file. Run the following RMAN command to determine the configured location of the snapshot control file:
SHOW SNAPSHOT CONTROLFILE NAME;
You can change the configured location of the snapshot control file. For example, on Linux and UNIX systems you can specify the snapshot control file location as $ORACLE_HOME/dbs/scf/snap_prod.cf
by entering the following at the RMAN prompt:
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '$ORACLE_HOME/dbs/scf/snap_prod.cf';
This command globally sets the configuration for the location of the snapshot control file throughout your cluster database. Therefore, ensure that the directory $ORACLE_HOME/dbs/scf
exists on all nodes that perform backups.
The CONFIGURE
command creates persistent settings across RMAN sessions. Therefore, you do not need to run this command again unless you want to change the location of the snapshot control file. You can also specify a cluster file system file or a raw device destination for the location of your snapshot control file. This file is shared across all nodes in the cluster just like other datafiles in Oracle RAC.
See Also:
Oracle Database Backup and Recovery Reference for more information about configuring the snapshot control fileIf you set CONFIGURE CONTROLFILE AUTOBACKUP
to ON
, then RMAN automatically creates a control file and an SPFILE backup after you run the BACKUP
or COPY
commands. RMAN can also automatically restore an SPFILE if this is required to start an instance to perform recovery. This means that the default location for the SPFILE must be available to all nodes in your Oracle RAC database.
These features are important in disaster recovery because RMAN can restore the control file even without a recovery catalog. RMAN can restore an autobackup of the control file even after the loss of both the recovery catalog and the current control file. You can change the default name that RMAN gives to this file with the CONFIGURE CONTROLFILE AUTOBACKUP FORMAT
command. Note that if you specify an absolute path name in this command, then this path must exist identically on all nodes that participate in backups.
RMAN performs the control file autobackup on the first allocated channel. Therefore, when you allocate multiple channels with different parameters, especially when you allocate a channel with the CONNECT
command, determine which channel will perform the control file autobackup. Always allocate the channel for this node first.
Besides using the RMAN control file, you can also use Enterprise Manager to use the RMAN features.
See Also:
Oracle Database Backup and Recovery User's Guide for more information about using the control file autobackup featureWhen crosschecking on multiple nodes (and when operating RMAN in general), configure the cluster so that all backups can be accessed by every node, regardless of which node created the backup. When the cluster is configured this way, you can allocate channels at any node in the cluster during restore or crosscheck operations.
If you cannot configure the cluster so that each node can access all backups, then during restore and crosscheck operations, you must allocate channels on multiple nodes by providing the CONNECT
option to the CONFIGURE CHANNEL
command, so that every backup can be accessed by at least one node. If some backups are not accessible during crosscheck because no channel was configured on the node that can access those backups, then those backups are marked EXPIRED
in the RMAN repository after the crosscheck.
For example, you can use CONFIGURE CHANNEL ... CONNECT
in an Oracle RAC configuration in which tape backups are created on various nodes in the cluster and each backup is only accessible on the node on which it is created. This is described in more detail in "Configuring Channels to Use a Specific Channel".
This section describes how to configure channels for RMAN. You can configure channels to use automatic load balancing or you can specify specific channels for specific instances as described in the following topics:
To configure channels to use automatic load balancing, use the following syntax:
CONFIGURE DEVICE TYPE [disk | sbt] PARALLELISM number of channels;
...
Where number of channels is the number of channels
that you want to use for the operation. After you complete this one-time configuration, you can issue BACKUP
or RESTORE
commands.
To configure one RMAN channel for each Oracle RAC instance, use the following syntax:
CONFIGURE CHANNEL DEVICE TYPE sbt CONNECT 'SYS/change_on_install@node1' CONFIGURE CHANNEL DEVICE TYPE sbt CONNECT 'SYS/change_on_install@node2' ...
After this one-time configuration step, you can issue the BACKUP
or RESTORE
commands. In addition, you can use the PARMS
command in this example to set vendor-specific parameters.
When a node generates an archived redo log, Oracle Database always records the filename of the log in the control file of the target database. If you are using a recovery catalog, then RMAN also records the archived redo log filenames in the recovery catalog when a resynchronization occurs.
The archived redo log naming scheme that you use is important because when a node writes to a log with a specific filename on its file system, the file must be readable by any node that needs to access this archived redo log. For example, if node 1 archives a log to /oracle/arc_dest/log_1_100_23452345.arc
, then node 2 can only back up this archived redo log only if it can read/oracle/arc_dest/log_1_100_23452345.arc
on its own file system.
The backup and recovery strategy that you choose depends on how you configure the archiving destinations for each node. Whether only one node or all nodes perform archived redo log backups, you need to ensure that all archived redo logs are backed up. If you use RMAN parallelism during recovery, then the node that performs recovery must have read access to all archived redo logs in your cluster.
Multiple nodes can restore archived logs in parallel. However, during recovery, one one node applies the archived logs. Therefore, the node that is performing the recovery must be able to access all of the archived logs that are needed for the recovery operation. By default, the database determines the optimum number of parallel threads to use during the recovery operation. You can use the PARALLEL
clause in the RECOVER
command to change this number.
Guidelines and Considerations for Archived Redo Logs
The primary consideration is to ensure that all archived redo logs can be read from every node during recovery, and if possible during backups. This section illustrates the archived redo log naming issues for configuring archiving in your cluster database. The scenario described here is for a noncluster file system archiving scheme. Assume that the following conditions are met:
Configure each node to write to a local archiving directory that is named the same on each node.
Do not set up a cluster file system (in other words, each node can only read from and write to its own local file system). See the information about cluster file systems later in this chapter.
Do not use NFS (network file system) or mapped drives to enable the nodes in the cluster to gain read/write access to one another.
Example 5-1 Example Configuration for the initialization parameters file
sid1.log_archive_dest_1 = (location=/arc_dest_1) sid2.log_archive_dest_1 = (location=/arc_dest_2) sid3.log_archive_dest_1 = (location=/arc_dest_3)
Assume that the filenames of the archived redo logs are recorded in the control file as follows:
/arc_dest_1/log_1_62_23452345.arc /arc_dest_2/log_2_100_23452345.arc /arc_dest_2/log_2_101_23452345.arc /arc_dest_3/log_3_70_23452345.arc /arc_dest_1/log_1_63_23452345.arc
During recovery, as long as the archived log destinations are visible from the node that performs the recovery, Oracle Database can successfully recover the archived log data.
For any archived redo log configuration, uniquely identify the archived redo logs with the LOG_ARCHIVE_FORMAT
parameter. The format of this parameter is operating system-specific and it can include text strings, one or more variables, and a filename extension.
Table 5-1 Archived Redo Log Filename Format Parameters
Parameter | Description | Example |
---|---|---|
|
Resetlogs identifier |
|
|
Padded resetlogs identifier |
|
|
Log sequence number, not padded |
|
|
Log sequence number, left-zero-padded |
|
|
Thread number, not padded |
|
|
Thread number, left-zero-padded |
|
All of the thread parameters, in either upper or lower case, are mandatory for Oracle RAC. This enables Oracle Database to create unique names for archive logs across the incarnation. This requirement is in effect when the COMPATIBLE
parameter is set to 10.0
or greater.
Use the %R
or %r
parameters to include the resetlogs identifier to avoid overwriting the logs from a previous incarnation. If you do not specify a log format, then the default is operating system-specific and includes %t
, %s
, and %r
.
As an example, if the instance associated with redo thread number 1 sets LOG_ARCHIVE_FORMAT
to log_%t_%s_%r.arc
, then its archived redo log files are named:
log_1_1000_23435343.arc log_1_1001_23452345.arc log_1_1002_23452345.arc ...
See Also:
Oracle Database Administrator's Guide about specifying the archived redo log filename format and destination, and Oracle Database platform-specific documentation about the default log archiving format and destinationThis section describes the archiving scenarios for an Oracle RAC database. The two configuration scenarios in this chapter describe a three-node UNIX cluster for an Oracle RAC database. For both scenarios, the LOG_ARCHIVE_FORMAT
that you specify for the instance performing recovery must be the same as the format that you specified for the instances that archived the files.
The preferred configuration for Oracle RAC is to use Automatic Storage Management (ASM) for a recovery area with a different disk group for your recovery set than for your datafiles. Alternatively, you can use a cluster file system archiving scheme.
In this case, each node writes to a single cluster file system archived redo log destination and can read the archived redo log files of the other nodes. Read access is achieved for all nodes with a cluster file system. For example, if node 1 archives a log to /arc_dest/log_1_100_23452345.arc
on the cluster file system, then any other node in the cluster can also read this file.
Note:
The archive log naming format in this example is only for a CFS example. ASM uses an Oracle Managed Files (OMF)-based naming format.If you do not use a cluster file system, then the archived redo log files cannot be on raw devices. This is because raw devices do not enable sequential writing of consecutive archive log files.
Figure 5-1 Cluster File System Archiving Scheme
The advantage of this scheme is that none of the nodes uses the network to archive logs. Because the filename written by a node can be read by any node in the cluster, RMAN can back up all logs from any node in the cluster. Backup and restore scripts are simplified because each node has access to all archived redo logs.
In the cluster file system scheme, each node archives to a directory that is identified with the same name on all instances within the cluster database. To configure this, set values for the LOG_ARCH_DEST_
n
parameter for each instance using the sid
designator as in the following example:
sid1.LOG_ARCHIVE_DEST_1="LOCATION=/arc_dest" sid2.LOG_ARCHIVE_DEST_1="LOCATION=/arc_dest" sid3.LOG_ARCHIVE_DEST_1="LOCATION=/arc_dest"
The following list shows archived redo log entry examples that would appear in the RMAN catalog or the in the control file based on the previous example. Note that any node can archive logs using any of the threads:
/arc_dest/log_1_999_23452345.arc /arc_dest/log_1_1000_23435343.arc /arc_dest/log_1_1001_23452345.arc <- thread 1 archived in node 3 /arc_dest/log_3_1563_23452345.arc <- thread 3 archived in node 2 /arc_dest/log_2_753_23452345.arc <- thread 2 archived in node 1 /arc_dest/log_2_754_23452345.arc /arc_dest/log_3_1564_23452345.arc
In the noncluster file system local archiving scheme, each node archives to a uniquely named local directory. If recovery is required, then you can configure the recovery node so that it can access directories on the other nodes remotely. For example, use NFS on Linux and UNIX computers, or mapped drives on Windows systems. Therefore, each node writes only to a local destination, but each node can also read archived redo log files in remote directories on the other nodes.
If you use noncluster file system local archiving for media recovery, then you must configure the node that is performing recovery for remote access to the other nodes so that it can read the archived redo log files in the archiving directories on the other nodes. In addition, if you are in recovery and if you do not have all of the available archive logs, then you must perform an incomplete recovery up to the first missing archived redo log sequence number. You do not have to use a specific configuration for this scheme. However, if you want to distribute the backup processing onto multiple nodes, then the easiest method is to configure channels as described in the backup scenarios in Chapter 6, " Managing Backup and Recovery".
You can set the archiving destination values as follows in the initialization parameter file:
sid1.LOG_ARCHIVE_DEST_1="LOCATION=/arc_dest_1" sid2.LOG_ARCHIVE_DEST_1="LOCATION=/arc_dest_2" sid3.LOG_ARCHIVE_DEST_1="LOCATION=/arc_dest_3"
The following list shows the possible archived redo log entries in the database control file. Note that any node is able to archive logs from any of the threads:
/arc_dest_1/log_1_1000_23435343.arc /arc_dest_2/log_1_1001_23452345.arc <- thread 1 archived in node 2 /arc_dest_2/log_3_1563_23452345.arc <- thread 3 archived in node 2 /arc_dest_1/log_2_753_23452345.arc <- thread 2 archived in node 1 /arc_dest_2/log_2_754_23452345.arc /arc_dest_3/log_3_1564_23452345.arc
As illustrated in Table 5-2, each node has a directory containing the locally archived redo logs. Additionally, if you mount directories on the other nodes remotely through NFS or mapped drives, then each node has two remote directories through which RMAN can read the archived redo log files that are archived by the remaining nodes.
Table 5-2 UNIX/NFS Location Log Examples, Noncluster File System Local Archiving
Node ... | Can read the archived redo log files in the directory ... | For logs archived by node ... |
---|---|---|
1 |
|
1 |
1 |
|
2 (through NFS) |
1 |
|
3 (through NFS) |
2 |
|
1 (through NFS) |
2 |
|
2 |
2 |
|
3 (through NFS) |
3 |
|
1 (through NFS) |
3 |
|
2 (through NFS) |
3 |
|
3 |
If you are performing recovery and a surviving instance must read all of the logs that are on disk but not yet backed up, then you should configure NFS as shown in Table 5-3.
Table 5-3 UNIX/NFS Configuration for Shared Read Local Archiving Examples
Node | Directory ... | Is configured ... | And mounted on ... | On node ... |
---|---|---|---|---|
1 |
|
Local read/write |
n/a |
n/a |
1 |
|
NFS read |
|
2 |
1 |
|
NFS read |
|
3 |
2 |
|
NFS read |
|
1 |
2 |
|
Local read/write |
n/a |
n/a |
2 |
|
NFS read |
|
3 |
3 |
|
NFS read |
|
1 |
3 |
|
NFS read |
|
2 |
3 |
|
Local read/write |
n/a |
n/a |
Note:
Windows users can achieve the same results depicted in the examples in this section by using mapped drives.You can run the ALTER
DATABASE
SQL statement to change the archiving mode in Oracle RAC as long as the database is mounted by the local instance but not open in any instances. You do not need to modify parameter settings to run this statement.
Note:
You can also change the archive log mode by using the Recovery Settings page in the Maintenance tab of the Enterprise Manager Oracle RAC Database Home Page.After your RMAN configuration is operative in your Oracle RAC environment, use the GV$ARCHIVE_PROCESSES
and V$ARCHIVE_PROCESSES
views to determine the status of the archiver processes. Depending on whether you query the global or local views, these views display information for all database instances, or for only the instance to which you are connected.
See Also:
Oracle Database Reference for more information about the database views