How To Recover A Drop Tablespace With RMAN (Doc ID 455865.1)
How To Recover A Drop Tablespace With RMAN (Doc ID 455865.1)
Copy right (c) 2024, Oracle. A ll rights reserv ed. Oracle Confidential.
In this Document
Goal
Solution
References
APPLIES TO:
Oracle Database - Enterprise Edition - Version 8.1.7.0 to 11.1.0.8 [Release 8.1.7 to 11.1]
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Backup Service - Version N/A and later
Information in this document applies to any platform.
GOAL
SOLUTION
The RMAN duplicate command cannot be used for a drop tablespace as the current target controlfile being accessed by the
duplicate would not have information about the datafiles associated with the drop tablespace.
Also prior to Oracle 11g release 2, you CANNOT use Tablespace Point In Time Recovery (TSPITR) to recover a dropped
tablespace.
To recover a dropped tablespace in Oracle 11g release 2 or higher, see Note 1277795.1.
Thus, you have one of two options based on your desired effect on the existing database:
1. Restore the entire database and recover back in time to before the tablespace is dropped.
This will cause ALL data within the database to go back in time, not just this tablespace.
2. Clone the target database to a new location, perform point in time recovery in order to export
the data of the tablespace for import into the original database. This causes the data of this
tablespace to be brought back into the production database, not effecting existing (current) data
in any other area of the database.
OPTION #1: Restore target database and recover to a time before the tablespace is dropped:
---------------
1. Determine what 'set until' to use for the restore and recovery:
- find the 'drop tablespace' statement in the alert.log of the target database.
- looking at the time of the drop, subtract about 5 minutes, and record as the time to be used for
the RMAN 'set until'.
For example:
The above shows the tablespace was dropped at 10:21 on Aug 23 2007. We also see that we began to
write to sequence 243 just before the drop.
Using time:
---------------
run
{
set until time "to_date('2007 Aug 23 10:15','yyyy mon dd hh24:mi')";
........
........
}
Using Sequence:
------------------------
run
{
set until sequence 243 thread 1;
........
........
}
Note: See Note 403883.1 and/or Note 372996.1 for more detail on restoring the controlfile.
RMAN> run
{
set until ........................;
restore database;
recover database;
}
As the RMAN duplicate command cannot be used, you must restore and recover the target database back in time to before
the 'drop tablespace'. The procedure would be the same as 'Option #1' above, but in a different location/server than the
original target.
https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=t0g3hk9ha_4#FIX 2/3
18/9/24, 18:53 Document Display
Please follow the detailed steps from below document for this purpose:
Note 223543.1 How to Recover From a DROP / TRUNCATE / DELETE TABLE with RMAN
REFERENCES
NOTE:372996.1 - Using RMAN to Restore and Recover a Database When the Repository and Spfile/Init.ora Files Are Also
Lost
NOTE:403883.1 - How To Restore Controlfile From A Backupset Without A Catalog Or Autobackup
NOTE:731559.1 - How to Move or Transport Table Partitions Using Transportable TableSpace (TTS) Option?
NOTE:1277795.1 - Steps To Recover A Dropped Tablespace Using TSPITR
BUG:3897724 - DUPLICATE FAILS THROUGH DROP TABLESPACE ON TARGET
NOTE:549972.1 - RMAN: SET NEWNAME Command Using SQL
NOTE:223543.1 - How to Recover From a DROP / TRUNCATE / DELETE TABLE with RMAN
Didn't find what you are looking for?
https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=t0g3hk9ha_4#FIX 3/3