---oracle的一个数据表被删除,如何恢复数据,以及查询是谁进行了操作
1. select object_name,original_name,partition_name,type,ts_name,createtime,droptime from recyclebin;
2. flashback table TAB_test to before drop;
eg:
1、创建一张表
create table testlyj (name varchar2(60));
2、插入一条数据
insert into testlyj(name) values('lyj');
3、查询
elect * from testlyj;
4、删除此表
5、 drop table testlyj (drop table testlyj purge 不经过回收站)
6、按时间倒序非序
select object_name,original_name,partition_name,type,ts_name,createtime,droptime from recyclebin order by createtime desc;
7、恢复操作
FLASHBACK table TESTLYJ to before drop;
------表数据恢复
--查个时间点:
select versions_starttime,
versions_endtime,
versions_xid,
versions_operation name --name是这个表的字段
from testlyj versions between timestamp minvalue and maxvalue
order by VERSIONS_endTIME, versions_starttime;
---只要存在数据 任意时间段
SELECT * FROM testlyj AS OF timestamp to_timestamp('2013-03-06 04:58:03', 'yyyy-mm-dd hh24:mi:ss')
转载于:https://blog.51cto.com/ahead51/1148671