validate命令---rman进行备份和回复的验证
rman作为oracle备份与恢复工具,为我们提供了强大的功能。当中包含对数据文件的物理和逻辑检測以及备份文件的有效性检測。
首先。来看一下rman对数据文件的检測。
我们知道,rman在备份数据时,会将数据读入读缓存,然会将数据从读缓存写入写缓存并终于写入数据库。在从读缓存到写缓存的过程中,rman会进行物理一致性的检測(db_block_checksum未true)和逻辑一致性检測(使用了check logical选项)。比如:
SQL> show parameter db_block NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_block_buffers integer 0
db_block_checking string FALSE
db_block_checksum string TRUE
db_block_size integer 8192
SQL>
RMAN> backup tablespace test1; Starting backup at 2014-11-06 15:12:49
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00005 name=/home/app/oraten/oradata/oraten/test01.dbf
channel ORA_DISK_1: starting piece 1 at 2014-11-06 15:12:50
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 11/06/2014 15:12:51
ORA-19566: exceeded limit of 0 corrupt blocks for file /home/app/oraten/oradata/oraten/test01.dbf
有时,我们只希望验证一下数据文件能否够备份。而不想进行真正的备份,这是我们就能够使用validate命令了。如
RMAN> backup validate database; Starting backup at 2014-11-06 15:14:23
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/home/app/oraten/oradata/oraten/system01.dbf
input datafile fno=00003 name=/home/app/oraten/oradata/oraten/sysaux01.dbf
input datafile fno=00002 name=/home/app/oraten/oradata/oraten/undotbs01.dbf
input datafile fno=00005 name=/home/app/oraten/oradata/oraten/test01.dbf
input datafile fno=00004 name=/home/app/oraten/oradata/oraten/users01.dbf
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 2014-11-06 15:14:27
注意。这里并没有发现test01.dbf的物理损坏块,个人觉得,rman只不过将数据文件读入了读缓存。而没有进行以下的操作,也就是说对于物理块的检測其功能是有限的,但。我们能够用其来检測物理文件的可读性和位置等。
以下是官方文档中的描写叙述:
VALIDATE Causes RMAN to scan the specified files and verify their contents, testing whether this file can be backed up. RMAN creates no output files. Use this
command periodically to check for physical and logical errors in database files.
使用validate命令能够验证备份集的有效性,官方文档:
To examine a backup set and report whether it can be restored. RMAN scans all of the backup pieces in the specified backup sets and looks at the checksums to verify that
the contents are intact so that the backup can be successfully restored if necessary. Use this command when you suspect that one or more backup pieces in a backup set
are missing or have been damaged. Use VALIDATE BACKUPSET to specify which backups to test; use the VALIDATE option of the RESTORE command to let RMAN
choose which backups to validate. For validating image copies, run RESTORE VALIDATE FROM DATAFILECOPY
演示样例:
RMAN> run {
2> set maxcorrupt for datafile 5 to 2;
3> backup database;}
RMAN> validate backupset 84; using channel ORA_DISK_1
channel ORA_DISK_1: starting validation of datafile backupset
channel ORA_DISK_1: reading from backup piece /home/app/oraten/flash_recovery_area/ORATEN/backupset/2014_11_06/o1_mf_nnndf_TAG20141106T152820_b5p8ro7v_.bkp
channel ORA_DISK_1: restored backup piece 1
piece handle=/home/app/oraten/flash_recovery_area/ORATEN/backupset/2014_11_06/o1_mf_nnndf_TAG20141106T152820_b5p8ro7v_.bkp tag=TAG20141106T152820
channel ORA_DISK_1: validation complete, elapsed time: 00:00:01
validate命令验证的是备份的物理有效性而不是存储在备份中的数据块的物理有效性。
RESTORE ... PREVIEW
该命令进行restore命令的预演,能够在不论什么resotre命令后加上preview来进行还原预演,这个命令仅仅是从数据字典读出须要的备份的元数据。不进行文件的验证。
You can apply RESTORE ... PREVIEW to any RESTORE operation to create a detailed list of every backup to be used in the requested RESTORE operation, as well as the necessary target SCN for recovery after the RESTORE operation is complete. This command accesses the RMAN repository to query the backup metadata, but does not actually read the backup files to ensure that they can be restored.
RMAN> restore database preview; Starting restore at 2014-11-06 15:44:28
using channel ORA_DISK_1 List of Backup Sets
=================== BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
84 Full 551.76M DISK 00:00:18 2014-11-06 15:28:24
BP Key: 52 Status: AVAILABLE Compressed: NO Tag: TAG20141106T152820
Piece Name: /home/app/oraten/flash_recovery_area/ORATEN/backupset/2014_11_06/o1_mf_nnndf_TAG20141106T152820_b5p8ro7v_.bkp
List of Datafiles in backup set 84
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ------------------- ----
1 Full 922948 2014-11-06 15:28:20 /home/app/oraten/oradata/oraten/system01.dbf
2 Full 922948 2014-11-06 15:28:20 /home/app/oraten/oradata/oraten/undotbs01.dbf
3 Full 922948 2014-11-06 15:28:20 /home/app/oraten/oradata/oraten/sysaux01.dbf
4 Full 922948 2014-11-06 15:28:20 /home/app/oraten/oradata/oraten/users01.dbf
5 Full 922948 2014-11-06 15:28:20 /home/app/oraten/oradata/oraten/test01.dbf archive logs generated after SCN 922948 not found in repository
Media recovery start SCN is 922948
Recovery must be done beyond SCN 922948 to clear data files fuzziness
Finished restore at 2014-11-06 15:44:28
RECOVER ... TEST:在内存中模拟recover过程,并不进行真正的recovery,能够用该命令来提起发现recovery中的问题。注意,模拟的recovery和正常recovery可能会遇到不同的问题。
A simulated recovery initiated with the RECOVER ... TEST command in RMAN or SQL*Plus. A trial recovery applies redo in a way similar to normal media recovery, but it never writes its changes to disk and it always rolls back its changes. Trial recovery occurs only in memory.
Trial recovery lets you foresee what problems might occur if you were to continue with normal recovery. For problems caused by ongoing memory corruption, trial recovery and normal recovery can encounter different errors.
validate命令---rman进行备份和回复的验证的更多相关文章
- RMAN常用备份恢复命令汇总
RMAN命令 1.独立命令 RMAN>shutdown immediate RMAN>startup RMAN>backup format 'd:\backup\%d_%s.b ...
- OCP读书笔记(5) - 使用RMAN创建备份
5.Creating Backups with RMAN 创建备份集 RMAN> backup as backupset format '/u01/app/oracle/backup/rmanb ...
- oracle11gRAC环境使用RMAN增量备份方案
转摘:http://blog.itpub.net/29819001/viewspace-1320977/ [oracle@zx ~]$ rman target /Recovery Manager: R ...
- RMAN简单备份
检查目标数据库是否处于归档模式: . 检查数据库模式: sqlplus /nolog conn /as sysdba archive log list (查看数据库是否处于归档模式中) 若为非归档,则 ...
- RMAN增量备份-备份保留策略-设置备份集属性
RMAN增量备份:增量备份级别:0,1,2,3,4BACKUP DATABASE也是创建数据库的完整备份,但是这种备份不同于增量备份的0级备份.这种备份不包含增量备份的0级备份,并不支持在此基础上再创 ...
- RMAN删除备份
删除备份--DELETE命令 用于删除RMAN备份记录及相应的物理文件.当使用RMAN执行备份操作时,会在RMAN资料库(RMAN Repository)中生成RMAN备份记录,默认情况下RMAN备份 ...
- Oracle Rman 增量备份与差异备份
一.增量与差异 关于Incremental增量备份级别: Oracle 9i 共有五种级别 0 1 2 3 4,0级最高-4级最低,0级是1级的基础以此类推. Oracle 10g官方文档明确指出增量 ...
- Oracle 使用RMAN进行备份
备份理论和基本语法 备份概念 执行备份或还原草的数据库称为目标.在一些环境下,有许多数据库,因此有许多RMAN目标.应一次连接每个数据库.目标的每个备份都有一些属性: 打开或关闭 完整或部分 完整或增 ...
- RMAN冗余备份概念与方法
冗余备份概念 RMAN提供了一种更谨慎的备份策略:duplexed方式备份,其实质就是在生成备份集的同时,向指定位置copy指定份数(最大不超过4)的备份集复制,以避免在灾难性事故时数据库损坏和备份丢 ...
随机推荐
- Linux - vim的基本使用
通过which指令来查看文件位置! [root@local ~]# which vim /usr/bin/vim [root@local ~]# which vi /usr/bin/vi [root@ ...
- Google的TensorFlow,微软CNTK, Amazon 的MxNet,Facebook 的Caffe2, PyTorch,国内百度的PaddlePaddle
深度学习框架竞争很激烈,而且看上去都是业界巨头在玩. 老师木:是的.一个深度学习框架一旦像Hadoop那样成为事实工业标准,就占据了人工智能各种关键应用的入口,对各类垂直应用,基于私有部署的技术服务, ...
- 你必须知道的.net导航
http://www.cnblogs.com/anytao/archive/2007/09/14/must_net_catalog.html
- Json转换成DataTable
今天看到Json转DataTable的例子,总结一下.... using System; using System.Collections; using System.Collections.Gene ...
- WinForm上传文件,下载文件
上传文件: 使用OpenFileDialog控件选择文件, 具体代码示例: private void btnUpLoadPic_Click(object sender, EventArgs e) { ...
- jquery自动完成插件的使用
.ui-autocomplete { z-index: !important; max-height: 100px; overflow-y: auto; /* 防止水平滚动条 */ overflow- ...
- RocketMQ之基本信息
1.Producer 即消息生产者,负责产生消息,一般由业务系统负责产生消息. 2.Consumer 即消息消费者,负责消费消息,一般是后台系统负责异步消费. 3.Push Consumer Cons ...
- hdu2112 HDU Today 基础最短路
这题的关键是把车站的名字转化为点的编号.我用的是map.声明一个map<string,int> st,然后按照字符串出现的次序给st赋值.例如:st[s1]=2;代表这字符串s1出现的次序 ...
- RecyclerView实现终极画廊效果 中间突出并且压住两侧布局
先给大家上个gif 要不然下面很枯燥 忘记原来在哪里看到了..... 这个效果我找了NNNNNN长时间,,,我认为凭我现在的能力 写出来需要好久 所以 退而求其次找大神写好的... 你们不要小看了这个 ...
- 读书笔记7-浪潮之巅(part2)
浪潮之巅 ——成功的公司各有各的绝招,而失败的公司倒有不少的共同之处 奔腾的芯(Intel) 前身:在处理器性能还很平庸的年代,站在科技前沿的计算机公司都是集中在工作站级处理器领域的,而同IBM.DE ...