Oracle recovers drop mistakenly deleted tables

Source: Internet
Author: User

first, the recovery of the table
for the mistakenly deleted table, as long as not using the Purge permanent delete option, then recover from the flash back area hope is quite large. The general steps are:
1. Query the deleted table from Flash back
SELECT * from RecycleBin
2, the implementation of the table recovery
Flashback table Tbname to before drop; Here the Tbname represents the name of the table you want to restore.
Second, table data recovery
as long as there is no TRUNCATE statement, we can select recovery according to the commit time of the transaction, and the general steps are:
1, the first query from the Flashback_transaction_query view, the view provides the table name for the query, transaction commit time, Undo_sql and other fields.
such as: SELECT * from Flashback_transaction_query where table_name= ' TEST ';
2, the implementation of the table record recovery
The query is usually based on time, and the query statement pattern is
SELECT * from TB as of timestamp to_timestamp (time, ' yyyy-mm-dd hh24:mi:ss '); TB refers to the name of the table
such as SELECT * from Scott.test as of timestamp to_timestamp (' 2009-12-11 20:53:57 ', ' yyyy-mm-dd hh24:mi:ss ');
If there is data, recovery is very simple, the statement is
Flashback table TB to timestamp to_timestamp (time, ' yyyy-mm-dd hh24:mi:ss ');
such as flashback table Scott.test to timestamp to_timestamp (' 2009-12-11 20:47:30 ', ' yyyy-mm-dd hh24:mi:ss ');

NOTE: ALTER TABLE Testvarchar enable row movement;
The purpose of this command is to allow Oracle to modify the ROWID assigned to the row. In Oracle, when a row is inserted, it is assigned a rowid, and this line will always have this rowid. The Flashback table processing completes the delete to the EMP and reinsert the rows so that the rows are assigned a new ROWID. To support flashback, Oracle must be allowed to perform this operation

Oracle recovers drop mistakenly deleted tables

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.