Wednesday, March 2, 2022

Oracle RMAN : Restore/ recover a database UNTIL TIME

 This tutorial explains you how to restore/ recover a database until a time.



Oracle RMAN : Restore/ recover a database UNTIL TIME


Here are the steps for Restoring/ Recovering an Oracle database until a specific time in the past:

 

1) Set the environment:

 

on Windows

set ORACLE_SID=DB10
echo %ORACLE_SID%
 

on AIX/Linux

export $ORACLE_SID=DB10

echo $ORACLE_SID

 

2) Connect to rman:

rman target / nocatalog
 

 

3) Start the database in "mount" state:

startup mount;
 

 

4) Run the following :
---------------------------------------
restore database UNTIL TIME
"to_date('11/03/2017 11:34:50 am','mm/dd/yyyy hh:mi:ss am')";

recover database UNTIL TIME
"to_date('11/03/2017 11:34:50 am','mm/dd/yyyy hh:mi:ss am')";

alter database open resetlogs;
---------------------------------------
OR

run
{
set UNTIL TIME "to_date('11/03/2017 11:34:50 am','mm/dd/yyyy hh:mi:ss am')";
restore database;
recover database;
alter database open resetlogs;
}

 

Note:

You have to put the right date/time.

No comments:

Post a Comment

Database Options/Management Packs Usage Reporting for Oracle Databases 11.2 and later (Doc ID 1317265.1)

  Database Options/Management Packs Usage Report You can determine whether an option is currently in use in a database by running options_pa...