Data Recovery after data is accidentally deleted in Oracle and committed

Source: Internet
Author: User

Data Recovery after data is accidentally deleted in Oracle and committed

Background: Table A is deleted due to data misoperations.

-- 1. Back up the current data of Table A first.

-- 2. query the SCN number before a certain time point

Select max (Scn) FROM Sys. Smon_Scn_Time WHERE Time_Dp <To_Date (a time point, 'yyyymmdd hh24: mi: ss ');

-- 3. View table A data at A certain time point

SELECT * from a as of scn 'scn Number OF step 2 ';

-- 4. If you want to view the data, restore it.

SELECT row_movement FROM user_tables WHERE table_name = 'a ';

-- 5. If the result of step 4 is DISABLE, execute the following statement. Otherwise, skip

Alter table a enable row movement;

-- 6. Execute

Flashback table a to scn 'scn Number of step 2 ';

-- 7. If it is enable, no execution is required; otherwise

Alter table a disable row movement;

-- 8. If the permissions are insufficient, change the DBA user to perform the above operations.

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.