restore、recover到指定時間

lusklusklusk發表於2017-09-18
run{
restore database UNTIL TIME "TO_DATE('2016-02-03 11:00:00','YYYY-MM-DD hh24:mi:ss')";
recover database UNTIL TIME "TO_DATE('2016-02-03 11:00:00','YYYY-MM-DD hh24:mi:ss')";
alter database open resetlogs;
}


run{
set UNTIL TIME "TO_DATE('2016-02-03 11:00:00','YYYY-MM-DD hh24:mi:ss')";
restore database;
recover database;
alter database open resetlogs;
}


run{
set UNTIL TIME "TO_DATE('2016-02-03 11:00:00','YYYY-MM-DD hh24:mi:ss')";

SET NEWNAME FOR DATAFILE 1 to '/u01/app/oracle/oradata/system01.dbf';
SET NEWNAME FOR DATAFILE 2 to '/u01/app/oracle/oradata/sysaux01.dbf';
SET NEWNAME FOR DATAFILE 3 to '/u01/app/oracle/oradata/undotbs01.dbf';
SET NEWNAME FOR DATAFILE 4 to '/u01/app/oracle/oradata/users01.dbf';
SET NEWNAME FOR DATAFILE 5 to '/u01/app/oracle/oradata/blobs01.dbf';

SET NEWNAME FOR TEMPFILE 1 to '/u01/app/oracle/oradata/temp01.dbf';

restore database;

SWITCH DATAFILE ALL;
SWITCH TEMPFILE ALL;

recover database;

alter database open resetlogs;
}

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30126024/viewspace-2145111/,如需轉載,請註明出處,否則將追究法律責任。

相關文章