当我们误删/修改数据之后,要进行数据恢复,需要有数据库管理员权限才能实现,所以奉劝各位修改数据要好好确认,搞出异常来就很麻烦了。下面是一个数据恢复简单的例子:
DML Sql
这里展示了修改的sql
UPDATE XX_MES_PROCESS SET PROCESS_ID=2;
commit;
管理员查询修改的时间点
select * from V$SQL WHERE SQL_TEXT like '%UPDATE XX_MES_PROCESS SET PROCESS_ID=2%'
备份数据,删除修改
create table lin.XX_MES_PROCESS_bak as select * from lin.XX_MES_PROCESS as of timestamp to_timestamp('2024-01-05 23:00:34','yyyy-mm-dd hh24:mi:ss');
SELECT * FROM lin.XX_MES_PROCESS_bak
DELETE * FROM lin.XX_MES_PROCESS ;
INSERT INTO lin.XX_MES_PROCESS SELECT * FROM lin.XX_MES_PROCESS_bak;
COMMIT;