0级备份和全备份的本质区别

准备:将测试环境的users表空间只读
测试:
1、数据库0级别备份
RMAN> backup incremental level 0 database tag 'levle0' format '/home/oracle/guo/%U';

Starting backup at 23-MAY-15
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/PROD1/system01.dbf
input datafile file number=00010 name=/u02/oradata/prod1/test_tbs.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/PROD1/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/PROD1/example01.dbf
channel ORA_DISK_1: starting piece 1 at 23-MAY-15
channel ORA_DISK_1: finished piece 1 at 23-MAY-15
piece handle=/home/oracle/guo/07q7mo4a_1_1 tag=LEVLE0 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
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=00003 name=/u01/app/oracle/oradata/PROD1/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 23-MAY-15
channel ORA_DISK_1: finished piece 1 at 23-MAY-15
piece handle=/home/oracle/guo/08q7mo5e_1_1 tag=LEVLE0 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
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=00009 name=/u01/app/oracle/oradata/PROD1/EXAMPLE.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/PROD1/indx.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/PROD1/TEST.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/PROD1/TOOLS.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/PROD1/users01.dbf
channel ORA_DISK_1: starting piece 1 at 23-MAY-15
channel ORA_DISK_1: finished piece 1 at 23-MAY-15
piece handle=/home/oracle/guo/09q7mo5h_1_1 tag=LEVLE0 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 23-MAY-15

Starting Control File and SPFILE Autobackup at 23-MAY-15
piece handle=/home/oracle/flash/PROD1/autobackup/2015_05_23/o1_mf_s_880500914_bp17km40_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 23-MAY-15

备份完成users表空间(只读)顺利备份
2、数据库1级别备份
RMAN> backup incremental level 1 database tag 'level1' format '/home/oracle/guo/%U';

Starting backup at 23-MAY-15
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=00001 name=/u01/app/oracle/oradata/PROD1/system01.dbf
input datafile file number=00010 name=/u02/oradata/prod1/test_tbs.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/PROD1/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/PROD1/example01.dbf
channel ORA_DISK_1: starting piece 1 at 23-MAY-15
channel ORA_DISK_1: finished piece 1 at 23-MAY-15
piece handle=/home/oracle/guo/0bq7mo93_1_1 tag=LEVEL1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
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=00003 name=/u01/app/oracle/oradata/PROD1/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 23-MAY-15
channel ORA_DISK_1: finished piece 1 at 23-MAY-15
piece handle=/home/oracle/guo/0cq7mo94_1_1 tag=LEVEL1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
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=00009 name=/u01/app/oracle/oradata/PROD1/EXAMPLE.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/PROD1/indx.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/PROD1/TEST.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/PROD1/TOOLS.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/PROD1/users01.dbf
skipping datafile 00004 because it has not changed
channel ORA_DISK_1: starting piece 1 at 23-MAY-15
channel ORA_DISK_1: finished piece 1 at 23-MAY-15
piece handle=/home/oracle/guo/0dq7mo96_1_1 tag=LEVEL1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 23-MAY-15

Starting Control File and SPFILE Autobackup at 23-MAY-15
piece handle=/home/oracle/flash/PROD1/autobackup/2015_05_23/o1_mf_s_880501031_bp17o7q8_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 23-MAY-15

RMAN>

结论:数据库0级备份是不会丢掉只读表空间的,只有1级的备份会因为只读表空间没有改变所以不会去备份它。
找到官方的说法:

Full
A backup of a datafile that includes every allocated block in the file being backed up. A full backup of a datafile can be an image copy, in which case every data block is backed up. It can also be stored in a backup set, in which case datafile blocks not in use may be skipped, according to rules in Oracle Database Backup and Recovery Reference.

A full backup cannot be part of an incremental backup strategy; that is, it cannot be the parent for a subsequent incremental backup.

Incremental
An incremental backup is either a level 0 backup, which includes every block in the file except blocks compressed out because they have never been used, or a level 1 backup, which includes only those blocks that have been changed since the parent backup was taken.

A level 0 incremental backup is physically identical to a full backup. The only difference is that the level 0 backup is recorded as an incremental backup in the RMAN repository, so it can be used as the parent for a level 1 backup.

 Ps:至于全备份和0级别备份另一个差异,我觉得前面的引用英文说的很清楚了,全备份不能作为0级别备份,让1级别的备份以它为基础进行增量备份,因为它的备份信息里没有相关的增量备份信息。

