rman中format参数(format_String clause)

我们经常在使用rman来备份数据库。在使用format指定备份集名称,经常会使用%U等参数,这些参数是什么意思呢?下面开始详细的介绍。


%c  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. 
	-->备份片的拷贝数,在一组备份片内。如果没有设置多备份集,那么这个参数默认设置为1并且0个拷贝片。如果设置了多备份集,这个变量显示的是拷贝数。%c的最大值时256.
	-->这个参数很少用到。使用场景是需要将备份集保存到2个以及2个以上路径时使用。
	-->如果将备份集保存到2个以上路径,需要rman做如下设置
	-->CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 2;
	-->CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 2;
	-->在format '路径1','路径2'
	
%d  The name of the database. 
	-->数据库名称

%D  The current day of the month (in format DD)
	-->日期

%F  Combination of DBID, day, month, year, and sequence into a unique
    and repeatable generated name. 
	-->复合format == c-IIIIIIIIII-YYYYMMDD-QQ,其中IIIIIIIIII为dbid,YYYYMMDD为年月日,QQ为十六进制的备份片的多个copy的序号(00-ff)

%M  The month (format MM)
	-->月份

%n  The name of the database, padded on the right with x characters
    to a total length of eight characters. (AKA: Porn star alias name)
    For example, if the scott is the database name, %n= scottxxx. 
	-->数据库的8位长度的db_name,不足部分用“x”后面填充

%p  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  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  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. 
	-->备份集的timestamp

%T  The year, month, and day (YYYYMMDD)
	-->时间格式

%u  An 8-character name constituted by compressed representations of
    the backup set number and the time the backup set was created. 
	-->8位的唯一序列号

%U  A convenient shorthand for %u_%p_%c that guarantees uniqueness in
    generated backup filenames.
    If you do not specify a format, RMAN uses %U by default. 
	-->复合format %u_%p_%c

%Y  The year (YYYY)
	-->年

%%  Specifies the '%' character. e.g. %%Y translates to %Y. 
	-->这个很少使用


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值