Main | Help! Oracle database won't shut down »
Friday
Jan142011

RMAN - restoring tablespaces/datafiles

  • Restore a datafile in "Recovery" status
  • Restore a single tablespace
  • Fix these errors: RMAN-00571,RMAN-00569,RMAN-00571,RMAN-03002,ORA-00283,RMAN-11003,ORA-00283,ORA-01111,ORA-01110,ORA-01157,ORA-01111,ORA-01110

I added a few files to a tablespace in trouble. Months later I went to restore the database on another server for a refresh. I didn't remember to call out the newer datafiles in the recovery script I wrote for that refresh.

The database restored, but users soon reported odd errors in the applications hitting it.

Oops.

I'd already done a resetlogs, so I was starting to get a sinking feeling.

Happily I was running Oracle 10.2.x... so I could restore through the resetlogs.

Here's what I did:

  1. Identify which tablespaces and datafiles were offline: In OEM (emctl start dbconsole will give you the URL) I navigated to Administration > datafiles and looked for any datafiles that did not have a status of ONLINE
  2. Once I identified those I jotted down the TABLESPACE they were a part of and the MISSING000## file name Oracle had assigned it.
  3. I renamed the datafiles via SQLPlus from MISSING000## to its legit name
  4. I ran a (base) restore and subsequent recover of the datafile
It looked something like the following

Note that:

  • My backup files were already cataloged
  • The tablespace is ryan_boyer_tablespace
  • The missing datafile is datafile #25
  • The missing datafile should be called "ryanboyer_indx03.dbf"
  • Oracle is calling the missing file MISSING00025
  • The datafile should reside in /u03/oradata/ryanboyer/...
First take the tablespace offline (from RMAN execute like so: sql 'sql command'; ): Now try a recovery/restore in a run block (also executed from RMAN):

In my case the run block failed with the following:

I entered SQLPLUS to get the MISSING0025 datafile renamed to what it should be, ryanboyer_indx03.dbf

I was greeted with Tablespace altered.. Phew.

Now I went back to RMAN and re-ran my restore/recovery:

I was greeted with output similar to the following:

Double *Phew*.

Now I bring the tablespace back online (shown also from RMAN):

Honestly though I was greeted with errors indicating that datafiles that were also a part of that tablespace needed to be restored prior to the tablespace successfully being brought online. Only after repeating the above steps for each datafile in the affected tablespace was I able to bring the tablespace online.

Please comment if you find any of this helpful.

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>