CONFIGURE
CONFIGURE {ARCHIVELOG DELETION POLICY {CLEAR | TO {APPLIED ON STANDBY | NONE }} | AUXNAME FOR DATAFILE datafileSpec {CLEAR | TO ' filename '} | backupConf | cfauConf | deviceConf | ENCRYPTION {ALGORITHM CLEAR | FOR {DATABASE | TABLESPACE tablespace_name } {ON | OFF | CLEAR } | ALGORITHM quoted_string } | SNAPSHOT CONTROLFILE NAME {CLEAR | TO ' filename '}}
configure ::=
cfauConf ::=
CONTROLFILE AUTOBACKUP {CLEAR | FORMAT FOR DEVICE TYPE [= ] deviceSpecifier {CLEAR | TO formatSpec } | OFF | ON }
deviceConf ::=
[AUXILIARY ] CHANNEL [integer ] DEVICE TYPE [= ] deviceSpecifier {allocOperandList | CLEAR } | DEFAULT DEVICE TYPE {CLEAR | TO deviceSpecifier } | DEVICE TYPE [= ] deviceSpecifier {CLEAR | {BACKUP TYPE TO {[COMPRESSED ] BACKUPSET | COPY } | PARALLELISM integer } [ {BACKUP TYPE TO {[COMPRESSED ] BACKUPSET | COPY } | PARALLELISM integer }]...}
cfauConf
Syntax Element | Description |
---|---|
CONTROLFILE AUTOBACKUP | Controls the control file autobackup feature. By default, this feature is not enabled. |
CLEAR | Returns the feature to its default setting of OFF . |
FORMAT FOR DEVICE TYPE deviceSpecifier [ CLEAR | TO formatSpec ] | Configures the default filename format for the control file autobackup on the specified device type. If a flash recovery area is enabled, then RMAN creates the disk autobackup in the flash recovery area. Otherwise, RMAN creates it in an operating system specific location (?/dbs on Unix and Windows). By default, the initial format is
Specify The formatSpec can specify an Automatic Storage Management disk group. The following example configures a channel for an ASM disk group: CONFIGURE CONTROLFILE AUTOBACKUP FOR DEVICE TYPE DISK TO '+dgroup1';本文末尾附deviceSpecifier和formatSpec |
OFF | Disables the autobackup feature. (OFF is the default value.) When this command is OFF , any BACKUP command that includes datafile 1 (including BACKUP DATABASE ) automatically includes the current control file and server parameter file in the backup set. Otherwise, RMAN does not include these files. |
ON | If CONFIGURE CONTROLFILE AUTOBACKUP is ON (by default it is OFF ), then RMAN performs a control file autobackup in the following circumstances:
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, the database writes a message containing the complete path of the backup piece and the device type to the alert log. The default location for the autobackup on disk is the flash recovery area (if configured) or a platform-specific location (if not configured). RMAN automatically backs up the current control file using the default format of |
Syntax Element | Description |
---|---|
[AUXILIARY] CHANNEL [ integer ] DEVICE TYPE deviceSpecifier | Specifies the standard or AUXILIARY channel that you are configuring or clearing, as well as the device type (DISK or sbt ) of the channel. Either configure a generic channel or specify a channel number, where integer is less than 255 . If you configure a generic channel (that is, if you do not specify a channel number), then RMAN uses the generic settings for every parallelized channel except any channel number that you have explicitly configured. A generic channel setting specifies options for all channels not configured explicitly. For generic channels of a specified device type, a new command erases previous settings for this device type. Assume that you run these commands: CONFIGURE CHANNEL DEVICE TYPE sbt MAXPIECESIZE 1G; The second command erases the If |
allocOperandList | Specifies control options for the allocated channel. Note that the FORMAT parameter can specify an Automatic Storage Management disk group. The following example configures a channel for an ASM disk group: |
CLEAR | Clears the specified channel. For example, CONFIGURE CHANNEL 1 DEVICE TYPE DISK CLEAR returns only channel 1 to its default, whereas CONFIGURE CHANNEL DEVICE TYPE DISK CLEAR returns the generic disk channel to its default. Note that you cannot specify any other channel options (for example, PARMS ) when you specify CLEAR . |
DEFAULT DEVICE TYPE [ TO deviceSpecifier | CLEAR ] | Specifies the default device type for automatic channels. By default, DISK is the default device type. CLEAR returns the default device type to DISK . By default, the The |
DEVICE TYPE [ = ] deviceSpecifier | Specifies the device type (disk or sbt) to which to apply the settings specified in this CONFIGURE command. |
CLEAR | Resets backup type and parallelism settings for this device to their defaults.. |
BACKUP TYPE TO [ COPY | [ COMPRESSED ] BACKUPSET] | Configures the default backup type for disk or tape backups to either BACKUPSET, COMPRESSED BACKUPSET or COPY . For sbt devices the The default for If the backup type is set to The default location for disk backups is the flash recovery area, if one is configured; otherwise, backups are stored in a platform-specific location (for Unix and Windows, this is |
PARALLELISM integer | Configures the device types that are eligible for use in jobs that use automatic channels and sets the degree of channel parallelism (DISK is the default). The By default, To change the parallelism for a device type to CONFIGURE DEVICE TYPE sbt PARALLELISM 3; Note: If you configure |
Examples
Configuring Automatic Disk and Tape Channels: Example This example configures generic DISK
and sbt
channels, sets the default device type to sbt
, and sets PARALLELISM
to 3
:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/?/%U'; CONFIGURE CHANNEL DEVICE TYPE sbt PARMS 'ENV=(NSR_SERVER=bksrv1)'; CONFIGURE DEFAULT DEVICE TYPE TO sbt; CONFIGURE DEVICE TYPE sbt PARALLELISM 3;
Overriding the Default Device Type: Example This example configures the default device type to sbt
, backs up the archived logs on the default sbt
channel, and then backs up the database to disk on the default disk channel:
CONFIGURE CHANNEL DEVICE TYPE sbt PARMS 'ENV=(NSR_SERVER=bksrv1)';
CONFIGURE DEFAULT DEVICE TYPE TO sbt;
BACKUP ARCHIVELOG ALL;
BACKUP DEVICE TYPE DISK DATABASE;
PARMS = ' channel_parms ' | Specifies parameters for the device to allocate. Do not use this port-specific string if you have specified DEVICE TYPE DISK .
|
'ENV=( var1 = val1 , var2 = val2 ,...)' | Specifies one or more environment variables required by the media management vendor in the server session corresponding to this RMAN client. Because RMAN is a client program, the PARMS="ENV=(TAPE_SERVER=srv1)" |
Configuring Automatic Channels Across File Systems: Example This example configures automatic disk channels across three file systems:
CONFIGURE DEVICE TYPE DISK PARALLELISM 3;
CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAT '/disk1/backup/%U';
CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT '/disk2/backup/%U';
CONFIGURE CHANNEL 3 DEVICE TYPE DISK FORMAT '/disk3/backup/%U';
BACKUP DEVICE TYPE DISK DATABASE PLUS ARCHIVELOG;
Configuring Automatic Channels in an Oracle Real Application Clusters Configuration: Example This example allocates automatic sbt
channels for two nodes of an Oracle Real Application Clusters database:
CONFIGURE DEVICE TYPE sbt PARALLELISM 2;
CONFIGURE DEFAULT DEVICE TYPE TO sbt;
CONFIGURE CHANNEL 1 DEVICE TYPE sbt CONNECT 'SYS/change_on_install@node1'
PARMS 'ENV=(NSR_SERVER=bkserv1)';
CONFIGURE CHANNEL 2 DEVICE TYPE sbt CONNECT 'SYS/change_on_install@node2'
PARMS ENV=(NSR_SERVER=bkserv2)';
Clearing Automatic Channels: Example This example clears manually numbered DISK
channels 2
and 3
and the generic sbt
channel:
CONFIGURE CHANNEL 2 DEVICE TYPE DISK CLEAR;
CONFIGURE CHANNEL 3 DEVICE TYPE DISK CLEAR;
CONFIGURE CHANNEL DEVICE TYPE sbt CLEAR;
Configuring and Clearing Parallelism: Example This example sets DISK
parallelism to 2
, then changes it to 3
, then returns it to the default parallelism of 1
:
CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
CONFIGURE DEVICE TYPE DISK PARALLELISM 3;
CONFIGURE DEVICE TYPE DISK CLEAR;
Configuring Backup Copies: Example This example configures duplexing to 3
for DISK
backups of datafiles and control files (control file autobackups on disk are a special case and are never duplexed) and then runs a database backup, specifying three different file systems for the copies:
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 3;
BACKUP DEVICE TYPE DISK DATABASE
FORMAT '/disk1/backup/%U', '/disk2/backup/%U', '/disk3/backup/%U';
deviceSpecifier
deviceSpecifier::=
Description of the illustration devicespecifier.gif
A subclause specifying the type of storage for a backup or copy.
Syntax Element | Description |
---|---|
DISK | Specifies disk storage device. |
'media_device' | Specifies a sequential I/O device or access method for storage. The syntax and semantics of sequential I/O device types are platform-specific. Example values are sbt and sbt_tape (with or without quotes). These values are synonymous. The |
Allocating a Tape Channel: Example This example allocates a maintenance channel for a media management device:
ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE sbt;
Backing Up to Disk: Example This example backs up the database to disk:
BACKUP DEVICE TYPE DISK DATABASE;
Restoring from Tape: Example This example restores archived logs from tape:
RESTORE DEVICE TYPE sbt ARCHIVELOG ALL;
formatSpec
formatSpec::=
Description of the illustration formatspec.gif
To specify a filename format or an Automatic Storage Management disk group for a backup piece or image copy. If you do not specify a value for the FORMAT
parameter, then RMAN either creates the backup in the flash recovery area if it is enabled, or in a port-specific directory (for example, ?/dbs
on UNIX) if a flash recovery area is not enabled. In either case, RMAN uses the variable %U
to name the backup.
The entire format_string
is processed in a port-specific manner by the target instance to derive the final backup piece name. The substitution variables listed in "Keywords and Parameters" are available in FORMAT
strings to aid in generating unique filenames. The formatting of this information varies by platform.
Order of Precedence for Multiple Format Strings
You can specify up to four FORMAT
strings. RMAN uses the second, third, and fourth values only when BACKUP
COPIES
, SET
BACKUP
COPIES
, or CONFIGURE
...
BACKUP
COPIES
is in effect. When choosing the format for each backup piece, RMAN uses the first format value for copy 1, the second format value for copy 2, and so on. If the number of format values exceeds the number of copies, then the extra formats are not used. If the number of format values is less than the number of copies, then RMAN reuses the format values, starting with the first one.
Specify format_string
in any of these places, listed in order of precedence:
-
The
backupSpec
clause -
The BACKUP command
-
The ALLOCATE CHANNEL command
-
The CONFIGURE
CHANNEL
command
If specified in more than one of these places, then RMAN searches for the FORMAT
parameter in the order shown.
Any name that is legal as a sequential filename on the platform is allowed, so long as each backup piece or copy has a unique name. If backing up to disk, then any legal disk filename is allowed, provided it is unique.
Syntax Element | Description |
---|---|
%a | Specifies the activation ID of the database. |
%c | Specifies the copy number of the backup piece within a set of duplexed backup pieces. If you did not duplex a backup, then this variable is 1 for backup sets and 0 for proxy copies. If one of these commands is enabled, then the variable shows the copy number. The maximum value for %c is 256. |
%d | Specifies the name of the database. |
%D | Specifies the current day of the month from the Gregorian calendar in format DD . |
%e | Specifies the archived log sequence number. |
%f | Specifies the absolute file number. |
%F | Combines the DBID, day, month, year, and sequence into a unique and repeatable generated name. This variable translates into c-IIIIIIIIII-YYYYMMDD-QQ , where:
|
%h | Specifies the archived redo log thread number. |
%I | Specifies the DBID. |
%M | Specifies the month in the Gregorian calendar in format MM . |
%N | Specifies the tablespace name. |
%n | Specifies the name of the database, padded on the right with x characters to a total length of eight characters. For example, if the prod1 is the database name, then the padded name is prod1xxx . |
%p | Specifies the piece number within the backup set. This value starts at 1 for each backup set and is incremented by 1 as each backup piece is created. Note: If you specify |
%s | Specifies the backup set number. This number is a counter in the control file that is incremented for each backup set. The counter value starts at 1 and is unique for the lifetime of the control file. If you restore a backup control file, then duplicate values can result. Also, CREATE CONTROLFILE initializes the counter back to 1 . |
%t | Specifies the backup set time stamp, which is a 4-byte value derived as the number of seconds elapsed since a fixed reference time. The combination of %s and %t can be used to form a unique name for the backup set. |
%T | Specifies the year, month, and day in the Gregorian calendar in this format: YYYYMMDD . |
%u | Specifies an 8-character name constituted by compressed representations of the backup set or image copy number and the time the backup set or image copy was created. |
%U | Specifies a system-generated unique filename (default). The meaning of %U is different for image copies and backup pieces. For a backup piece, For an image copy of a datafile,
For an image copy of an archived redo velog, %U means the following:
For an image copy of a control file, %U means the following:
|
%Y | Specifies the year in this format: YYYY . |
%% | Specifies the literal ' % ' character. For example, %%Y translates to the string %Y . |
Specifying an ASM Disk Group: Example This example copies the database to ASM disk group disk1
:
BACKUP AS COPY DATABASE FORMAT '+disk1';
Specifying a Format for Datafile Copies: Example This example creates copies of three datafiles with tag 'LATESTCOPY
' to directory /copies
:
# Create copies of 3 datafiles with tag 'LATESTCOPY' to directory /copies
BACKUP AS COPY
FROM TAG 'LATESCOPY'
COPY OF DATAFILE 4, 6, 14
FORMAT '/copies/Datafile%f_Database%d';
Creating a Database Copy for Use as a Standby Database: Example This example creates an image copy of the database to instantiate a physical standby in /stby:
# Create an image copy of the database to instantiate physical standby in /stby
BACKUP AS COPY
DATABASE
FORMAT '/stby/standby_file_%f_of_db_%I';
参考至:http://download.oracle.com/docs/cd/B19306_01/backup.102/b14194/rcmsynta015.htm
http://download.oracle.com/docs/cd/B19306_01/backup.102/b14194/rcmsynta006.htm#i78513
http://download.oracle.com/docs/cd/B19306_01/backup.102/b14194/rcmsynta025.htm#i81605
http://download.oracle.com/docs/cd/B19306_01/backup.102/b14194/rcmsynta033.htm#i82206
本文原创,转载请注明出处、作者
如有错误,欢迎指正
邮箱:czmcj@163.com