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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Dedecms備份的資料檔案位置及備份資料庫的方法資料庫
- Java中CMD命令來備份mysql資料庫備份檔案出來為0位元組問題JavaMySql資料庫
- 雲備份和同步檔案資料
- oracle uncatalog資料庫備份檔案Oracle資料庫
- 檔案資料同步備份工具:ChronoSync for MacMac
- Mysql中備份資料檔案中/*!*/的含義MySql
- 遠端備份資料庫和檔案的方法資料庫
- SQL SERVER備份資料庫檔案(使用SSMS)SQLServer資料庫SSM
- 如何將SQL Server 2000備份的資料庫檔案還原(升級)為SQL Server 2005或更高版本的資料庫?SQLServer資料庫
- sql檔案備份SQL
- iturns備份的檔案在win10的什麼位置_iturns備份的檔案在win10哪個資料夾Win10
- 如何備份整個硬碟為映象檔案?硬碟
- Linux作業系統定時備份檔案方法Linux作業系統
- 這麼設定USB Copy資料就能輕鬆備份到NAS
- Mac硬碟備份遷移資料工具:Carbon Copy Cloner 簡稱CCCMac硬碟
- Linux實現定時備份MySQL資料庫並刪除30天前的備份檔案LinuxMySql資料庫
- Networker備份windows檔案Windows
- ManagerDB 備份檔案管理與異地備份
- Windows 多次製作母盤,備份檔案變大的問題Windows
- RMAN備份恢復典型案例——資料檔案存在壞快
- 【RMAN】Oracle中如何備份控制檔案?備份控制檔案的方式有哪幾種?Oracle
- 容災備份 | 看我使用Powershell操作FTP進行資料檔案自動上傳備份FTP
- 【備份】RMAN中對控制檔案的幾種備份方法
- 從備份片中恢復某個指定得歸檔或者資料檔案
- Oracle 之利用BBED修改資料塊SCN----沒有備份資料檔案的資料恢復Oracle資料恢復
- 資料庫資料恢復-SQL SERVER資料庫檔案大小變為“0”的資料恢復方案資料庫資料恢復SQLServer
- 使用NineData實現企業級資料庫備份, 資料備份告別“拆盲盒” ?資料庫
- win10如何備份桌面檔案 win10怎樣備份桌面檔案Win10
- Laravel 資料庫及專案檔案自動備份指北 (spatie/Laravel-backup)Laravel資料庫
- WIN10怎麼檢視itunes備份的檔案_win10 itunes備份的檔案在哪看Win10
- win10系統如何設定自動備份資料檔案Win10
- 作為企業資料安全的後盾,備份自身的問題解決了嗎?
- win10備份檔案後怎麼還原_win10備份檔案還原的方法Win10
- python保留7天備份檔案Python
- 為什麼資料備份那麼重要?
- 檔案的基本管理和XFS檔案系統備份恢復
- win10系統如何備份檔案 win10系統備份檔案在哪裡Win10
- 怎樣恢復Mac檔案及資料夾資料?BackupLoupe for mac(資料恢復備份助手)3.5.4Mac資料恢復
- 『無為則無心』Python基礎 — 43、檔案備份的實現Python