`

Rman备份之configure语法

 
阅读更多

CONFIGURE

Syntax

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 ::=

Description of configure.gif follows

 

{ARCHIVELOG | DATAFILE } BACKUP COPIES FOR DEVICE TYPE [= ] deviceSpecifier {CLEAR | TO integer } | BACKUP OPTIMIZATION {CLEAR | OFF | ON } | EXCLUDE FOR TABLESPACE tablespace_name [CLEAR ] | MAXSETSIZE {CLEAR | TO {sizeSpec | UNLIMITED }} | RETENTION POLICY {CLEAR | TO {NONE | RECOVERY WINDOW OF integer DAYS | REDUNDANCY [= ] integer }}

backupConf ::=

Description of backupconf.gif follows

cfauConf ::=

Description of cfauconf.gif follows

CONTROLFILE AUTOBACKUP {CLEAR | FORMAT FOR DEVICE TYPE [= ] deviceSpecifier {CLEAR | TO formatSpec } | OFF | ON }

deviceConf ::=

Description of deviceconf.gif follows
Description of the illustration deviceconf.gif

Purpose

To configure persistent settings affecting RMAN backup, restore, duplication, and maintenance jobs. These configurations are in effect for any RMAN session until the configuration is cleared or changed.

Use CONFIGURE to set the following:

  • An ongoing retention policy that automatically determines which backups and copies are eligible for deletion because they are no longer needed

  • The device type (for example, DISK or sbt ) for RMAN jobs

  • The default number of channels of each device type that RMAN should allocate for automated backup and restore jobs

  • The settings for automatic channels for a specified device type

  • The maximum size of backup pieces and sets created on automatic channels

  • Backup optimization either ON or OFF

  • The exclusion policy for tablespaces in whole database backups

  • The filename of the snapshot control file

  • Filenames for files in an auxiliary database

  • The control file autobackup feature to ON or OFF

  • The default format for the control file autobackup output files

RMAN uses default settings for CONFIGURE options. You can return to the default value for any CONFIGURE command by running the same command with the CLEAR option.

See Also:

Oracle Database Backup and Recovery Basics to learn how to configure the RMAN environment

Restrictions and Usage Notes

  • Execute this command at the RMAN prompt. CONFIGURE cannot be used within a RUN block.

  • The target database must be mounted or open, because configuration settings are stored in the control file.

  • Channels allocated with ALLOCATE CHANNEL override any configured automatic channels.

  • RMAN does not simultaneously allocate automatic channels for multiple device types in BACKUP command.

  • To direct backups or restores to specific channels, use the RMAN-generated channel names. If you specify channel numbers in the CONFIGURE CHANNEL command, then RMAN uses the same numbers in the system-generated channel names.

  • If you configure channels by using the nondefault CONNECT or PARMS options to create backups or copies, then you must either use the same configured channels or manually allocate channels with the same options to restore or crosscheck these backups.

  • You cannot exclude the SYSTEM tablespace from whole database backups.

  • The REDUNDANCY and RECOVERY WINDOW options are mutually exclusive. Only one type of retention policy can be in effect at any time.

  • You cannot clear individual parameters when running CONFIGURE ... CLEAR . For example, you can run CONFIGURE CHANNEL DEVICE TYPE sbt CLEAR but not CONFIGURE CHANNEL DEVICE TYPE sbt MAXPIECESIZE 5M CLEAR .

  • The channel number in a manually numbered channel must be less than 255.

  • You must specify at least one channel option when running CONFIGURE CHANNEL . In other words, you cannot issue a command such as CONFIGURE CHANNEL 2 DEVICE TYPE DISK , but you can issue a command such as CONFIGURE CHANNEL 2 DEVICE TYPE DISK MAXPIECESIZE 2500K .

  • The CONFIGURE CONTROLFILE AUTOBACKUP FORMAT format string must include the %F substitution variable. It cannot contain any other substitution variable.

  • With Oracle Database Release 10g in a Data Guard environment, configurations can be set for standby databases as well as primary databases. All configurations except for retention policy, tablespace exclude and auxiliary names can be set to node-specific values. This means that the primary and standby databases can have different channel configurations, autobackup locations, and so on.

Keywords and Parameters

configure

Syntax Element Description
ARCHIVELOG DELETION POLICY TO ( APPLIED ON STANDBY | NONE | CLEAR ) Governs archived redo log deletion policy for the flash recovery area. Possible settings are:
  • APPLIED ON STANDBY - enables flash recovery area to delete archivelogs that are applied on mandatory standby. See Oracle Data Guard Concepts and Administration for details.

  • NONE - enables flash recovery area to delete archivelogs that are backed up to tertiary device and that are obsolete based on the configured backup retention policy. This is the default configuration.

  • CLEAR - clears the deletion policy and returns the specified configuration to default value. The default value is NONE .

AUXNAME FOR DATAFILE datafileSpec TO ' filename ' Configures the auxiliary filename for the specified target datafile to ' filename ' . For example, you can set the auxiliary name for datafile 2 to /df2.f , and then unspecify this auxiliary name by running CONFIGURE AUXNAME FOR DATAFILE 2 CLEAR .

If you are performing TSPITR or running the DUPLICATE command, then by setting AUXNAME you can preconfigure the filenames for use on the auxiliary database without manually specifying the auxiliary filenames during the procedure.

For example, use this command during TSPITR if the datafiles are on raw disk and you need to restore auxiliary datafiles to raw disk for performance reasons. Typically, you set the AUXNAME parameter in TSPITR for the datafiles of the SYSTEM tablespace and the tablespaces containing rollback segments. Do not overlay files which are in use by the production database and can be discarded after TSPITR completes. In essence, the AUXNAME of a datafile is the location where TSPITR can create a temporary copy of it.

When renaming files with the DUPLICATE command, CONFIGURE AUXNAME is an alternative to SET NEWNAME . The difference is that after you set the AUXNAME the first time, you do not need to reset the filename when you issue another DUPLICATE command: the AUXNAME setting remains in effect until you issue CONFIGURE AUXNAME ... CLEAR . In contrast, you must reissue the SET NEWNAME command every time you rename files.

See Also: Oracle Database Backup and Recovery Advanced User's Guide to learn how to perform RMAN TSPITR, and Oracle Database Backup and Recovery Advanced User's Guide to learn how to duplicate a database with RMAN

backupConf Configures default backup options such as duplexing, optimization, excluding tablespaces, backup set sizes, and retention policies.
cfauConf Configures control file autobackup settings
deviceConf Configures default backup settings for devices, such as the default backup device, channel configurations for devices, default backup types for each device, and parallelism.
ENCRYPTION Used to specify encryption settings for the database or tablespaces within the database, which apply unless overridden using the SET command. Options specified for an individual tablespace take precedence over options specified for the whole database.
ALGORITHM

{ algorithm_name |

CLEAR }

Specifies the default algorithm to use for encryption, when writing encrypted backup sets. Possible values are listed in V$RMAN_ENCRYPTION_ALGORITHMS . With CLEAR , resets the database to the default algorithm, which is AES128 .
FOR

{ DATABASE |

TABLESPACE

tablespace_name }

{ ON | OFF | CLEAR }

Specifies whether to use encryption for the database or specified tablespaces. With FOR DATABASE , the effect is as follows:

ON enables encryption for all database files,

OFF turns off encryption for all database files

CLEAR restores the default setting of OFF .

Configured settings for a tablespace always override configuration set at the database level. With FOR TABLESPACE tablespace_name , the effect is as follows:

ON means encryption is on for that tablespace, unless SET ENCRYPTION OFF FOR ALL TABLESPACES is used.

OFF means encryption is off for that tablespace, unless SET ENCRYPTION ON FOR ALL TABLESPACES is used.

CLEAR means that encryption for that tablespace is determined by the current default for the whole database.

With ON , turns on encryption for the specified tablespaces or the whole database. With OFF turns off encryption for the specified tablespaces or the whole database. With CLEAR , returns the database or tablespaces to the default setting of OFF .

SNAPSHOT CONTROLFILE NAME [ TO ' filename ' | CLEAR ] Configures the snapshot control file filename to ' filename ' . If you run CONFIGURE SNAPSHOT CONTROLFILE NAME CLEAR , then RMAN sets the snapshot control file name to its default.

The default value for the snapshot control file name is platform-specific and dependent on the Oracle home. For example, the default on some UNIX system is ?/dbs/snapcf_@.f . If you clear the control file name, and you change the Oracle home, then the default location of the snapshot control file changes as well.

See Also: Oracle Database Backup and Recovery Advanced User's Guide for more information about snapshot control files


backupConf

Syntax Element Description
{ARCHIVELOG | DATAFILE} BACKUP COPIES FOR DEVICE TYPE [=] deviceSpecifier [CLEAR |TO integer ] Specifies the number of copies of each backup set for DATAFILE (both datafiles and control files) or ARCHIVELOG files on the specified device type, from 1 (default) to 4. If duplexing is specified in the BACKUP command or in a SET BACKUP COPIES command, then the CONFIGURE setting is overridden.

Note: Control file autobackups on disk are a special case and are never duplexed. RMAN always writes one and only copy.

Note: RMAN raises an error if you try to duplex backups to the flash recovery area. You cannot duplex backups to the flash recovery area.

BACKUP OPTIMIZATION [CLEAR | OFF | ON ] Toggles backup optimization ON or OFF (default). Specify CLEAR to return optimization to its default value of OFF .

Optimization does not back up a file to a device type if the identical file is already backed up on the device type. For two files to be identical, their content must be exactly the same. You can override backup optimization by using the FORCE option of the BACKUP command.

RMAN does not signal an error if optimization causes all files to be skipped during a backup. Note that BACKUP ... DELETE INPUT deletes all specified files whether or not optimization would skip these files during a backup.

Backup optimization is enabled when all of the following conditions are met:

  • The CONFIGURE BACKUP OPTIMIZATION ON command has been run.

  • You run BACKUP DATABASE , BACKUP ARCHIVELOG with ALL or LIKE options, or BACKUP BACKUPSET ALL .

  • The RMAN job uses a channel of only one device type.

The retention policy has an effect on which files backup optimization skips.

See Also: Oracle Database Backup and Recovery Advanced User's Guide for a description of how RMAN determines that it can skip the backup of a file

EXCLUDE FOR TABLESPACE tablespace_name [ CLEAR ] Excludes the specified tablespace from BACKUP DATABASE commands. Note that you cannot exclude the SYSTEM tablespace. By default, each tablespace is not excluded, that is, the exclude functionality is disabled. The exclusion is stored as an attribute of the tablespace, not the individual datafiles, so the exclusion applies to any files that are added to this tablespace in the future. If you run CONFIGURE ... CLEAR on a tablespace after excluding it, then it returns to the default configuration of "not excluded."

You can still back up the configured tablespace by explicitly specifying it in a BACKUP command or by specifying the NOEXCLUDE option on a BACKUP DATABASE command.

MAXSETSIZE [ CLEAR | TO [ sizeSpec | UNLIMITED ] Specifies the maximum size of each backup set created on a channel. By default MAXSETSIZE is set to UNLIMITED , meaning that it is disabled.

Note: This option is ignored by BACKUP AS COPY .

RETENTION POLICY Specifies a persistent, ongoing policy for datafile and control file backups and copies that RMAN marks as obsolete, that is, not needed and eligible for deletion. As time passes, RMAN marks backups and copies as obsolete according to the criteria you specify in the retention policy. RMAN does not automatically delete any backups or copies: manually run the DELETE OBSOLETE command to remove obsolete files. By default, RETENTION POLICY is configured to REDUNDANCY 1 .

For backups, the basic unit of the retention policy is a backup set (not a backup piece) or image copy. For example, BACKUP AS BACKUPSET COPIES 4 TABLESPACE users generates a single backup set that is duplexed into four identical backup pieces. The retention policy considers this as one backup, not four separate backups.

CLEAR Resets the retention policy to its default (REDUNDANCY = 1 ).
TO RECOVERY WINDOW OF integer DAYS Specifies a time window in which RMAN should be able to recover the database. The window stretches from the current time (SYSDATE ) to the point of recoverability , which is the earliest date to which you want to recover. The point of recoverability is SYSDATE - integer days in the past.
TO REDUNDANCY integer Specifies that RMAN should retain integer backups or copies of each datafile and control file. If more than integer backups or copies exist, RMAN marks these extra files as obsolete. Then, RMAN determines the oldest of the retained backups and copies, and marks all archived logs and log backups older than this backup or copy as obsolete. The DELETE OBSOLETE command removes obsolete backups and copies as well as archived log backups and copies.
TO NONE Disables the retention policy feature. RMAN does not consider any backups or copies as obsolete.

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 %F for all devices. Any default format string specified with CONFIGURE must include the %F substitution variable.

%F is the only legal substitution variable for use in a control file autobackup format. Use of any other substitution variable is an error.

Specify CLEAR to return the format to the default %F .

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';

See Also: "formatSpec" , for the semantics of the %F substitution variable.

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:
  • After every BACKUP or CREATE CATALOG command issued at the RMAN prompt.

  • Whenever a BACKUP command within a RUN block is followed by a command that is not BACKUP .

  • At the end of every RUN block if the last command in the block was BACKUP .

  • After database structural changes such as adding a new tablespace, altering the state of a tablespace or datafile (for example, bringing it online), adding a new online redo log, renaming a file, adding a new redo thread, and so forth. This type of autobackup, unlike autobackups that occur in the preceding circumstances, goes only to disk. You can run CONFIGURE CONTROLFILE AUTOBACKUP FOR DEVICE TYPE DISK to set a nondefault disk location.

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 %F (refer to entry for CONFIGURE CONTROLFILE AUTOBACKUP FORMAT for an explanation of this substitution variable). You can change the location and filename format with the CONFIGURE CONTROLFILE AUTOBACKUP FORMAT and SET CONTROLFILE AUTOBACKUP FORMAT commands.


deviceConf

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;
CONFIGURE CHANNEL DEVICE TYPE sbt FORMAT 'bkup_%U';

The second command erases the MAXPIECESIZE setting of the first command.

If AUXILIARY is specified, then this configuration is used only for channels allocated at the auxiliary instance. Specify configuration information for auxiliary channels if they require different parameters from the channels allocated at the target instance. If no auxiliary device configuration is specified, then RMAN configures any auxiliary channels using the target database device configuration.

See Also: Oracle Database Backup and Recovery Advanced User's Guide to learn how configure automatic channels specified by channel number

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:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '+dgroup1';

See Also: "allocOperandList"

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 BACKUP command only allocates channels of the default device type. For example, if you configure automatic channels for DISK and sbt and set the default device type to DISK , then RMAN only allocates disk channels when you run the BACKUP DATABASE command. You can override this behavior either by manually allocating channels in a RUN command, or by specifying DEVICE TYPE on the BACKUP command itself.

The RESTORE command allocates automatic channels of all configured device types, regardless of the default device type. The RESTORE command obeys the PARALLELISM setting for each configured device type.

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 COPY option is not supported.

The default for DISK is BACKUPSET .

If the backup type is set to BACKUPSET , the BACKUP command always produces backup sets regardless of which media the backup is produced on. With the COMPRESSED option, the backupsets produced will use binary compression.

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 $ORACLE_HOME/dbs ). The default format for backup filenames is %U .

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 PARALLELISM parameter sets the number of automatic channels of the specified device type allocated for RMAN jobs. RMAN always allocates the number of channels set by PARALLELISM , although it may use only a subset of these channels.

By default, PARALLELISM = 1 . Specifying CLEAR for a device type resets its settings to the default. For example, you can set PARALLELISM for disk backups to 3 . If you configure automatic channels of type disk and tape, and set the default device type as disk, then RMAN allocates three disk channels when you run BACKUP DATABASE at the RMAN prompt.

To change the parallelism for a device type to n , run a new CONFIGURE DEVICE TYPE ... PARALLELISM n command. For example, you can change configure PARALLELISM to 3 for sbt and then change it to 2 as follows:

CONFIGURE DEVICE TYPE sbt PARALLELISM 3;
CONFIGURE DEVICE TYPE sbt PARALLELISM 2;

Note: If you configure n manually numbered channels, the PARALLELISM setting can be greater than or less than n . For example, you can manually number 10 automatic channels and configure PARALLELISM to 2 or 12 .


Examples

Configuring Backup Optimization: Example  This example configures RMAN so that the BACKUP command does not back up files to a device type if the identical file has already been backed up to the device type:

CONFIGURE BACKUP OPTIMIZATION ON;

Configuring a Retention Policy: Example  This example configures a retention policy with a recovery window of 2 weeks, and then resets the retention policy to its default value of REDUNDANCY = 1 :

CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 14 DAYS;
CONFIGURE RETENTION POLICY CLEAR;

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;

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';

Configuring the Snapshot Control File Location: Example  This example configures a new location for the snapshot control file and then resynchronizes the recovery catalog.

CONFIGURE SNAPSHOT CONTROLFILE NAME TO '?/oradata/snap.cf';

Excluding a Tablespace from a Whole Database Backup: Example  This example excludes the example tablespace from whole database backups, then returns the tablespace to its default value of "not excluded":

CONFIGURE EXCLUDE FOR TABLESPACE example;
CONFIGURE EXCLUDE CLEAR;

Specifying Auxiliary Filenames: Example  This example duplicates a database to a remote host with a different directory structure, by using CONFIGURE AUXNAME to specify new filenames for the datafiles:

# set auxiliary names for the datafiles 
CONFIGURE AUXNAME FOR DATAFILE 1 TO '/oracle/auxfiles/aux_1.f'; 
CONFIGURE AUXNAME FOR DATAFILE 2 TO '/oracle/auxfiles/aux_2.f'; 
CONFIGURE AUXNAME FOR DATAFILE 3 TO '/oracle/auxfiles/aux_3.f'; 
CONFIGURE AUXNAME FOR DATAFILE 4 TO '/oracle/auxfiles/aux_4.f'; 

RUN
{  
  ALLOCATE AUXILIARY CHANNEL dupdb1 TYPE DISK;
  DUPLICATE TARGET DATABASE TO dupdb 
  LOGFILE
    GROUP 1 ('?/dbs/dupdb_log_1_1.f', 
             '?/dbs/dupdb_log_1_2.f') SIZE 200K, 
    GROUP 2 ('?/dbs/dupdb_log_2_1.f', 
             '?/dbs/dupdb_log_2_2.f') SIZE 200K REUSE; 
}
# Un-specify the auxiliary names for the datafiles so that they are not overwritten 
# by mistake:
CONFIGURE AUXNAME FOR DATAFILE 1 CLEAR; 
CONFIGURE AUXNAME FOR DATAFILE 2 CLEAR; 
CONFIGURE AUXNAME FOR DATAFILE 3 CLEAR; 
CONFIGURE AUXNAME FOR DATAFILE 4 CLEAR; 

Specifying the Default Format for the Control File Autobackup: Example  This example turns on the autobackup feature, then changes the default format for the DISK and sbt devices, then clears the autobackup setting:

CONFIGURE CONTROLFILE AUTOBACKUP ON; 
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '?/oradata/%F';
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE sbt TO 'cf_auto_%F';
CONFIGURE CONTROLFILE AUTOBACKUP CLEAR;   # returns to default setting of OFF
分享到:
评论

相关推荐

    RMAN 工具使用.pdf

    一、RMAN备份 1. 配置数据库到归档模式: 在归档模式下,数据库会保存所有的事务日志,以便于在发生故障时进行恢复。要检查归档状态,可以使用`ARCHIVELOG`命令。关闭数据库后,用`STARTUP MOUNT`启动到挂载状态,...

    RMAN简明使用手册

    使用恢复目录可以更有效地管理和追踪备份信息,同时允许存储RMAN备份脚本。通过设置`CONTROL_FILE_RECORD_KEEP_TIME`参数,控制记录在控制文件中的备份信息保留时间。 6. **RMAN Repository**: RMAN仓库是存储在...

    rman简明使用手册.doc

    1. **Target Database**:这是RMAN备份的目标,即你要备份的数据库实例。 2. **RMAN Client**:客户端程序,它解析并执行备份和恢复命令,与服务器会话交互,并在控制文件中记录活动。 3. **Flash Recovery Area ...

    ORACLE RMAN 简明使用手册

    本文档基于 Oracle 10gR2 版本,旨在为用户提供一份简洁明了的 Oracle RMAN(Recovery Manager)备份与恢复命令的手册。RMAN 是 Oracle 数据库的一个重要组成部分,用于实现数据库的备份、恢复及灾难恢复等功能。 #...

    rman命令相关资料

    综上所述,“rman命令相关资料”涵盖了RMAN在Oracle数据库备份与恢复中的核心概念、命令语法以及最佳实践等方面的内容。对于Oracle数据库管理员而言,熟练掌握这些知识对于保障数据库的安全性和连续性至关重要。

    Oracle 9i RMAN参考使用手册

    2. **RMAN命令语法**:RMAN提供了丰富的命令集,如`BACKUP`用于创建备份,`RESTORE`和`RECOVER`用于恢复数据,以及`CONFIGURE`用于设置参数等。了解这些命令的用法是使用RMAN的关键。 3. **通道管理**:RMAN允许...

    oracle rman

    本书并非全面介绍备份和恢复概念的书籍,而是侧重于RMAN架构概述、备份和恢复数据库的基本方法、目录设置问题以及提供RMAN命令的快速参考语法图解等内容。 #### 二、RMAN架构 **RMAN架构**主要涉及以下几个关键...

    oracle rman 通用简明使用手册

    RMAN命令行语法** - RMAN命令行允许用户输入各种备份、恢复、报告和配置命令。 - 例如,`TARGET /`连接无恢复目录的目标数据库,`CATALOG`指定恢复目录数据库连接。 **5. 使用示例** - 在命令行输入`% rman TARGET...

    Oracle数据库备份与恢复专题.pdf

    总结来说,Oracle数据库备份与恢复涉及多种策略和工具,如exp/imp用于逻辑备份,而tar结合RMAN则提供了物理备份的解决方案。理解并熟练掌握这些工具的使用,对于保障Oracle数据库的安全运行至关重要。同时,定期进行...

    最完整的Toad For Oracle使用手册

    - **RMAN Templates**:讲述了如何使用RMAN模板进行备份和恢复操作。 - **RMAN Scripts in Toad**:介绍了如何在Toad中编写和执行RMAN脚本。 #### 九、比较与控制 - **Comparing**:涵盖了多种比较功能,如数据...

Global site tag (gtag.js) - Google Analytics