Oracle recovers deleted data

Source: Internet
Author: User

  There are two ways to recover from SCN and timestamp.

I. Recovering deleted and committed data through the SCN
    • Querying the current SCN
Select  from v$database

  

    • Narrow the scope to query

Queries the current SCN to 14543776308552, querying the SCN corresponding to the current SCN for table data.

Select *  from  as  of 14543776308550 -- determine if the deleted data exists and, if present, recover the data; otherwise continue to shrink the SCN number
    • Recovering data
Table  to 14543776308550;
Second, the recovery by time stamp
    • Querying the current system time
Select ' YYYY-MM-DD Hh24:mi:ss '  from dual;
    • Querying data before deleting data points in time
Select *  from  as  of timestamp to_timestamp ('2018-02-13 15:48:00'yyyy-mm-dd hh24: Mi:ss'--  if not, continue to narrow the time frame
    • Recovering data
Table  to timestamp to_timestamp ('2018-02-13 15:48:00','yyyy-mm-dd hh24:mi : ss');

Note: If there is an error executing the recovery data sql, you can execute: ALTER TABLE name enable row movement; Allow change of time stamp

Oracle recovers deleted data

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.