Oracle method for recovering a data table

Source: Internet
Author: User

Today submitted to the client side a SQL script to go with the new historical data, the result of the client side of the deployment personnel made a mistake, directly take the system account to deploy, the result of the first code did not succeed, the second code is executed successfully, and has been submitted, .... Since there is no prior backup of the second Update table data, resulting in the recovery of the underlying data is very difficult, online search for half a day, will now find the method summarized as follows:

1. Execute the following SQL to restore the data from the Test_temp table to July 7, 2016, which is the point in time before the script is executed.

Note that it is important to delete all data first, otherwise it may result in duplication of data

1 SELECT *  from  2as of  TIMESTAMP to_timestamp ('2016-07-07 00:00:00'3  'yyyy-mm-dd hh24:mi:ss' );
Delete from Test_tmp;insert to test_tmp select * from    test_tmp as of timestamp to_timestamp (' 2014-05-28 11:00:00 ', ' Yyyy-mm-dd Hh24:mi:ss ') commit;

Or get Sync node time, the basic and the first method is consistent.

1 SelectTIMESTAMP_TO_SCN (To_timestamp ('2014-05-27 11:00:00','YYYY-MM-DD HH:MI:SS')) 2  fromdual;3OrSelect *  fromSys.smon_scn_timeOrder  byTime_dpdesc;4Get results71547785then5  Insert  intoTest_tmpSelect *  fromTest_tmp as  ofTC)71547785

Attention:

The data after truncate is unrecoverable.

TRUNCATE TABLE test_temp;


2. See the third (this method requires a higher administrative authority, or can not query the reply data)

The data found through this statement is limited because some users may have disconnected the Oracle connection

If you see the above method can solve your problem, do not hesitate, do it quickly, because if the hands of late, the previous operation of the data record may be overwritten, because the storage of small words to be recycled

(Many of the above blogs are quoted from http://vvv-110.iteye.com/blog/2072702)

Oracle method for recovering a data 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.