How to undo DROP TABLE statement without backup in SQL?
Asked
Active
Viewed 319 times
-1
-
2Ooops.You cant.Use backups. – Mihai Jan 04 '15 at 10:20
-
2This is impossible to answer without knowing what RDBMS (MySQL, Oracle, DB2 etc.) you are using. – Ben Jan 04 '15 at 10:24
-
Which DBMS are you using? Did you already commit the drop? If not, you can rollback it in some DBMS. – Jan 04 '15 at 11:02
1 Answers
1
If you are using Oracle then you can use flashback drop. For more details check this link http://docs.oracle.com/cd/B19306_01/backup.102/b14192/flashptr004.htm
SQL> drop table mytab;
Table dropped.
SQL> select original_name from dba_recyclebin;
Original Name
--------------------------------
MYTAB
SQL> flashback table MYTAB to before drop;
Flashback complete.
SQL> select * from mytab;
ID
----------
2
2

Ben
- 51,770
- 36
- 127
- 149

Manoj Kumar
- 745
- 2
- 8
- 29