0% found this document useful (0 votes)
25 views

How To Recover A Drop Tablespace With RMAN (Doc ID 455865.1)

Uploaded by

ajfernandezt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

How To Recover A Drop Tablespace With RMAN (Doc ID 455865.1)

Uploaded by

ajfernandezt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

18/9/24, 18:53 Document Display

Copy right (c) 2024, Oracle. A ll rights reserv ed. Oracle Confidential.

How to Recover a Drop Tablespace with RMAN (Doc ID 455865.1)

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

How do I recover from a dropped tablespace with RMAN?

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:

Thu Aug 23 10:21:01 2007


Thread 1 advanced to log sequence 243
Current log# 2 seq# 243 mem# 0: /<path>/redo02.log
Thu Aug 23 10:21:16 2007
drop tablespace test including contents and datafiles
https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-state=t0g3hk9ha_4#FIX 1/3
18/9/24, 18:53 Document Display
Thu Aug 23 10:21:19 2007
Deleted file /<path>/<datafile_name>.dbf
Completed: drop tablespace <tablespace_name> including contents and datafiles

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.

Thus an appropriate 'set until' for RMAN would be:

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: The above syntax tells RMAN to recover to sequence 242.

2. Shutdown the target database and startup with NOMOUNT option:


RMAN> shutdown immediate;
RMAN> startup nomount;

3. Restore a controlfile using the same 'set until'.


RMAN> run
{
set until ........................;
restore controlfile;
}

Note: See Note 403883.1 and/or Note 372996.1 for more detail on restoring the controlfile.

4. Mount the database:


RMAN> alter database mount;

5. Restore and recover the database back in time.

RMAN> run
{
set until ........................;
restore database;
recover database;
}

6. Open the database with resetlogs option:

RMAN> alter database open resetlogs;

OPTION #2: Clone database for data retrieval of dropped tablespace.


---------------

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

You might also like