Space requirements for log files varies depending on your
needs and on configuration parameter settings.
You will require 56 KB of space for log control files. You will
also need at least enough space for your active log configuration,
which you can calculate as
- (logprimary + logsecond)
× (logfilsiz + 2 ) × 4096
where:
- logprimary is the number of primary log files,
defined in the database configuration file
- logsecond is the number of secondary log files,
defined in the database configuration file; in this calculation, logsecond cannot
be set to -1. (When logsecond is
set to -1, you are requesting an infinite active
log space.)
- logfilsiz is the number of pages in each log
file, defined in the database configuration file
- 2 is the number of header pages required for each log file
- 4096 is the number of bytes in one page.
This
calculation provides a general guideline for planning required disk
space for log files. However, you must ensure to provide sufficient
disk space for potential log archiving failures if the selected log
archiving method fails. This might result in log file retention until
those log files are successfully archived. Therefore, depending on
the rate at which your transactions fill the log files and the time
it takes you to notice a log archiving failure, a number of log files
might be retained and occupy a large amount of the available disk
space. DB2® processes might keep
a few extra archived log files in the log path for performance reasons.
Therefore, you might see more log files in the log path than you expected.
- Roll-forward recovery
- If the database is enabled for roll-forward recovery, special
log space requirements should be taken into consideration:
- With the logarchmeth1 configuration parameter
set to LOGRETAIN, the log files will be archived
in the log path directory. The online disk space
will eventually fill up, unless you move the log files to a different
location.
- With the logarchmeth1 configuration parameter
set to USEREXIT, DISK, or VENDOR,
a user exit program moves the archived log files to a different location.
Extra log space is still required to allow for:
- Online archived logs that are waiting to be moved by the user
exit program
- New log files being formatted for future use
- Circular logging
- If the database is enabled for circular logging, the result of
this formula is all the space that will be allocated for logging;
that is, more space will not be allocated, and you will not receive
insufficient disk space errors for any of your log files.
- Infinite logging
- If the database is enabled for infinite logging (that is, you
set the logsecond configuration parameter to -1),
the logarchmeth1 configuration parameter must
be set to a value other than OFF or logretain to
enable archive logging. The database manager will keep at least the
number of active log files specified by the logprimary configuration
parameter in the log path, therefore, you should not use the value
of -1 for the logsecond configuration
parameter in the above formula. Ensure that you provide extra disk
space to allow for the delay caused by archiving log files.
- Mirroring log paths
- If you are mirroring the log path, you will need to double the
estimated log file space requirements.
- Currently committed
- If queries return the currently committed value of the data, more
log space is required for logging the first update of a data row during
a transaction when the cur_commit configuration
parameter is not set to DISABLED. Depending on the
size of the workload, the total log space used can vary significantly.
This affects the log I/O required for a given workload, the amount
of active log space required, and the amount of log archive space
required.
Note: Setting the cur_commit configuration
parameter to DISABLED, maintains the same behavior
as in previous releases, and results in no changes to the log space
required.