溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

rman增量備份的示例分析

發(fā)布時間:2021-11-12 09:38:17 來源:億速云 閱讀:148 作者:小新 欄目:關(guān)系型數(shù)據(jù)庫

這篇文章主要為大家展示了“rman增量備份的示例分析”,內(nèi)容簡而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領(lǐng)大家一起研究并學(xué)習(xí)一下“rman增量備份的示例分析”這篇文章吧。

BACKUP DATABASE 和 BACKUP INCREMENTAL LEVEL 0 DATABASE 備份的內(nèi)容都是一樣的,但是它們?nèi)匀挥胁煌c。full backup不會被應(yīng)用于增量備份策略,只有0級備份才可以當(dāng)做增量備份的基點,也沒有RMAN命令可以轉(zhuǎn)換兩者之間的關(guān)系。在數(shù)據(jù)庫打開的狀態(tài)下,只有數(shù)據(jù)庫處于歸檔模式才可以使用增量備份,如果數(shù)據(jù)庫不是歸檔模式且數(shù)據(jù)庫處于open狀態(tài)是不能進行增量備份的。
增量備份分為兩種:積累增量備份和差異增量備份
積累增量備份
An incremental backup that backs up all the blocks changed since the most recent backup at level 0. When recovering with cumulative incremental backups, only the most recent cumulative incremental backup must be applied.
積累增量備份會備份那些最近的0級備份點到現(xiàn)在的所有改動塊,當(dāng)使用增量備份恢復(fù)數(shù)據(jù)時,只有最近的增量備份才會被使用
差異增量備份
A type of incremental backup that backs up all blocks that have changed since the most recent backup at level 1 or level 0. For example, in a differential level 1 backup RMAN determines which level 1 or level 0 incremental backup is most recent and then backs up all blocks changed since that backup. Differential backups are the default type of incremental backup. When recovering using differential incremental backups, RMAN must apply all differential incremental level 1 backups since the restored data file backup.
差異增量備份會備份那些最近0或1級點到現(xiàn)在的所有改動塊。當(dāng)前面只有0級備份時,差異增量備份只會備份0級到現(xiàn)在的改動塊,當(dāng)前面有1級備份后,差異增量備份會備份1級到現(xiàn)在的改動塊。當(dāng)使用差異增量備份恢復(fù)數(shù)據(jù)時,所有的1級差異增量備份都需要被應(yīng)用。


差異備份和積累備份的差異
差異備份與積累備份相比,會節(jié)省更多的空間和資源,但是必須要保證level 1的可用性,保證不因為某個level 1的實效而導(dǎo)致數(shù)據(jù)庫不能恢復(fù)到失敗點。相反的,積累備份相對于差異備份更具有安全性,因為其本身的備份就具有重復(fù)性,只需要保證最近一次level 1備份可用就可以恢復(fù)到失敗點了,而不是所有l(wèi)evel 1都可用。積累備份也需要更多的磁盤空間。


RMAN> backup incremental level 0 database;


Starting backup at 2017-07-30 13:12:44
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/test/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/test/sysaux01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/test/users01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/test/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 2017-07-30 13:12:44
channel ORA_DISK_1: finished piece 1 at 2017-07-30 13:12:59
piece handle=/home/oracle/1csal8ic_1_1 tag=TAG20170730T131244 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 2017-07-30 13:13:02
channel ORA_DISK_1: finished piece 1 at 2017-07-30 13:13:03
piece handle=/home/oracle/1dsal8ir_1_1 tag=TAG20170730T131244 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2017-07-30 13:13:03


改變數(shù)據(jù)
SQL> create table scott.backuptest(a int);


Table created.


SQL> insert into scott.backuptest values(1);


1 row created.


SQL> commit
  2  /


Commit complete


1級積累增量備份
RMAN> BACKUP INCREMENTAL LEVEL 1 CUMULATIVE DATABASE;


Starting backup at 2017-07-30 13:25:38
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1 device type=DISK
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=00001 name=/u01/app/oracle/oradata/test/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/test/sysaux01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/test/users01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/test/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 2017-07-30 13:25:39
channel ORA_DISK_1: finished piece 1 at 2017-07-30 13:25:46
piece handle=/home/oracle/1fsal9aj_1_1 tag=TAG20170730T132538 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 2017-07-30 13:25:47
channel ORA_DISK_1: finished piece 1 at 2017-07-30 13:25:48
piece handle=/home/oracle/1gsal9aq_1_1 tag=TAG20170730T132538 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2017-07-30 13:25:48


v$backup_datafile視圖可查看備份情況
SQL> SELECT   FILE#, INCREMENTAL_LEVEL, COMPLETION_TIME, 
         BLOCKS, DATAFILE_BLOCKS 
FROM     V$BACKUP_DATAFILE 
WHERE INCREMENTAL_LEVEL IN (0,1)
ORDER BY COMPLETION_TIME;  2    3    4    5  


     FILE# INCREMENTAL_LEVEL COMPLETION_TIME     BLOCKS DATAFILE_BLOCKS
---------- ----------------- ------------------- ---------- ---------------
3   0 2017-07-30 13:12:44       1241      11520
4   0 2017-07-30 13:12:49      49665      52320
2   0 2017-07-30 13:12:52      62449      81920
1   0 2017-07-30 13:12:53      78054     117760
3   1 2017-07-30 13:25:40 160      11520
4   1 2017-07-30 13:25:42 11      52320
2   1 2017-07-30 13:25:43 527      81920
1   1 2017-07-30 13:25:44 53     117760


8 rows selected.

以上是“rman增量備份的示例分析”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對大家有所幫助,如果還想學(xué)習(xí)更多知識,歡迎關(guān)注億速云行業(yè)資訊頻道!

向AI問一下細節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI