rman backup format 就不会放到FRA中计算

Can RMAN Duplex Backups to Fast Recovery Area (FRA) and a Disk Location? (Doc ID 434222.1)    To BottomTo Bottom    

SOLUTION
If you are backing up to the FRA, you cannot simultaneously duplex/multiplex the backup to a file system disk location.    Well, unfortunately, you can't do it in one command .
First you have to back it up the FRA and then you backup the backupset to your secondary disk location

The elaborate way to do this is write a script to fetch the backupset keys and embed them in a script

You can use the following as temporary solutions

Example:
=======

1) First write to disk

RMAN> backup datafile 4 format 'C:\<backup directory>\%U';

Starting backup at 30-MAY-07
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00004 name=+<diskgroup>/<db name>/datafile/users.260.623685049
channel ORA_DISK_1: starting piece 1 at 30-MAY-07
channel ORA_DISK_1: finished piece 1 at 30-MAY-07
piece handle=C:\<backup directory>\09IJ1P4F_1_1 tag=TAG20070530T183351 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 30-MAY-07

RMAN> list backup of datafile 4;

List of Backup Sets
===================

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
7 Full 88.00K DISK 00:00:01 30-MAY-07
BP Key: 14 Status: AVAILABLE Compressed: NO Tag: TAG20070530T183351
Piece Name: C:\<backup directory>\09IJ1P4F_1_1
List of Datafiles in backup set 7
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
4 Full 407470 30-MAY-07 +<diskgroup>/<db name>/datafile/users.260.623685049

RMAN> backup backupset 7;

Starting backup at 30-MAY-07
using channel ORA_DISK_1
input backupset count=9 stamp=623961231 creation_time=30-MAY-07
channel ORA_DISK_1: starting piece 1 at 30-MAY-07
channel ORA_DISK_1: backup piece C:\<backup directory>\09IJ1P4F_1_1
piece handle=+<diskgroup>/<db name>/backupset/2007_05_30/nnndf0_0.351.623961271 comment=NONE
channel ORA_DISK_1: finished piece 1 at 30-MAY-07
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:00
Finished backup at 30-MAY-07

2) Backup database to FRA
RMAN> backup incremental level 0 database tag 'backup_db';

Second
----------

# Backup backupsets completed in the last 12 hours to the other local disk location

RMAN> backup format 'c:\<backup directory>\backup_%d_l0_bk%s_pc%p_cp%c_%T'
backupset completed after 'sysdate - 12/24';

OR

#Get all backupsets backed up after you back up to FRA

RMAN> Backup backupset all format 'C:\...';

If you try to accomplish this with the following:

RMAN> backup
        copies 2
        incremental level 0
        database tag 'backup_db'
        format '+<fra diskgroup>/<db name>/backupset/data_%d_l0_bsk%s_pc%p_cp%c_%T',
               'C:\<backup directory>\data_%d_l0_bsk%s_pc%p_cp%c_%T';

Yes, you will end up with a backup in the location '+<fra diskgroup>/<db name>/backupset/' and 'C:\<backup directory>\'.   However, while there is a copy of the backup in the 
+<fra diskgroup> diskgroup, the backup will not be registered by the database as residing in the FRA.   So you are not take the benefits of automatic space management of the FRA. 
The moment you use a format with the backup command, that file (regardless of it's true location) is not considered as residing in the FRA. 

If you were to issue the rman "catalog recovery area" command, it would not allow a new entry for that same backup.  Instead, it returns a message similar to the following:


RMAN> catalog recovery area;

starting full resync of recovery catalog
full resync complete
searching for all files in the recovery area
no files found to be unknown to the database

List of files in Recovery Area not managed by the database
==========================================================
File Name: +<diskgroup>/<db name>/backupset/...................
RMAN-07526: Reason: File is not an Oracle Managed File
File Name: +<diskgroup>/<db name>/backupset/...................
RMAN-07526: Reason: File is not an Oracle Managed File


Number of files not managed by recovery area is 2, totaling 85GB   If you were to query the database as to the use of the FRA, you would see that the backup is not counted in the backuppiece section.

SQL> select * from v$flash_recovery_area_usage;

FILE_TYPE   PERCENT_SPACE_USED  PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
------------ ------------------ ------------------------- ---------------
CONTROLFILE                 .01                         0               1
ONLINELOG                   .33                         0              10
ARCHIVELOG                 3.57                         0             165
BACKUPPIECE                   0                         0               0
IMAGECOPY                     0                         0               0
FLASHBACKLOG              33.74                     33.66            1369

While something is being written to the FRA it will be stored in the FRA's physical location.  However,  the FRA points  to so, in in the example above the format clause of the
backup command is sending the backup to the physical  location '+<fra diskgroup>/<db name>/backupset' (not the FRA) and 'g:\<backup directory>'.

There is no way to specify the FRA as a destination in a format clause, so if you have format in your backup  statement, by definition, you are not sending anything to the FRA.

To summarize, writing to the FRA will store files in +<fra diskgroup>, but writing files to +<fra diskgroup>; does not  necessarily store them in the FRA.

So, is there a way for getting rman to store the backup files in the FRA and in another disk location

Reference
=======

From the Oracle® Database Backup and Recovery Reference BACKUP
Note: Duplexing cannot be used when creating files in the flash recovery area.

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值