In this post, we will discuss one of the important physical files in Oracle database that is Online Redo Log File. The activity for the online redo log file can be found here
Oracle 11g Online Redo Log File Management
What is an Online Redo Log File
The most crucial structure for recovery operations is the Online redo log file, which consists of two or more preallocated files that store all changes made to the database as they occur. Every instance of an OracleDatabase has an associated redo log to protect the database in case of an instance failure.
The minimum no.of online redo log file groups that are required to create a database are two. In version 9i, the minimum size of online redo log file is 64k.
If we create a database using dbca,oracle creates online Redolog files of sizes 50MB.
Online Redolog file contains change vectors(old value, new value, transaction, and status of the transaction).
Every change initially has to be recorded into online redo log files. we can also avoid this by creating a tablespace in nologging mode. since online redo logs are very important for instance recovery as well as database recovery, it is recommended to mirror them to avoid a single point of failure.At the time of mirroring place the mirrorred copy in a seperate file system.
Log writer background process writes the data into online redo log files under the following circumstances.
1.If one-third of the redo buffer cache is filled
2.if the data reaches 1 MB
3.If user commits
4.For every 3 secs
5.Before the DB writer writes the data to the respective datafiles.
Log writer writes the data into online redo log files in a cyclic manner.Identical copies of online redolog files within a group are called members.members within a group should be of same size. members across the group can be of varying size but it is not recommended.
An online redolog file will exists in any of the following state
- current -> logwriter pointing to the logfile.
- Active -> an online redolog file which is needed for recovery, or redolog file with data not written to archivelog
- incative -> an online redolog file which is not needed for recovery
- unused -> an online redolog file which is not needed for recovery
- stale -> online redo log file with partial data exists in the stale state.
Archivelog file management:
Database can be configured to run either in archivelog mode or no-archivelog mode.once we configure the database in archive log mode, ARCHIVER background process gets enabled and it picks the content of active online redo log file and generated the archivelog file.
Archive log file is the content copy of online redo log file.
whenever a log switch occurs the current online redolog file is switched to next logfile and previous current logfile becomes active.
- generally log switches under the following circumstances.
- once an online redolog file is filled.
- once the dba switches manually.
If the archivelog destination fills 100% database goes to hung state and it will not allow the user to establish a connection.
Fast Recovery Area
The fast recovery area is an Oracle-managed directory, file system, or Oracle Automatic Storage Management disk group that provides a centralized storage location for backup and recovery files.
Once we configure FRA, by default the following files can be created in FRA
- Archive logs
- Flashback logs
- RMAN Backup sets
- multiplexed control files
- multiplexed redo log files
It is important for a DBA to monitor space in FRA.
Also Read, Online Redo log management – Activity.
Words from dbapath
Thank you for giving your valuable time to read the above information. I hope the content served your purpose in reaching out the blog.
Suggestions for improvement of the blog are highly appreciable. Please contact us for any information/suggestion/feedback.
If you want to be updated with all our articles
please follow us on Facebook | Twitter
Please subscribe to our newsletter.