- 查询误操作表的历史数据信息(此步用于查看可回滚的日期,可选择最近的正确数据日期进行回滚)
select * from 表名 as of timestamp to_timestamp('2019-08-23 17:15:00', 'yyyy-mm-dd hh24:mi:ss');
- 开启表行移动功能
alter table 表名 enable row movement;
- 查看数据闪回功能是否开启
select open_mode,log_mode,flashback_on from v$database;
- 回滚误操作表指定日期的数据
flashback table 表名 to timestamp to_timestamp('2019-08-23 17:15:00', 'yyyy-mm-dd hh24:mi:ss');
- 关闭表行移动功能
alter table 表名 disable row movement;
如果发生误操作表数据,请尽可能在数小时内使用上述方法进行回滚,周期过长,将无法操作。