Wednesday, May 14, 2014

Recover datafile from image copy



Unable to bring the tablespace to online, needs media recovery
==========================================

RMAN> sql "alter tablespace example online";

sql statement: alter tablespace example online
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of sql command on default channel at 05/14/2014 07:49:56
RMAN-11003: failure during parse/execution of SQL statement: alter tablespace example online
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: '+DATA/cvrman/datafile/example.dbf'


1. List failure from the RMAN prompt, (get the failure details using list failure command in the rman prompt)

RMAN> list failure 2348 detail;

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

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
2348       HIGH     OPEN      14-MAY-14     One or more non-system datafiles are missing
  Impact: See impact for individual child failures
  List of child failures for parent failure ID 2348
  Failure ID Priority Status    Time Detected Summary
  ---------- -------- --------- ------------- -------
  2351       HIGH     OPEN      14-MAY-14     Datafile 5: '+DATA/cvrman/datafile/example.dbf' is missing
    Impact: Some objects in tablespace EXAMPLE might be unavailable


3. Check for the copy of tablespace example

RMAN> list copy of tablespace example;

List of Datafile Copies
=======================

Key     File S Completion Time Ckp SCN    Ckp Time
------- ---- - --------------- ---------- ---------------
30      5    A 14-MAY-14       1064695    14-MAY-14
        Name: +DATA/cvrman/datafile/example.308.847525493
        Tag: TAG20140514T074452


4.switching the datafile to copy

RMAN> switch datafile 5 to copy;

datafile 5 switched to datafile copy "+DATA/cvrman/datafile/example.308.847525493"

5.Recover the tablespace example

RMAN> recover tablespace example;

Starting recover at 14-MAY-14
using channel ORA_DISK_1

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

Finished recover at 14-MAY-14


6.Bring the tablespace back to online
RMAN> sql "alter tablespace example online";

sql statement: alter tablespace example online






No comments: