Delete data from table in PL/SQL and submit recovery method

Source: Internet
Author: User

Recently in the operation of the table data, deleted the table data, but want to restore, and later found an official document, it is quite useful, as follows:

Run in PL/SQL, select * from A as of TIMESTAMP to_timestamp ('20150401', ' yyyymmdd ');

This principle is the use of Flashback query This feature, the most commonly used is to repair the wrong operation of the data. Note that this is not to say that flashback query can recover data. Flashback query itself does not restore any action or modification, nor does it tell you what has been done or modified, in fact, when the Flashback query feature is actually applied, it is based on the extension of the standard Select, which enables the user to query a record in a table at a specified point in time. The equivalent of having the ability to see the past.

Note: 1. Red marking time must be changed to the most appropriate time for you to delete data, so as to ensure that the data to the maximum possible to be queried, then you can export the data. sql file, and then insert to the original table

2.AS of timestamp is very convenient to use, but in some cases we recommend using the as of SCN to execute flashback Query. If you need to restore multiple tables with primary foreign key constraints, if you use the as of timestamp, the data selection or insertion failure may be caused by inconsistent time points, and the as of SCN ensures that the recording processing time is consistent.

Delete data from table in PL/SQL and submit recovery method

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.