update commit後找回update前資料

來源:互聯網
上載者:User

t_sys_client 

1.首先建立暫存資料表
[sql]

  1. create table tmp as  select * from t_sys_client  where 1=0;  
2. 將查詢的記錄插入到 暫存資料表
[sql]
  1. insert into tmp select * from t_sys_client  as of timestamp sysdate-10/1440;    --10分鐘之前的資料  
select * from t2 as of timestamp sysdate-1/1440         -->  1 代表 1分鐘前,改成5 代表 5分鐘前
這時候臨時就是你以前的表了,可以用 where 。 但是,如果十分鐘之內,我對t_sys_client 的那一條記錄update了兩次,這時tmp表中的,就只有最近一次update的記錄了。要知道這個記錄上一次的記錄,

那就在建立一張暫存資料表

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

這就需要那大概知道 第二個 update 時間了  

指定精準時間
insert into tmp1  select * from t2 as of timestamp to_timestamp('2011-07-12 10:30:00', 'YYYY-MM-DD HH24:MI:SS');


 閃回是10g新特性,那麼閃回可以關掉嗎?閃回分 表閃回和資料庫閃回,

資料庫閃回預設是關閉的,需要手動開啟

表閃回是通過 undo 閃回的,剛才的操作是通過 undo 恢複的

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.