博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[20171031]rman xxx Failure.txt
阅读量:6224 次
发布时间:2019-06-21

本文共 6525 字,大约阅读时间需要 21 分钟。

[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现在数据库正常打开了.

转载于:https://www.cnblogs.com/lfree/p/7761998.html

你可能感兴趣的文章
热门拍照应用Prisma前途未卜:融资还是被收购?
查看>>
Vestas 利用IBM大数据提升风电运营
查看>>
5G时代,中国将彻底终结美国霸权!wifi和互联网也面临消失!
查看>>
人工智能技术将助力改善移动安全
查看>>
WPS Office Linux版本一年未更新:已中止开发
查看>>
云计算性能常见问题:云计算何处何从?
查看>>
优秀OA系统的五大特性
查看>>
线路愈加明晰?万达牵手IBM进军公有云业务
查看>>
【转】Zookeeper-Watcher机制与异步调用原理
查看>>
纽约州推出“被遗忘权”提案 用户或能要求将个人隐私信息从搜索结果中移
查看>>
降低测试难度及成本 加速物联网普及
查看>>
融入欧洲产业链 华为在数学上投注希望
查看>>
中国实现城域量子隐形传态为全球量子网络打基础
查看>>
超算入云
查看>>
沃达丰完成5G毫微波测试 室外单用户速率达到20Gbps
查看>>
Facebook宣布支持在Android上使用Tor访问
查看>>
即便背靠微信,微信企业号累积 2000 万用户也用了近两年时间
查看>>
MuleSoft发布新的Anypoint Platform,用户可操控API
查看>>
牙疼怎么快速止痛,三招解决牙痛立竿见影
查看>>
大数据云计算悄然改变服务器市场格局 英特尔霸主地位受IBM、ARM威胁
查看>>