I have actually dropped instead of deleting a table in Oracle SQL.
Drop table emp;
Is there any way to retrieve it back?
For a dropped table to be recoverable, the table space in which the table resides must have the DROPPED TABLE RECOVERY option turned on. This option can be enabled during table space creation, or by invoking the ALTER TABLESPACE statement.
Use the FLASHBACK TABLE statement to restore an earlier state of a table in the event of human or application error. The time in the past to which the table can be flashed back is dependent on the amount of undo data in the system.
You cannot roll back a DROP TABLE statement. Note: For an external table, this statement removes only the table metadata in the database. It has no affect on the actual data, which resides outside of the database.
Actually there exists a way to retrieve back the dropped table. Please find the steps below. When you drop a table, the database does not immediately remove the space associated with the table. Instead, the table is renamed and, along with any associated objects, it is placed in the Recycle Bin of the database. The Flashback Drop operation recovers the table from the recycle bin.
Also please check if you are using oracle 10g and above too.
SQL> drop table vimal;
Table dropped.
SQL> show recyclebin;
ORIGINAL NAME RECYCLEBIN NAME OBJECT TYPE DROP TIME
---------------- ------------------------------ ------------ -------------------
VIMAL BIN$c9/MeUSERvCmafRSweHlWQ==$0 TABLE 2017-01- 06:16:57:29
SQL> flashback table "BIN$c9/MeUSERvCmafRSweHlWQ==$0" to before drop;
Flashback complete.
SQL> select * from vimal;
NAME ID
---------- ----------
f 1
I request you to please read the oracle documentation for further clarification. Please go through them.
Reference can be taken from : https://docs.oracle.com/cd/B19306_01/backup.102/b14192/flashptr004.htm
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With