Redo logs are the most important component of oracle database. The way oracle manages its redo logs is known as redo mechanism and is the most salient feature of oracle database. It is this mechanism that differentiates oracle from other database vendors. The basic purpose of redo mechanism is to facilitate recovery. Redo Mechanism involves log buffer, log writer, online redo log, and archived redo log.
Redo log files are logically arranged in the form of groups. Normally each group has two members i.e. two redo log files. The members (files) in a group are of same size. Or you can say that a set of similar copies of redo log files is known as group. This grouping of redo log files is logical. It is hidden even from the operating system. Oracle manages them all by itself. Each group has a number assigned to it which is called Log Sequence Number. Members inside a group have same LSN and it is assigned each time log writer starts writing on redo log files. Within each member of the group there are entries. These are redo log entries; one per transaction. These redo log entries also have a unique number assigned to it which is called System Change Number. These two I mean Log Sequence Number (LSN) and System Change Number (SCN) have a great role to play in the Instance Recovery.
When LGWR writes on these groups it writes on both members of the group simultaneously. If you increase the number of members in the group that extra member will not be an exception to this mechanism. In simple words it uses the concept of multiplexing. When the first group is full it switches to the next and so forth. When LGWR switches from one log group to the other it is known as log switch.
When a log switch occurs the event of check point occurs. Here the CKPT performs both of its functions. First it asks the DBWR to write. Note here the synchronization again that before DBWR, LGWR will write. And second it writes the check point information to control files and to the header of data files. What is the check point information? It includes the LSN and SCN numbers. One point worth mentioning here is that LSN is stored normally of the next redo group (the group to which you are switching); and SCN is stored of the previous group (the group from which you are switching). It is clear now that LSN and SCN stored in the control files and in the data file’s header indicate that until them the data is stored back on disc and is safe.
No comments:
Post a Comment