Redo log files

Redo log files are operating system files used by Oracle to maintain logs of all transactions performed against the database. The primary purpose of these log files is to allow Oracle to recover changes made to the database in the case of a failure.

An Oracle database must have at least two redo log files, and most databases have more than two. These files are written by the LGWR process in a circular fashion; that is, when the last log file is filled, the first log file is reused. For example, if a database has three redo log files, blocks will be written to file1 until it is filled; then that file is closed, and LGWR begins writing to file2 (this is called a log switch). When file2 is filled, LGWR switches to file3. When file3 is filled, file1 is reused, and so on.

If the database is being operated in archivelog mode, then at the time of a log switch, the ARCH process copies the contents of the log file just filled to the ARCHIVE_LOG_DEST directory, giving the archived log file a unique name using a sequential number. These archived log files may be used during a database recovery to restore transactions made after the last complete backup of the database. If the ARCH process cannot finish copying before Oracle needs to use the log file again, all database activity stops until archiving is finished. Since this can have a significant effect on performance, make sure to create enough log files to prevent this from happening.

Because redo log files are so critical to ...

Get Oracle Database Administration: The Essential Refe now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.