Oracle11g RMAN REPAIR ADVISOR

本文介绍了一次数据库系统文件丢失后的故障排查和修复过程,包括使用RMAN工具进行数据文件的恢复,并详细说明了故障原因、修复步骤和后续验证,旨在为数据库管理员提供有效的故障处理指南。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

USING RMAN REPAIR ADVISOR:

Go to /u01/app/oracle/oradata/wbdb and rename system01.dbf to system01.dbf.old

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

[oracle@zhongwc wbdb]$ mv system01.dbf system01.dbf.old
[oracle@zhongwc wbdb]$ ll
total 1850284
-rw-r----- 1 oracle oinstall   9748480 Mar  6 15:44 control01.ctl
-rw-r----- 1 oracle oinstall 104865792 Mar  6 15:44 example01.dbf
-rw-r----- 1 oracle oinstall  52429312 Mar  6 15:19 redo01.log
-rw-r----- 1 oracle oinstall  52429312 Mar  6 15:19 redo02.log
-rw-r----- 1 oracle oinstall  52429312 Mar  6 15:44 redo03.log
-rw-r----- 1 oracle oinstall 702554112 Mar  6 15:44 sysaux01.dbf
-rw-r----- 1 oracle oinstall 723525632 Mar  6 15:44 system01.dbf.old
-rw-r----- 1 oracle oinstall  30416896 Mar  5 22:00 temp01.dbf
-rw-r----- 1 oracle oinstall  10493952 Mar  6 15:44 test01
-rw-r----- 1 oracle oinstall  20979712 Mar  6 15:44 test02
-rw-r----- 1 oracle oinstall 110108672 Mar  6 15:44 undotbs01.dbf
-rw-r----- 1 oracle oinstall  45883392 Mar  6 15:44 users01.dbf
[oracle@zhongwc wbdb]$ 

Next try to startup database…will fail with error that SYSTEM01.DBF is missing.

[oracle@zhongwc ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Tue Mar 6 15:52:12 2012

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  839282688 bytes
Fixed Size                  2217992 bytes
Variable Size             624953336 bytes
Database Buffers          209715200 bytes
Redo Buffers                2396160 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
ORA-01110: data file 1: '/u01/app/oracle/oradata/wbdb/system01.dbf'


SQL> 

[oracle@zhongwc ~]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Tue Mar 6 15:54:10 2012

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: WBDB (DBID=4225961736, not open)

RMAN> list failure;

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

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
302        CRITICAL OPEN      06-MAR-12     System datafile 1: '/u01/app/oracle/oradata/wbdb/system01.dbf' is missing

RMAN> list failure detail;

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

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
302        CRITICAL OPEN      06-MAR-12     System datafile 1: '/u01/app/oracle/oradata/wbdb/system01.dbf' is missing
  Impact: Database cannot be opened

RMAN> advise failure;

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

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
302        CRITICAL OPEN      06-MAR-12     System datafile 1: '/u01/app/oracle/oradata/wbdb/system01.dbf' is missing
  Impact: Database cannot be opened

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 /u01/app/oracle/oradata/wbdb/system01.dbf was unintentionally renamed or moved, restore it

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

RMAN> repair failure preview;

Strategy: The repair includes complete media recovery with no data loss
Repair script: /u01/app/oracle/diag/rdbms/wbdb/wbdb/hm/reco_1451996614.hm

contents of repair script:
   # restore and recover datafile
   restore datafile 1;
   recover datafile 1;

RMAN> repair failure noprompt;

Strategy: The repair includes complete media recovery with no data loss
Repair script: /u01/app/oracle/diag/rdbms/wbdb/wbdb/hm/reco_1451996614.hm

contents of repair script:
   # restore and recover datafile
   restore datafile 1;
   recover datafile 1;
executing repair script

Starting restore at 06-MAR-12
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 00001 to /u01/app/oracle/oradata/wbdb/system01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/WBDB/backupset/2012_03_06/o1_mf_nnndf_TAG20120306T151010_7ocg2m3g_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/flash_recovery_area/WBDB/backupset/2012_03_06/o1_mf_nnndf_TAG20120306T151010_7ocg2m3g_.bkp tag=TAG20120306T151010
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
Finished restore at 06-MAR-12

Starting recover at 06-MAR-12
using channel ORA_DISK_1

starting media recovery
media recovery complete, elapsed time: 00:00:02

Finished recover at 06-MAR-12
repair failure complete
database opened

RMAN> exit


Recovery Manager complete.

[oracle@zhongwc ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Tue Mar 6 16:11:38 2012

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ WRITE

SQL> select file_name from dba_data_files;

FILE_NAME
----------------------------------------------------------------------------------------------------
/u01/app/oracle/oradata/wbdb/users01.dbf
/u01/app/oracle/oradata/wbdb/undotbs01.dbf
/u01/app/oracle/oradata/wbdb/sysaux01.dbf
/u01/app/oracle/oradata/wbdb/system01.dbf
/u01/app/oracle/oradata/wbdb/example01.dbf
/u01/app/oracle/oradata/wbdb/test01
/u01/app/oracle/oradata/wbdb/test02

7 rows selected.

SQL> 


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值