---
title: "ORACLE将表中的数据恢复到某一个时间点 "
author: "beee"
date: "2013-11-20T18:21:59Z"
tags: []
categories: ["数据库"]
slug: "oracle"
draft: false
lastmod: "2013-11-20T18:22:30Z"
id: 1978164
url: "https://beee.iteye.com/blog/1978164"
---

执行如下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;