I accidentally deleted some huge number of rows from a table...
How can I roll it back?
I executed the query using PuTTY.
I'll be grateful if any of you can guide me safely out of this...
If you are performing the DELETE within a TRANSACTION , the action can always be rolled-back until you COMMIT it.
Following is an example, which would delete those records from the table which have the age = 25 and then ROLLBACK the changes in the database. SQL> DELETE FROM CUSTOMERS WHERE AGE = 25; SQL> ROLLBACK; Thus, the delete operation would not impact the table and the SELECT statement would produce the following result.
You will need set AUTOCOMMIT=0 , and after you can issue COMMIT or ROLLBACK at the end of query or session to submit or cancel a transaction.
The operation cannot be rolled back. DROP and TRUNCATE are DDL commands, whereas DELETE is a DML command. DELETE operations can be rolled back (undone), while DROP and TRUNCATE operations cannot be rolled back.
If you haven't made a backup, you are pretty much fudged.
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