| Oracle® Database Backup and Recovery Advanc
ed User's Guide 10g Release 1 (10.1) Part Number B10734-01 |
Home Contents Index
Master Index ![]() Feedback |
|
View PDF |
This chapter describ es how to perform setup and configuration tasks. This chapter contains these topics:
Oracle Database Backup and Recovery Basics for basic RMAN configuration inform ation |
To take maximum advantage of the flash recovery area, it should be used to store and manage as many different types of file as possible: online redo logs, archived redo logs, control files and RMAN's own working files for backu p and restore operations.
This section contains the following topics:
The following statements can create online redo logs in the f lash recovery area:
ALTER DATABASE ADD LOGFILEALT
ER DATABASE ADD STANDBY LOGFILEALTER DATABASE OPEN RESETLOGSThe default size of an online log created in the flash recovery area is 100 MB. T he log member filenames are automatically generated by the database.
The initialization par
ameters that determine where online redo log files are created are DB_CREATE_ONLINE_LOG_DEST_n, DB_CREATE_FILE_DEST. Details of the effect of various combinations of these paramet
ers on online redo log creation can be found inOracle Database SQL Reference in the description of the LOGFILE clause of the C
REATE DATABASE statement.
The initialization parameters CONTROL_FILES, DB_CREATE_ONLINE
_LOG_DEST_n, DB_RECOVERY_FILE_DEST, and DB_CREATE_FILE_DEST all interact to de
termine the location where the database control files are created.
For a full description o
f how these parameters interact, see the "Semantics" section of the description of CREATE CONTROLFILE in Oracle Database SQL Reference
a>.
If the database creates an Oracle managed control file, and if the database uses a serv
er parameter file, then the database sets the CONTROL_FILES initialization parameter in the server parameter file. If th
e database uses a client-side initialization parameter file, then you must set the CONTROL_FILES initialization paramete
r manually in the initialization parameter file.
It is recommended that you the use flash recovery area as an archived log location because the archived log s are automatically managed by the database. Whatever archiving scheme you choose, it is always advisable to create multiple copies o f archived logs.
You have the following basic options, listed from most to least recommende d:
LOG_ARCHIVE_DEST_n<
/em> initialization parameter to locations outside the flash recovery area.LOG_ARCHIVE_DEST_n initialization parameters to archive only to n
on-flash recovery area locations.If you want to use the flash recovery area, you can
not use the LOG_ARCHIVE_DEST and LOG_ARCHIVE_DUPLEX_DEST initialization parameters. You must use instead th
e LOG_ARCHIVE_DEST_n parameters, which have somewhat different semantics. Once your database is us
ing LOG_ARCHIVE_DEST_n, you can configure a flash recovery area.
The interactions among different init ialization parameters affecting redo log archiving desintations are as follows:
LOG_ARCHIVE_DEST (and, optionally, LOG_ARCHIVE_DUPLEX_DEST) is set, these parameters w
ill specify the only redo log archiving destinations.DB_RECOVERY_FIL
E_DEST is specified (that is, if a flash recovery area is configured) and no LOG_ARCHIVE_DEST_n<
/em> is specified, then LOG_ARCHIVE_DEST_10 is implicitly set to the flash recovery area. (You can override this behavio
r by explicitly setting LOG_ARCHIVE_DEST_10 to an empty string.)LOG_ARCHIVE_DEST_n, then archived redo logs are stored only
in the destinations you specify using those parameters. In this case, redo log files are not archived in the flash recovery area by d
efault. If you have a flash recovery area configured, you can explicitly add the flash recovery area to the set of archiving destinat
ions by setting one of the LOG_ARCHIVE_DEST_n parameters to LOCATION=USE_DB_RECOVERY_FILE_DE
ST (note that this does not have to be LOG_ARCHIVE_DEST_10).LOG_ARCHIVE_DEST, LOG_ARCHIVE_DEST_n, or DB_
RECOVERY_FILE_DEST, then the redo logs are archived to a default location that is platform-specific. On Solaris, for example,
the default is ?/dbs.The generated filenames for the archived redo logs in the flash recovery area are Oracle Manged Filename
s and are not determined by LOG_ARCHIVE_FORMAT.
This section describes RMAN commands or implicit actions (such as control file autobackup) that can cre ate files in the flash recovery area, and how to control whether a specific command creates files there or in some other destination. The assumption in all cases is that a flash recovery area has already been configured for your database. The commands are:
BACKUP
Do not specify a FORMAT option to the BACKUP command, and do not configure a FORMAT option for disk backups. In such a case, RMAN creates backup pieces and image copies in the flash recovery area, with names in Orac
le Managed Files name format.
RMAN can create control file autobackups in the flash recovery area. Use the
RMAN command CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK CLEAR to clear any configured format option fo
r the control file autobackup location on disk. Control file autobackups will be placed in the flash recovery area when no other dest
ination is configured.
RESTORE ARCHIVELOG
<
p>
Explicitly or implicitly (as in the case of ), set one of the LOG_ARCHIVE_DEST_n) parameters to 'LOCATION=USE_DB_RECOVERY_FILE_DEST'. If you do not specify SET ARCHIVELOG DESTINATION to override t
his behavior, then restored archived redo log files will be stored in the flash recovery area.
RECOVER DATABASE or TABLESPACE, BLOCKR
ECOVER, and FLASHBACK DATABASE
These comm ands restore archived redo logs from backup for use during media recovery, as required by the command. RMAN restores any redo log fil es needed during these operations to the flash recovery area, and delete them once they are applied during media recovery.
To direct the restored archived redo logs to the flash recovery area, set one of the LOG_ARCHI
VE_DEST_n parameters to 'LOCATION=USE_DB_RECOVERY_FILE_DEST", and make sure you are not usi
ng SET ARCHIVELOG DESTINATION to direct restored archived logs to some other destination.
On most platforms, to back up to and restore from sequential media such as tape you must integrate a media manager with your Oracle database. A media manag er 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 ge neric steps for configuring RMAN for use with a media manager. The actual steps depend on the media management product that you insta ll and the platform on which you are running the database.
Read the following sections in o rder 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 wi th a media manager, you must install it and make sure that RMAN can communicate with it. Instructions for this procedure should be av ailable in the media manager vendor's software documentation.
In general, you should begin by installing and configuring the media management software on the target host or production network. Ensure that you can make non-RM AN backups of operating system files on the target database host. This step makes later troubleshooting much easier, by confirming th at the basic integration of the media manager with the target host has been successful. Refer to your media management documentation to learn how to back up files to the media manager outside of RMAN.
Then, obtain and instal l the third-party media management module for integration with the database server. This module contains the media management library that the Oracle database loads and uses when accessing the media manager. It is generally a third-party product which must be purcha sed separately. Contact your media management vendor for details.
When allocating or configuring channels for RMAN to use to communicate with a m
edia manager, specify the SBT_LIBRARY parameter to provide the path to the media management software library. When RMAN
actually allocates channels to communicate with a media manager, it attempts to load the library indicated by the SBT_LIBRARY
code> parameter.
If you do not provide a value for this parameter, RMAN looks in a platform
-specific default location. On UNIX, the default library filename is $ORACLE_HOME/lib/libobk.so, with the extension name
varying according to platform: .so, .sl, .a, and so forth. On Windows the default library loc
ation is %ORACLE_HOME%\bin\orasbt.dll.
|
Note: The default media management library file is not part of the standard database installation. It is only present if you install third-party media management software. |
If the database is unable to locate a media management library in th
e location specified by the SBT_LIBRARY parameter or the default location, then RMAN issues an ORA-27211 er
ror and exits.
Whenever channel allocation fails, the database writes a trace file to the < code>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
See Also:
|
After you have confirmed that the database server can load the media management library, test to make sure that RMAN can back up to the media manager. The process for testing the med ia management library is described in the following sections:
After installing the media management software, perform whate ver configuration that your vendor requires so that the software can accept RMAN backups. Depending on the type of media management s oftware that you installed, you may have to define media pools, configure users and classes, and so forth.
Then, determine which PARMS settings are needed for the ALLOCATE CHANNEL or 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-spec
ific 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.
See Also:
|
To work with restri ctions on file names and sizes imposed by your media manager, you may need to configure RMAN settings that control the naming and siz e of backup pieces.
You may need to manage the naming of backup pieces to be written to the media manager, so that backup pieces have unique na
mes. A backup piece name is determined by the FORMAT string specified in the BACKUP command, the CONF
IGURE CHANNEL command, or the ALLOCATE CHANNEL command. 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.
You can use the substitution variables provided by RMAN to generate unique backup piece names. If you do not specify the %U substitution variable.
Oracle Database Recovery Manager Reference f
or the complete list of variables allowable in format strings with the BACKUP command
Some media managers have limits on the maximum size of files that they can back up or restore. You must ensure that RMAN does not produce backup sets lar ger than limits imposed by your media manager.
To limit backup piece sizes, use the paramet
er MAXPIECESIZE, which you can set in the CONFIGURE CHANNEL and ALLOCATE CHANNEL commands. Ref
er to the *.rcv scripts in the demo subdirectory on your system, which is located in an operating system sp
ecific location ($ORACLE_HOME/rdbms on UNIX) for an example.
Oracle Database Recovery Manager Reference and "Size of Backup Pieces"for details on how to set |
"After Installation of Media Manager, RMAN Channel Allocation Fails: Scenario" for a troubleshooting scenario |
After testing a channe l 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 CHA NNEL c1 DEVICE TYPE sbt PARMS='SBT_LIBRARY=/mediavendor/lib/libobk.so ENV=(NSR_SERVER=tape_srv,NSR_ GROUP= oracle_tapes)'; BACKUP CURRENT CONTROLFILE; }
The specifics of your PARMS and FORMAT settings depend on the media management s
oftware that you are using.
If the backup succeeds, then you are ready to make backups to y our media manager.
Possible failures include the following cases:
| 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 m edia manager jobs in "tape mount request" mode and fix the problem. Ensure that the steps in "Configuring RMAN to Make Backups to a Media Manager" are corr ectly done. Refer to "Backup Job Is Hanging: Scenario" if the p roblem persists. |
|
The backup fails with an |
This error i
ndicates that the media management software is not correctly configured. Ensure that the steps in "Con
figuring RMAN to Make Backups to a Media Manager" are correctly done. Also, ensure that you ha
ve the correct |
| See Also:
"Testing the Media Management API" a> and "RMAN Troubleshooting Scenarios" for more information ab out troubleshooting RMAN with a media manager |
This section describes how to configure automatic channels specifically for use with a media manager. For an overview of automatic channels and how they are used, refer to the section "Configuring Automatic Channels". The following setup procedure references the sections in < a href="rcmconfg.htm#1006908">"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 enter all parameters that you tested in the section "Testing a Back
up to the Media Manager". For example, assume that your media vendor requires PARMS settings as follows:
RMAN> CONFIGURE CHANNEL DEVICE TYPE sbt
PAR
MS='SBT_LIBRARY=/mediavendor/lib/libobk.so ENV=(NSR_SERVER=tape_svr,NSR_
CLIENT=oracleclnt,NSR_GROUP=ora_tapes)'
<
/a> FORMAT "BACKUP_%U";
RMAN> BACKUP DEVICE TYPE sbt CURRENT CONTROLFILE;
RMAN> SHOW CHANNEL FOR DEVICE TYP E sbt;
RMAN> CO NFIGURE DEFAULT DEVICE TYPE TO sbt;
RMAN> BACKUP CURRENT CONTROLFILE;
RMAN> SHOW DEFAULT DEVICE TYPE;
RMAN> CONFIGURE DEVICE TYPE sbt PARALLELISM 2; RMAN> BACKUP DATABASE;
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 ch annels for use in backup, restore, recovery, and maintenance jobs.
You can always override
automatic channels with ALLOCATE CHANNEL to allocate channels manually for a particular backup job.
By default, RMAN has preconfigured a disk channel so that you can back up to disk without doing an y manual configuration. You may, however, want to parallelize the channels for disk or tape devices to improve performance.
| <
/a>See Also:
"About RMAN Channels" for a conceptual overview of automatic and man ual channels, and Oracle Datab ase Recovery Manager Reference for syntax |
By default, channel parallelism for each configured device is set to 1<
/code>. As a rule, allocate one channel for each physical device. If you are backing up to only one disk location or only one tape dr
ive, then you need only one channel.
The CONFIGURE DEVICE T
YPE ... PARALLELISM integer command specifies how many channels (up to 254) RM
AN should allocate for jobs on the specified device type. This command allocates three channels for jobs on device type DISK :
RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 3;
These commands back up to a media manager using two tape drives in parallel:
< a name="1008641">RMAN> CONFIGURE DEFAULT DEVICE TYPE TO sbt; # default backup device is tape RMAN> CO NFIGURE DEVICE TYPE sbt PARALLELISM 2; # configure two tape channels RMAN> BACKUP DATABASE; # backup goes to two tapes, in two parallel streams
Each configured sbt channel will back up roughly half the total data.
By default, RMAN automatically allocates a precon
figured DISK channel without any options. However, you may use a media manager that requires special options (PARM
S, FORMAT, MAXPIECESIZE, and so forth) or you may want to change the default DISK setti
ng. By configuring channels, you define which parameters are used when RMAN automatically allocates channels.
Use the CONFIGURE CHANNEL command to configure automatic channel options for the availab
le 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 ca
n configure generic disk and tape channels as in this example:
RMAN> CONFIGURE CHANNEL D EVICE TYPE DISK FORMAT = '?/bkup_%U'; RMAN> CONFIGURE CHANNEL DEVICE TYPE sbt PARMS ='SBT_LIBRARY=/mediavendor/lib/libobk.so ENV=(NSR_SERVER=tape_svr,NSR_ CLIENT=oracleclnt,NSR_GROUP=ora_tapes)';
To configure a generic channel, that is, a templ
ate 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, the
n erases this setting and sets a FORMAT:
RMAN> CONFIGURE CHANNEL DEVICE TYP E DISK MAXPIECESIZE 2G; RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT = /tmp/%U;
The automatic channel that RMAN allocates for its b
ackups depends on the default device type. If the default device type is DISK, then RMAN uses the DISK chan
nel 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 (and, in fact, you should never attempt to use channels fo
r multiple device types simultaneously for any backup job).
The following example creates a
configuration in which all backups go to two tapes in parallel. For this example, the media management software requires additional
parameters besides specifying the SBT_LIBRARY: ENV=(NSR_DATA_VOLUME_POOL=oracle_tapes). The chosen FO
RMAT for backup file names is %U_backup.
CONFIGURE DEFAULT DEVICE TYPE TO sbt; # by default, backup goes to MML CONFIGURE DEVICE TYPE sbt PARALLELISM 2; # two tapes in par allel CONFIGURE CHANNEL DEVICE TYPE # sets parameters for all channels P ARMS 'SBT_LIBRARY=/mediavendor/lib/libobk.so ENV=(NSR_DATA_VOLUME_ POOL=oracle_tapes)' FORMAT '%U_backup'; BACK UP DATABASE; # backs up database
After connecting to the target database and recovery catalog (if you use one), issue the SHOW CH
ANNEL command to display the settings for all automatically allocated channels. For example, connect the RMAN client to the ta
rget and possibly catlaog databases, and enter:
RMAN> SHOW CHANNEL; # shows the CONFI GURE setting for the automatic channels
Sample output for S
HOW CHANNEL follows:
RMAN configuration parameters are: CONFIGURE CHANNEL DEVICE TYPE 'SBT' RATE 1500K;< h4 class="H3">Showing the Configured Device Types
Issue the SHOW DEFAULT DEVICE TYPE command
to display the settings for the default device type used by the automatic channels. When you issue the BACKUP command,
RMAN allocates only default channels of the type set by the CONFIGURE DEFAULT DEVICE TYP
E command. This default device type setting is not in effect when you use commands other than BACKUP. Note that y
ou cannot disable the default device type: it is always either DISK (default setting) or sbt.
To show the default device type for automatic channels:
After connecting to the target database and recovery catalog (if you use one), run the SHOW DEVICE TYPE command. For example, enter:
SHOW DE FAULT DEVICE TYPE; # shows the CONFIGURE DEFAULT DEVICE TYPE setting
Sample output for SHOW DEFAULT DEVICE TYPE follows:
RMAN configuration parameters are: CONFIGURE DEFAULT DEVICE TYPE TO 'SBT';
If you manually allocate a channel during a job, t
hen RMAN disregards any automatic channel settings. For example, assume that the default device type is configured to sbt, and you execute this command:
RMAN> RUN { a> ALLOCATE CHANNEL c1 DEVICE TYPE DISK; BACKUP TABLESPACE users; }
In this case, RMAN uses only the disk channel that you manually allocated within th
e RUN block, overriding any defaults set by using CONFIGURE DEVICE TYPE, CO
NFIGURE DEFAULT DEVICE, or CONFIGURE CHANNEL settings.
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 num
bering channels, you must specify one or more channel options (for example, MAXPIECESIZE or FORMAT) for eac
h channel. When you use that specific numbered channel in a backup, the configured settings for that channel will be used instead of
the configured generic channel settings.
Configure specific channels by number when it is n ecessary to control the parameters set for each channel separately. This could arise in the following situations:
PARMS settingsFor example, assume that you have two tap e 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 r un the following commands:
CONFIGURE DEFAULT DEVICE TYPE TO sbt; # backup goes to sbt CONFIGURE DEVICE TYPE sbt PARALLELISM 2; # two tapes used in parallel # configure first str eam to go to data volume pool named first_pool CONFIGURE CHANNEL 1 DEVICE TYPE sbt PAR MS 'SBT_LIBRARY=/mediavendor/lib/libobk.so 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 'SBT_LIBRARY=/mediavendor/lib/libobk.so ENV=(NSR_DATA_VOLUME_ POOL=second_pool)'; BACKUP DATABASE; # first str eam goes to 'first_pool' and second to 'second_pool'
In this exam ple, 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 PARALLELISM 2; # two channels used in in parallel CONFIGURE CHANNEL 1 DEVICE TYPE DISK FOR MAT '/disk1/%U' # 1st channel to disk1 CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT '/disk2/%U' # 2nd channel t o disk2 BACKUP DATABASE; # backup - first channel goes to disk1 and second to disk2< /a>
When parallelizing, RMAN always allocates channels beginning wit
h 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 chann el configuration CONFIGURE DEVICE TYPE DISK PARALLELISM 4; CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT = '/tmp/backup_%U'; CONFIGURE CHANNEL 2 DEVICE TYPE DISK MAXPIECESIZE = 20M; CONFIGURE CHANNEL 4 DEVICE TYPE DISK MAXPIECESIZE = 40M; # sbt channel configuration < a name="1007100">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 s bt 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 R
MAN allocates when the default device is sbt and PARALLELISM for sbt is set to 3.
| Channel Name | Setting |
|---|---|
|
|
|
|
|
|
|
|
|
| See Als
o:
"Automatic Channel-Specific Configurations" a> 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 c hannel and device settings by using these commands:
CONF
IGURE DEVICE TYPE ... CLEARCONFIGURE DEFAULT DEVICE TYPE CLEARCONFIGURE CHANNEL DEVICE TYPE ... CONFIGURE 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 C
ONFIGURE DEFAULT DEVICE TYPE. The CONFIGURE DEVICE TYPE
... CLEAR command removes the configuration for the specified device type and returns it to the def
ault (PARALLELISM 1).
The CONFIGURE DEFAULT DEVICE TYPE ... CLEAR command clears the configured default device and returns it to DISK<
/code> (the default setting).
The CONFIGURE CHANNEL DEVICE<
/code> 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 options to automati
c channels, then clear the options for these channels individually by specifying the channel number in CONFIGURE C
HANNEL n DEVICE TYPE ... CLEAR. For example, assume
that you run the following:
RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE = 1800 K; RMAN> CONFIGURE CHANNEL 3 DEVICE TYPE DISK FORMAT = /tmp/%U; RMAN> CONFIGURE CHA NNEL 3 DEVICE TYPE DISK CLEAR;
In this case, RMAN clears the sett
ings for CHANNEL 3, but leaves the settings for the generic DISK channel (the channel with no
number manually assigned) intact.
The CONFIGURE MAXSETSIZE command limits the s
ize of backup sets created on a channel. This CONFIGURE setting applies to any channel, whether manually or automaticall
y allocated, when the BACKUP command is used to create backup sets.
You can se
t 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 t
o 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 t
his value to 2 kilobytes (2048 bytes).
The value set by the CONFIGURE MAXSETSIZE command is a default for the given channel. You can override the configured MAXSETSIZE value by specifying a MA
XSETSIZE option for an individual BACKUP command.
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 MAXSET SIZE TO 7500K; BACKUP TABLESPACE users; BACKUP TABLESPACE tools MAXSETSIZE 5G;
The results will be as follows:
users tablespace uses the automatic sbt channel and the confi
gured default MAXSETSIZE setting of 7500K.tools tablespace uses the MAXSETSIZE setting of 5G used in the BACKUP co
mmand.
| See Also:
Oracle Database Recovery Manager Reference for |
See Also:
|
You can use SHOW BACKUP OPTIMIZATIO
N to view the current settings of backup optimization as configured with the CONFIGURE BACKUP
OPTIMIZATION command. After connecting to the target database and recovery catalog (if you use one), issue the SHOW BACKUP OPTIMIZATION command. For example, enter:
SHOW BACKUP O PTIMIZATION;
Sample output for SHOW BACKUP OPTIMIZATION follows:
RMAN configuration parameters are: CONFIGURE BACKUP OPTIMIZATION ON;
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 backu
p sets of datafiles (which includes the current control file) and archived redo logs. It does not affect image copies.
|
Note: Control file autobackups on disk are a special case and are never duplexed: RMAN always creates one and o nly one copy. |
To configure the number of backup set copies, sp ecify an integer. The following examples show possible configurations:
# Makes 2 disk copie s of each datafile and control file backup set # (autobackups excluded) CONFIGURE DATAFIL E 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 set copy. For example, assume that you configure BACKUP COPIES to 3. Then, you can iss
ue:
BACKUP DATABASE FORMAT '/tmp/%U', '?/dbs/%U', '?/oradata/%U'; pre>RMAN generates 3 identical copies of each backup piece in the backup set, and names each p iece according to the specified
FORMATstring: the first copy is placed in the/tmpdirectory, the second i n the?/dbsdirectory, and the third in the?/oradatadirectory. Note that you can specify theFORMATstring on theBACKUP,CONFIGURECHANNEL, andALLOCATECHANNELcommands.To return a
BACKUPCOPIESconfiguration to its defaul t value, run the sameCONFIGUREcommand with theCLEARoption, as in this example:CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE sbt CLEAR;< p class="BP">By default,CONFIGURE...BACKUPCOPIESis set to1for each device type.
Note: < a name="1014996">If you do not want to create a persistent copies configuration, then you can specify copies with the
BACKUPCOPIESandSETBACKUPCOPIEScommands.
See Also:
- "Manual Par allelization of Backups" for concepts
Oracle Database Recovery Manager Reference for BACKUPsyntax- Oracle Database Recovery Manager Reference for
CONFIGURE syntax - Oracle Database Recovery Manager Reference for
SETsyntax li>Showing the Configured Degree of Duplexing: SHOW... BACKUP COPIES
a>
SHOW... BACKUP COPIESlets you view how you have usedCONFIGURE...BA CKUPCOPIEScommand to set the number of identical copies that RMAN makes of each of several types of backup.After connecting to the target database and recovery catalog (if you use one), run the
S HOWARCHIVELOGBACKUPCOPIESorSHOWDATAFILEBACKUPCOPIEScommands. For example, enter:SHOW DATAFILE BACKUP COPIES; # sh ows CONFIGURE DATAFILE BACKUP COPIES settingSample output for
SHOW DATAFILEBACKUPCOPIESfollows:RMAN configuration parameters are: CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # defaultConfiguring Tablespaces for Exclus ion from Whole Database Backups
You can run
CONFIGUREcommand. The exclusion condition applies to any datafiles that you add to this tablespace in the future.EXCLUDEFORTABLESPACEto exempt the specified tablespace from theBACKUPDATABASE 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:<
/p>
BACKUP DATABASE;
You ca
n 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 comma
nds:
# backs up the whole database, including cwmlite and example BAC KUP DATABASE NOEXCLUDE; BACKUP TABLESPACE cwmlite, example; # backs up only cwmlite and example
You can disable the exclusion feature for cwmlite and examp
le as follows:
CONFIGURE EXCLUDE FOR TABLESPACE cwmlite CLEAR; CONFIGURE EXCLUDE FOR TABLESPACE example CLEAR;
RMAN includes th ese tablespaces in future whole database backups.
SHOW EXCLUDE shows how you have used the CONFIGURE EXCLUDE command to exclu
de tablespaces from whole database backups.
After connecting to the target database and rec
overy catalog (if you use one), run the SHOW EXCLUDE command. For example, enter:
RMAN> SHOW EXCLUDE; # shows the CONFIGURE EXCLUDE setting
Sample output for SHOW EXCLUDE follows:
RMAN conf iguration parameters are: CONFIGURE EXCLUDE FOR TABLESPACE 'OLD_ACCOUNTS';
See Also:
|
When performing tablespace point-in-time recovery (TSPITR) or duplicating a database using RMAN, you may want to set the names of datafiles in the auxiliary instance before startingthe actual TSPITR or database duplication.
The command for doing so is:
CONFIGURE AUXNAME FOR datafileSpec TO 'filename';
where datafileSpec identifies some datafile by its original name or datafile number, and filename is the new path for the speci
fied file.
For example, you might configure a new auxiliary name for datafile 2 as follows:
CONFIGURE AUXNAME FOR DATAFILE 2 TO '/newdisk/datafiles/df2.df;' pre>As with other settings, this
CONFIGUREsetting is persistent across RMAN sess ions until cleared usingCONFIGURE...CLEAR, as shown here:CONFI GURE AUXNAME FOR DATAFILE 2 CLEAR;If you are performing TSPITR o r running the
DUPLICATEcommand, then by usingCONFIGURE AUXNAMEyou can preconfigure the filenames for use on the auxiliary database without manually specifying the auxiliary filenames during the procedure.When renaming files with the
DUPLICATEcommand,CONFIGURE AUXNAMEis an alternative toSET NEWNAME. The difference is that after you set theAUXNAMEthe first time, you do not need to reset the filename w hen you issue anotherDUPLICATEcommand: theAUXNAMEsetting remains in effect until you issueCONFIG URE AUXNAME...CLEAR. In contrast, you must reissue theSET NEWNAMEcommand every time you rename f iles.See Chapter 10, "RMAN Tablespace Point-in-Time Re covery (TSPITR)" for more details on using
CONFIGUREAUXNAMEin connection with TSPITR, and Chapter 11, "Duplicating a Database with Recovery Manager" for more on usingCONFIGUREAUXNAME in performing database duplication. Showing the Default Filenames Configured for Auxiliary Channels
Setting the Snapshot Control File Location
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 o r when making a backup of the current control file.
The default value for the snapshot cont rol file is platform-specific and depends on the Oracle home. For example, the default filename on some UNIX platforms in Oracle Data base 10g is
$ORACLE_HOME/dbs/snapcf_@.f. Note that if you have a flash recovery area configured, the default location for the snapshot control file is not the flash recovery area.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.
Default Location of the Snapshot Control Fi le
By default, the location of the snapshot control file is determin ed by the rules in the following table:
You can see the current sn
apshot location by running the SHOW command. This example shows a snapshot location that is determined by the default ru
le:
RMAN> SHOW SNAPSHOT CONTROLFILE NAME; CONFIGURE SNAPSHOT CONTR OLFILE NAME TO '/oracle/dbs/snapcf_trgt.f'; # default
This exampl e shows a snapshot control file that has a nondefault filename:
RMAN> SHOW SNAPSHOT CON TROLFILE NAME; CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/oracle/oradata/trgt/snap_trgt.ctl';
Use the CONFIGURE SNAPSHOT CONTROLFIL
E NAME TO 'filename' command to change the name of the snapshot c
ontrol file. Subsequent snapshot control files that RMAN creates use the specified filename.
For example, start RMAN and then enter:
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/oracle/o radata/trgt/snap_trgt.ctl';
You can also set the snapshot control file name to a raw device:
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/dev/vgd_1_0/rlvt5';
If one RMAN job is already backing up the control file while anothe r needs to create a new snapshot control file, you may see the following message:
waiting f or 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 u p 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", Oracle Real Application Cl
usters Administrator's Guide for handling of snapshot control files in RAC configurations, and Oracle Database Recovery Manager Reference for |
To reset the snapshot control file locat
ion to the default, run the CONFIGURE SNAPSHOT CONTROLFILE LOCATION CLEAR command.
Issue the SHOW SNAPSHO
T CONTROLFILE command to display the value set by CONFIGURE SNAPSHOT CONTROLFILE NAME.
|
Note: In releases prior to Oracle9i, the |
To show the snapshot control file filename:
After connecting to the target database and recovery catalog (if you use one), run the SHOW SNAPSHOT
CONTROLFILE command. For example, enter:
SHOW SNAPSHOT CONTROLFILE NAME; # s hows CONFIGURE SNAPSHOT CONTROLFILE setting
Sample output for SNAPSHOT CONTROLFILE follows:
RMAN configuration p arameters are: CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/oracle/dbs/cf_snap.f';< div align="center">
| See Also:
< a href="rcmconfg.htm#1015611">"Setting the Snapshot Control File Location" to learn about the snapshot control file and its function |
RMAN cannot connect to the target database through a shared server dispatcher. RMAN 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 wh
en 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 configurat
ion varies greatly from system to system. The following procedure illustrates only one method. This scenario assumes that the followi
ng service name in the tnsnames.ora connects to the target database using the shared server architecture, where in
st1 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=inst 1)(SERVER=dedicated)) )
CONNECT SYS/oracle@inst 1_ded SELECT SERVER FROM V$SESSION WHERE SID = (SELECT DISTIN CT SID FROM V$MYSTAT); SERVER --------- D EDICATED 1 row selected.
To connect to a s hared server session, you can issue:
CONNECT SYS/oracle@inst1_shs AS SYSDBA 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-specif ic Oracle documentation and your Oracle Net Serv ices Reference Guide for a complete description of Oracle Net connect string syntax |
html>