Home » RDBMS Server » Server Administration » The function of the redo log?
The function of the redo log? [message #50966] Tue, 16 April 2002 11:44 Go to next message
Goryan
Messages: 2
Registered: April 2002
Junior Member
Hi,

I am wondering why the Oracle server writes to the redo log anyway? Why can it first put changed blocks in some memory buffer and then when the transaction commits or rollbacks write them to disk or from the rollback segment respectively? They say redo logs are for recovery, but if blocks are written directly to disk when commited transactions what is the purpose of recovery?

Clearly I am missing something crucial...HELP...
Re: The function of the redo log? [message #50967 is a reply to message #50966] Tue, 16 April 2002 13:30 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
your right.
But the purpose of redolog is also to provide a redo functionality.( like rollback segment is for undo functionality).
if you want the database to be recovered to the latest time point, then u need to apply the logs too.
in simple words, u need all the actions that are done before, to repeated again. like u create a table,insert data, delete some,again insert some etc etc.
so u can apply the logs in the same manner...or just in the same steps. similarly u apply the rollback data also. thus after the recovery the database will be synchronized.
yes. the commited data is written through the disk.
what if , in a typical scenario, u want to trash all the data for the last 30 days? or after recovery u want the database to be in the state that was a 30 days before?.
to do all these, u need to have redolog files.
a more genuine example would be MS-Word.
we all know ctrl+z undo's(deletes the last action) what we have typed.
and ctrl+y redo's(repeats the last action) what we have typed.
Re: The function of the redo log? [message #51206 is a reply to message #50966] Tue, 07 May 2002 02:40 Go to previous message
irfan
Messages: 19
Registered: July 2001
Junior Member
Dear Friend,

What if you have passed dozens of transactions and forgotten to enter COMMIT and suddenly your computer crashes or electricity goes off. Your precious data would be lost forever or rolled back. You then have to repeat typing all the transactions causing you headache or backache ;)

Dont think of a single user environment. Take the scenario of a Financial Institution (Bank) where every single transaction means the increase or decrease of currency from an account. Anything could happen to data in such an environment without notifying you.

RedoLogs are the best way to preserve date even when the system crashes.

I hope your confusion is gone with the wind ;)
Previous Topic: Benefits of OCP
Next Topic: rollback tablespace and logging
Goto Forum:
  


Current Time: Mon Sep 09 18:49:46 CDT 2024