How to recover Dropped TABLE FROM FLASH BACK - Oracle
In Oracle, you can recover a dropped table using the Flashback Drop feature if it's enabled. Flashback Drop allows you to recover dropped tables or other objects without having to perform a full database restore. However, this feature is only available if you've enabled and configured the Flashback technology in your Oracle database.
Here are the general steps to recover a dropped table using Flashback Drop:
Check Flashback Feature: Ensure that the Flashback feature is enabled in your Oracle database. You can verify this by querying the
DBA_FLASHBACK_DATABASE
view or by checking the database initialization parameters.Identify the dropped table: You need to know the name of the dropped table and when it was dropped. This information will be useful for the flashback operation.
Determine the retention period: Flashback Drop operates within a specified retention period.
If the table was dropped within this retention period, you can recover it. You can check the value of the
FLASHBACK_RETENTION_TARGET
parameter to see how far back in time you can recover.Perform Flashback Operation:
Use the
FLASHBACK TABLE
command to recover the dropped table.Here's an example:
- Create table RP_TABLE5(N NUMBER); INSERT INTO RP_TABLE5 VALUES(1234); INSERT INTO RP_TABLE5 VALUES(3456); COMMIT; SELECT * FROM RP_TABLE5; DROP TABLE RP_TABLE5; -- dropping table SELECT * FROM RP_TABLE5; FLASHBACK TABLE RP_TABLE5 TO BEFORE DROP;
- -- Dropped table is recovered
- or
- FLASHBACK TABLE RP_TABLE5 TO BEFORE DROP RENAME TO RECOVERED_TABLE;
- -- Dropped table is recovered with new name RECOVERED_TABLE
- SELECT * FROM RP_TABLE5;
- or
- SELECT * FROM RECOVERED_TABLE;