oracle-databaserman

What happens to not commited transaction in oracle RMAN backup


I have written script for oracle backup and restore using RMAN. Note i took backup database + archive logs

Now, I did some sql statement in oracle but not commited transaction then it may be somewhere in redo logs i am not sure about it.

Now, In above situation i took backup database + archive log and did restore.

Non-commited data was not present.

I am confuse about this scenario, Does this scenario is correct or it is missing my data or i missed somewhere.


Solution

  • This is perfectly fine. Your transaction is in fact at redo. But since you didn't commit it the recover process rolled it back after reapplying it because it couldn't find a commit statement at the end of the redo stream. This is by design. The opposite would be a problem, if you had committed a statement, no matter what happened with the server (power loss, crashed) you should be able to see it after restoring the server and applying all of redo/archives.

    The reason for that is that once you commit, all of the work to reexecute your transaction should be stored at disk (redo log file). There are other types of commit (COMMIT WRITE NOWAIT, for example) that bypass this behaviour and should be avoided.

    Hope this helps.