文章详情

短信预约-IT技能 免费直播动态提醒

请输入下面的图形验证码

提交验证

短信预约提醒成功

rman增量备份的示例分析

2024-04-02 19:55

关注

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

阅读原文内容投诉

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

软考中级精品资料免费领

  • 历年真题答案解析
  • 备考技巧名师总结
  • 高频考点精准押题
  • 2024年上半年信息系统项目管理师第二批次真题及答案解析(完整版)

    难度     813人已做
    查看
  • 【考后总结】2024年5月26日信息系统项目管理师第2批次考情分析

    难度     354人已做
    查看
  • 【考后总结】2024年5月25日信息系统项目管理师第1批次考情分析

    难度     318人已做
    查看
  • 2024年上半年软考高项第一、二批次真题考点汇总(完整版)

    难度     435人已做
    查看
  • 2024年上半年系统架构设计师考试综合知识真题

    难度     224人已做
    查看

相关文章

发现更多好内容

猜你喜欢

AI推送时光机
位置:首页-资讯-数据库
咦!没有更多了?去看看其它编程学习网 内容吧
首页课程
资料下载
问答资讯