Retrieve data before update after update commit

Source: Internet
Author: User

T_sys_client

1. Create a temporary table first
[SQL]

  1. Create TableTmpAsSelect*FromT_sys_clientWhere1 = 0;
2. Insert the queried records into the temporary table
[SQL]
  1. Insert IntoTmpSelect*FromT_sys_clientAs Of TimestampSysdate-10/1440;-- Data generated 10 minutes ago
Select * from t2 as of timestamp sysdate-1/1440 --> 1 represents 1 minute ago, change to 5 represents 5 minutes ago
At this time, it is your previous table. You can use where. However, if I update the t_sys_client record twice within ten minutes, only the last update history is in the tmp table. You need to know the last record of this history,

Create a temporary table.

Insert into tmp1 select * from t_sys_client as of timestamp sysdate-10/1440

So we need to know the second update time.

Specify precise time
Insert into tmp1 select * from t2 as of timestamp to_timestamp ('2017-07-12 10:30:00 ', 'yyyy-MM-DD HH24: MI: ss ');


Flash back is a new 10 Gb feature. Can I turn it off? Flashback table flashback and database Flashback,

Database flash back is disabled by default and needs to be enabled manually

The table is flashed back through undo, and the previous operation was restored through undo.

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.