练习使用list failure,advise failure; repair failure;

1 首先备份测试数据文件

RMAN> backup datafile 5;

Starting backup at 06-NOV-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=43 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00005 name=/data/oracle/oradata/aaron/example01.dbf
channel ORA_DISK_1: starting piece 1 at 06-NOV-14
channel ORA_DISK_1: finished piece 1 at 06-NOV-14
piece handle=/data/oracle/flash_recovery_area/AARON/backupset/2014_11_06/o1_mf_nnndf_TAG20141106T001531_b5pck41v_.bkp tag=TAG20141106T001531 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:16
Finished backup at 06-NOV-14

Starting Control File and SPFILE Autobackup at 06-NOV-14
piece handle=/data/oracle/flash_recovery_area/AARON/autobackup/2014_11_06/o1_mf_s_862877747_b5pcknj2_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 06-NOV-14

2 删除测试数据文件

SYS@aaron> !rm /data/oracle/oradata/aaron/example01.dbf

3 重新启动数据库查看错误信息

SYS@aaron> shutdown abort
ORACLE instance shut down.
SYS@aaron> startup
ORACLE instance started.

Total System Global Area  422670336 bytes
Fixed Size    1336960 bytes
Variable Size  314575232 bytes
Database Buffers  100663296 bytes
Redo Buffers    6094848 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: '/data/oracle/oradata/aaron/example01.dbf'

4 重新连接RMAN 并执行 List Failure

RMAN> list failure;

using target database control file instead of recovery catalog
List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
522        HIGH     OPEN      06-NOV-14     One or more non-system datafiles are missing


5 查看建议脚本

RMAN> advise failure;

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
522        HIGH     OPEN      06-NOV-14     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=17 device type=DISK
analyzing automatic repair options complete

Mandatory Manual Actions
========================
no manual actions available

Optional Manual Actions
=======================
1. If file /data/oracle/oradata/aaron/example01.dbf was unintentionally renamed or moved, restore it

Automated Repair Options
========================
Option Repair Description
------ ------------------
1      Restore and recover datafile 5  
  Strategy: The repair includes complete media recovery with no data loss
  Repair script: /data/oracle/diag/rdbms/aaron/aaron/hm/reco_780979516.hm

[oracle@localhost alert]$ more /data/oracle/diag/rdbms/aaron/aaron/hm/reco_780979516.hm
   # restore and recover datafile
   restore datafile 5;
   recover datafile 5;


6 执行恢复操作

RMAN> restore datafile 5;

Starting restore at 06-NOV-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=18 device type=DISK

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 00005 to /data/oracle/oradata/aaron/example01.dbf
channel ORA_DISK_1: reading from backup piece /data/oracle/flash_recovery_area/AARON/backupset/2014_11_06/o1_mf_nnndf_TAG20141106T001531_b5pck41v_.bkp
channel ORA_DISK_1: piece handle=/data/oracle/flash_recovery_area/AARON/backupset/2014_11_06/o1_mf_nnndf_TAG20141106T001531_b5pck41v_.bkp tag=TAG20141106T001531
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:07
Finished restore at 06-NOV-14

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28719055/viewspace-1324389/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/28719055/viewspace-1324389/

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值