[20171031]rman xxx Failure.txt
[20171031]rman xxx Failure.txt
--//简单测试 List Failure, Advise Failure and Repair Failure命令在11g下,也许以后工作需要.
--//虽然我自己很少使用这个命令,感觉这个有点傻瓜化.
1.环境:
SYS@book> @ &r/ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
RMAN> report schema;
using target database control file instead of recovery catalog
Report of database schema for database with db_unique_name BOOK
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 760 SYSTEM *** /mnt/ramdisk/book/system01.dbf
2 940 SYSAUX *** /mnt/ramdisk/book/sysaux01.dbf
3 865 UNDOTBS1 *** /mnt/ramdisk/book/undotbs01.dbf
4 128 USERS *** /mnt/ramdisk/book/users01.dbf
5 346 EXAMPLE *** /mnt/ramdisk/book/example01.dbf
6 40 TEA *** /mnt/ramdisk/book/tea01.dbf
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 414 TEMP 32767 /mnt/ramdisk/book/temp01.dbf
2.建立测试环境:
--//建立备份:
delete archivelog all;
backup database format '/home/oracle/backup/full_%U';
backup archivelog all format '/home/oracle/backup/archive_%U';
--//过程略.
3.关闭数据库,删除一个数据文件:
RMAN> shutdown immediate ;
database closed
database dismounted
Oracle instance shut down
$ mv /mnt/ramdisk/book/tea01.dbf /mnt/ramdisk/book/tea01.dbf_20171031
4.启动数据库:
SYS@book> startup
ORACLE instance started.
Total System Global Area 634732544 bytes
Fixed Size 2255792 bytes
Variable Size 197133392 bytes
Database Buffers 427819008 bytes
Redo Buffers 7524352 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
ORA-01110: data file 6: '/mnt/ramdisk/book/tea01.dbf'
SYS@book> select open_mode from v$database ;
OPEN_MODE
--------------------
MOUNTED
5.通过以下命令观察:
--//List Failure;
RMAN> List Failure;
List of Database Failures
=========================
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------------- -------
71648 HIGH OPEN 2017-10-31 15:48:51 One or more non-system datafiles are missing
RMAN> List Failure detail;
List of Database Failures
=========================
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------------- -------
71648 HIGH OPEN 2017-10-31 15:48:51 One or more non-system datafiles are missing
Impact: See impact for individual child failures
List of child failures for parent failure ID 71648
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------------- -------
71651 HIGH OPEN 2017-10-31 15:48:51 Datafile 6: '/mnt/ramdisk/book/tea01.dbf' is missing
Impact: Some objects in tablespace TEA might be unavailable
RMAN> List Failure 71651;
List of Database Failures
=========================
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------------- -------
71651 HIGH OPEN 2017-10-31 15:48:51 Datafile 6: '/mnt/ramdisk/book/tea01.dbf' is missing
Impact: Some objects in tablespace TEA might be unavailable
--//Advise Failure
RMAN> Advise Failure;
List of Database Failures
=========================
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------------- -------
71648 HIGH OPEN 2017-10-31 15:48:51 One or more non-system datafiles are missing
analyzing automatic repair options; this may take some time
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=28 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=41 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=54 device type=DISK
analyzing automatic repair options complete
Mandatory Manual Actions
========================
no manual actions available
Optional Manual Actions
=======================
1. If file /mnt/ramdisk/book/tea01.dbf was unintentionally renamed or moved, restore it
Automated Repair Options
========================
Option Repair Description
------ ------------------
1 Restore and recover datafile 6
Strategy: The repair includes complete media recovery with no data loss
Repair script: /u01/app/oracle/diag/rdbms/book/book/hm/reco_4210181035.hm
$ cat /u01/app/oracle/diag/rdbms/book/book/hm/reco_4210181035.hm
# restore and recover datafile
restore datafile 6;
recover datafile 6;
sql 'alter database datafile 6 online';
--//可以发现修复脚本.再次执行Advise Failure ;还是在目录/u01/app/oracle/diag/rdbms/book/book/hm/生产不同的文件.
--//Repair Failure
RMAN> Repair Failure preview;
Strategy: The repair includes complete media recovery with no data loss
Repair script: /u01/app/oracle/diag/rdbms/book/book/hm/reco_3211653773.hm
contents of repair script:
# restore and recover datafile
restore datafile 6;
recover datafile 6;
sql 'alter database datafile 6 online';
RMAN> Repair Failure ;
Strategy: The repair includes complete media recovery with no data loss
Repair script: /u01/app/oracle/diag/rdbms/book/book/hm/reco_3211653773.hm
contents of repair script:
# restore and recover datafile
restore datafile 6;
recover datafile 6;
sql 'alter database datafile 6 online';
Do you really want to execute the above repair (enter YES or NO)? yes
executing repair script
Starting restore at 2017-10-31 15:55:10
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00006 to /mnt/ramdisk/book/tea01.dbf
channel ORA_DISK_1: reading from backup piece /home/oracle/backup/full_gdsidcrr_1_1
channel ORA_DISK_1: piece handle=/home/oracle/backup/full_gdsidcrr_1_1 tag=TAG20171031T154706
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 2017-10-31 15:55:12
Starting recover at 2017-10-31 15:55:12
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
starting media recovery
media recovery complete, elapsed time: 00:00:00
Finished recover at 2017-10-31 15:55:12
sql statement: alter database datafile 6 online
repair failure complete
Do you want to open the database (enter YES or NO)? YES
database opened
SYS@book> select open_mode from v$database ;
OPEN_MODE
--------------------
READ WRITE
--//OK现在数据库正常打开了.
[20171031]rman xxx Failure.txt的更多相关文章
- [20171206]rman与truncate2.txt
[20171206]rman与truncate2.txt --//上午测试发现truncate的表在做rman备份时还要做8个extents的备份.--//不知道自己的猜测是否正确,选择一个使用UNI ...
- [20171206]rman与truncate.txt
[20171206]rman与truncate.txt --//昨天下班在回家的路上,突然想起以前遇到的问题,就是truncate表后,rman做备份时会备份多少truncate表的信息,--//当时 ...
- [20171130]关于rman备份疑问.txt
[20171130]关于rman备份疑问.txt --//前面测试太乱,重新做一些rman as copy相关测试. 1.环境:SCOTT@book> @ &r/ver1PORT_STR ...
- [20190517]rman tape compressed.txt
[20190517]rman tape compressed.txt --//前一段测试rman选择压缩备份时,如果备份单个数据文件小于64M-3*8K时,先建立大小64M文件,最后会回收到自己的备份 ...
- [20171225]没有备份数据文件的恢复.txt
[20171225]没有备份数据文件的恢复.txt --//别人问的问题,增加了数据文件没有备份,如何恢复,实际上很简单,因为当前控制文件有记录建立时间只要从建立数据文件开始的--//归档日志都存在恢 ...
- 转 rman 恢复报错
###sample 1 原因是新库起了FRA 区,FRA 区的旧文件属于之前的归档日志文件产生,这样会导致无法识别的问题. 解决办法,清空FRA或者恢复时候不启用FRA. RMAN RESTORE ...
- 官方文档 恢复备份指南二 Getting Started with RMAN
本章对RMAN进行基本的熟悉和了解 1.Overview of the RMAN Environment RMAN运行时需要的最小环境: target database ...
- 使用rman恢复数据小结
恢复前提有数据备份 以 alter database open resetlogs 开机以后多要做一次全备(以前的备份失效了) 恢复参数文件: restore spfile from '/home/o ...
- RMAN详细教程(二):备份、检查、维护、恢复
RMAN详细教程(一):基本命令代码 一.创建增量备份 增量备份级别为0-4,但为方便备份管理,oracle建议只限于0级和1级. 1.差异增量备份(differential incremental ...
随机推荐
- 微信开发之获取openid及推送模板消息
有很多的朋友再问我怎么获取code,openid之类的问题,在这里我就给大家分享一下. 在做微信支付是需要获取openid的,推送模板消息也是需要openid包括其他一些功能分享等也都是需要的,ope ...
- HP服务器设置iLO步凑
HP服务器设置iLO步凑 1.开机出现界面—按下F11进入Boot Menu: 2.选择Generic USB Boot回车: 3.选择System Configuration回车: 4.选择iLO ...
- Django集成OpenLDAP认证
本文详细介绍了django-auth-ldap的使用方法,参数含义,并提供了示例代码 版本说明 Django==2.2 django-auth-ldap==1.7.0 集成过程 Django集成LDA ...
- transformer 源码
训练时: 1. 输入正确标签一次性解码出来 预测时: 1. 第一次输入1个词,解码出一个词 第二次输入第一次输入的词和第一次解码出来词一起,解码出来第3个词,这样依次解码,解码到最长的长度或者< ...
- checkbox在vue中的用法总结
前言 关于checkbox多选框是再常见不过的了,几乎很多地方都会用到,这两天在使用vue框架时需要用到checkbox多选功能,实在着实让我头疼,vue和原生checkbox用法不太一样, 之前对于 ...
- python中的函数对象的内存地址是多少
今天和同学讨论一个问题,发现了函数的内存地址和我想象的不一样. 我以为同一个函数,假如给的参数不一样,那么这两个函数的id就不一样. 然后经过实验,发现python为了便于管理函数,所有的函数都放在同 ...
- 一张 JVM 相关的思维脑图(4.4M)
楼主学习 JVM 总结的知识点,用思维脑图串起来,温故而知新,其中含有类加载器,内存布局,GC(右侧). 最多的就是 GC 的内容了. 内容有错误之处,还请指正. 大图地址
- php 中的sprintf 坑
先说下为什么要写这个函数的前言,这个是我在看工作中发现一处四舍五入的bug后,当时非常不理解, echo sprintf('%.2f',123.455); //123.45 echo sprintf( ...
- Maven远程仓库的各种配置
1.远程仓库的配置 在平时的开发中,我们往往不会使用默认的中央仓库,默认的中央仓库访问的速度比较慢,访问的人或许很多,有时候也无法满足我们项目的需求,可能项目需要的某些构件中央仓库中是没有的,而在其他 ...
- 设计模式之状态模式(State )
状态模式是根据其状态变化来改变对象的行为,允许对象根据内部状态来实现不同的行为.内容类可以具有大量的内部状态,每当调用实现时,就委托给状态类进行处理. 作用 当一个对象的内在状态改变时允许改变其行为, ...