oracle11g, rman备份的路径应该是这样的优先级
备份语句中指定的format>rman 中显现的configure channel device type disk format '/oracle/orclarch/%U_%d'的路径>闪回恢复区>$ORACLE_HOME/dbs
下面实验过程:
1,备份语句中如果指定了format,那么优先选择指定的路径,
2,备份语句中如果没有指定了format,那么选择rman 中配置的默认路径,
例如:
RMAN> configure channel device type disk format '/oracle/orclarch/%U_%d';
RMAN>showall;
RMANconfigurationparametersfordatabasewithdb_unique_nameORCLare:
CONFIGURERETENTIONPOLICYTOREDUNDANCY1;#default
CONFIGUREBACKUPOPTIMIZATIONOFF;#default
CONFIGUREDEFAULTDEVICETYPETODISK;#default
CONFIGURECONTROLFILEAUTOBACKUPOFF;#default
CONFIGURECONTROLFILEAUTOBACKUPFORMATFORDEVICETYPEDISKTO'%F';#default
CONFIGUREDEVICETYPEDISKPARALLELISM1BACKUPTYPETOBACKUPSET;#default
CONFIGUREDATAFILEBACKUPCOPIESFORDEVICETYPEDISKTO1;#default
CONFIGUREARCHIVELOGBACKUPCOPIESFORDEVICETYPEDISKTO1;#default
CONFIGURECHANNELDEVICETYPEDISKFORMAT'/oracle/orclarch/%U_%d';
CONFIGUREMAXSETSIZETOUNLIMITED;#default
CONFIGUREENCRYPTIONFORDATABASEOFF;#default
CONFIGUREENCRYPTIONALGORITHM'AES128';#default
CONFIGURECOMPRESSIONALGORITHM'BASIC'ASOFRELEASE'DEFAULT'OPTIMIZEFORLOADTRUE;#default
CONFIGUREARCHIVELOGDELETIONPOLICYTONONE;#default
CONFIGURESNAPSHOTCONTROLFILENAMETO'/oracle/app/oracle/product/11.2/db_1/dbs/snapcf_orcl.f';#default
RMAN>backuptablespacesystem;
Startingbackupat08-APR-16
usingtargetdatabasecontrolfileinsteadofrecoverycatalog
allocatedchannel:ORA_DISK_1
channelORA_DISK_1:SID=21devicetype=DISK
channelORA_DISK_1:startingfulldatafilebackupset
channelORA_DISK_1:specifyingdatafile(s)inbackupset
inputdatafilefilenumber=00001name=/oradata/orcl/system01.dbf
channelORA_DISK_1:startingpiece1at08-APR-16
channelORA_DISK_1:finishedpiece1at08-APR-16
piecehandle=/oracle/orclarch/36r2hgkp_1_1_ORCLtag=TAG0408T161521comment=NONE
channelORA_DISK_1:backupsetcomplete,elapsedtime:00:00:25
channelORA_DISK_1:startingfulldatafilebackupset
channelORA_DISK_1:specifyingdatafile(s)inbackupset
includingcurrentcontrolfileinbackupset
includingcurrentSPFILEinbackupset
channelORA_DISK_1:startingpiece1at08-APR-16
channelORA_DISK_1:finishedpiece1at08-APR-16
piecehandle=/oracle/orclarch/37r2hglj_1_1_ORCLtag=TAG0408T161521comment=NONE
channelORA_DISK_1:backupsetcomplete,elapsedtime:00:00:01
Finishedbackupat08-APR-16
3,如果rman没有显现的配置备份路径,也就是没有如下操作,
RMAN>configure channel device type disk format '/oracle/orclarch/%U_%d';
如果这种情况下,数据库开启了闪回恢复区,如下所示表示开启了闪回区。
SQL>showparameterrecover
NAMETYPEVALUE
-----------------------------------------------------------------------------
db_recovery_file_deststring/oracle/flsh_area
db_recovery_file_dest_sizebiginteger3G
recovery_parallelisminteger0
如下备份到了闪回恢复区目录下,并且又在后面自动生成了以实例名ORCL的子目录。
RMAN>backuptablespacesystem;
Startingbackupat08-APR-16
allocatedchannel:ORA_DISK_1
channelORA_DISK_1:SID=83devicetype=DISK
channelORA_DISK_1:startingfulldatafilebackupset
channelORA_DISK_1:specifyingdatafile(s)inbackupset
inputdatafilefilenumber=00001name=/oradata/orcl/system01.dbf
channelORA_DISK_1:startingpiece1at08-APR-16
channelORA_DISK_1:finishedpiece1at08-APR-16
piecehandle=/oracle/flsh_area/ORCL/backupset/_04_08/o1_mf_nnndf_TAG0408T163916_cjgvkock_.bkptag=TAG0408T163916comment=NONE
channelORA_DISK_1:backupsetcomplete,elapsedtime:00:00:35
channelORA_DISK_1:startingfulldatafilebackupset
channelORA_DISK_1:specifyingdatafile(s)inbackupset
includingcurrentcontrolfileinbackupset
includingcurrentSPFILEinbackupset
channelORA_DISK_1:startingpiece1at08-APR-16
channelORA_DISK_1:finishedpiece1at08-APR-16
piecehandle=/oracle/flsh_area/ORCL/backupset/_04_08/o1_mf_ncsnf_TAG0408T163916_cjgvlskq_.bkptag=TAG0408T163916comment=NONE
channelORA_DISK_1:backupsetcomplete,elapsedtime:00:00:01
Finishedbackupat08-APR-16
4,关闭闪回恢复区,将db_recovery_file_dest参数设置为空,可以停用闪回恢复区。并且没有在rman显现的配置备份路径,同时也没有在语句中指定路径,此时会选择 $ORACLE_HOME/dbs
SQL>showparameterrecover
NAMETYPEVALUE
-----------------------------------------------------------------------------
db_recovery_file_deststring
db_recovery_file_dest_sizebiginteger3G
recovery_parallelisminteger0
RMAN>show all;
usingtargetdatabasecontrolfileinsteadofrecoverycatalog
RMANconfigurationparametersfordatabasewithdb_unique_nameORCLare:
CONFIGURERETENTIONPOLICYTOREDUNDANCY1;#default
CONFIGUREBACKUPOPTIMIZATIONOFF;#default
CONFIGUREDEFAULTDEVICETYPETODISK;#default
CONFIGURECONTROLFILEAUTOBACKUPOFF;#default
CONFIGURECONTROLFILEAUTOBACKUPFORMATFORDEVICETYPEDISKTO'%F';#default
CONFIGUREDEVICETYPEDISKPARALLELISM1BACKUPTYPETOBACKUPSET;#default
CONFIGUREDATAFILEBACKUPCOPIESFORDEVICETYPEDISKTO1;#default
CONFIGUREARCHIVELOGBACKUPCOPIESFORDEVICETYPEDISKTO1;#default
CONFIGUREMAXSETSIZETOUNLIMITED;#default
CONFIGUREENCRYPTIONFORDATABASEOFF;#default
CONFIGUREENCRYPTIONALGORITHM'AES128';#default
CONFIGURECOMPRESSIONALGORITHM'BASIC'ASOFRELEASE'DEFAULT'OPTIMIZEFORLOADTRUE;#default
CONFIGUREARCHIVELOGDELETIONPOLICYTONONE;#default
CONFIGURESNAPSHOTCONTROLFILENAMETO'/oracle/app/oracle/product/11.2/db_1/dbs/snapcf_orcl.f';#default
RMAN>backuptablespacesystem;
Startingbackupat08-APR-16
allocatedchannel:ORA_DISK_1
channelORA_DISK_1:SID=21devicetype=DISK
channelORA_DISK_1:startingfulldatafilebackupset
channelORA_DISK_1:specifyingdatafile(s)inbackupset
inputdatafilefilenumber=00001name=/oradata/orcl/system01.dbf
channelORA_DISK_1:startingpiece1at08-APR-16
channelORA_DISK_1:finishedpiece1at08-APR-16
piecehandle=/oracle/app/oracle/product/11.2/db_1/dbs/34r2hfq8_1_1tag=TAG0408T160112comment=NONE
channelORA_DISK_1:backupsetcomplete,elapsedtime:00:01:25
channelORA_DISK_1:startingfulldatafilebackupset
channelORA_DISK_1:specifyingdatafile(s)inbackupset
includingcurrentcontrolfileinbackupset
includingcurrentSPFILEinbackupset
channelORA_DISK_1:startingpiece1at08-APR-16
channelORA_DISK_1:finishedpiece1at08-APR-16
piecehandle=/oracle/app/oracle/product/11.2/db_1/dbs/35r2hfsu_1_1tag=TAG0408T160112comment=NONE
channelORA_DISK_1:backupsetcomplete,elapsedtime:00:00:01
Finishedbackupat08-APR-16
综上所述:oracle数据库rman的备份路径,遵循的原则是
备份语句中指定的format>rman 中显现的configure channel device type disk format '/oracle/orclarch/%U_%d'的路径>闪回恢复区>$ORACLE_HOME/dbs