
oracle用delete误删表数据后可以恢复吗?下面web建站小编给大家实操一遍。
1、根据时间进行恢复
select * from DEMO as of timestamp to_timestamp(‘2022-04-02 16:26:11',‘yyyy-mm-dd hh24:mi:ss');
delete执行时间之前都可以,越小越好,本例以1分钟为例
2、执行以下sql进行数据恢复
flashback table DEMO to timestamp to_timestamp(‘2022-04-02 16:26:11',‘yyyy-mm-dd hh24:mi:ss');
3、新建临时表
create table DEMO1 as select * from DEMO as of timestamp to_timestamp(‘2022-04-02 16:30:11',‘yyyy-mm-dd hh24:mi:ss');
4、将demo1表的数据恢复到demo表中
insert into DEMO select * from DEMO1 where not exists (select * from DEMO where DEMO.id=DEMO1.id);
5、根据scn恢复
查询当前的scn号
select current_scn from v$database;
将scn号减少若干,执行下语句,直到能查看到我们delete的数据为止
select * from DEMO as of scn 166937913;
通过合适的scn号,执行下sql语句进行数据恢复
flashback table DEMO to scn 166937913;
完成了!
上面是“oracle用delete误删表数据后可以恢复吗?”的全面内容,想了解更多关于 mysql 内容,请继续关注web建站教程。
当前网址:https://m.ipkd.cn/webs_2245.html
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

免费在线拼图工具:自由添加文字、箭头、方框和圆圈等功能
为你的DEDECMS面包屑导航自动加入锚文本的一个小
5173游戏交易平台:包括网络游戏的装备、游戏币、账号、点卡、代练、道具及其它数字点卡等在线交易
深度求索(快捷指令):使用 DeepSeek API 增强Siri能力的快捷指令