Oracle RMAN Recover Database Until Time

In many cases you need to recover an Oracle database until time in the past or a point in time recovery because there was some kind of error or someone made a mistake.

First you need to shut down the database and start it in mount state.

shutdown immediate
startup mount

Then you can run this command inside RMAN after connecting with rman target / or with a catalog if you also have one.

run {
set until time "to_date('22-07-2019 16:30:00','DD-MM-YYYY HH24:MI:SS')";
restore database;
recover database;
alter database open resetlogs;

After this, it is advised that you do a full database backup.

Leave a Reply

Your email address will not be published. Required fields are marked *