oracleoracle11gbackuprecoveryrman

oracle online recovery does not change archived db


created db with dbca choosing asm, fast recovery area, archived mode.

Now I want to backup it preform some tests that would change the content of the db and If need comes then recover it from the backup. I know of export/import utilities but need to use rman in case I need to move the db.

I followed the following tutorial with some caveats with most of the commands succeeding:

https://www.thegeekstuff.com/2013/08/oracle-rman-backup/ https://www.thegeekstuff.com/2014/11/oracle-rman-restore/

RMAN> BACKUP DATABASE PLUS ARCHIVELOG;
SQL> SHUTDOWN
RMAN> STARTUP NOMOUNT;
RMAN> RESTORE CONTROLFILE FROM "+DG1/<DB_NAME>/CONTROLFILE/CURRENT.<3_DIGIT_NUMBER>.<10_DIGIT_NUMBER>"

(before one of these commands) mounted the db with SQL> STARTUP MOUNT because needed exclusive type

RMAN> RESTORE DATABASE;
RMAN> RECOVER DATABASE;
RMAN> ALTER DATABASE OPEN RESETLOGS;

*last one didn't run successfully, outputted that only if badly recovered can be run

the change I've made to check the backup and recovery, was droping a table on one occurrence and inserting a record in another. the problem is after checking the db didnt change to its previous state.


Solution

  • "only if badly recovered can be run" is not a known error message.

    NOthing changed, because you didn't put a limitation on the 'recover' step. So it recovered right back through all the online redo - right back to where it was an instant before you shut it down to do the restore/recover. You need to look at the SET UNTIL command in the rman manuals. SET UNTIL a point in time or scn prior to when you did the activity that you expected to be gone after the restore/recover.

    This is exactly as expected, and exactly what you would do in case of a disaster recovery where you do not want any data loss. In your case you do not want complete recovery, but a Point In Time (PIT) recovery.