Oracle11g RMAN REPAIR ADVISOR

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> 


你可能感兴趣的:(oracle,oracle,oracle,manager,rman,rman,recovery)