Oracle commit之后如何回退--亲测有效

记住大概的时候,获取前一分钟的数据就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’;
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值