rman增量备份的示例分析

这篇文章主要为大家展示了“rman增量备份的示例分析”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“rman增量备份的示例分析”这篇文章吧。

创新互联是一家集网站建设,港闸企业网站建设,港闸品牌网站建设,网站定制,港闸网站建设报价,网络营销,网络优化,港闸网站推广为一体的创新建站企业,帮助传统企业提升企业形象加强企业竞争力。可充分满足这一群体相比中小企业更为丰富、高端、多元的互联网需求。同时我们时刻保持专业、时尚、前沿,时刻以成就客户成长自我,坚持不断学习、思考、沉淀、净化自己,让我们为更多的企业打造出实用型网站。

BACKUP DATABASE 和 BACKUP INCREMENTAL LEVEL 0 DATABASE 备份的内容都是一样的,但是它们仍然有不同点。full backup不会被应用于增量备份策略,只有0级备份才可以当做增量备份的基点,也没有RMAN命令可以转换两者之间的关系。在数据库打开的状态下,只有数据库处于归档模式才可以使用增量备份,如果数据库不是归档模式且数据库处于open状态是不能进行增量备份的。
增量备份分为两种:积累增量备份和差异增量备份
积累增量备份
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级备份点到现在的所有改动块,当使用增量备份恢复数据时,只有最近的增量备份才会被使用
差异增量备份
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级点到现在的所有改动块。当前面只有0级备份时,差异增量备份只会备份0级到现在的改动块,当前面有1级备份后,差异增量备份会备份1级到现在的改动块。当使用差异增量备份恢复数据时,所有的1级差异增量备份都需要被应用。


差异备份和积累备份的差异
差异备份与积累备份相比,会节省更多的空间和资源,但是必须要保证level 1的可用性,保证不因为某个level 1的实效而导致数据库不能恢复到失败点。相反的,积累备份相对于差异备份更具有安全性,因为其本身的备份就具有重复性,只需要保证最近一次level 1备份可用就可以恢复到失败点了,而不是所有level 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


改变数据
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增量备份的示例分析”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注创新互联行业资讯频道!


网页名称:rman增量备份的示例分析
文章起源:http://myzitong.com/article/geodgj.html