RMAN - restoring tablespaces/datafiles
Friday, January 14, 2011 at 10:36PM - 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:
- 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
- Once I identified those I jotted down the TABLESPACE they were a part of and the MISSING000## file name Oracle had assigned it.
- I renamed the datafiles via SQLPlus from MISSING000## to its legit name
- I ran a (base) restore and subsequent recover of the datafile
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/...
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