【RMAN】使用增量備份更新資料庫備份映象
從檔案系統遷移資料檔案到ASM磁碟組時,可以使用RMAN對資料庫進行熱備份為映象檔案。如果資料量大,熱備過程持續時間長,熱備過程中事務比較繁忙,可以在熱備結束後再做一次增量備份,來更新熱備出來的映象檔案。
【實驗環境】
作業系統:AIX 5.3
資料庫:Oracle 10.2.0
【實驗過程】
一、0級增量熱備:
點選(此處)摺疊或開啟
-
run {
-
sql 'alter system archive log current';
-
allocate channel dev1 type disk;
-
backup as copy incremental level 0 database format '+DATA' TAG 'lxh_asm_migration';
-
sql 'alter system archive log current';
- }
-
RMAN>
-
sql statement: alter system archive log current
-
released channel: ORA_DISK_1
-
released channel: ORA_DISK_2
-
allocated channel: dev1
-
channel dev1: sid=144 devtype=DISK
-
Starting backup at 21-AUG-14
-
channel dev1: starting datafile copy
-
input datafile fno=00001 name=/u01/app/oracle/oradata/prod/system01.dbf
-
output filename=+DATA/prod/datafile/system.259.856179627 tag=LXH_ASM_MIGRATION recid=47 stamp=856179756
-
channel dev1: datafile copy complete, elapsed time: 00:02:15
-
channel dev1: starting datafile copy
-
input datafile fno=00002 name=/u01/app/oracle/oradata/prod/undotbs01.dbf
-
output filename=+DATA/prod/datafile/undotbs1.260.856179763 tag=LXH_ASM_MIGRATION recid=48 stamp=856179907
-
channel dev1: datafile copy complete, elapsed time: 00:02:35
-
channel dev1: starting datafile copy
-
input datafile fno=00003 name=/u01/app/oracle/oradata/prod/sysaux01.dbf
-
output filename=+DATA/prod/datafile/sysaux.258.856179919 tag=LXH_ASM_MIGRATION recid=49 stamp=856180002
-
channel dev1: datafile copy complete, elapsed time: 00:01:25
-
channel dev1: starting datafile copy
-
input datafile fno=00005 name=/u01/app/oracle/oradata/prod/example01.dbf
-
output filename=+DATA/prod/datafile/example.257.856180003 tag=LXH_ASM_MIGRATION recid=50 stamp=856180045
-
channel dev1: datafile copy complete, elapsed time: 00:00:45
-
channel dev1: starting datafile copy
-
input datafile fno=00004 name=/u01/app/oracle/oradata/prod/users01.dbf
-
output filename=+DATA/prod/datafile/users.256.856180049 tag=LXH_ASM_MIGRATION recid=51 stamp=856180051
-
channel dev1: datafile copy complete, elapsed time: 00:00:03
-
Finished backup at 21-AUG-14
-
-
Starting Control File and SPFILE Autobackup at 21-AUG-14
-
piece handle=/arch/ctl_c-267173497-20140821-04 comment=NONE
-
Finished Control File and SPFILE Autobackup at 21-AUG-14
-
-
sql statement: alter system archive log current
- released channel: dev1
二、1級增量熱備:SCN不一致
點選(此處)摺疊或開啟
-
run {
-
sql 'alter system archive log current';
-
allocate channel dev1 type disk;
-
backup incremental level 1 for recover of copy with tag 'lxh_asm_migration' database;
-
sql 'alter system archive log current';
- }
點選(此處)摺疊或開啟
-
sql statement: alter system archive log current
-
-
allocated channel: dev1
-
channel dev1: sid=144 devtype=DISK
-
-
Starting backup at 21-AUG-14
-
channel dev1: starting compressed incremental level 1 datafile backupset
-
channel dev1: specifying datafile(s) in backupset
-
input datafile fno=00001 name=/u01/app/oracle/oradata/prod/system01.dbf
-
input datafile fno=00002 name=/u01/app/oracle/oradata/prod/undotbs01.dbf
-
input datafile fno=00003 name=/u01/app/oracle/oradata/prod/sysaux01.dbf
-
input datafile fno=00005 name=/u01/app/oracle/oradata/prod/example01.dbf
-
input datafile fno=00004 name=/u01/app/oracle/oradata/prod/users01.dbf
-
channel dev1: starting piece 1 at 21-AUG-14
-
channel dev1: finished piece 1 at 21-AUG-14
-
piece handle=/u01/app/oracle/product/10.2.0/db_1/dbs/etpgghnv_1_1 tag=TAG20140821T115438 comment=NONE
-
channel dev1: backup set complete, elapsed time: 00:00:03
-
Finished backup at 21-AUG-14
-
-
Starting Control File and SPFILE Autobackup at 21-AUG-14
-
piece handle=/arch/ctl_c-267173497-20140821-05 comment=NONE
-
Finished Control File and SPFILE Autobackup at 21-AUG-14
-
-
sql statement: alter system archive log current
- released channel: dev1
檢視copy檔案中資料檔案的SCN號,不一致。
三、refresh copy:SCN一致
點選(此處)摺疊或開啟
-
RMAN> recover copy of database with tag 'lxh_asm_migration';
-
Starting recover at 21-AUG-14
-
using channel ORA_DISK_1
-
using channel ORA_DISK_2
-
channel ORA_DISK_1: starting incremental datafile backupset restore
-
channel ORA_DISK_1: specifying datafile copies to recover
-
recovering datafile copy fno=00001 name=+DATA/prod/datafile/system.259.856179627
-
recovering datafile copy fno=00002 name=+DATA/prod/datafile/undotbs1.260.856179763
-
recovering datafile copy fno=00003 name=+DATA/prod/datafile/sysaux.258.856179919
-
recovering datafile copy fno=00004 name=+DATA/prod/datafile/users.256.856180049
-
recovering datafile copy fno=00005 name=+DATA/prod/datafile/example.257.856180003
-
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/product/10.2.0/db_1/dbs/etpgghnv_1_1
-
channel ORA_DISK_1: restored backup piece 1
-
piece handle=/u01/app/oracle/product/10.2.0/db_1/dbs/etpgghnv_1_1 tag=TAG20140821T115438
-
channel ORA_DISK_1: restore complete, elapsed time: 00:00:16
-
Finished recover at 21-AUG-14
-
-
Starting Control File and SPFILE Autobackup at 21-AUG-14
-
piece handle=/arch/ctl_c-267173497-20140821-07 comment=NONE
- Finished Control File and SPFILE Autobackup at 21-AUG-14
四、檢視更新後的copy檔案:SCN一致
RMAN> list copy of database;檢視copy檔案中資料檔案的SCN號,一致。
這樣在切換資料檔案到ASM switch database to copy; 後,
檢視資料檔案頭部SCN (v$datafile_header),就會發現SCN號一致,都是1194421
【相關資料】
1、Oracle10g官方文件中相關介紹
2、11g ocp 模擬題中相關題目
Oracle 11g 1Z0-053-79:
You executed the
following command:
RMAN> RECOVER COPY OF
DATAFILE '/u01/app/oracle/oradata/orcl/users01.dbf';
Which statement regarding the above command is correct?
A. The '/u01/app/oracle/oradata/orcl/users01.dbf' data file is recovered from
the image copy.
B. The '/u01/app/oracle/oradata/orcl/users01.dbf' data file is recovered from the last incremental backup.
C. Image copies of the '/u01/app/oracle/oradata/orcl/users01.dbf' data file are updated with all changes up to incremental backup SCN.
D. Image copies of the '/u01/app/oracle/oradata/orcl/users01.dbf' data file are recovered using the above command if data file recovery fails.
Answer: C
呂星昊
2014.10.08
文章連結:http://blog.itpub.net/29475508/viewspace-1291605/
轉載請註明出處!謝謝
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29475508/viewspace-1291605/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 使用RMAN增量備份前滾STANDBY資料庫資料庫
- 使用RMAN備份資料庫資料庫
- oracle資料庫備份之exp增量備份Oracle資料庫
- rman備份和增量備份指令碼指令碼
- Oracle RMAN 增量備份Oracle
- 使用RMAN增量更新備份實現快速還原
- RMAN說,我能備份(9)--RMAN增量備份與備份保留策略
- 使用innobackupex線上增量備份和再增量備份及恢復mysql資料庫MySql資料庫
- Oracle 11g RMAN備份-增量備份Oracle
- 【備份恢復】noarchive模式下使用增量備份恢復資料庫Hive模式資料庫
- Backup And Recovery User's Guide-從RMAN開始-備份資料庫-增量備份GUIIDE資料庫
- rman增量備份指令碼指令碼
- Backup And Recovery User's Guide-RMAN備份概念-增量備份-累積增量備份GUIIDE
- Backup And Recovery User's Guide-RMAN備份概念-增量備份-差異增量備份GUIIDE
- Backup And Recovery User's Guide-RMAN備份概念-增量備份-多級增量備份GUIIDE
- Backup And Recovery User's Guide-備份RMAN備份-用RMAN備份映象拷貝備份GUIIDE
- Backup And Recovery User's Guide-RMAN備份概念-增量備份-增量備份演算法GUIIDE演算法
- 【原】Oracle學習系列—資料庫備份—RMAN備份Oracle資料庫
- 資料庫差異備份與增量備份的不同之處資料庫
- Backup And Recovery User's Guide-RMAN備份概念-增量備份-累積增量備份-練習GUIIDE
- oracle資料庫使用rman備份指令碼Oracle資料庫指令碼
- 使用RMAN建立資料庫備份庫(筆記)資料庫筆記
- 利用RMAN備份重建資料庫資料庫
- Backup And Recovery User's Guide-備份資料庫-RMAN備份概覽-RMAN備份的目的GUIIDE資料庫
- Backup And Recovery User's Guide-建立和更新增量備份-增量更新備份GUIIDE
- Backup And Recovery User's Guide-備份資料庫-使用RMAN備份資料庫檔案GUIIDE資料庫
- Backup And Recovery User's Guide-備份RMAN備份-使用RMAN備份備份集GUIIDE
- Backup And Recovery User's Guide-備份資料庫-RMAN備份概覽-為RMAN備份指定TAGGUIIDE資料庫
- Backup And Recovery User's Guide-RMAN備份概念-增量備份GUIIDE
- oracle聯機熱備份的原理,及rman增量備份原理Oracle
- Oracle聯機熱備份的原理及rman增量備份原理Oracle
- Rman增量壓縮備份來解決備份空間不足
- RMAN備份恢復——RAC環境資料庫的備份(zt)資料庫
- RMAN備份恢復--RAC環境資料庫的備份(十)資料庫
- RMAN備份恢復——RAC環境資料庫的備份(一)資料庫
- RMAN備份 建立catalog資料庫資料庫
- 非歸檔資料庫RMAN備份資料庫
- Backup And Recovery User's Guide-備份資料庫-RMAN備份概覽-為RMAN備份指定格式GUIIDE資料庫