rman BackupFormatSpec
2015-07-10 10:23
323 查看
formatSpec
PurposeUse the
formatSpecsubclause
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
FORMATparameter,
then RMAN either creates the backup in the flash recovery area if it is enabled, or in a platform-specific directory (for example,
?/dbson
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.609791431is
an OMF filename, then you cannot specify this filename in the
FORMATparameter.
Environment variables are not valid in the
FORMATparameter.
The entire
format_stringis
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
FORMATstrings
to aid in generating unique filenames. The formatting of this information varies by platform.
You can specify up to four
FORMATstrings.
RMAN uses the second, third, and fourth values only when
BACKUP
COPIES,
SET
BACKUP COPIES, or
CONFIGURE
... BACKUP COPIESis 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_stringin
any of the following places, listed in order of precedence:
The
backupSpecclause
The
BACKUPcommand
The
ALLOCATE CHANNELcommand
The
CONFIGURE
CHANNELcommand
If specified in more than one of these places, then RMAN searches for the
FORMATparameter
in the order shown.
Syntax
formatSpec::=
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 %cis 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: IIIIIIIIIIstands for the DBID. The DBID is printed in decimal so that it can be easily associated with the target database. YYYYMMDDis a time stamp in the Gregorian calendar of the day the backup is generated 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 xcharacters 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 1for each backup set and is incremented by 1 as each backup piece is created. Note: If you specify PROXY, then the %pvariable must be included in the FORMATstring 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 1and is unique for the lifetime of the control file. If you restore a backup control file, then duplicate values can result. Also, CREATE CONTROLFILEinitializes 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 %sand %tcan 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 %Uis different for image copies and backup pieces. For a backup piece, %Uspecifies a convenient shorthand for %u_%p_%cthat guarantees uniqueness in generated backup filenames. For an image copy of a datafile, %Umeans the following: data-D-%d_id-%I_TS-%N_FNO-%f_%u For an image copy of an archived redo log, %Umeans the following: arch-D_%d-id-%I_S-%e_T-%h_A-%a_%u For an image copy of a control file, %Umeans the following: cf-D_%d-id-%I_%u |
%Y | Specifies the year in this format: YYYY. |
%% | Specifies the percent (%) character. For example, %%Ytranslates to the string %Y. |
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
LATESTCOPYto
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
相关文章推荐
- QT交通标识牌测试数据集分类整理
- stl之deque
- seekbar的尺寸定义精要
- 7月8日全球六大国际域名解析量统计报告
- NGUI制作Word图文混排效果
- 九:二叉搜索树与双向链表(二叉搜索树转为有序双向链表)
- 断电造成ORA-00600: internal error code, arguments: [4194]
- C#开发Unity游戏教程循环遍历做出判断及Unity游戏示例
- C#分页
- highcharts 时间少8小时问题
- Nginx 负载均衡模块 ngx_http_upstream_module 详述
- Redis Sentinel:集群Failover解决方案
- 常用正则表达式
- 启动或者关闭系统
- @RequestMapping 用法详解之地址映射
- Codeforces Round #287 (Div. 2) E. Breaking Good 最短路
- Mac无法读取外置硬盘怎么办?
- 怎么样算是心浮气躁?
- UML中的六大关系
- google protocol buffer的原理和使用(四)