1.设置好nls_date_format;
SQL> alter system set nls_date_format='yyyy-mm-dd hh24:mi:ss' scope=spfile;
System altered.
SQL> shutdown immediate;
SQL> startup编译profile,设置NLS_DATE_FORMAT
export NLS_DATE_FORMAT='yyyy-mm-dd hh24:mi:ss'
2.删除表的记录,确认删除时间。
SQL> select count(*) from hr.test;
COUNT(*)
----------
700
SQL> truncate table test;
Table truncated.
3.尝试恢复
RMAN> startup mount;
RMAN> run {
2> set until time='2010-08-27 16:55:10';
3> restore database;
4> recover database;
5> }
4.用resetlogs模式open database
SQL> alter database open resetlogs;
Database altered.
SQL> select count(*) from hr.test;
COUNT(*)
----------
700
5.全备数据库
6.基于SCN的恢复,只需要替换set until time='xxx' 为set until scn=xxx
联系客服