1.查找当前的scn的值
SELECT dbms_flashback.get_system_change_number from dual;
假设返回值:140856480
2.统计或查看当前scn值的记录
SELECT count(*) from qt_exame_ver as of scn 140856480;
SELECT * from qt_exame_ver as of scn 140856480;
3.统计或查看当前scn值的记录
SELECT count(*) from qt_exame_ver as of scn 140856000;
SELECT * from qt_exame_ver as of scn 140856000;
一直找到一个合适的scn值,假设是:140848000
4.开启行移动功能,只有开启行移动功能才能对表做闪回
alter table qt_exame_ver enable row movement;
flashback table qt_exame_ver to scn 140848000;
如不支持闪回表,可以使用手动插入
INSERT INTO qt_exame_ver SELECT * from qt_exame_ver as of scn 140848000 where msg_id=18838;
本文介绍如何通过查询系统变更号(SCN)并利用SCN进行Oracle闪回表操作的方法,包括查找当前SCN值、确定合适的SCN值及开启行移动功能等步骤。
1405

被折叠的 条评论
为什么被折叠?



