Oracle 11g – How to Recover Database Without New Data

oracleoracle-11g

I have oracledb 11g. I setup archivelog mode on my server. There's my backup\recovery scenario:

rman TARGET SYS/pass@XE
RMAN> backup database plus archivelog;

After that I make changes to the data tables. Create new customer as example.
After that I execute in rman:

shutdown immediate;
startup mount;
restore database;
recover database; 
alter database open;

My server is started. I run my application and creater customer is there… Where's my mistake? I tried delete all dbf from db folder. And after restore database I saw my new customer. How can I restore a database without the data that was added to the database after the backup?

Best Answer

You performed a complete recovery. Recovery uses the available archivelogs and redo logs as well.

To perform an incomplete recovery until the time that's before the changes, use:

recover database until time "to_date('2018-02-24 15:05:20', 'YYYY-MM-DD HH24:MI:SS')";
alter database open resetlogs;

Set the point of time as needed.