时间: 2024-09-20 12:33:50

0级备份和全备份的本质区别的相关文章

windows下mysql增量备份与全备份批处理

win下的全备批处理 批处理用于游戏服务器,经过严格测试,且正式使用,主要用来完全备份数据库,当然.这只是将数备份出来 ,至于如何将备份出来的数据远程传送的远程服务器上可以调用ftp的功能,此脚本并未详细说明,不明白 的可留言,亦可邮件至jzcxfy@opkeep.com  代码如下 复制代码 @echo off @echo ################################################################### @echo # RAR backup

oracle备份知识:每天备份,全备份和保留七天的备份

1. 保留七天 只保留七天的备份是这样设置的 RMAN> connect target/ connected to target database: DBSID (DBID=3100778490) RMAN> configure retention policy to recovery window of 7 days; 2. 备份脚本 vi /root/rmanbak.sh #! /bin/bash su - oracle <<! rman target /<<EOF

数据库备份 SQLServer的备份和灾难恢复

各大服务器硬件厂商(IBM,HP等)提供有很好的数据保护策略(硬件或软件).如大家熟知的RAID磁盘阵列(Redundant Array of Independent Disks)就是很好的数据保护方法.就SQL Server而言,通过维护计划可以制定详细的数据备份计划. 数据备份策略(full backup, differential backup and transaction log backup) 数据备份是为数据恢复服务的,所以建立数据备份计划之前,应先考虑是否能利用该备份有效的恢复数

数据库备份 SQLServer的备份和灾难恢复_MsSql

各大服务器硬件厂商(IBM,HP等)提供有很好的数据保护策略(硬件或软件).如大家熟知的RAID磁盘阵列(Redundant Array of Independent Disks)就是很好的数据保护方法.就SQL Server而言,通过维护计划可以制定详细的数据备份计划. 数据备份策略(full backup, differential backup and  transaction log backup) 数据备份是为数据恢复服务的,所以建立数据备份计划之前,应先考虑是否能利用该备份有效的恢复

[20151116]rman 全备份以及增量0级备份.txt

[20151116]rman 全备份以及增量0级备份.txt --前一阵子写了一篇将as copy作为增量0级备份的帖子,今天对比全备份以及增量0级备份的不同. 1.测试环境: SCOTT@book> @ &r/ver1 PORT_STRING                    VERSION        BANNER ------------------------------ -------------- --------------------------------------

1112catalog copy的数据文件作为0级备份

[20151112]catalog copy的数据文件作为0级备份.txt --使用热备份模式备份的文件是否可以作为0级备份呢? --以前学习rman这部分内容时候有点混乱,无法理解为什么使用rman backup as copy 的数据文件与0级备份的数据文件存在那些不同. --是否使用热备份以及backpup as copy备份的数据文件是否可以作为0级备份. --通过例子来说明: 1.测试环境: SYS@book> @ &r/ver1 PORT_STRING              

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.d

换硬盘不再愁 装系统、备份数据全攻略

单碟1TB硬盘的性能自诞生以来,带给网友一个又一个惊喜,无论是作为主盘,还是作为高清硬盘,单碟1TB硬盘比老款硬盘的性能有明显提升.特别是近期硬盘大打价格战,心仪已久的网友出手购买. 换盘不再愁 装系统.备份数据全攻略 单碟1TB硬盘的持续读写速度在140-160MB/秒,最大读写速度超过200MB/秒,秒杀老款硬盘绰绰有余.不少网友一度担心新单碟1TB硬盘的速度太快,老主板发挥不出来.武汉网友用6年前的945GC主板将单碟1TB硬盘的性能发挥的淋漓尽致. P4 506+945GC平台测试的单碟

shell实现mysql mysqldump实现数据全备份或增量备份

本篇文章主要讲如何使用shell实现mysql全量,增量备份.增量备份在周一-周六凌晨3点,会复制mysql-bin.00000*到指定目录:而全量备份则使用mysqldump将所有的数据库导出,每周日凌晨3点执,并会删除上周留下的mysq-bin.00000*.然后对mysql的备份操作会保留在bak.log文件中.如下图: 开始:2013年05月02日 15:10:57 结束:2013年05月02日 15:12:16 20130502.sql.tgz succ是由DBFullyBak.sh产