| Oracle9i Recovery Manager User's Guide Release 2 (9.2) Part Number A96566-01 |
|
This chapter describes how to perform setup and configuration tasks. This chapter contains these topics:
On most platforms, to back up to and restore from sequential media such as tape, you must integrate a media manager with Oracle. A media manager is not an Oracle product and must be obtained from a third-party vendor. If you choose to use RMAN with a media manager, then you must obtain all product-specific information from the vendor.
This section describes the generic steps for configuring RMAN for use with a media manager. The actual steps depend on the media management product that you install and the platform on which you are running Oracle.
Read the following sections in order when configuring the media manager:
| See Also:
"Media Management" for an overview of media management software and its implications for RMAN |
Before you can begin using RMAN with a media manager, you must install it and make sure that RMAN can communicate with it. Instructions for this procedure should be available in the media manager vendor's software documentation.
Depending on the product that you are installing, the following basic steps apply:
If you have not performed the preceding steps, then do not proceed with the media management configuration.
To make backups to a media manager, RMAN must communicate with a media management library. The procedure for using RMAN with a media manager in Oracle9i has not changed from previous releases.
The loading of a media manager library is operating system specific. When you RMAN allocates channels, it uses the following algorithm when deciding which library to load:
SBT_LIBRARY parameter in the ALLOCATE CHANNEL or CONFIGURE CHANNEL command. If the SBT_LIBRARY parameter is not specified, then Oracle proceeds to the next step.$ORACLE_HOME/lib/libobk.so, with the extension name varying according to platform: .so, .sl, .a, and so forth. On Windows NT the library is named %ORACLE_HOME%\bin\orasbt.dll.
ORA-27211 error and exits.
Whenever channel allocation fails, Oracle writes a trace file to the USER_DUMP_DEST directory. The following shows sample output:
SKGFQ OSD: Error in function sbtinit on line 2278 SKGFQ OSD: Look for SBT Trace messages in file /oracle/rdbms/log/sbtio.log SBT Initialize failed for /oracle/lib/libobk.so
After you install the media management software, the media management library should already be integrated with the Oracle server. You should not have to perform further integration. However, you may choose to follow the procedure in this section to ensure that the media manager is integrated correctly.
Because the specifics of your media management integration with Oracle depends on both the product and the operating system, this section cannot cover all possible cases. This section describes the basic procedures for naming the media management library correctly on UNIX and Windows NT so that Oracle can load it.
On UNIX, Oracle accesses the media management library through the UNIX shared library libobk.so. This file must exist somewhere in the system path. It is highly recommended that you place libobk.so in $ORACLE_HOME/lib, which is where Oracle searches first.
You do not need to start or shut down the instance when installing the media management library.
To integrate the media manager on UNIX:
libobk.so symbolic link already exists in $ORACLE_HOME/lib, then remove it before installing the media manager. For example:
% rm $ORACLE_HOME/lib/libobk.so
/vendor/lib/oracle_lib.so.$ORACLE_HOME/lib/libobk.so, or created a symbolic link to the library called libobk.so. For example, you can create a symbolic link to the library as follows:
% ln -s /vendor/lib/oracle_lib.so $ORACLE_HOME/lib/libobk.so
Alternatively, you can simply change the name of the library to libobk.so. For example:
% mv /vendor/lib/oracle_lib.so $ORACLE_HOME/lib/libobk.so
On Windows NT, Oracle accesses the media management library through the library orasbt.dll. This file must exist somewhere in the system path. Typically, the file is located in the %ORACLE_HOME%\bin folder of the Oracle home.
Note that you do not need to start or shut down the instance when installing the media management library.
To integrate the media manager with RMAN on Windows NT:
orasbt.dll already exists in the system path, then remove it before installing the media manager. For example:
D:\> del %ORACLE_HOME%\bin\orasbt.dll
D:\vendor\lib\oracle_lib.dll.orasbt.dll, then rename the installed media management library to %ORACLE_HOME%\bin\orasbt.dll. For example, you can copy the installed library as follows:
D:\> copy D:\vendor\lib\oracle_lib.dll %ORACLE_HOME%\bin\orasbt.dll
Note that the orasbt.dll file does not have to be in the %ORACLE_HOME\bin folder as long as the folder containing the library is in the system PATH variable setting. To see the PATH variable setting, choose Start > Settings > Control Panel > System > Environment.
See Also:
|
After you have confirmed that the Oracle server can load the media management library, test to make sure that RMAN can back up to the media manager. This test occurs in the steps described in the following scenarios:
After installing the media management software, perform whatever configuration that your vendor requires so that the software can accept RMAN backups. Depending on the type of media management software that you installed, you may have to define media pools, configure users, configure classes, and so forth.
You should determine which PARMS settings are needed for the ALLOCATE CHANNEL or CONFIGURE CHANNEL commands as well as the recommended FORMAT string for the BACKUP command (if needed). The PARMS parameter sends instructions to the media manager. For example, the following vendor-specific PARMS setting instructs the media manager to back up to a volume pool called oracle_tapes:
PARMS='ENV=(NSR_DATA_VOLUME_POOL=oracle_tapes)'
Refer to your third-party vendor documentation for the appropriate settings.
Note that you can use the substitution variables provided by RMAN to generate unique backup piece names when writing backups to a media manager. A backup piece name is determined by the FORMAT string specified in the BACKUP command, the CONFIGURE CHANNEL command, or the ALLOCATE CHANNEL command.
If you do not specify the FORMAT parameter, then RMAN automatically generates a unique filename using the %U substitution variable. The media manager considers the backup piece name as the filename of the backup file, so this name must be unique in the media manager catalog.
Some media managers have limits on the maximum size of files that they can back up or restore. File size is an issue in those situations in which RMAN multiplexes multiple datafiles into one output file, but the backup piece size is in excess of the size that the media manager or file system is able to store.
To avoid problems, see your media management documentation for operational limits on file sizes. Ensure that the files written by RMAN do not exceed the limits. To limit backup piece sizes, use the parameter MAXPIECESIZE, which you can set in the CONFIGURE CHANNEL and ALLOCATE CHANNEL commands. Refer to the *.rcv scripts in the demo directory on your system, which is located in an operating system specific location ($ORACLE_HOME/rdbms on UNIX) for an example.
See Also:
|
After integrating the media management library with Oracle, test whether RMAN is able to load the library.
To test channel allocation on the media manager:
% rman TARGET /
ALLOCATE CHANNEL command with the PARMS required by your media management software. For example, run this command:
RUN { ALLOCATE CHANNEL c1 DEVICE TYPE sbt PARMS='ENV=(NSR_SERVER=tape_srv,NSR_GROUP=oracle_tapes)'; }
If you do not receive an error message, then Oracle successfully loaded the shared library. However, channel allocation can fail with the ORA-27211 error:
RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03009: failure of allocate command on c1 channel at 11/30/2001 13:57:18 ORA-19554: error allocating device, device type: SBT_TAPE, device name: ORA-27211: Failed to load Media Management Library Additional information: 25
The ORA-27211 error indicates that Oracle was not able to load the media management library that you installed. In this case, you must check your media management installation to make sure that the library is correctly installed and redo the steps from the section "Integrating RMAN with a Media Manager on Windows NT: Basic Steps".
If you do not receive ORA-27211, then the library is loaded. For any other errors, check the trace file in USER_DUMP_DEST directory for more information.
| See Also:
"After Installation of Media Manager, RMAN Channel Allocation Fails: Scenario" for a troubleshooting scenario |
After testing a channel allocation on the media manager, make a test backup. For example, to test whether your backup goes successfully to tape, you might run the following command:
RUN { ALLOCATE CHANNEL c1 DEVICE TYPE sbt PARMS='ENV=(NSR_SERVER=tape_srv,NSR_GROUP=oracle_tapes)'; BACKUP DATAFILE 1; }
The specifics of your PARMS and FORMAT settings depend on the media management software that you are using. The following table illustrates possible outcomes and suggests possible responses in case of a failure.
| Case | Response |
|---|---|
|
The backup hangs. |
A hanging backup usually indicates that the media manager is waiting to mount a tape. Check if there are any media manager jobs in "tape mount request" mode and fix the problem. Ensure that the steps in "Integrating RMAN with the Media Manager: Basic Steps" are correctly done. Refer to "Backup Job Is Hanging: Scenario" if the problem persists. |
|
The backup fails with |
This error indicates that the media management software is not correctly configured. Ensure that the steps in "Integrating RMAN with the Media Manager: Basic Steps" are correctly done. Also, ensure that you have the correct |
|
The backup succeeds. |
In this case, you are ready to use RMAN to make |
| See Also:
"Testing the Media Management API" and "RMAN Troubleshooting Scenarios" for more information about troubleshooting RMAN with a media manager |
This section describes how to configure automatic channels specifically for use with a media manager. To gain an overview of what automatic channels are and how they are used, refer to the section "Configuring Automatic Channels". The following setup procedure references the sections in "Configuring Automatic Channels" where it is appropriate.
To configure automatic channels for use with a media manager:
DEVICE TYPE sbt as described in "Configuring a Generic Automatic Channel for a Device Type". In the configuration type all parameters you tested in the section "Testing a Backup to the Media Manager". For example, assume that your media vendor requires PARMS settings as follows:
CONFIGURE CHANNEL DEVICE TYPE sbt PARMS='ENV=(NSR_SERVER=tape_svr, NSR_CLIENT=oracleclnt, NSR_GROUP=oracle_tapes)' FORMAT "BACKUP_%U";
BACKUP DEVICE TYPE sbt DATAFILE 1;
SHOW CHANNEL DEVICE TYPE sbt;
sbt as described in "Changing the Default Device Type". By configuring the device to sbt, RMAN will automatically send all backups to the media manager. For example:
CONFIGURE DEFAULT DEVICE TYPE TO sbt;
BACKUP DATAFILE 1;
SHOW DEFAULT DEVICE TYPE;
CONFIGURE DEVICE TYPE sbt PARALELLISM 2; # two channels (tape drives) BACKUP DATABASE; # backup goes to tape but in two streams in parallel (two tapes)
This section contains these topics:
| See Also:
"RMAN Automatic and Manual Channel Allocation" for a conceptual overview of automatic and manual channels, and Oracle9i Recovery Manager Reference for syntax |
You can save persistent configuration information such as channel parameters, parallelism, and the default device type in the RMAN repository. Hence, you do not have to manually allocate channels for each backup. Instead, you can configure automatic channels for use in backup, restore, recovery, and maintenance jobs.
You can always override automatic channels by using ALLOCATE CHANNEL to allocate channels manually. The automatic channel feature is mutually exclusive with the manual channel feature: RMAN uses one or the other for every job.
By default, RMAN has preconfigured a disk channel so that you can back up to disk without doing any manual configuration. Hence, if you are backing up to disk rather than to a media manager, you can immediately begin backing up to disk. The only change you may want to parallelize the channels, as described in "Configuring Parallelism for Automatic Channels".
The default device is the device that RMAN uses on the BACKUP command when you do not explicitly allocate channels. For example, if the default device is sbt (that is, the media manager), then the BACKUP DATABASE command backs up to the configured sbt device. A default device type is required so that RMAN knows which device it should use when you do not manually allocate a channel. You cannot set the default device type to an unspecified value such as NULL.
The preconfigured default device type is DISK. To change the default device type to sbt, you must run this command:
CONFIGURE DEFAULT DEVICE TYPE TO sbt;
Change the default back to DISK by running either of the following commands:
CONFIGURE DEFAULT DEVICE TYPE TO DISK; CONFIGURE DEFAULT DEVICE TYPE CLEAR; # returns to default of DISK
The following example sets the default device type to sbt and then runs a backup:
CONFIGURE DEFAULT DEVICE TYPE TO sbt; BACKUP DATABASE; # backup goes to sbt
By default, channel parallelism for each configured device is set to 1. Run the CONFIGURE DEVICE TYPE ... PARALLELISM integer command to specify the number of channels that RMAN should allocate for each job on a specified device type, where integer stands for a positive integer less than 255. For example, to allocate three channels for each job on the DISK device, run this command:
CONFIGURE DEVICE TYPE DISK PARALLELISM 3;
You can change PARALLELISM for a device type simply by running a new command. The following example sets parallelism to 3, changes parallelism from 3 to 4, then changes it to 2:
CONFIGURE DEVICE TYPE DISK PARALLELISM 3; CONFIGURE DEVICE TYPE DISK PARALLELISM 4; CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
Assume that you want to back up to your media manager using two tape drives in parallel. You run the following commands:
CONFIGURE DEFAULT DEVICE TYPE TO sbt; # make the tape drive the default backup device CONFIGURE DEVICE TYPE sbt PARALELLISM 2; # configure two channels (tape drives) BACKUP DATABASE; # backup goes to tape but in two parallel streams (two tapes)
In this case, each configured sbt channel will back up roughly half the total data.
By default, RMAN automatically allocates a preconfigured DISK channel without any options. However, you may use a media manager that requires special options (PARMS, FORMAT, MAXPIECESIZE, and so forth) or you may want to change the default DISK setting. By configuring channels, you define which parameters are used when RMAN automatically allocate channels.
Use the CONFIGURE CHANNEL command to configure automatic channel options for the available device types: DISK and sbt. You can use the same options for CONFIGURE CHANNEL that you use for ALLOCATE CHANNEL, and you must specify at least one of these options. For example, you can configure generic disk and tape channels as in this example:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT = '?/bkup_%U'; CONFIGURE CHANNEL DEVICE TYPE sbt PARMS='ENV=(NSR_SERVER=tape_svr,NSR_CLIENT=oracleclnt, NSR_GROUP=oracle_tapes)';
To configure a generic channel, that is, a template that is used for all parallelized channels, do not assign a number for the channel. If you set the parallelism for a device, and then make the device default, then RMAN uses the same channel configuration for each parallelized channel.
To configure new generic channel settings for a specified device type, simply run a new command for the device type. The following example configures the default DISK channel to MAXPIECESIZE 2G, then erases this setting and sets a FORMAT:
CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 2G; CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT = /tmp/%U;
The automatic channel that RMAN allocates for its backups depends on the default device type. If the default device type is DISK, then RMAN uses the DISK channel only. If the default device type is sbt, then RMAN uses the sbt channel only. RMAN cannot automatically allocate channels in backup jobs for multiple device types simultaneously.
This example creates a configuration so that all backups go to two tapes in parallel. Additionally, the media management software requires additional parameters: ENV=(NSR_DATA_VOLUME_POOL=oracle_tapes) and FORMAT of %U_backup.
CONFIGURE DEFAULT DEVICE TYPE TO sbt; # by default, backup goes to media manager CONFIGURE DEVICE TYPE sbt PARALELLISM 2; # two tapes in parallel CONFIGURE CHANNEL DEVICE TYPE # sets parameters for all channels PARMS 'ENV=(NSR_DATA_VOLUME_POOL=oracle_tapes)' FORMAT '%U_backup'; BACKUP DATABASE; # backs up database
If you manually allocate a channel during a job, then RMAN disregards any automatic channel settings. For example, assume that the default device type is configured to sbt, and you execute this command:
RUN { ALLOCATE CHANNEL c1 DEVICE TYPE DISK; BACKUP TABLESPACE users; }
In this case, RMAN uses the channel that you manually allocated within the RUN block--and only this channel. None of the CONFIGURE DEVICE TYPE, CONFIGURE DEFAULT DEVICE, or CONFIGURE CHANNEL settings apply to this job.
See Also:
|
Besides configuring a generic channel for a device, you can also configure one or more specific channels for each device type by manually assigning your own channel numbers to the channels. Run the CONFIGURE CHANNEL n command (where n is a positive integer less than 255) to configure a specific channel. When manually numbering channels, you must specify one or more channel options (for example, MAXPIECESIZE or FORMAT) for each channel.
Use specific channels when you want you want to alter the configuration for a channel. Typically, you should only need to do this when running an Oracle Real Application Clusters configuration and when using a media manager with multiple tape drives requiring different PARMS settings.
For example, assume that you have two tape drives and want one tape drive to use tapes from the first pool and the second tape drive to use tapes from second tape pool. You run the following commands:
CONFIGURE DEFAULT DEVICE TYPE TO sbt; # backup goes to sbt CONFIGURE DEVICE TYPE sbt PARALELLISM 2; # two tapes used in parallel # configure first stream to go to data volume pool named first_pool CONFIGURE CHANNEL 1 DEVICE TYPE sbt PARMS 'ENV=(NSR_DATA_VOLUME_POOL=first_pool)'; # configure second stream to go to data volume pool named second_pool CONFIGURE CHANNEL 2 DEVICE TYPE sbt PARMS 'ENV=(NSR_DATA_VOLUME_POOL=second_pool)'; BACKUP DATABASE; # first stream goes to 'first_pool' and second to 'second_pool'
In this example, you want to back up to two different disks because not enough space exists on a single disk. So, you do the following:
CONFIGURE DEFAULT DEVICE TYPE TO disk; # backup goes to disk CONFIGURE DEVICE TYPE sbt PARALELLISM 2; # two channels used in in parallel CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAT '/disk1/%U' # first channel goes to disk1 CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT '/disk2/%U' # second channel goes to disk2 BACKUP DATABASE; # backup - first channel goes to disk1 and second to disk2
When parallelizing, RMAN always allocates channels beginning with CHANNEL 1 and ending with channel number equal to the parallelism setting. Hence, RMAN uses a specific configuration for a given channel if you have configured it; otherwise, it uses a generic configuration.
Assume you enter the following channel configuration:
# disk channel configuration CONFIGURE DEVICE TYPE DISK PARALLELISM 4; CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT = '/tmp/backup_%U'; CONFIGURE CHANNEL 2 DEVICE TYPE DISK MAXPIECESIZE = 2M; CONFIGURE CHANNEL 4 DEVICE TYPE DISK MAXPIECESIZE = 4M; # sbt channel configuration CONFIGURE DEVICE TYPE sbt PARALLELISM 3; CONFIGURE CHANNEL DEVICE TYPE sbt PARMS='SBT_LIBRARY=oracle.disksbt, ENV=(BACKUP_DIR=?/oradata)'; CONFIGURE CHANNEL 3 DEVICE TYPE sbt PARMS='SBT_LIBRARY=oracle.disksbt, ENV=(BACKUP_DIR=/tmp)';
The following table illustrates the channel names and channel settings that RMAN allocates when the default device is DISK and parallelism for DISK is set to 4.
| Channel Name | Setting |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
The following table illustrates the channel names and channel settings that RMAN allocates when the default device is sbt and parallelism for sbt is set to 3.
| Channel Name | Setting |
|---|---|
|
|
|
|
|
|
|
|
|
The PARALLELISM setting is not constrained by the number of specifically configured channels. For example, if you back up to 20 different tape devices, then you can configure 20 different sbt channels, each with a manually assigned number (from 1 to 20) and each with a different set of channel options. You can set parallelism to any value.
RMAN always numbers parallel channels starting with 1 and ending with the parallelism setting. For example, if the default device is sbt and parallelism for sbt is set to 3, then RMAN names the channels as follows:
ORA_SBT_TAPE_1 ORA_SBT_TAPE_2 ORA_SBT_TAPE_3
Note that RMAN always uses the name ORA_SBT_TAPE_n even if you configure DEVICE TYPE sbt (not the synonymous sbt_tape). RMAN always allocates the number of channels specified in parallelism, using manual channels if you have configured them and generic channels if you have not.
| See Also:
"Automatic Channel Specific Configurations" for concepts about manually numbered channels, and "Configuring Specific Channels: Examples" |
To clear a configuration is to return it to its default settings. You can clear channel and device settings by using these commands:
CONFIGURE DEVICE TYPE ... CLEARCONFIGURE DEFAULT DEVICE TYPE CLEARCONFIGURE CHANNEL DEVICE TYPE ... CLEARCONFIGURE CHANNEL n DEVICE TYPE ... CLEAR (where n is an integer)Each CONFIGURE ... CLEAR command clears only itself. For example, CONFIGURE DEVICE TYPE ... CLEAR does not clear CONFIGURE DEFAULT DEVICE TYPE. The CONFIGURE DEVICE TYPE ... CLEAR command removes the configuration for the specified device type and returns it to the default (PARALLELISM 1).
The CONFIGURE DEFAULT DEVICE TYPE ... CLEAR command clears the configured default device and returns it to DISK (the default setting).
The CONFIGURE CHANNEL DEVICE TYPE ... CLEAR command erases the channel configuration for the specified device type. RMAN does not change the parallelism setting for the device type because PARALLELISM is specified through a separate CONFIGURE command.
If you have manually assigned numbers to automatic channels, then clear the options for these channels individually by specifying the channel number in CONFIGURE CHANNEL n DEVICE TYPE ... CLEAR. For example, assume that you run the following:
CONFIGURE CHANNEL DEVICE TYPE DISK MAXOPENFILES = 10 MAXPIECESIZE = 1800K; CONFIGURE CHANNEL 3 DEVICE TYPE DISK FORMAT = /tmp/%U; CONFIGURE CHANNEL 3 DEVICE TYPE DISK CLEAR;
In this case, RMAN clears the settings for CHANNEL 3, but leaves the settings for the generic DISK channel (the channel with no number manually assigned) intact.
RMAN can automatically back up the control file and server parameter file whenever the database structure metadata in the control file changes and whenever a backup or copy record is added.
If CONFIGURE CONTROLFILE AUTOBACKUP is ON (by default it is OFF), then RMAN automatically backs up the control file and the current server parameter file (if used) in the following circumstances:
BACKUP or COPY command issued at the RMAN prompt.BACKUP or COPY command within a RUN block is followed by a command that is neither BACKUP nor COPY.RUN block if the last command in the block was either BACKUP or COPY.CONFIGURE CONTROLFILE AUTOBACKUP FOR DEVICE TYPE DISK to set a nondefault disk location. Note that the autobackup never causes the associated structural change to fail. For example, if you add a datafile, and if the resulting autobackup fails, then the datafile addition is still successful.
The first channel allocated during the backup or copy job creates the autobackup and places it into its own backup set; for post-structural autobackups, the default disk channel makes the backup. RMAN writes the control file and the server parameter file to the same backup piece. After the control file autobackup completes, Oracle writes a message containing the complete path of the backup piece and the device type to the alert log.
As explained by the following table, the RMAN behavior when the BACKUP command includes datafile 1 differs depending on whether CONFIGURE CONTROLFILE AUTOBACKUP is ON or OFF.
The purpose of the autobackup is to enable RMAN to recover the database even if the current control file, recovery catalog, and server parameter file are inaccessible. Because the autobackup uses a well-known format, RMAN can search for it without access to a repository, and then restore the server parameter file.
After you have started the instance with the restored server parameter file, RMAN can restore the control file from an autobackup. After you mount the control file, use the RMAN repository in the mounted control file to restore the datafiles.
You can enable the autobackup feature by running this command:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
You can disable the feature by running this command:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
By default, the format of the autobackup file for all configured devices is the substitution variable %F. This variable format translates into c-IIIIIIIIII-YYYYMMDD-QQ, where:
IIIIIIIIII stands for the DBID. The DBID is a unique numerical identifier for the database. The DBID is printed in decimal so that it can be easily associated with the target database.YYYYMMDD is a time stamp in the Gregorian calendar of the day the backup is generatedQQ is the sequence in hexadecimal number that starts with 00 and has a maximum of FF (256)You can change the default format by using the following command, where deviceSpecifier is any valid device such as DISK or sbt, and 'string' contains the variable %F and is a valid handle for the specified device:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE deviceSpecifier TO 'string';
For example, you can run the following command:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '?/oradata/cf_%F';
|
Note: The format string must contain the |
You can return the default autobackup format to %F by running this command, where deviceSpecifier is any valid device such as DISK or sbt:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE deviceSpecifier CLEAR;
The SET CONTROLFILE AUTOBACKUP FORMAT command, which you can specify either within a RUN block or at the RMAN prompt, overrides the configured autobackup format in the current session only. The order of precedence is:
SET CONTROLFILE AUTOBACKUP FORMAT (within RUN)SET CONTROLFILE AUTOBACKUP FORMAT (at RMAN prompt)CONFIGURE CONTROLFILE AUTOBACKUP FORMAT
See Also:
|
A retention policy specifies when RMAN should consider the backups and copies it creates as obsolete. Before attempting to configure the policy, read the conceptual explanation in "Backup Retention Policies".
Use the CONFIGURE command to set the retention policy. If you use Oracle Enterprise Manager, then you can also set the policy with the Maintenance wizard.
This section contains these topics:
See Also:
|
The RECOVERY WINDOW parameter of the CONFIGURE command specifies the number of days between the current time and the earliest point of recoverability. RMAN does not consider any backup or copy as obsolete if it falls within the recovery window. Additionally, RMAN retains all archived logs and incremental backups that are needed to recover to a random point within the window.
Run the CONFIGURE command at the RMAN prompt. This example ensures that you can recover the database to any point within the last 7 days:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
RMAN does not automatically delete backups and copies rendered obsolete by the recovery window. Instead, RMAN shows them as OBSOLETE in the REPORT OBSOLETE output and deletes them if you run DELETE OBSOLETE.
To change the retention policy setting, run the CONFIGURE RETENTION POLICY command with a new setting. For example:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 4 DAYS; CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 11 DAYS;
| See Also:
"Recovery Window" for a conceptual introduction to the recover window |
The REDUNDANCY parameter of the CONFIGURE RETENTION POLICY command specifies how many backups and copies of each datafile and control file that RMAN should keep. In other words, if the number of backups and copies for a specific datafile or control file exceeds the REDUNDANCY setting, then RMAN considers the extra backups and copies as obsolete.
As you produce more backups, RMAN keeps track of which ones to retain and which are obsolete. Additionally, RMAN retains all archived logs and incremental backups that are needed to recover the nonobsolete backups.
Assume that you make a backup of a specific datafile on Monday, Tuesday, Wednesday, and Thursday. Hence, you have four backups of the datafile. If REDUNDANCY is 2, then the Monday and Tuesday backups are obsolete. If you produce another backup on Friday, then the Wednesday backup also becomes obsolete.
Run the CONFIGURE RETENTION POLICY command at the RMAN prompt, as in the following example:
CONFIGURE RETENTION POLICY TO REDUNDANCY 3;
To change the setting, run the command with a new REDUNDANCY setting. For example, run the following:
CONFIGURE RETENTION POLICY TO REDUNDANCY 4; CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
| See Also:
"Backup Redundancy" for a conceptual introduction to backup redundancy |
To disable the retention policy, run this command:
CONFIGURE RETENTION POLICY TO NONE;
This command means that RMAN does not consider any backup or copy as obsolete. Consequently, if you run REPORT OBSOLETE or DELETE OBSOLETE with no other options, RMAN issues an error because no retention policy exists to determine which backups and copies are obsolete.
|
Note: Configuring the retention policy to |
To clear the retention policy, that is, return the retention policy to its default setting, run this command:
CONFIGURE RETENTION POLICY CLEAR;
This command returns the retention policy to its default setting, which is REDUNDANCY = 1.
The CONFIGURE MAXSETSIZE command limits the size of backup sets created on a channel. The CONFIGURE settings apply to any channel, whether manually or automatically allocated, when the BACKUP command is run.
You can set MAXSETSIZE in bytes (default), kilobytes (K), megabytes (M), and gigabytes (G). The default value is given in bytes and is rounded down to the lowest kilobyte value. For example, if you set the maximum set size to 2000, then RMAN rounds down this value to 1 kilobyte (1024 bytes). If you set the maximum set size to 2049, then RMAN rounds down this value to 2 kilobytes (2048 bytes).
You can specify MAXSETSIZE on the following commands, listed in descending order of precedence (that is, the higher overriding the lower):
An example illustrates the hierarchy of settings. Assume that you issue the following commands at the RMAN prompt:
CONFIGURE DEFAULT DEVICE TYPE TO sbt; CONFIGURE CHANNEL DEVICE TYPE sbt PARMS 'ENV=(NSR_DATA_VOLUME_POOL=first_pool)'; CONFIGURE MAXSETSIZE TO 7500K; BACKUP TABLESPACE users; BACKUP TABLESPACE tools MAXSETSIZE 10M;
Note these consequences of RMAN behavior:
hr tablespace uses the automatic sbt channel and the default MAXSETSIZE setting of 7500K.orders tablespace uses the MAXSETSIZE setting of 10M used in the BACKUP command.
| See Also:
Oracle9i Recovery Manager Reference for |
Run the CONFIGURE command to enable and disable backup optimization. Backup optimization skips the backup of files in certain circumstances if the identical file or an identical version of the file has already been backed up. Before configuring optimization, read the discussion of the backup optimization algorithm in "Backup Optimization".
Note that backup optimization applies only to these commands:
You can override optimization at any time by specifying theFORCE option on the BACKUP command. For example, you can run:
BACKUP DATABASE FORCE; BACKUP ARCHIVELOG ALL FORCE;
By default, backup optimization is configured to OFF. To enable backup optimization, run the following command:
CONFIGURE BACKUP OPTIMIZATION ON;
To disable backup optimization, run the following command:
CONFIGURE BACKUP OPTIMIZATION OFF;
To clear the current backup optimization setting, that is, return backup optimization to its default setting of OFF, run this command:
CONFIGURE BACKUP OPTIMIZATION CLEAR;
|
Note: If you use Oracle Enterprise Manager, then you can use the Maintenance wizard to configure backup optimization. |
See Also:
|
Use the CONFIGURE ... BACKUP COPIES command to specify how many copies of each backup piece should be created on the specified device type for the specified type of file. This feature is known as duplexing. The CONFIGURE settings applies only to backups of datafiles (which includes the current control file) and archived redo logs.
|
Note: Control file autobackups on disk are a special case and are never duplexed: RMAN always creates one and only one copy. |
If you backup to sbt, than you have to set initialization parameter BACKUP_TAPE_IO_SLAVES=true. If you do not, then RMAN signals the following error:
RMAN-10035: exception raised in RPC: ORA-19565: BACKUP_TAPE_IO_SLAVES not enabled when duplexing to sequential devices
To configure the number of backup copies, specify an integer. The following examples show possible configurations:
# Makes 2 copies of every datafile and control file backup (autobackups excluded) to disk CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 2; # Makes 3 copies of every archived redo log backup to tape CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE sbt TO 3;
If you use the duplexing feature in conjunction with multiple FORMAT strings, then you can name each individual backup copy. For example, assume that you configure BACKUP COPIES to 3. Then, you can issue:
BACKUP DATABASE FORMAT '/tmp/%U', '?/dbs/%U', '?/oradata/%U';
RMAN generates 3 identical copies of each backup piece in the backup set, and names each piece according to the specified FORMAT string: the first copy is placed in the /tmp directory, the second in the ?/dbs directory, and the third in the ?/oradata directory. Note that you can specify the FORMAT string on the BACKUP, CONFIGURE CHANNEL, and ALLOCATE CHANNEL commands.
To return a BACKUP COPIES configuration to its default value, run the same CONFIGURE command with the CLEAR option, as in this example:
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE sbt CLEAR;
By default, CONFIGURE ... BACKUP COPIES is set to 1 for each device type.
|
Note: If you do not want to create a persistent copies configuration, then you can specify copies with the |
See Also:
|
You can CONFIGURE EXLUDE FOR TABLESPACE to exempt the specified tablespace from the BACKUP DATABASE command. The exclusion condition applies to any datafiles that you add to this tablespace in the future.
This tablespace exclusion feature is useful when you do not want to make a specified tablespace part of the regular backup schedule, as in these cases:
For example, you can exclude testing tablespaces cwmlite and example from whole database backups as follows:
CONFIGURE EXCLUDE FOR TABLESPACE cwmlite; CONFIGURE EXCLUDE FOR TABLESPACE example;
If you run the following command, then RMAN backs up all tablespaces in the database except cwmlite and example:
BACKUP DATABASE;
You can still back up the configured tablespaces by explicitly specifying them in a BACKUP command or by specifying the NOEXCLUDE option on a BACKUP DATABASE command. For example, you can enter one of the following commands:
BACKUP DATABASE NOEXCLUDE; # backs up the whole database, including cwmlite and example BACKUP TABLESPACE cwmlite, example; # backs up only cwmlite and example
You can disable the exclusion feature for cwmlite and example as follows:
CONFIGURE EXCLUDE FOR TABLESPACE cwmlite CLEAR; CONFIGURE EXCLUDE FOR TABLESPACE example CLEAR;
RMAN includes these tablespaces in future whole database backups.
|
Note: If you use Oracle Enterprise Manager, then you can use the Maintenance wizard to exclude tablespaces from backups. |
See Also:
|
This section describes globalization support variable settings in RMAN and contains these topics:
Before invoking RMAN, set the NLS_DATE_FORMAT and NLS_LANG environment variables. These variables determine the format used for the time parameters in RMAN commands such as RESTORE, RECOVER, and REPORT.
The following example shows typical language and date format settings:
NLS_LANG=american NLS_DATE_FORMAT='Mon DD YYYY HH24:MI:SS'
If you are going to use RMAN to connect to an unmounted database and mount the database later while RMAN is still connected, then set the NLS_LANG environment variable so that it also specifies the character set used by the database.
A database that is not mounted assumes the default character set, which is US7ASCII. If your character set is different from the default, then RMAN returns errors after the database is mounted. To avoid this problem, set the NLS_LANG to specify the target database's character set. For example, if the character set is WE8DEC, you can set the NLS_LANG parameter as follows:
NLS_LANG=american_america.we8dec
| See Also:
Oracle9i Database Reference for more information about the |
When RMAN needs to resynchronize from a read-consistent version of the control file, it creates a temporary snapshot control file. RMAN needs a snapshot control file only when resynchronizing with the recovery catalog or when making a backup of the current control file.
The default value for the snapshot control file is platform-specific and depends on the Oracle home. For example, the default filename on some UNIX platforms in Oracle9i is $ORACLE_HOME/dbs/snapcf_@.f.
In general, you should only need to set the control file location when You are upgrading to the current release from a release earlier than 8.1.7. In these earlier releases, the default location for the snapshot control file was not dependent on the Oracle home, whereas in the current release the default location is dependent on the Oracle home.
In some cases, you may want to set the snapshot control file to the default location. Run the CONFIGURE SNAPSHOT CONTROLFILE LOCATION CLEAR command. The behavior of the default value is described in the following table.
You can see the current snapshot location by running the SHOW command. This example shows a snapshot location that is default:
RMAN> SHOW SNAPSHOT CONTROLFILE NAME; CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/oracle/dbs/snapcf_trgt.f'; # default
This example shows a snapshot control file that has a nondefault filename:
RMAN> SHOW SNAPSHOT CONTROLFILE NAME; CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/tmp/snapcf_trgt.f'; # default
Use the CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'filename' command to change the name of the snapshot control file to a nondefault value. Subsequent snapshot control files that RMAN creates use the specified filename.
For example, start RMAN and then enter:
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/oracle/oradata/trgt/snap_trgt.ctl';
You can also set the snapshot control file name to a raw device. An Oracle Real Application Clusters configuration does not require the snapshot control file to be shared across all instances, but the snapshot controlfile name must be set to a location where any instance can create one. Each instance is permitted to create the snapshot control file in its own file system as it needs one. The following example sets the snapshot control file name to a raw device:
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/dev/vgd_1_0/rlvt5';
Note that if one RMAN job is already backing up the control file while another needs to create a new snapshot control file, you may see the following message:
waiting for snapshot controlfile enqueue
Under normal circumstances, a job that must wait for the control file enqueue waits for a brief interval and then successfully retrieves the enqueue. Recovery Manager makes up to five attempts to get the enqueue and then fails the job. The conflict is usually caused when two jobs are both backing up the control file, and the job that first starts backing up the control file waits for service from the media manager.
| See Also:
"Backup Fails Because of Control File Enqueue: Scenario", and Oracle9i Recovery Manager Reference for |
RMAN cannot connect to the target database through a shared server dispatcher: it requires a dedicated server process. Nevertheless, you can connect specified sessions to dedicated servers, even when the target is configured for a shared server.
To ensure that RMAN does not connect to a dispatcher when the target database is configured for a shared server, the net service name used by RMAN must include (SERVER=DEDICATED) in the CONNECT_DATA attribute of the connect string.
Oracle Net configuration varies greatly from system to system. The following procedure illustrates only one method. This scenario assumes that the following service name in the tnsnames.ora connects to the target database using the shared server architecture, where inst1 is a value of the SERVICE_NAMES initialization parameter:
inst1_shs = (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=inst1_host)(port1521))
(CONNECT_DATA=(SERVICE_NAME=inst1)(SERVER=shared))
)
To use RMAN with a shared server:
tnsnames.ora file that connects to the nonshared SID. For example, enter:
inst1_ded = (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=inst1_host)(port1521)) (CONNECT_DATA=(SERVICE_NAME=inst1)(SERVER=dedicated)) )
SQL> CONNECT SYS/oracle@inst1_ded Connected. SQL> SELECT SERVER FROM V$SESSION WHERE SID = (SELECT DISTINCT SID FROM V$MYSTAT); SERVER --------- DEDICATED 1 row selected.
To connect to a shared server session, you can issue:
SQL> CONNECT SYS/oracle@inst1_shs AS SYSDBA Connected. SQL> SELECT SERVER FROM V$SESSION WHERE SID = (SELECT DISTINCT SID FROM V$MYSTAT); SERVER --------- SHARED 1 row selected.
% rman TARGET SYS/oracle@inst1_ded CATALOG rman/cat@catdb
| See Also:
Your operating system-specific Oracle documentation and your Oracle9i Net Services Reference Guide for a complete description of Oracle Net connect string syntax |
A recovery catalog is not necessary when using RMAN. To use a recovery catalog, you need to create a schema in a recovery catalog database. The catalog will be located in the default tablespace of the scheme. Note that SYS cannot be the owner of the catalog.
Create the recovery catalog schema in a different host, on different disks, and in a different database from the target database you will be backing up. If you do not, then the benefits of using a recovery catalog are lost if you lose the database and need to restore.
|
Caution: Ensure that the recovery catalog and target databases do not reside on the same disks. If they do and you lose one database, you will probably lose the other. |
The basic procedure for setting up a recovery catalog, which is described in complete detail in Chapter 16, "Managing the Recovery Manager Repository", is as follows:
-- connect as SYS to recovery catalog database CONNECT SYS/oracle@catdb AS SYSDBA -- create user that will own catalog tables CREATE USER rman IDENTIFIED by cat TEMRORARY TABLESPACE temp DEFAULT TABLESPACE tools QUOTA UNLIMITED ON tools;
GRANT RECOVERY_CATALOG_OWNER TO rman; GRANT CONNECT, RESOURCE TO rman;
CREATE CATALOG command. For example:
% rman TARGET / CATALOG rman/cat@catdb RMAN> CREATE CATALOG
REGISTER DATABASE command. For example:
RMAN> REGISTER DATABASE;
|
![]() Copyright © 1996, 2002 Oracle Corporation. All Rights Reserved. |
|