Query historical data in Oracle-Restore deleted data by mistake

Source: Internet
Author: User

Restore accidentally deleted data information:

1. Execute alter table table_name enable row movement;

2. Execute flashback table table_name to timestamp to_timestamp ('2017-05-24 14:59:36 ', 'yyyy-mm-dd hh24: MI: ss ');


Query historical operation data:

A reasonable method is to first find the accidentally deleted data from the flash back area, and then insert the accidentally deleted data into the original table.

1. Execute select * from a as of Timestamp sysdate-10/1440; 

This SQL statement finds all the data in Table A 10 minutes ago. 

Sysdate-10/1440 indicates that the number 1440 represents 1440 minutes a day before the current 10 minutes. 

If no distance time is written, the SQL statement can be written as: Select * from a as of Timestamp sysdate; to find all the data in Table A up to now.

 2. Find the accidentally deleted data from the data found above, and then insert it into the original table.

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.