Oracle restoration of deleted tables or table records

Source: Internet
Author: User

I. Table Restoration

If the purge permanent deletion option is not used for accidentally deleted tables, it is expected to be restored from the flash back area. The general steps are as follows:

1. query the deleted table from flash back.

Select * From recyclebin

2. Execute table Restoration

Flashback table TB to before drop. The TB here indicates the name of the table to be restored.

Ii. Table data recovery

If you do not have a truncate statement for the table records that are accidentally deleted, you can choose to restore the records based on the transaction commit time. The general steps are as follows:

1. First query from the flashback_transaction_query view. The view provides the table name, transaction commit time, undo_ SQL, and other fields for query.

For example, select * From flashback_transaction_query where table_name = 'test ';
2. Execute Table Record recovery

Generally, query is performed based on time. The query statement mode is select * from TB as of Timestamp to_timestamp (time, 'yyyy-mm-dd hh24: MI: ss '); TB indicates the table name, and time indicates a certain time point.

For example, select * from Scott. Test as of Timestamp to_timestamp ('2017-12-11 20:53:57 ', 'yyyy-mm-dd hh24: MI: ss ');

If data exists, the restoration is extremely simple. The statement is flashback table TB to timestamp to_timestamp (time, 'yyyy-mm-dd hh24: MI: ss ');

For example, flashback table Scott. Test to timestamp to_timestamp ('2017-12-11 20:47:30 ', 'yyyy-mm-dd hh24: MI: ss ');

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.