操作方法
启动数据库到mount状态。
开启数据库flashback闪回查询,然后启动数据库到open状态。
创建flashback还原点 SQL>create restore point b4 guarantee flashback database;
解锁scott用户,删掉该用户的emp表; drop table emp purge;
关闭数据库,启动数据库到mount状态
在mount阶段闪回数据库到删除emp表之前的状态 SQL>flashback database to timestamp to_timestamp('2014-12-08 11:31:00','yyyy-mm-dd hh24:mi:ss');
启动数据库到readonly状态,查看emp表是否存在,此时发现emp已经回来了。 SQL>alter database open read only;
到shell终端下导出找回的表格。 $exp scott/tiger tables=emp file=emp.dmp
再次关闭数据库,然后启动到mount状态。
再次闪回数据库到删除emp表之后,关闭数据库之前。 SQL>flashback database to timestamp to_timestamp('2014-12-08 12:00:00'),'yyyy-mm-dd hh24:mi:ss'); 闪回之后使用resetlogs方式打开数据库。
查看scott下的emp表,不存在。
回到shell终端,导入emp表 $imp scott/tiger file=emp tables=emp
再次检查emp表。