ITeye博客

ORACLE将表中的数据恢复到某一个时间点

beee · 2013-11-20 18:21 · sql · 数据库 · Markdown

执行如下SQL将test_temp表中的数据恢复到 2011 04 29  11:06:00 

注意,这里一定要先删除全部数据,否则可能会导致数据重复

delete from test_temp;
insert into test_temp
  select *
    from test_temp as of timestamp to_timestamp('20110429 11:06:00', 'yyyymmdd HH:mi:ss');

commit;

 

附:truncate后的数据是无法恢复的

truncate table test_temp;

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。