RMAN备份-使用相同命令的不同输出

时间:2019-02-04 21:55:14

标签: oracle oracle11g oracle11gr2 rman

当我将语法的一部分保留在中间,而将语法的另一部分保留在最后时,我将看到使用“格式关键字”的RMAN'备份数据库'命令的不同输出或行为,如上文所述。以下情况

在以下情况1中-我在中间使用了format关键字,并将备份集保存在定义的位置,但是,如果在末尾使用与format关键字相同的命令,它将备份件存储在ORACLE_HOME / dbs位置。不知道为什么要这么做。任何想法都是非常可取的。

注意:-未启用FRA参数,因为在使用case2时将备份件存储到FRA位置。

案例1:-在中间使用format关键字。

RMAN> backup format '/o/export/export/cold_test/backup_%U_%u_%t_%d' incremental level 0 database plus archivelog ;


Starting backup at 04-FEB-19
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=283 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=16 RECID=16 STAMP=999351604
input archived log thread=1 sequence=17 RECID=17 STAMP=999351609
input archived log thread=1 sequence=18 RECID=18 STAMP=999351923
channel ORA_DISK_1: starting piece 1 at 04-FEB-19
channel ORA_DISK_1: finished piece 1 at 04-FEB-19
piece handle=/o/export/export/cold_test/backup_1stp1pjj_1_1_1stp1pjj_999351923_TEST tag=TAG20190204T134523 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 04-FEB-19

Starting backup at 04-FEB-19
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=+DATA_01/TEST/DATAFILE/tnext_indx.dbf
input datafile file number=00005 name=+DATA_01/TEST/DATAFILE/tnext_data.dbf
input datafile file number=00007 name=+DATA_01/TEST/DATAFILE/tnext_data02.dbf
input datafile file number=00008 name=+DATA_01/TEST/DATAFILE/tnext_data03.dbf
input datafile file number=00003 name=+DATA_01/TEST/DATAFILE/sysaux.dbf
input datafile file number=00001 name=+DATA_01/TEST/DATAFILE/system.dbf
input datafile file number=00004 name=+DATA_01/TEST/DATAFILE/undotbs1.dbf
input datafile file number=00006 name=+DATA_01/TEST/DATAFILE/users.dbf
channel ORA_DISK_1: starting piece 1 at 04-FEB-19
channel ORA_DISK_1: finished piece 1 at 04-FEB-19
piece handle=/o/export/export/cold_test/backup_1ttp1pjk_1_1_1ttp1pjk_999351924_TEST tag=TAG20190204T134524 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 04-FEB-19
channel ORA_DISK_1: finished piece 1 at 04-FEB-19
piece handle=/o/export/export/cold_test/backup_1utp1pjr_1_1_1utp1pjr_999351931_TEST tag=TAG20190204T134524 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 04-FEB-19

Starting backup at 04-FEB-19
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=19 RECID=19 STAMP=999351933
channel ORA_DISK_1: starting piece 1 at 04-FEB-19
channel ORA_DISK_1: finished piece 1 at 04-FEB-19
piece handle=/o/export/export/cold_test/backup_1vtp1pjt_1_1_1vtp1pjt_999351933_TEST tag=TAG20190204T134533 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 04-FEB-19

RMAN>

情况2:在备份命令末尾使用format关键字。

RMAN> backup incremental level 0 database plus archivelog format '/o/export/export/cold_test/backup_%U_%u_%t_%d' ;


Starting backup at 04-FEB-19
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=283 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=16 RECID=16 STAMP=999351604
input archived log thread=1 sequence=17 RECID=17 STAMP=999351609
input archived log thread=1 sequence=18 RECID=18 STAMP=999351923
input archived log thread=1 sequence=19 RECID=19 STAMP=999351933
input archived log thread=1 sequence=20 RECID=20 STAMP=999352079
input archived log thread=1 sequence=21 RECID=21 STAMP=999352087
input archived log thread=1 sequence=22 RECID=22 STAMP=999358913
channel ORA_DISK_1: starting piece 1 at 04-FEB-19
channel ORA_DISK_1: finished piece 1 at 04-FEB-19
piece handle=/o/export/export/cold_test/backup_29tp20e1_1_1_29tp20e1_999358913_TEST tag=TAG20190204T154153 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 04-FEB-19

Starting backup at 04-FEB-19
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=+DATA_01/TEST/DATAFILE/tnext_indx.dbf
input datafile file number=00005 name=+DATA_01/TEST/DATAFILE/tnext_data.dbf
input datafile file number=00007 name=+DATA_01/TEST/DATAFILE/tnext_data02.dbf
input datafile file number=00008 name=+DATA_01/TEST/DATAFILE/tnext_data03.dbf
input datafile file number=00003 name=+DATA_01/TEST/DATAFILE/sysaux.dbf
input datafile file number=00001 name=+DATA_01/TEST/DATAFILE/system.dbf
input datafile file number=00004 name=+DATA_01/TEST/DATAFILE/undotbs1.dbf
input datafile file number=00006 name=+DATA_01/TEST/DATAFILE/users.dbf
channel ORA_DISK_1: starting piece 1 at 04-FEB-19
channel ORA_DISK_1: finished piece 1 at 04-FEB-19
piece handle=/o/oracle/DB12102/dbs/2atp20e2_1_1 tag=TAG20190204T154154 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 04-FEB-19
channel ORA_DISK_1: finished piece 1 at 04-FEB-19
piece handle=/o/oracle/DB12102/dbs/2btp20e6_1_1 tag=TAG20190204T154154 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 04-FEB-19

Starting backup at 04-FEB-19
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=23 RECID=23 STAMP=999358920
channel ORA_DISK_1: starting piece 1 at 04-FEB-19
channel ORA_DISK_1: finished piece 1 at 04-FEB-19
piece handle=/o/export/export/cold_test/backup_2ctp20e8_1_1_2ctp20e8_999358920_TEST tag=TAG20190204T154200 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 04-FEB-19

RMAN>

谢谢, DBA

1 个答案:

答案 0 :(得分:0)

backup命令包含两种密钥文件格式。第一种密钥格式定义数据库本身的备份文件的位置和格式,第二种密钥格式定义存档日志的备份文件的位置和格式。

RMAN> backup format '/o/export/export/cold_test/backup_%U_%u_%t_%d'  incremental level 0 database plus archivelog format '/o/export/export/cold_test/backup_%U_%u_%t_%d' ;