rman BackupFormatSpec

转载 2015年07月10日 10:23:03

formatSpec

Purpose

Use the formatSpec subclause 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 platform-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.

Tip:

Oracle Database SQL Language Reference to learn how to create and name Automated Storage Manager disk groups

Usage Notes

Any name that is valid 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 valid disk filename is allowed, provided it is unique.

You cannot specify an Oracle Managed Files filename as the format for a backup. For example, if +DISK1/datafile/system.732.609791431 is an OMF filename, then you cannot specify this filename in the FORMAT parameter.

Environment variables are not valid in the FORMAT parameter.

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 "Semantics" are available in FORMAT strings to aid in generating unique filenames. The formatting of this information varies by platform.

You can specify up to four FORMAT strings. RMAN uses the second, third, and fourth values only when BACKUP COPIESSET BACKUP COPIES, orCONFIGURE ... 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 the following 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.

Syntax

formatSpec::=

Description of formatspec.gif follows
Description of the illustration formatspec.gif

Semantics

formatSpec

The following table lists RMAN substitution variables that are valid in format strings.

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 (see Example 3-22).
%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 (see Example 3-22).
%F Combines the DBID, day, month, year, and sequence into a unique and repeatable generated name. This variable translates intoc-IIIIIIIIII-YYYYMMDD-QQ, where:
  • IIIIIIIIII stands for the DBID. 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 generated

  • QQ is the sequence in hexadecimal number that starts with 00 and has a maximum of 'FF' (256)

%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. This substitution variable is only valid when backing up datafiles as image copies.
%n Specifies the name of the database, padded on the right with x characters to a total length of eight characters. For example, if prod1is 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 PROXY, then the %p variable must be included in the FORMAT string either explicitly or implicitly within %U.

%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, %U specifies a convenient shorthand for%u_%p_%c that guarantees uniqueness in generated backup filenames. For an image copy of a datafile, %U means the following:

data-D-%d_id-%I_TS-%N_FNO-%f_%u

For an image copy of an archived redo log, %U means the following:

arch-D_%d-id-%I_S-%e_T-%h_A-%a_%u

For an image copy of a control file, %U means the following:

cf-D_%d-id-%I_%u

%Y Specifies the year in this format: YYYY.
%% Specifies the percent (%) character. For example, %%Y translates to the string %Y.

Example

Example 3-21 Specifying an ASM Disk Group

This example copies the database to ASM disk group DISK1:

BACKUP AS COPY DATABASE FORMAT '+DATAFILE';

Example 3-22 Specifying a Format for Datafile Copies

This example copies two datafiles with tag LATESTCOPY to directory /disk2:

BACKUP AS COPY
  COPY OF DATAFILE 27, 28
  FROM TAG 'LATESTCOPY' 
  FORMAT '/disk2/Datafile%f_Database%d';

原文:http://docs.oracle.com/cd/B28359_01/backup.111/b28273/rcmsubcl010.htm#RCMRF195

RMAN 性能优化全攻略

㈠ 发现问题      RMAN在做备份、恢复时所做的操作说起来很简单:   就是把数据从“源”读到缓冲区,然后自读缓冲区写到“目的地”、并在这个过程中完成数据块的校验工作   这一过程中会发生很多的...
  • linwaterbin
  • linwaterbin
  • 2013年04月12日 23:03
  • 3781

rman初级实操(每天自动备份并打包)

客户服务器,64位,windows环境 首先将数据库打开归档模式
  • u012366626
  • u012366626
  • 2014年09月27日 13:01
  • 1110

初识RMAN 3 :查看备份、通道和并行度配置

RMAN列出备份列表列出各个备份的信息RMAN> list backup; 备份集列表 =================== BS 关键字 类型 LV 大小 设备类型 经过时间 完成时...
  • x6_9x
  • x6_9x
  • 2015年12月04日 23:50
  • 1995

(shell)rman备份脚本

1. 全备(包括控制文件) [oracle@centos6 scripts]$ cat rman_backup.sh source /home/oracle/.bash_profile rman t...
  • gumengkai
  • gumengkai
  • 2016年12月14日 20:18
  • 1191

RMAN 提示符下执行SQL语句

在手动恢复数据库时,有时候需要在SQL*Plus提示符以及操作系统提示符,RMAN提示符下来回切换显得有些繁琐。实际上RMAN为我们提供了命令行下执行一些简单的SQL语句以及PL/SQL的方法,以避免...
  • robinson_0612
  • robinson_0612
  • 2013年06月04日 11:37
  • 6520

linux平台下RMAN 备份详解

--====================== -- RMAN 备份详解 --======================   一、数据库备份与RMAN备份的概念         1.数...
  • oMiracle12345678
  • oMiracle12345678
  • 2014年03月07日 14:05
  • 1305

RMAN实战2:ORACLE 12C 可插拔数据库的RMAN备份

主要演示了ORACLE 12C 下用RMAN对根容器和可插拔数据库的备份和恢复。 ORACLE 12C的备份根容器连接下数据库的备份确认当前连接的信息 --连接后确认个人信息 sys@CYANG> s...
  • x6_9x
  • x6_9x
  • 2015年12月14日 20:11
  • 1074

Oracle数据库备份与恢复 - RMAN备份

如果要说DBA工作中最重要的职责(没有之一),那无疑就是保证客户数据的安全和完整,可以看到几乎任何一本Oracle DBA的技术书籍一定都会把大篇幅来介绍数据库的备份与恢复,从中也可以看到备份和恢复的...
  • pan_tian
  • pan_tian
  • 2015年07月05日 23:10
  • 4547

linux 下RMAN备份shell脚本

RMAN备份对于Oracle数据库的备份与恢复简单易用,成本低廉。对于使用非catalog方式而言,将RMAN脚本嵌入到shell脚本,然后再通过crontab来实现中小型数据库数据库备份无疑是首选。...
  • robinson_0612
  • robinson_0612
  • 2012年09月28日 16:56
  • 19015

Oracle的rman备份与恢复

1、开启归档模式 查看是否处于归档模式 SQL> archive log list Database log mode             No Archive Mode Automatic ...
  • fly43108622
  • fly43108622
  • 2015年11月27日 16:03
  • 4276
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:rman BackupFormatSpec
举报原因:
原因补充:

(最多只允许输入30个字)