UPDATE误操作,将sysuser表中部分数据更新错了
解决办法
step1 查询sysuser表最后dml操作时间:
select max(ora_rowscn),to_char(scn_to_timestamp(max(ora_rowscn)),‘yyyy-mm-dd hh24:mi:ss’) from sysuser;
step2 查询出误操作前的值,比对是否正确:
select dept from sysuser as of timestamp to_timestamp(‘2019-03-13 16:04:20’,‘YYYY-MM-DD HH24:MI:SS’) where useful=‘1’ and dept IS NOT NULL;
step3 创建tmp_sysuser表
create table tmp_sysuser as select * from sysuser as of timestamp to_timestamp(‘2019-03-13 16:04:20’,‘YYYY-MM-DD HH24:MI:SS’);
step4 rename表(生产环境慎操作)
alter table sysuser rename to sysuser_bak;
alter tabel tmp_sysuser rename to sysuser;