oracle
用delete
误删表数据后可以恢复吗?下面编程教程网小编给大家实操一遍。
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 内容,请继续关注编程基础学习网。
织梦狗教程
本文标题为:oracle用delete误删表数据后可以恢复吗?


基础教程推荐
猜你喜欢
- MySQL如何优化查询速度 2023-12-18
- 必须会的SQL语句(六) 数据查询 2024-01-10
- Redis SCAN命令 2024-02-07
- ex:Redis使用代码 2023-09-12
- 详解mysql跨库查询解决方案 2022-08-31
- 一篇文章带你弄清楚Redis的精髓 2023-07-13
- MySql视图触发器存储过程详解 2024-01-08
- 让Redis突破内存大小的限制 2023-09-12
- Python技巧之四种多线程应用分享 2023-07-28
- Ubuntu下载安装Redis 2024-01-30