【備份】RMAN中對控制檔案的幾種備份方法
控制檔案對於Oracle資料庫來說是至關重要的,這裡簡單的介紹幾種在RMAN中對控制檔案的備份方法。
1.進入RMAN命令列介面
secooler@secDB /oracle/oradata$ rman target /
Recovery Manager: Release 10.2.0.3.0 - Production on Wed Dec 16 16:39:15 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: SECOOLER (DBID=21803462)
RMAN>
2.修改控制檔案備份方式為自動備份
RMAN> configure controlfile autobackup on;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
3.確認引數是否修改成功,成功。
RMAN> show CONTROLFILE AUTOBACKUP;
RMAN configuration parameters are:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
4.修改控制檔案的備份檔案的存放位置,這裡注意一下其中的“%F”不可或缺。
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
5.確認一下備份檔案備份位置引數是否修改成功。成功。
RMAN> show controlfile autobackup format;
RMAN configuration parameters are:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/orabackup/%F';
6.此時使用“backup database”命令可以出發控制檔案的備份
RMAN> backup database;
Starting backup at 2009-12-16 16:54:21
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=146 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/oracle/oradata/secooler/system01.dbf
input datafile fno=00002 name=/oracle/oradata/secooler/undotbs01.dbf
input datafile fno=00003 name=/oracle/oradata/secooler/sysaux01.dbf
input datafile fno=00004 name=/oracle/oradata/secooler/users01.dbf
channel ORA_DISK_1: starting piece 1 at 2009-12-16 16:54:22
channel ORA_DISK_1: finished piece 1 at 2009-12-16 16:54:25
piece handle=/oracle/app/oracle/flash_recovery_area/SECOOLER/backupset/2009_12_16/o1_mf_nnndf_TAG20091216T165421_5lk81y4j_.bkp tag=TAG20091216T165421 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 2009-12-16 16:54:25
Starting Control File and SPFILE Autobackup at 2009-12-16 16:54:25
piece handle=/orabackup/c-21803462-20091216-00 comment=NONE
Finished Control File and SPFILE Autobackup at 2009-12-16 16:54:26
7.在RMAN中使用“backup current controlfile”亦可完成控制檔案的備份。
RMAN> backup current controlfile;
Starting backup at 2009-12-16 22:34:31
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=141 devtype=DISK
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 2009-12-16 22:34:31
channel ORA_DISK_1: finished piece 1 at 2009-12-16 22:34:32
piece handle=/oracle/app/oracle/flash_recovery_area/SECOOLER/backupset/2009_12_16/o1_mf_ncnnf_TAG20091216T223431_5lkvzqp6_.bkp tag=TAG20091216T223431 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2009-12-16 22:34:32
Starting Control File and SPFILE Autobackup at 2009-12-16 22:34:32
piece handle=/orabackup/c-21803462-20091216-01 comment=NONE
Finished Control File and SPFILE Autobackup at 2009-12-16 22:34:33
8.在RMAN中得到曾經備份過的控制檔案資訊
RMAN> list backup of controlfile;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
2 Full 6.80M DISK 00:00:00 2009-12-16 16:54:25
BP Key: 2 Status: AVAILABLE Compressed: NO Tag: TAG20091216T165425
Piece Name: /orabackup/c-21803462-20091216-00
Control File Included: Ckp SCN: 742397 Ckp time: 2009-12-16 16:54:25
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
3 Full 6.77M DISK 00:00:00 2009-12-16 22:34:31
BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20091216T223431
Piece Name: /oracle/app/oracle/flash_recovery_area/SECOOLER/backupset/2009_12_16/o1_mf_ncnnf_TAG20091216T223431_5lkvzqp6_.bkp
Control File Included: Ckp SCN: 763491 Ckp time: 2009-12-16 22:34:31
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
4 Full 6.80M DISK 00:00:00 2009-12-16 22:34:32
BP Key: 4 Status: AVAILABLE Compressed: NO Tag: TAG20091216T223432
Piece Name: /orabackup/c-21803462-20091216-01
Control File Included: Ckp SCN: 763495 Ckp time: 2009-12-16 22:34:32
9.使用RMAN的copy命令亦完成可對控制檔案的備份任務
RMAN> copy current controlfile to '/orabackup/rman_copy_controlfile.ctl';
Starting backup at 2009-12-16 22:42:47
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying current control file
output filename=/orabackup/rman_copy_controlfile.ctl tag=TAG20091216T224247 recid=1 stamp=705796967
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 2009-12-16 22:42:48
Starting Control File and SPFILE Autobackup at 2009-12-16 22:42:48
piece handle=/orabackup/c-21803462-20091216-02 comment=NONE
Finished Control File and SPFILE Autobackup at 2009-12-16 22:42:50
10.小結
以上僅是羅列了幾種在RMAN中備份控制檔案的方法,途徑很多,適用就好,具體環境下使用順手的備份方法便可。誠然,備份的根本目的是為恢復,任何一種備份方法在緊要關頭只要可用便是王道。
Good luck.
secooler
10.01.26
-- The End --
1.進入RMAN命令列介面
secooler@secDB /oracle/oradata$ rman target /
Recovery Manager: Release 10.2.0.3.0 - Production on Wed Dec 16 16:39:15 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: SECOOLER (DBID=21803462)
RMAN>
2.修改控制檔案備份方式為自動備份
RMAN> configure controlfile autobackup on;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
3.確認引數是否修改成功,成功。
RMAN> show CONTROLFILE AUTOBACKUP;
RMAN configuration parameters are:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
4.修改控制檔案的備份檔案的存放位置,這裡注意一下其中的“%F”不可或缺。
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
5.確認一下備份檔案備份位置引數是否修改成功。成功。
RMAN> show controlfile autobackup format;
RMAN configuration parameters are:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/orabackup/%F';
6.此時使用“backup database”命令可以出發控制檔案的備份
RMAN> backup database;
Starting backup at 2009-12-16 16:54:21
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=146 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/oracle/oradata/secooler/system01.dbf
input datafile fno=00002 name=/oracle/oradata/secooler/undotbs01.dbf
input datafile fno=00003 name=/oracle/oradata/secooler/sysaux01.dbf
input datafile fno=00004 name=/oracle/oradata/secooler/users01.dbf
channel ORA_DISK_1: starting piece 1 at 2009-12-16 16:54:22
channel ORA_DISK_1: finished piece 1 at 2009-12-16 16:54:25
piece handle=/oracle/app/oracle/flash_recovery_area/SECOOLER/backupset/2009_12_16/o1_mf_nnndf_TAG20091216T165421_5lk81y4j_.bkp tag=TAG20091216T165421 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 2009-12-16 16:54:25
Starting Control File and SPFILE Autobackup at 2009-12-16 16:54:25
piece handle=/orabackup/c-21803462-20091216-00 comment=NONE
Finished Control File and SPFILE Autobackup at 2009-12-16 16:54:26
7.在RMAN中使用“backup current controlfile”亦可完成控制檔案的備份。
RMAN> backup current controlfile;
Starting backup at 2009-12-16 22:34:31
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=141 devtype=DISK
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 2009-12-16 22:34:31
channel ORA_DISK_1: finished piece 1 at 2009-12-16 22:34:32
piece handle=/oracle/app/oracle/flash_recovery_area/SECOOLER/backupset/2009_12_16/o1_mf_ncnnf_TAG20091216T223431_5lkvzqp6_.bkp tag=TAG20091216T223431 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2009-12-16 22:34:32
Starting Control File and SPFILE Autobackup at 2009-12-16 22:34:32
piece handle=/orabackup/c-21803462-20091216-01 comment=NONE
Finished Control File and SPFILE Autobackup at 2009-12-16 22:34:33
8.在RMAN中得到曾經備份過的控制檔案資訊
RMAN> list backup of controlfile;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
2 Full 6.80M DISK 00:00:00 2009-12-16 16:54:25
BP Key: 2 Status: AVAILABLE Compressed: NO Tag: TAG20091216T165425
Piece Name: /orabackup/c-21803462-20091216-00
Control File Included: Ckp SCN: 742397 Ckp time: 2009-12-16 16:54:25
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
3 Full 6.77M DISK 00:00:00 2009-12-16 22:34:31
BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20091216T223431
Piece Name: /oracle/app/oracle/flash_recovery_area/SECOOLER/backupset/2009_12_16/o1_mf_ncnnf_TAG20091216T223431_5lkvzqp6_.bkp
Control File Included: Ckp SCN: 763491 Ckp time: 2009-12-16 22:34:31
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
4 Full 6.80M DISK 00:00:00 2009-12-16 22:34:32
BP Key: 4 Status: AVAILABLE Compressed: NO Tag: TAG20091216T223432
Piece Name: /orabackup/c-21803462-20091216-01
Control File Included: Ckp SCN: 763495 Ckp time: 2009-12-16 22:34:32
9.使用RMAN的copy命令亦完成可對控制檔案的備份任務
RMAN> copy current controlfile to '/orabackup/rman_copy_controlfile.ctl';
Starting backup at 2009-12-16 22:42:47
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying current control file
output filename=/orabackup/rman_copy_controlfile.ctl tag=TAG20091216T224247 recid=1 stamp=705796967
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 2009-12-16 22:42:48
Starting Control File and SPFILE Autobackup at 2009-12-16 22:42:48
piece handle=/orabackup/c-21803462-20091216-02 comment=NONE
Finished Control File and SPFILE Autobackup at 2009-12-16 22:42:50
10.小結
以上僅是羅列了幾種在RMAN中備份控制檔案的方法,途徑很多,適用就好,具體環境下使用順手的備份方法便可。誠然,備份的根本目的是為恢復,任何一種備份方法在緊要關頭只要可用便是王道。
Good luck.
secooler
10.01.26
-- The End --
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31444259/viewspace-2154367/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【RMAN】Oracle中如何備份控制檔案?備份控制檔案的方式有哪幾種?Oracle
- nid 對RMAN備份的影響--- 控制檔案中備份記錄全部丟失
- RMAN說,我能備份(4)--RMAN備份資料檔案和控制檔案
- 備份之控制檔案備份
- Backup And Recovery User's Guide-使用RMAN備份控制檔案-對控制檔案進行手工備份GUIIDE
- RMAN說,我能備份(5)--RMAN備份歸檔檔案
- rman備份-(1) 利用備份級恢復資料檔案和控制檔案
- 如何刪除控制檔案中過去rman備份到磁帶的歸檔備份集
- 備份控制檔案
- RMAN備份檔案格式
- rman備份檔案的格式
- rman備份丟失控制檔案恢復
- 10g R2 rman backup database 控制檔案備份後於備份集備份Database
- rman全庫備份備份歸檔日誌檔案
- RMAN簡單演示 備份各種檔案
- Oracle RMAN 備份控制檔案報錯問題Oracle
- RMAN相容性、控制檔案自動備份、儲存時間、備份策略、備份指令碼(二)指令碼
- RMAN備份資料檔案+控制檔案+歸檔日誌
- rman開啟備份優化對備份歸檔的影響優化
- Backup And Recovery User's Guide-備份RMAN備份-備份保留期對備份的備份的影響GUIIDE
- Backup And Recovery User's Guide-備份資料庫-使用RMAN備份控制檔案GUIIDE資料庫
- rman恢復資料庫--用備份的控制檔案資料庫
- 只有rman備份集,控制檔案丟失的恢復
- RMAN備份恢復之控制檔案的恢復(三)
- RMAN備份恢復之控制檔案的恢復(二)
- RMAN備份恢復之控制檔案的恢復(一)
- 備份與恢復--利用備份的控制檔案恢復
- RMAN基於備份控制檔案恢復失敗
- 解析redis備份檔案rdb的兩種方法及對比Redis
- 控制檔案重建以及備份
- 【備份恢復】利用 備份控制檔案到指定目錄下的控制檔案 恢復控制檔案
- ORACLE_備份恢復_RMAN相關內容(控制檔案在閃回區中的自動備份)Oracle
- 【實驗】從RMAN備份中恢復controlfile控制檔案
- 【備份恢復】所有控制檔案丟失後 利用trace中的控制檔案備份執行恢復
- Backup And Recovery User's Guide-RMAN備份概念-RMAN何時執行控制檔案自動備份GUIIDE
- 使用logmnr,在RMAN備份檔案中恢復備份的歸檔日誌檔案進行分析
- Backup And Recovery User's Guide-備份RMAN備份-使用RMAN備份備份集GUIIDE
- RMAN說,我能備份(11)--RMAN中的備份集屬性