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.
1 2 | 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.
1 2 3 4 5 6 | 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.