Recovery is possible due to two structures in your database: the online redo logs (and potentially the archived redo logs if you restore from a backup), and the undo segments.
When an instance crashes, there will be transactions that have not yet committed or rolled back. On an instance crash, we are not concerned with any transactions that have already committed. By definition, a committed transaction has its changes written to disk, so there is nothing to recover in the case of a committed transaction, provided we are just dealing with an instance failure. So the database needs to recover uncommitted transactions. The database read the last active online redo log for the most recent transactions. It uses the information there to replay those transactions just as if the database had never crashed. When the replay of all transactions is complete, the database then rolls back the effect of those transactions since they were never committed. It is safer to assume that active transactions should be rolled back rather than committed when an instance crashes. By using these two structures, the database is able to perform instance recovery.
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.