0
点赞
收藏
分享

微信扫一扫

Oracel恢复某张表数据到指定时间

yundejia 2022-04-15 阅读 31
Oracle
--oracle没有开启闪回,也没记录日志,最后根据某一时刻的数据还原,具体操作如下:
--根据oracle自己的快照备份查询某一时刻的某张表数据
select * from 	COMPANY as of timestamp to_timestamp('2021-08-15 14:06:00', 'YYYY-MM-DD:HH24:MI:SS');

--可以加条件:
 select * from 	COMPANY as of timestamp to_timestamp('2021-08-15 14:06:00', 'YYYY-MM-DD:HH24:MI:SS')  where id='123';

--可直接删除表数据,再插入历史快照数据:
delete from COMPANY;
commit;
insert into COMPANY select * from COMPANY as of timestamp to_timestamp('2021-08-15 14:06:00', 'YYYY-MM-DD:HH24:MI:SS');
举报

相关推荐

0 条评论