1207catalog copy的資料檔案作為0級備份2
[20151207]catalog copy的資料檔案作為0級備份補充.txt
-- 前一陣子寫了1篇blog,使用熱備份模式備份的檔案是否可以作為0級備份。
-- 以及使用backpup as copy備份的資料檔案是否可以作為0級備份.
-- 連結:http://blog.itpub.net/267265/viewspace-1832475/
-- 當時困惑的是使用catalog datafilecopy '/home/oracle/backup/datafile_4_USERS.dbf' level 0 ;作為0級。
--- 不知道那裡能看出來這個copy備份作為1級備份呢?
-- 實際上透過v$datafile_copy檢視就可以知道?還是透過例子來說明:
1.環境:
SCOTT@book> @ &r/ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
RMAN> list backup ;
using target database control file instead of recovery catalog
specification does not match any backup in the repository
RMAN> list copy ;
specification does not match any datafile copy in the repository
specification does not match any control file copy in the repository
specification does not match any archived log in the repository
--我刪除了全部備份以及archivelog。
2.建立backup as copy備份:
RMAN> backup as copy datafile "/mnt/ramdisk/book/example01.dbf" format "/home/oracle/backup/example_%U.dbf";
Starting backup at 2015-12-07 08:20:08
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=/mnt/ramdisk/book/example01.dbf
output file name=/home/oracle/backup/example_data_D-BOOK_I-1337401710_TS-EXAMPLE_FNO-5_01qo71tp.dbf tag=TAG20151207T082008 RECID=2 STAMP=897812410
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 2015-12-07 08:20:10
RMAN> list copy ;
specification does not match any control file copy in the repository
specification does not match any archived log in the repository
List of Datafile Copies
=======================
Key File S Completion Time Ckp SCN Ckp Time
------- ---- - ------------------- ---------- -------------------
2 5 A 2015-12-07 08:20:10 13212703957 2015-12-07 08:20:09
Name: /home/oracle/backup/example_data_D-BOOK_I-1337401710_TS-EXAMPLE_FNO-5_01qo71tp.dbf
Tag: TAG20151207T082008
SCOTT@book> select file#, tag, incremental_level, name from v$datafile_copy where deleted='NO' order by 1;
FILE# TAG INCREMENTAL_LEVEL NAME
---------- -------------------------------- ----------------- ------------------------------------------------------------
5 TAG20151207T082008 /home/oracle/backup/example_data_D-BOOK_I-1337401710_TS-EXAM
PLE_FNO-5_01qo71tp.dbf
3.改成0級備份:
RMAN> catalog datafilecopy '/home/oracle/backup/example_data_D-BOOK_I-1337401710_TS-EXAMPLE_FNO-5_01qo71tp.dbf' level 0 tag 'inc0';
cataloged datafile copy
datafile copy file name=/home/oracle/backup/example_data_D-BOOK_I-1337401710_TS-EXAMPLE_FNO-5_01qo71tp.dbf RECID=3 STAMP=897812572
RMAN> list copy ;
specification does not match any control file copy in the repository
specification does not match any archived log in the repository
List of Datafile Copies
=======================
Key File S Completion Time Ckp SCN Ckp Time
------- ---- - ------------------- ---------- -------------------
3 5 A 2015-12-07 08:22:52 13212703957 2015-12-07 08:20:09
Name: /home/oracle/backup/example_data_D-BOOK_I-1337401710_TS-EXAMPLE_FNO-5_01qo71tp.dbf
Tag: INC0
--檢視檢視v$datafile_copy。
SCOTT@book> select file#, tag, incremental_level, name from v$datafile_copy where deleted='NO' order by 1;
FILE# TAG INCREMENTAL_LEVEL NAME
---------- -------------------------------- ----------------- ------------------------------------------------------------
5 INC0 0 /home/oracle/backup/example_data_D-BOOK_I-1337401710_TS-EXAM
PLE_FNO-5_01qo71tp.dbf
--當時主要精力查詢含有RMAN以及BACKUP字串的檢視,忽略了還要查詢包含COPY字串的檢視。
--可以發現透過這個檢視可以確定backup as copy的備份以及修改為0級備份。
4.還可以不斷應用日誌:
SCOTT@book> select file#, tag, incremental_level, name ,CHECKPOINT_CHANGE# from v$datafile_copy where deleted='NO' order by 1;
FILE# TAG INCREMENTAL_LEVEL NAME CHECKPOINT_CHANGE#
------------ -------------------------------- ----------------- -------------------------------------------------- ------------------
5 INC0 0 /home/oracle/backup/example_data_D-BOOK_I-13374017 13212705401
10_TS-EXAMPLE_FNO-5_01qo71tp.dbf
--RMAN> backup incremental level 1 for recover of copy with tag 'inc0' datafile "/mnt/ramdisk/book/example01.dbf";
RMAN> backup incremental level 1 for recover of copy with tag 'inc0' datafile 5;
Starting backup at 2015-12-07 08:56:47
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00005 name=/mnt/ramdisk/book/example01.dbf
channel ORA_DISK_1: starting piece 1 at 2015-12-07 08:56:47
channel ORA_DISK_1: finished piece 1 at 2015-12-07 08:56:48
piece handle=/u01/app/oracle/fast_recovery_area/BOOK/backupset/2015_12_07/o1_mf_nnnd1_INC0_c69pbhf2_.bkp tag=INC0 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2015-12-07 08:56:48
SCOTT@book> select file#, tag, incremental_level, name ,CHECKPOINT_CHANGE# from v$datafile_copy where deleted='NO' order by 1;
FILE# TAG INCREMENTAL_LEVEL NAME CHECKPOINT_CHANGE#
------------ -------------------------------- ----------------- -------------------------------------------------- ------------------
5 INC0 0 /home/oracle/backup/example_data_D-BOOK_I-13374017 13212705401
10_TS-EXAMPLE_FNO-5_01qo71tp.dbf
-- 奇怪並沒有變化CHECKPOINT_CHANGE#。
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
8 Incr 1 32.00K DISK 00:00:00 2015-12-07 08:56:47
BP Key: 8 Status: AVAILABLE Compressed: NO Tag: INC0
Piece Name: /u01/app/oracle/fast_recovery_area/BOOK/backupset/2015_12_07/o1_mf_nnnd1_INC0_c69pbhf2_.bkp
List of Datafiles in backup set 8
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ------------------- ----
5 1 Incr 13212705949 2015-12-07 08:56:47 /mnt/ramdisk/book/example01.dbf
-- 實際上增加1個1級備份,以這個copy備份為基礎。看了一些文件發現要不斷應用日誌,執行的是如下:
RUN {
RECOVER COPY OF DATABASE WITH TAG 'incr_update';
BACKUP INCREMENTAL LEVEL 1 FOR RECOVER OF COPY WITH TAG 'incr_update' DATABASE;
}
正確的應該是:
RMAN> recover copy of datafile 5;
Starting recover at 2015-12-07 08:59:52
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: specifying datafile copies to recover
recovering datafile copy file number=00005 name=/home/oracle/backup/example_data_D-BOOK_I-1337401710_TS-EXAMPLE_FNO-5_01qo71tp.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/BOOK/backupset/2015_12_07/o1_mf_nnnd1_INC0_c69pbhf2_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/BOOK/backupset/2015_12_07/o1_mf_nnnd1_INC0_c69pbhf2_.bkp tag=INC0
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished recover at 2015-12-07 08:59:53
SCOTT@book> select file#, tag, incremental_level, name ,CHECKPOINT_CHANGE# from v$datafile_copy where deleted='NO' order by 1;
FILE# TAG INCREMENTAL_LEVEL NAME CHECKPOINT_CHANGE#
------------ -------------------------------- ----------------- -------------------------------------------------- ------------------
5 INC0 0 /home/oracle/backup/example_data_D-BOOK_I-13374017 13212705949
10_TS-EXAMPLE_FNO-5_01qo71tp.dbf
--這樣inc0就變化了。如下執行不存在1級會不應用的的。
RMAN> RECOVER COPY OF datafile 5 WITH TAG 'inc0';
Starting recover at 2015-12-07 09:05:05
using channel ORA_DISK_1
no copy of datafile 5 found to recover
Finished recover at 2015-12-07 09:05:05
RMAN> recover copy of datafile 5;
Starting recover at 2015-12-07 09:08:37
using channel ORA_DISK_1
no copy of datafile 5 found to recover
Finished recover at 2015-12-07 09:08:37
--必須存在1級備份才會應用:
RMAN> backup incremental level 1 for recover of copy with tag 'inc0' datafile 5;
Starting backup at 2015-12-07 09:08:42
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00005 name=/mnt/ramdisk/book/example01.dbf
channel ORA_DISK_1: starting piece 1 at 2015-12-07 09:08:42
channel ORA_DISK_1: finished piece 1 at 2015-12-07 09:08:43
piece handle=/u01/app/oracle/fast_recovery_area/BOOK/backupset/2015_12_07/o1_mf_nnnd1_INC0_c69q0tmf_.bkp tag=INC0 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2015-12-07 09:08:43
RMAN> recover copy of datafile 5;
Starting recover at 2015-12-07 09:08:45
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: specifying datafile copies to recover
recovering datafile copy file number=00005 name=/home/oracle/backup/example_data_D-BOOK_I-1337401710_TS-EXAMPLE_FNO-5_01qo71tp.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/BOOK/backupset/2015_12_07/o1_mf_nnnd1_INC0_c69q0tmf_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/BOOK/backupset/2015_12_07/o1_mf_nnnd1_INC0_c69q0tmf_.bkp tag=INC0
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished recover at 2015-12-07 09:08:46
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-1867253/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 1112catalog copy的資料檔案作為0級備份
- rman備份-(1) 利用備份級恢復資料檔案和控制檔案
- RMAN關於物理檔案copy的增量備份
- Dedecms備份的資料檔案位置及備份資料庫的方法資料庫
- Java中CMD命令來備份mysql資料庫備份檔案出來為0位元組問題JavaMySql資料庫
- 2 Day DBA-管理方案物件-執行備份和恢復-備份資料庫-資料檔案增量備份物件資料庫
- RMAN說,我能備份(4)--RMAN備份資料檔案和控制檔案
- 資料檔案誤刪--但有資料檔案的copy恢復
- 還原sqlserver資料庫備份檔案.bak的檔案SQLServer資料庫
- 雲備份和同步檔案資料
- RMAN備份資料檔案+控制檔案+歸檔日誌
- rman備份但丟失一個資料檔案,但有歸檔備份
- rman不做0級備份,可以直接做其他級別的incremental 備份,其本質還是先做0級備份!REM
- 一次資料檔案COPY
- 0級備份和全備份的本質區別
- RMAN 全庫備份和 0級備份的區別
- oracle uncatalog資料庫備份檔案Oracle資料庫
- 檔案資料同步備份工具:ChronoSync for MacMac
- 遠端備份資料庫和檔案的方法資料庫
- 使用備份的控制檔案恢復資料庫資料庫
- 沒有備份的資料檔案恢復(五)
- Mysql中備份資料檔案中/*!*/的含義MySql
- 歸檔模式,恢復沒有備份的資料檔案模式
- 把資料庫控制檔案備份到跟蹤檔案資料庫
- 不完全恢復(資料檔案備份--新建表空間--控制檔案備份--日誌歸檔檔案)
- rman的level 0 1 2級備份有什麼區別?
- SQL SERVER備份資料庫檔案(使用SSMS)SQLServer資料庫SSM
- 備份恢復之資料檔案丟失
- rman恢復資料庫--用備份的控制檔案資料庫
- 無處不在的Oracle資料庫控制檔案備份Oracle資料庫
- 所有除引數檔案以外的檔案都丟失,但是隻有資料檔案的 RMAN 備份的恢復2
- 備份之控制檔案備份
- 【備份恢復】無備份線上恢復非關鍵資料檔案
- Backup And Recovery User's Guide-備份資料庫-使用RMAN備份資料庫檔案GUIIDE資料庫
- Oracle RMAN中全備份與0級備份區別Oracle
- 使用RMAN備份集和過時的控制檔案進行資料庫的恢復(2/2)資料庫
- 備份策略 增量備份中的差異備份:週日和週三執行0級備份,其他每天執行1級備份
- 10gR2rman backup as copy移動資料檔案,非常方便!