Oracle 11gR2 RMAN 配置控制檔案自動備份(control file autobackup)
透過在 RMAN 中配置 control file autobackup,RMAN 會自動備份控制檔案和引數檔案到預先設定好的路徑。
觸發情況:
1、當資料庫的結構發生改變時(資料庫執行在歸檔模式)
2、當完成 RMAN 備份後
好處:
即使資料庫丟失了控制檔案和恢復目錄(recovery catalog),控制檔案和引數檔案也可以從自動備份的控制檔案中進行恢復,讓資料庫多了一層保護,而且從autobackup中恢復控制檔案和引數檔案更加快速方便。
設定方法:
檢視現有的 RMAN 配置引數,可以看到沒有啟用控制檔案自動備份,引數依舊是預設值
[oracle@ATFDB1 admin]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Wed Dec 9 09:19:07 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: FIRE (DBID=917673527)
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name FIRE are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
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 '/u02/app/oracle/product/11.2.0/db_1/dbs/snapcf_fire.f'; # default
啟用控制檔案自動備份特性
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
配置控制檔案自動備份的路徑和格式
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/ORADATA/controlfile/cf_%F';
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/ORADATA/controlfile/cf_%F';
new RMAN configuration parameters are successfully stored
檢視重新設定的引數
RMAN> show all;
RMAN configuration parameters for database with db_unique_name FIRE 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 '/ORADATA/controlfile/cf_%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 '/u02/app/oracle/product/11.2.0/db_1/dbs/snapcf_fire.f'; # default
透過 RMAN 備份資料庫,檢視是否生成控制檔案自動備份。在 RMAN 備份結束後,可以看到自動備份的相關資訊。
RMAN> backup database plus archivelog delete all input;
Starting backup at 2015-12-09 09:41:59
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=59 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
……
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 2015-12-09 09:42:07
Starting backup at 2015-12-09 09:42:07
using channel ORA_DISK_1
specification does not match any archived log in the repository
backup cancelled because there are no files to backup
Finished backup at 2015-12-09 09:42:07
Starting Control File and SPFILE Autobackup at 2015-12-09 09:42:07
piece handle=/ORADATA/controlfile/cf_c-917673527-20151209-00 comment=NONE
Finished Control File and SPFILE Autobackup at 2015-12-09 09:42:08
檢視磁碟上生產的控制檔案自動備份,生成的備份檔案的格式中包含了 DBID,下面的紅色字部分就是資料庫的 DBID
[oracle@ATFDB1 ~]$ ll /ORADATA/controlfile
total 9888
-rw-r----- 1 oracle oinstall 10125312 Dec 9 09:42 cf_c-917673527-20151209-00
使用控制檔案自動備份恢復引數檔案
SQL> shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 1.0021E+10 bytes
Fixed Size 2236968 bytes
Variable Size 1543507416 bytes
Database Buffers 8455716864 bytes
Redo Buffers 19918848 bytes
[oracle@ATFDB1 controlfile]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Wed Dec 9 14:03:28 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: FIRE (not mounted)
RMAN> RESTORE SPFILE TO '/home/oracle/spfileTEMP.ora' from '/ORADATA/controlfile/cf_c-917673527-20151209-00';
Starting restore at 2015-12-09 14:03:35
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=254 device type=DISK
channel ORA_DISK_1: restoring spfile from AUTOBACKUP /ORADATA/controlfile/cf_c-917673527-20151209-00
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 2015-12-09 14:03:36
使用控制檔案自動備份恢復控制檔案
RMAN> RESTORE CONTROLFILE TO '/home/oracle/controlTEMP.ora' from '/ORADATA/controlfile/cf_c-917673527-20151209-00';
Starting restore at 2015-12-09 14:04:26
using channel ORA_DISK_1
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
Finished restore at 2015-12-09 14:04:28
觸發情況:
1、當資料庫的結構發生改變時(資料庫執行在歸檔模式)
2、當完成 RMAN 備份後
好處:
即使資料庫丟失了控制檔案和恢復目錄(recovery catalog),控制檔案和引數檔案也可以從自動備份的控制檔案中進行恢復,讓資料庫多了一層保護,而且從autobackup中恢復控制檔案和引數檔案更加快速方便。
設定方法:
檢視現有的 RMAN 配置引數,可以看到沒有啟用控制檔案自動備份,引數依舊是預設值
[oracle@ATFDB1 admin]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Wed Dec 9 09:19:07 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: FIRE (DBID=917673527)
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name FIRE are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
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 '/u02/app/oracle/product/11.2.0/db_1/dbs/snapcf_fire.f'; # default
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
配置控制檔案自動備份的路徑和格式
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/ORADATA/controlfile/cf_%F';
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/ORADATA/controlfile/cf_%F';
new RMAN configuration parameters are successfully stored
RMAN> show all;
RMAN configuration parameters for database with db_unique_name FIRE 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 '/ORADATA/controlfile/cf_%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 '/u02/app/oracle/product/11.2.0/db_1/dbs/snapcf_fire.f'; # default
RMAN> backup database plus archivelog delete all input;
Starting backup at 2015-12-09 09:41:59
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=59 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
……
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 2015-12-09 09:42:07
Starting backup at 2015-12-09 09:42:07
using channel ORA_DISK_1
specification does not match any archived log in the repository
backup cancelled because there are no files to backup
Finished backup at 2015-12-09 09:42:07
Starting Control File and SPFILE Autobackup at 2015-12-09 09:42:07
piece handle=/ORADATA/controlfile/cf_c-917673527-20151209-00 comment=NONE
Finished Control File and SPFILE Autobackup at 2015-12-09 09:42:08
檢視磁碟上生產的控制檔案自動備份,生成的備份檔案的格式中包含了 DBID,下面的紅色字部分就是資料庫的 DBID
[oracle@ATFDB1 ~]$ ll /ORADATA/controlfile
total 9888
-rw-r----- 1 oracle oinstall 10125312 Dec 9 09:42 cf_c-917673527-20151209-00
使用控制檔案自動備份恢復引數檔案
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 1.0021E+10 bytes
Fixed Size 2236968 bytes
Variable Size 1543507416 bytes
Database Buffers 8455716864 bytes
Redo Buffers 19918848 bytes
Recovery Manager: Release 11.2.0.3.0 - Production on Wed Dec 9 14:03:28 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: FIRE (not mounted)
RMAN> RESTORE SPFILE TO '/home/oracle/spfileTEMP.ora' from '/ORADATA/controlfile/cf_c-917673527-20151209-00';
Starting restore at 2015-12-09 14:03:35
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=254 device type=DISK
channel ORA_DISK_1: restoring spfile from AUTOBACKUP /ORADATA/controlfile/cf_c-917673527-20151209-00
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 2015-12-09 14:03:36
RMAN> RESTORE CONTROLFILE TO '/home/oracle/controlTEMP.ora' from '/ORADATA/controlfile/cf_c-917673527-20151209-00';
Starting restore at 2015-12-09 14:04:26
using channel ORA_DISK_1
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
Finished restore at 2015-12-09 14:04:28
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26506993/viewspace-1869014/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [Rman]Oracle 11g控制檔案延遲自動備份Oracle
- oracle11g 新特性 - rman自動備份控制檔案延遲Oracle
- 【RMAN】Oracle中如何備份控制檔案?備份控制檔案的方式有哪幾種?Oracle
- Oracle RMAN 備份控制檔案報錯問題Oracle
- oracle 控制檔案及引數檔案何時自動備份Oracle
- Backup And Recovery User's Guide-RMAN備份概念-RMAN何時執行控制檔案自動備份GUIIDE
- RMAN說,我能備份(4)--RMAN備份資料檔案和控制檔案
- RMAN相容性、控制檔案自動備份、儲存時間、備份策略、備份指令碼(二)指令碼
- ORACLE_備份恢復_RMAN相關內容(控制檔案在閃回區中的自動備份)Oracle
- 控制檔案-control file
- control file(控制檔案)
- Oracle Control File(控制檔案)的內容Oracle
- Oracle 快照控制檔案(snapshot control file)Oracle
- Oracle快照控制檔案(snapshot control file)Oracle
- oracle11g控制檔案自動備份延遲特性Oracle
- [20171116]11GR2控制檔案自動備份.txt
- 從控制檔案自動備份還原引數檔案
- rman備份丟失控制檔案恢復
- 【備份】RMAN中對控制檔案的幾種備份方法
- RMAN備份資料檔案+控制檔案+歸檔日誌
- rman備份-(1) 利用備份級恢復資料檔案和控制檔案
- 控制檔案自動備份報錯併產生TRACE檔案
- 重建控制檔案 recreate control file
- Oracle RAC 利用RMAN自動排程備份Oracle
- RMAN說,我能備份(5)--RMAN備份歸檔檔案
- RMAN備份檔案格式
- Backup And Recovery User's Guide-使用RMAN備份控制檔案-對控制檔案進行手工備份GUIIDE
- Rman-ORACLE資料庫RMAN實現自動備份Oracle資料庫
- 設定路徑找到自動備份的控制檔案
- 備份之控制檔案備份
- oracle rman不能自動刪除歸檔日誌備份解決Oracle
- 備份控制檔案
- Oracle 11g 備份控制檔案Oracle
- RMAN基於備份控制檔案恢復失敗
- 開啟 控制檔案自動備份下,引數檔案、控制檔案全部丟失恢復
- 自動生成sqlldr 控制檔案的指令碼(Script To Generate SQL*Loader Control File)SQL指令碼
- oracle檔案管理之 control fileOracle
- 11G新特性-控制檔案延遲自動備份