Common SCNFlashBack flash back statements

Source: Internet
Author: User
You can use the SCN_TO_TIMESTAMP (after 10 Gb) function to convert it back to timestamp: selectdbms_flashback.get_system_change_number, SCN_TO_TIME

You can use the SCN_TO_TIMESTAMP (after 10 Gb) function to convert it back to timestamp: select dbms_flashback.get_system_change_number, SCN_TO_TIME

You can use the SCN_TO_TIMESTAMP (10 Gb later) function to convert it back to timestamp:

Select dbms_flashback.get_system_change_number, SCN_TO_TIMESTAMP (dbms_flashback.get_system_change_number) from dual;

You can also use the timestamp_to_scn function to convert a timestamp to SCN:

Select timestamp_to_scn (SYSTIMESTAMP) as scn from dual;

If you want to convert the DATE type to the TIMESTAMP type, use the CAST function.

Select cast (sysdate as timestamp) from dual;

-- Restored to a few minutes ago
Select t. *, t. rowid from ar_mid_acap as of timestamp sysdate-5/1440 t;

-- Restore to a specific time point
Select *
From ar_mid_acap as of scn timestamp_to_scn (To_Date ('2017-4-25 ', 'yyyy-mm-dd hh24: mi: ss '));

-- Change information between two time points
Select v_id, va, versions_startscn, versions_endscn, versions_operation
From t_fb_test versions between scn 12372466 and 12372538
Order by 1;

-- Restore statement undo
Select xid, commit_scn, commit_timestamp, operation, undo_ SQL
From flashback_transaction_query q
Where q. xid in
(Select versions_xid
From t_fb_test versions between scn 23413946 and 23413959 );

-- Restore table
Flashback table goodsinfo1 to before drop;

,

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.