|
[oracle@localhost ~]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Thu Apr 2 16:00:58 2020
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1500336691)
修改控制文件备份方式为自动备份
RMAN> configure controlfile autobackup on;
using target database control file instead of recovery catalog
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
验证:
RMAN> show all;
RMAN configuration parameters for database with db_unique_name ORCL 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 COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_orcl.f'; # default
创建备份路径
[root@localhost /]# mkdir orabackup
修改控制文件的备份文件的存放位置
RMAN> configure controlfile autobackup format for device type disk to '/orabackup/%F';
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/orabackup/%F';
new RMAN configuration parameters are successfully stored
验证:
RMAN> show all;
RMAN configuration parameters for database with db_unique_name ORCL 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 '/orabackup/%F';
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 COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_orcl.f'; # default
在RMAN中使用“backup current controlfile”亦可完成控制文件的备份
RMAN> backup current controlfile;
Starting backup at 02-APR-20
using channel ORA_DISK_1
channel ORA_DISK_1: starting full 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 02-APR-20
channel ORA_DISK_1: finished piece 1 at 02-APR-20
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2020_04_02/o1_mf_ncnnf_TAG20200402T175044_h8cfcp2g_.bkp tag=TAG20200402T175044 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 02-APR-20
Starting Control File and SPFILE Autobackup at 02-APR-20
piece handle=/orabackup/c-1500336691-20200402-02 comment=NONE
Finished Control File and SPFILE Autobackup at 02-APR-20
在RMAN中得到曾经备份过的控制文件信息
RMAN> list backup of controlfile;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3 Full 9.36M DISK 00:00:01 02-APR-20
BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20200402T171451
Piece Name: /orabackup/c-1500336691-20200402-01
Control File Included: Ckp SCN: 1014182 Ckp time: 02-APR-20
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
4 Full 9.33M DISK 00:00:02 02-APR-20
BP Key: 4 Status: AVAILABLE Compressed: NO Tag: TAG20200402T175044
Piece Name: /u01/app/oracle/fast_recovery_area/ORCL/backupset/2020_04_02/o1_mf_ncnnf_TAG20200402T175044_h8cfcp2g_.bkp
Control File Included: Ckp SCN: 1014371 Ckp time: 02-APR-20
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
5 Full 9.36M DISK 00:00:00 02-APR-20
BP Key: 5 Status: AVAILABLE Compressed: NO Tag: TAG20200402T175047
Piece Name: /orabackup/c-1500336691-20200402-02
Control File Included: Ckp SCN: 1014378 Ckp time: 02-APR-20
使用RMAN的copy命令亦完成可对控制文件的备份任务
RMAN> copy current controlfile to '/orabackup/rman_copy_controlfile.ctl';
Starting backup at 02-APR-20
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=/orabackup/rman_copy_controlfile.ctl tag=TAG20200402T181727 RECID=1 STAMP=1036693048
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 02-APR-20
Starting Control File and SPFILE Autobackup at 02-APR-20
piece handle=/orabackup/c-1500336691-20200402-03 comment=NONE
Finished Control File and SPFILE Autobackup at 02-APR-20
|
|