Control File:The Control file is another very Important file in the Database.Without Control file,the database will not get started.You can consider Control File as the Brain of the Database which contains Information about :
- Name of the Database
- The timestamp when Database was created
- Name and Location of the Data files and Redo Log files
- Tablespace Information
- Archived Log Info
Imp Points to Keep in Mind:
- Control File is a binary file.It is accessible only to Oracle and can be modified/written to by the same.No user/DBA can edit it.
- Several BG(background) Processes keep on updating/writing to the Control file.Hence Availability of the same is very Important.
- Each control file is associated with only one Oracle database.
- The Control file doesn't verify the existence of Datafiles and Online Redo Log files.
- The Control file plays a very important role in Database Recovery as it contains info about Datafiles created/Dropped,Checkpoint Info (CKPT--- will discuss later)
- It is always advisable to take a backup of your Control File when you are making physical changes to your Database i.e while using "Alter Database" commands.
You will be thinking what would happen if all the Control Files are lost or damaged?
Well in such a case the Instance will abort and we need to start Media Recovery.This is ofcourse a Tedious task . So make sure to preserve your Control Files.
By this you would have surmised the importance of Control File.
Well now Lets talk about our next file which is Redo Log file.
Online Redo Log files:Well have you heard of a Life Line? Yes...
Hmm Oracle too Provides you with a Life Line in case you mess up with your Database.
Online Redo Log files is for You.
This is the Most Imp Structure when it comes to Database Recovery and Instance Failover.
Redo Log files one or more in number form a redo log group.Thus there may be one or more Redo log files in a redo log group and two or more Redo Log groups.
Redo Log files record the details of Data block which is modified.For eg : Say we have a table emp_details in which you are modifying the salary of the emp, then the datablock corresponding to this value of the table will be modified.This info is stored in the Redo Log file.When required you can recontruct the changes made to the Database using redo log entries.
As the name suggests it stores changes made to the data so that you can "redo" those when needed.
Structure and Working :
Redo Log Groups are circular buffer in which data is written to in a circular fashion in the sense that once all files of one Redo Log group are exhausted, redo data is written to files of the next redo log group and then again back to the first one (in case there are 2 redo log groups).
This is called a Log Switch.Switching from one Log group to the other.
Each redo log group is identified by a Log Sequence Number that is overwritten when the log is reused.
Now you would have realised Why we need at least 2 log groups.So that when one redo log group is full and needs switch there is another to take over from it.
LGWR is the Process which writes data from Redo Log Buffer to the Redo Log files.
I will discuss the remaining files in my next post.Besides I will also discuss Background Processes one by one.

