Wednesday , April 24 2024

Recover A Dropped Table Using Oracle Flashback Drop

In today’s article, we will be learning how to Recover a Dropped Table Using Oracle Flashback Drop.

If a table with certain constraints is dropped and then tried to recover with a flashback, all constraints except the Foreign Key come back, but the foreign key does not.

If a table is dropped with PURGE, it cannot be restored using the Flashback feature.

The reason is that UNDO does not occur during the DROP process and we prevent the data from being thrown into the trash bin where we can return it.

This table can only be restored from backup.

In order to restore a table with flashback, the RECYCLEBIN parameter must be ON.

However, if it has not been deleted with PURGE, it can be restored as follows.

If a tablespace is dropped with DROP TABLESPACE … INCLUDING CONTENTS, its objects do not go to the trash.

If there are objects in the trash can of the tablespace, they are also deleted from the trash can.

If a user is deleted with CASCADE (DROP USER … CASCADE), its objects do not go to the trash.

If there are objects in the user’s trash can, they are also deleted from the trash can.

Below is everything that can be done with Flashback.

1. We drop the table.

2. The table is queried and it is confirmed that there is no information.

3. By querying the trash can, it is seen that the dropped table is there.

4. We recover the table with the flashback table.

5. The table is queried and the data is seen.

NOTE: If there are 2 paintings with the same name in the trash can, the one that was last thrown into the trash bin is returned.

If we want to bring the old one, object_name is written in the table name.

6. Bringing the old DROP from the tables with the same name.

Loading

About Onur ARDAHANLI

Leave a Reply

Your email address will not be published. Required fields are marked *

Categories