记住大概的时候,获取前一分钟的数据就OK。
insert into t1 select * from t1 as
of timestamp to_timestamp(‘2009-03-17 11:06:00’,‘yyyy-mm-dd hh24:mi:ss’) ;
参考:https://blog.csdn.net/zl834205311/article/details/86605494
https://blog.csdn.net/zuimeitulip/article/details/84547946
eg1:
select tpp.rowid,tpp.* from t_pc_program tpp where task_name=‘test1220test1013’
– 查询时间戳,提交的时间。
–insert into t_pc_program
select * from t_pc_program as of timestamp to_timestamp(‘2019-07-17 14:45:00’,‘yyyy-mm-dd hh24:mi:ss’) where task_name=‘test1220test1013’
– 回退,找回数据。
flashback table t_pc_program to timestamp to_timestamp(‘2019-07-17 14:45:00’,‘yyyy-mm-dd hh24:mi:ss’)
– 如果报错,未启用行移动功能,不能闪回表;
alter table t_pc_program enable row movement;
eg2:
如果更新的话,再插入会有两条数据,所以不能插入,根据查出来的值,再去手动更新回去。删除的话可以如此恢复。
select task_name,project_inv_at from t_pc_prog as of timestamp to_timestamp(‘2019-07-17 11:00:00’,‘yyyy-mm-dd hh24:mi:ss’) where task_cd=‘24.2400_0057’;