oracle11g备份出错,备份恢复实验5-oracle11g自动修复

SYS@ora11g>! rm

/u01/oracle/oradata/ora11g/users01.dbf

SYS@ora11g>! rm

/u01/oracle/oradata/ora11g/users01.dbf

SYS@ora11g>create table scott.test_emp as select * from

scott.emp;

create table scott.test_emp as select * from scott.emp

ERROR at line 1:

ORA-01116: error in opening database file 4

ORA-01110: data file 4:

'/u01/oracle/oradata/ora11g/users01.dbf'

ORA-27041: unable to open file

Linux Error: 2: No such file or directory

Additional information: 3

RMAN> list failure;

using target database control file instead of recovery

catalog

List of Database Failures

=========================

Failure ID Priority Status  Time Detected  Summary

---------- -------- --------- -------------------

-------

1102  HIGH  OPEN  2018-02-07 22:23:15 One or

more non-system datafiles are missing

RMAN> advise failure;

List of Database Failures

=========================

Failure ID Priority Status  Time Detected  Summary

---------- -------- --------- -------------------

-------

1102  HIGH  OPEN  2018-02-07 22:23:15 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=20 device type=DISK

analyzing automatic repair options complete

Mandatory Manual Actions

========================

no manual actions available

Optional Manual Actions

=======================

1. If file /u01/oracle/oradata/ora11g/users01.dbf was

unintentionally renamed or moved, restore it

Automated Repair Options

========================

Option Repair Description

------ ------------------

1  Restore and recover datafile 4

Strategy: The repair includes complete

media recovery with no data loss

Repair script:

/u01/oracle/diag/rdbms/ora11g/ora11g/hm/reco_2346148381.hm

[oracle@rhel6 ora11g]$ more

/u01/oracle/diag/rdbms/ora11g/ora11g/hm/reco_2346148381.hm

# restore and recover

datafile

sql 'alter database

datafile 4 offline';

restore datafile 4;

recover datafile 4;

sql 'alter database

datafile 4 online';

RMAN> repair failure;

Strategy: The repair includes complete media recovery with no

data loss

Repair script:

/u01/oracle/diag/rdbms/ora11g/ora11g/hm/reco_2346148381.hm

contents of repair script:

# restore and recover

datafile

sql 'alter database

datafile 4 offline';

restore datafile 4;

recover datafile 4;

sql 'alter database

datafile 4 online';

Do you really want to execute the above repair (enter YES or

NO)? yes

executing repair script

sql statement: alter database datafile 4 offline

Starting restore at 2018-02-07 22:30:53

using channel ORA_DISK_1

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 00004 to

/u01/oracle/oradata/ora11g/users01.dbf

channel ORA_DISK_1: reading from backup piece

/u01/oracle/flash_recovery_area/ORA11G/backupset/2018_02_07/o1_mf_nnndf_TAG20180207T015604_f7mv1ntr_.bkp

channel ORA_DISK_1: piece

handle=/u01/oracle/flash_recovery_area/ORA11G/backupset/2018_02_07/o1_mf_nnndf_TAG20180207T015604_f7mv1ntr_.bkp

tag=TAG20180207T015604

channel ORA_DISK_1: restored backup piece 1

channel ORA_DISK_1: restore complete, elapsed time:

00:00:01

Finished restore at 2018-02-07 22:30:54

Starting recover at 2018-02-07 22:30:54

using channel ORA_DISK_1

starting media recovery

media recovery complete, elapsed time: 00:00:01

Finished recover at 2018-02-07 22:30:56

sql statement: alter database datafile 4 online

repair failure complete

注意:完成自动修复前提是有完整的rman备份且数据库为mount状态

[oracle@rhel6 ora11g]$ ls -lrt

total 1542328

-rw-r----- 1 oracle oinstall  9748480 Dec 30

2016 bak1.ctl

-rw-r----- 1 oracle oinstall  52429312 Feb

7 21:28 redo02.log

-rw-r----- 1 oracle oinstall  52429312 Feb

7 21:28 redo01.log

-rw-r----- 1 oracle oinstall 104865792 Feb  7

21:28 example01.dbf

-rw-r----- 1 oracle oinstall 104865792 Feb  7

22:15 temp00.dbf

-rw-r----- 1 oracle oinstall  5251072 Feb

7 22:30 users01.dbf

-rw-r----- 1 oracle oinstall  62922752 Feb

7 22:31 undotbs01.dbf

-rw-r----- 1 oracle oinstall 713039872 Feb  7

22:31 system01.dbf

-rw-r----- 1 oracle oinstall 513810432 Feb  7

22:33 sysaux01.dbf

-rw-r----- 1 oracle oinstall  52429312 Feb

7 22:33 redo03.log

-rw-r----- 1 oracle oinstall  9748480 Feb

7 22:33 control01.ctl

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值