取消

Oracle全表update恢复

oracle执行update没有带where条件,造成全表更新。


问题

oracle执行update没有带where条件,造成全表更新。

解决

1
2
3
4
5
6
7
8
9
1.select * from V$SQL where SQL_TEXT like '%%'--根据修改语句查出你需要恢复的时间点

2.create table new_table as select * from table as of timestamp to_timestamp('2020-09-10 11:44:25','yyyy-mm-dd            hh24:mi:ss');

--new_table :新建表的名; table :误操作的表名;  2020-09-10 11:44:25:保存这个时间点的数据到新表。

3.delete table ;--将原表的数据全部删除

4.insert into table select * from new_table ;--把恢复的数据保存到原表。

参考资料

本文会经常更新,请阅读原文: https://dashenxian.github.io/post/Oracle%E5%85%A8%E8%A1%A8update%E6%81%A2%E5%A4%8D ,以避免陈旧错误知识的误导,同时有更好的阅读体验。

知识共享许可协议

本作品采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可。欢迎转载、使用、重新发布,但务必保留文章署名 小神仙 (包含链接: https://dashenxian.github.io ),不得用于商业目的,基于本文修改后的作品务必以相同的许可发布。如有任何疑问,请 与我联系 (125880321@qq.com)

登录 GitHub 账号进行评论