1select
*from 表名 as
oftimestamp to_timestamp('
2019-04-15 22:00:38
', '
yyyy-mm-dd hh24:mi:ss
');
1select*2
from 表名 as
oftimestamp to_timestamp('
2019-04-16 21:43:38
', '
yyyy-mm-dd hh24:mi:ss')
3minus
4select*5
from 表名;
1 merge into表名 a
2 using (select
*from 表名 as
oftimestamp to_timestamp('
2019-04-16 21:43:38
', '
yyyy-mm-dd hh24:mi:ss')
3 minus select
*from
表名) b
4on (a.id =
b.id)
5when matched then
6update
set a.col =
b.col,
7when
not matched then
8insert
values (b.id, b.col);
1 select * from表名2 minus
3 select * from 表名 as of timestamp to_timestamp('2019-04-16 21:45:38', 'yyyy-mm-dd hh24:mi:ss');
1delete
from
表名 a
2where
exists(3
select
1from(4
select
*from表名5
minus
6select
*from 表名 as
oftimestamp to_timestamp('
2019-04-16 21:45:38
', '
yyyy-mm-dd hh24:mi:ss
')) b
7where a.id = b.id);
如果相隔時間過長的話,資料就回滾不了了,所以一旦資料出現問題,就要立即進行處理。
oracle資料回滾
當我們修改了表的資料並且提交了事務後,想回滾資料怎麼辦?先根據sql執行歷史確定資料回滾時間點 select sql text,last load time from v sql where sql text like update order by last load time desc 再將資料...
Oracle資料回滾
select from 表名 as of timestamp to timestamp 2019 04 15 22 00 38 yyyy mm dd hh24 mi ss alter table 表名 enable row movement alter table 表名 disable row mo...
Oracle資料回滾
今天差一點刪庫跑路 還好有乙個回滾 嚇死 1.查詢某個時間點的資料 select from table as of timestamp to timestamp 2019 12 24 00 00 00 yyyy mm dd hh24 mi ss 2.開啟資料閃回 alter table table ...