[embedplusvideo height=”328″ width=”584″ standard=”http://www.youtube.com/v/nNGLyWIPPTQ?fs=1″ vars=”ytid=nNGLyWIPPTQ&width=584&height=328&start=&stop=&rs=w&hd=0&autoplay=0&react=1&chapters=¬es=” id=”ep8443″ /]
Watch the earlier parts first:
- Writes from the SGA to the data files
- Does deffered writes
- like a hotel room clerk
- kicks blocks out to disk when new data needs free blocks
- writes info to the current group of redo logs
- very important process
- performs instance recovery
- cleans up after sorts
- Monitors Processes
- detects – deadlock detected for example
one big reason for checkpoints is that commonly accessed
data may never get written out to disk. A checkpoint forces
this to get written.
– is the SGA and background processes
Oracle database and the Oracle instance combined is called the Oracle Server.
You can have multiple instances associated with the same database, this is called RAC.
Dedicated server process connects through the PGA.
One of the most important ideas in Oracle is that your data is safe. It is protected from corruption and also from system crashes.
One of the most important ways that it does this is through the Redo logs.
A Redo log record is written to describe the changes every time some data is changed in the database.
This is so that the system can be recovered after a system failure.
If the system suffers a crash like a power failure, all data in the buffers (memory) will be lost.
The redo logs can be used the re-apply all changes that have been made since the data file were last written to.
On recovery, all committed transactions will be re-applied (basically, the SQL will be re-run). All uncommitted transactions will be rolled back.
Without redo logs, you cannot recover after a system failure.
note. You should not use disk caching on disks with redo logs unless that disk caching controller is battery backed up. This is because if the power failed, Oracle would think that data was written to disk but it may be sitting in the cache and would be lost with the power.
Process of modifying data in the Oracle database:
- A change is made to the buffer cache in the database.
- The transaction completes and commit opperation is triggered.
- Redo data is written to the redo log buffers.
- The LGWR (Log Writer) process writes to redo log files on disk.
- Commit operation is complete once the redo log file has been written.
How the Redo logs are structured.
The Redo logs are made up or 2 or more log files or log groups.
A log group is treated the same as log file but it has redundancy. It is simply multiple copies of the same file.
- The two or more files are used in an alternating fashion
- One log file fills up then the next one starts being written to.
- If archivelogmode is enabled, the first redo log file will be archived.
- If the first Redo log file has not finished being archived by the time the last one fills up, the database will wait and not execute any more transactions until the first Redo log file has been fully archived.