rman增量备份的示例分析

71次阅读
没有评论

共计 4617 个字符,预计需要花费 12 分钟才能阅读完成。

这篇文章主要为大家展示了“rman 增量备份的示例分析”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让丸趣 TV 小编带领大家一起研究并学习一下“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 增量备份的示例分析”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注丸趣 TV 行业资讯频道!

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-07-20发表,共计4617字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)