Oracle RMAN 映像備份(Image copies)基本原理與方案
映像級別備份(image copies)相當於資料檔案和歸檔日誌的複製複製品,與原檔案在儲存空間上完全一致,如果需要做一個部分恢復(比如某一資料檔案)採用映像備份情況下只需要檢索相應的映像即可,恢復速度非常快,在某些非常情況下,可以直接switch到映像資料檔案以保證生產環境儘可能短時間的停機,事後再做一個copy到原路徑,選擇空閒時段再次swich回去。
鑑於映像備份需要佔用和生產資料檔案相同的空間,所以在資料量較大的情況下是不建議採用的,因為這種方案需要客戶為花費雙份儲存的錢,但是如果說在某庫建立之初,資料檔案不是很大,或者說某庫資料量始終較小,那麼選擇影響備份是一種極好的方案,可以在資料檔案出現物理損壞時,以最短的時間完成介質恢復。
下面介紹一些最簡單的RMAN映像備份方案
1、開啟rman塊追蹤技術
SQL> alter database enable block change tracking using file '/u01/app/oralce/oradata/orcl/block_change_track_file.f';
Database altered.
2、進行映像級別的level 0備份
run {
ALLOCATE CHANNEL "ch1" DEVICE TYPE DISK FORMAT "/u04/%U";
BACKUP AS COPY TAG 'BASE01' INCREMENTAL LEVEL 0 DATABASE;
}
3、進行映像級別的level 1備份
$ rman target /
run {
ALLOCATE CHANNEL "ch1" DEVICE TYPE DISK FORMAT "/u04/%U";
BACKUP TAG 'incr_update' INCREMENTAL LEVEL 1 DATABASE;
}
4、用level 1的備份update level 0 中的映像
run {
ALLOCATE CHANNEL "ch1" DEVICE TYPE DISK FORMAT "/u04/%U";
RECOVER COPY OF DATABASE WITH TAG 'BASE01';
}
實驗紀錄
1、level 0
RMAN> run {
ALLOCATE CHANNEL "ch1" DEVICE TYPE DISK FORMAT "/u04/%U";
BACKUP AS COPY TAG 'BASE01'
INCREMENTAL LEVEL 0
DATABASE;
}
2> 3> 4> 5> 6>
released channel: ORA_DISK_1
allocated channel: ch1
channel ch1: SID=32 device type=DISK
Starting backup at 05-SEP-13
channel ch1: starting datafile copy
input datafile file number=00001 name=/u01/app/oralce/oradata/orcl/system01.dbf
output file name=/u04/data_D-ORCL_I-1349053318_TS-SYSTEM_FNO-1_0coj3jug tag=BASE01 RECID=18 STAMP=825348067
channel ch1: datafile copy complete, elapsed time: 00:00:25
channel ch1: starting datafile copy
input datafile file number=00002 name=/u01/app/oralce/oradata/orcl/sysaux01.dbf
output file name=/u04/data_D-ORCL_I-1349053318_TS-SYSAUX_FNO-2_0doj3jv9 tag=BASE01 RECID=19 STAMP=825348091
channel ch1: datafile copy complete, elapsed time: 00:00:25
channel ch1: starting datafile copy
input datafile file number=00005 name=/u01/app/oralce/oradata/orcl/example01.dbf
output file name=/u04/data_D-ORCL_I-1349053318_TS-EXAMPLE_FNO-5_0eoj3k02 tag=BASE01 RECID=20 STAMP=825348107
channel ch1: datafile copy complete, elapsed time: 00:00:15
channel ch1: starting datafile copy
input datafile file number=00004 name=/u01/app/oralce/oradata/orcl/users01.dbf
output file name=/u04/data_D-ORCL_I-1349053318_TS-USERS_FNO-4_0foj3k0h tag=BASE01 RECID=21 STAMP=825348116
channel ch1: datafile copy complete, elapsed time: 00:00:03
channel ch1: starting datafile copy
input datafile file number=00003 name=/u01/app/oralce/oradata/orcl/undotbs01.dbf
output file name=/u04/data_D-ORCL_I-1349053318_TS-UNDOTBS1_FNO-3_0goj3k0l tag=BASE01 RECID=22 STAMP=825348120
channel ch1: datafile copy complete, elapsed time: 00:00:07
Finished backup at 05-SEP-13
Starting Control File and SPFILE Autobackup at 05-SEP-13
piece handle=/u01/app//product/11.2.0/dbhome_1/dbs/c-1349053318-20130905-00 comment=NONE
Finished Control File and SPFILE Autobackup at 05-SEP-13
released channel: ch1
RMAN>
2、做一些操作,比如建立一個表
SQL> create table rmantest1 as select * from rmantest;
Table created.
SQL> commit;
Commit complete.
SQL> select count(*) from rmantest1;
COUNT(*)
----------
2209792
3、level 1
RMAN> run {
ALLOCATE CHANNEL "ch1" DEVICE TYPE DISK FORMAT "/u04/%U";
BACKUP TAG 'incr_update'
INCREMENTAL LEVEL 1
DATABASE;
}
2> 3> 4> 5> 6>
allocated channel: ch1
channel ch1: SID=37 device type=DISK
Starting backup at 05-SEP-13
channel ch1: starting incremental level 1 datafile backup set
channel ch1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oralce/oradata/orcl/system01.dbf
input datafile file number=00002 name=/u01/app/oralce/oradata/orcl/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oralce/oradata/orcl/example01.dbf
input datafile file number=00004 name=/u01/app/oralce/oradata/orcl/users01.dbf
input datafile file number=00003 name=/u01/app/oralce/oradata/orcl/undotbs01.dbf
channel ch1: starting piece 1 at 05-SEP-13
channel ch1: finished piece 1 at 05-SEP-13
piece handle=/u04/0loj3khg_1_1 tag=INCR_UPDATE comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:15
Finished backup at 05-SEP-13
Starting Control File and SPFILE Autobackup at 05-SEP-13
piece handle=/u01/app//product/11.2.0/dbhome_1/dbs/c-1349053318-20130905-03 comment=NONE
Finished Control File and SPFILE Autobackup at 05-SEP-13
released channel: ch1
4、update image copy with incremental level 1
RMAN> run {
ALLOCATE CHANNEL "ch1" DEVICE TYPE DISK FORMAT "/u04/%U";
RECOVER COPY OF DATABASE WITH TAG 'BASE01';
}
2> 3> 4>
using target database control file instead of recovery catalog
allocated channel: ch1
channel ch1: SID=32 device type=DISK
Starting recover at 05-SEP-13
channel ch1: starting incremental datafile backup set restore
channel ch1: specifying datafile copies to recover
recovering datafile copy file number=00001 name=/u04/data_D-ORCL_I-1349053318_TS-SYSTEM_FNO-1_0coj3jug
recovering datafile copy file number=00002 name=/u04/data_D-ORCL_I-1349053318_TS-SYSAUX_FNO-2_0doj3jv9
recovering datafile copy file number=00003 name=/u04/data_D-ORCL_I-1349053318_TS-UNDOTBS1_FNO-3_0goj3k0l
recovering datafile copy file number=00004 name=/u04/data_D-ORCL_I-1349053318_TS-USERS_FNO-4_0foj3k0h
recovering datafile copy file number=00005 name=/u04/data_D-ORCL_I-1349053318_TS-EXAMPLE_FNO-5_0eoj3k02
channel ch1: reading from backup piece /u04/0loj3khg_1_1
channel ch1: piece handle=/u04/0loj3khg_1_1 tag=INCR_UPDATE
channel ch1: restored backup piece 1
channel ch1: restore complete, elapsed time: 00:00:15
Finished recover at 05-SEP-13
Starting Control File and SPFILE Autobackup at 05-SEP-13
piece handle=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/c-1349053318-20130905-04 comment=NONE
Finished Control File and SPFILE Autobackup at 05-SEP-13
released channel: ch1
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9034054/viewspace-2061463/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- rman映像copy自動備份的一個指令碼指令碼
- Oracle RMAN中全備份與0級備份區別Oracle
- RMAN備份型別 - 備份集(backupset)和映象副本(Image copy)型別
- oracle之rman備份Oracle
- Oracle RMAN 增量備份Oracle
- oracle rman備份命令Oracle
- 【轉】Oracle rman備份Oracle
- oracle11gRAC環境使用RMAN備份方案Oracle
- RMAN說,我能備份(9)--RMAN增量備份與備份保留策略
- Oracle 11g RMAN備份-增量備份Oracle
- Oracle RMAN備份實戰Oracle
- Oracle OCP(60):RMAN 備份Oracle
- oracle RMAN備份指令碼Oracle指令碼
- 關於RMAN 備份片backup copies 和通道CHANNEL之間關係的總結
- RMAN備份型別 - 備份集(backupset)和映象副本(Image copy) [final]型別
- RMAN備份與恢復之加密備份加密
- Oracle 11g RMAN備份-備份標籤Oracle
- Oracle資料庫備份與恢復之RMANOracle資料庫
- [Oracle] rman備份指令碼(2)Oracle指令碼
- ORACLE RMAN備份及還原Oracle
- Oracle備份之RMAN工具(四)Oracle
- Oracle備份之RMAN工具(三)Oracle
- Oracle備份之RMAN工具(二)Oracle
- Oracle備份之RMAN工具(一)Oracle
- oracle rman備份指令碼收集Oracle指令碼
- Oracle裡邏輯備份、物理備份、Rman備份的區別Oracle
- Oracle備份及備份策略及基於Linux下 Oracle 備份策略(RMAN)OracleLinux
- Oracle 11G 備份與恢復 使用RMAN建立備份集舉例Oracle
- Oracle 11g RMAN備份-一致備份Oracle
- 揭祕ORACLE備份之----RMAN之二(備份方式)Oracle
- 【RMAN】RMAN備份恢復3 RMAN增量備份指令碼與crontab計劃任務指令碼
- oracle rman備份驗證和備份進度監控Oracle
- 【原】Oracle學習系列—資料庫備份—RMAN備份Oracle資料庫
- 分享Oracle Rman的備份指令碼Oracle指令碼
- oracle 12c rman備份pdbOracle
- oracle rman 定時備份指令碼Oracle指令碼
- oracle rman備份及策略設定Oracle
- oracle RMAN 備份恢復總結Oracle