If the log files are too small or if there are not enough of them in the ring, Oracle may have to stall on a log switch.
If this happens, the DMLs in the next log in the ring may not have been written to the tablespace files, and therefore the next log file has not been archived by the background ARCH process. For more information about Redo log archiving, see the Oracle documentation.
Redo log files are created when the database is created. You should have at least four Redo log files, each 2 MB in size. If the disk space is available, using more than four Redo log files further reduces the chances of delayed log switches. Larger Redo log files improve performance, but care must be taken to adequately schedule checkpoints that write DMLs stored in the Redo logs to the tablespace files.
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.
Redo log files that are no longer required for instance recovery are called inactive redo log files. A log switch is the point at which the database stops writing to one redo log file and begins writing to another. Normally, a log switch occurs when the current redo log file is completely filled and writing must continue to the next redo log file. However, you can configure log switches to occur at regular intervals, regardless of whether the current redo log file is completely filled.
You can also force log switches manually. Oracle Database assigns each redo log file a new log sequence number every time a log switch occurs and LGWR begins writing to it. When the database archives redo log files, the archived log retains its log sequence number. A redo log file that is cycled back for use is given the next available log sequence number.
Each online or archived redo log file is uniquely identified by its log sequence number. During crash, instance, or media recovery, the database properly applies redo log files in ascending order by using the log sequence number of the necessary archived and redo log files.
Skip Headers. What Is the Redo Log? Redo Threads When speaking in the context of multiple database instances, the redo log for each database instance is also referred to as a redo thread. Redo Log Contents Redo log files are filled with redo records. Active Current and Inactive Redo Log Files Oracle Database uses only one redo log files at a time to store redo records written from the redo log buffer. Log Switches and Log Sequence Numbers A log switch is the point at which the database stops writing to one redo log file and begins writing to another.
All rights reserved.
0コメント