首先,查询出误操作的那条sql的执行时间:
select v.FIRST_LOAD_TIME,v.* from v$sqlarea v order by v.FIRST_LOAD_TIME desc
获取执行时间后,执行:
create table new_table
as
select * from cpws
as of timestamp to_timestamp('2018-02-06 16:50:16','yyyy-mm-dd hh24:mi:ss')
其中new_table 是新表,用于存放误操作表中的原数据,cpws是误操作的表,“2018-02-06 16:50:16”是误执行sql的时间。
执行结束后,new_table中的数据即是误操作之前的数据。