DBA Tips Archive for Oracle

  


Tuning the Redo Log Buffer

by Jeff Hunter, Sr. Database Administrator

All changes (insert, update or delete) made to an Oracle data block will be contained in the Oracle redo log buffer. The redo log buffer gives the Oracle database the ability to recover from a media failure.

If the redo buffers are not large enough, the Oracle log-writer process waits for space to become available. This wait time becomes wait time for the end user. The size of the redo log buffer is defined in the init.ora file using the 'LOG_BUFFER' parameter. The script below can be used to monitor if the log-writer process is waiting for redo log buffers. The time being reported is in 1/100's of a second

     SELECT SUM(value) "Redo Buffer Waits"
     FROM v$sysstat
     WHERE  name = 'redo log space wait time';

LGWR writes redo entries from the redo log buffer to a redo log file. Once LGWR copies the entries to the redo log file the user process can over write these entries. The statistic 'redo log space requests' reflects the number of times a user process waits for space in the redo log buffer. Use the script below to monitor the number of times a user process had to wait for space within the redo log buffer.

     SELECT SUM(value) "Redo Buffer Waits"
     FROM v$sysstat
     WHERE  name = 'redo log space requests';

Here are some tips in sizing the redo logs:

Finally, the following script can be used to view various statistics on your redo log buffer and files.

     COLUMN value FORMAT 999,999,999,990
     COLUMN name FORMAT a31
     SELECT a.name,b.value
     FROM   v$statname a,v$sysstat b
     WHERE  a.statistic# = b.statistic#
        AND a.name like '%redo%';

     NAME                                       VALUE
     ------------------------------- ----------------
     redo synch writes                      4,940,014
     redo synch time                        4,299,767
     redo entries                         203,212,938
     redo size                         47,844,123,778
     redo entries linearized                        0
     redo buffer allocation retries             2,822
     redo small copies                      1,853,067
     redo wastage                       1,051,015,930
     redo writer latching time                 10,898
     redo writes                            5,382,902
     redo blocks written                   98,714,473
     redo write time                        5,216,053
     redo log space requests                      601
     redo log space wait time                  25,567
     redo log switch interrupts                     0
     redo ordering marks                            0


Copyright (c) 1998-2017 Jeffrey M. Hunter. All rights reserved.

All articles, scripts and material located at the Internet address of http://www.idevelopment.info is the copyright of Jeffrey M. Hunter and is protected under copyright laws of the United States. This document may not be hosted on any other site without my express, prior, written permission. Application to host any of the material elsewhere can be made by contacting me at jhunter@idevelopment.info.

I have made every effort and taken great care in making sure that the material included on my web site is technically accurate, but I disclaim any and all responsibility for any loss, damage or destruction of data or any other property which may arise from relying on it. I will in no case be liable for any monetary damages arising from such loss, damage or destruction.

Last modified on
Monday, 16-Apr-2001 00:00:00 EDT
Page Count: 49815