飄ぺ風
【宁可因梦想而忙碌,不要因忙碌而失去梦想】

注:此文章属原创,转载请注明出处,谢谢。

 

数据库版本:oracle 10g (10.2.0.5.0)

autobackup on: 备份控制文件controlfile时,会自动备份参数文件spfile

autobackup off: 备份控制文件controlfile时,不会自动备份参数文件spfile

 

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON; ---- 开启自动备份功能

new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored

RMAN> show all;

RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_orcl.f'; # default

RMAN> backup current controlfile;

Starting backup at 03-JAN-18
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
channel ORA_DISK_1: starting piece 1 at 03-JAN-18
channel ORA_DISK_1: finished piece 1 at 03-JAN-18
piece handle=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/36snp37s_1_1 tag=TAG20180103T183747 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 03-JAN-18

Starting Control File and SPFILE Autobackup at 03-JAN-18
piece handle=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/c-1403607036-20180103-00 comment=NONE
Finished Control File and SPFILE Autobackup at 03-JAN-18

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP OFF; ---- 关闭自动备份功能

old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
new RMAN configuration parameters are successfully stored

RMAN> backup current controlfile;

Starting backup at 03-JAN-18
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
channel ORA_DISK_1: starting piece 1 at 03-JAN-18
channel ORA_DISK_1: finished piece 1 at 03-JAN-18
piece handle=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/38snp38j_1_1 tag=TAG20180103T183811 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 03-JAN-18

RMAN>

RMAN> show all;

RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_orcl.f'; # default

RMAN>

 

 


---- autobackup off,备份数据文件1时,会自动备份控制文件和参数文件,并且datafile 1的备份集与控制文件和参数文件是分开的
---- controlfile和spfile备份的路径与数据文件的备份路径相同


RMAN> CONFIGURE CONTROLFILE AUTOBACKUP OFF;

old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
new RMAN configuration parameters are successfully stored

RMAN>
RMAN> backup datafile 1;

Starting backup at 03-JAN-18
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=00001 name=/u02/oradata/orcl/system01.dbf
channel ORA_DISK_1: starting piece 1 at 03-JAN-18
channel ORA_DISK_1: finished piece 1 at 03-JAN-18
piece handle=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/3bsnp3q3_1_1 tag=TAG20180103T184731 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 03-JAN-18
channel ORA_DISK_1: finished piece 1 at 03-JAN-18
piece handle=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/3csnp3qi_1_1 tag=TAG20180103T184731 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
Finished backup at 03-JAN-18

RMAN> list backup;


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

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
104 Full 366.76M DISK 00:00:10 03-JAN-18
BP Key: 106 Status: AVAILABLE Compressed: NO Tag: TAG20180103T184731
Piece Name: /u01/app/oracle/product/11.2.0/dbhome_1/dbs/3bsnp3q3_1_1
List of Datafiles in backup set 104
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 615672 03-JAN-18 /u02/oradata/orcl/system01.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
105 Full 13.67M DISK 00:00:02 03-JAN-18
BP Key: 107 Status: AVAILABLE Compressed: NO Tag: TAG20180103T184731
Piece Name: /u01/app/oracle/product/11.2.0/dbhome_1/dbs/3csnp3qi_1_1
Control File Included: Ckp SCN: 615675 Ckp time: 03-JAN-18
SPFILE Included: Modification time: 03-JAN-18

RMAN>

RMAN> backup datafile 1 format '/backup/rman/dat1.bak.%U';

Starting backup at 03-JAN-18
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=00001 name=/u02/oradata/orcl/system01.dbf
channel ORA_DISK_1: starting piece 1 at 03-JAN-18
channel ORA_DISK_1: finished piece 1 at 03-JAN-18
piece handle=/backup/rman/dat1.bak.3jsnp4jh_1_1 tag=TAG20180103T190105 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:04:27
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 03-JAN-18
channel ORA_DISK_1: finished piece 1 at 03-JAN-18
piece handle=/backup/rman/dat1.bak.3ksnp4rs_1_1 tag=TAG20180103T190105 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 03-JAN-18

RMAN>


---- autobackup on,备份数据文件1时,也会自动备份控制文件和参数文件,并且datafile 1的备份集与控制文件和参数文件也是分开的
---- 但是controlfile和spfile是备份到自动备份的路径中,与数据文件的备份路径不同

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;

old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored

RMAN>

RMAN> backup datafile 1 ;

Starting backup at 03-JAN-18
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=00001 name=/u02/oradata/orcl/system01.dbf
channel ORA_DISK_1: starting piece 1 at 03-JAN-18
channel ORA_DISK_1: finished piece 1 at 03-JAN-18
piece handle=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/3dsnp3t6_1_1 tag=TAG20180103T184910 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 03-JAN-18

Starting Control File and SPFILE Autobackup at 03-JAN-18
piece handle=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/c-1403607036-20180103-01 comment=NONE
Finished Control File and SPFILE Autobackup at 03-JAN-18

RMAN> list backup;


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

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
106 Full 366.76M DISK 00:00:10 03-JAN-18
BP Key: 108 Status: AVAILABLE Compressed: NO Tag: TAG20180103T184910
Piece Name: /u01/app/oracle/product/11.2.0/dbhome_1/dbs/3dsnp3t6_1_1
List of Datafiles in backup set 106
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 616023 03-JAN-18 /u02/oradata/orcl/system01.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
107 Full 13.67M DISK 00:00:01 03-JAN-18
BP Key: 109 Status: AVAILABLE Compressed: NO Tag: TAG20180103T184926
Piece Name: /u01/app/oracle/product/11.2.0/dbhome_1/dbs/c-1403607036-20180103-01
Control File Included: Ckp SCN: 616033 Ckp time: 03-JAN-18
SPFILE Included: Modification time: 03-JAN-18

RMAN>


RMAN> backup datafile 1 format '/backup/rman/dat1.bak.%U';

Starting backup at 03-JAN-18
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=00001 name=/u02/oradata/orcl/system01.dbf
channel ORA_DISK_1: starting piece 1 at 03-JAN-18
channel ORA_DISK_1: finished piece 1 at 03-JAN-18
piece handle=/backup/rman/dat1.bak.3hsnp4gt_1_1 tag=TAG20180103T185941 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 03-JAN-18

Starting Control File and SPFILE Autobackup at 03-JAN-18
piece handle=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/c-1403607036-20180103-03 comment=NONE
Finished Control File and SPFILE Autobackup at 03-JAN-18

RMAN>

 

posted on 2018-01-04 01:18  飄ぺ風  阅读(1080)  评论(0编辑  收藏  举报