Use database logging configuration parameters to specify
data logging options for your database, such as the type of logging
to use, the size of the log files, and the location where log files
should be stored.
About this task
You can configure database logging options using the UPDATE
DATABASE CONFIGURATION command on the command line processor
(CLP), through the Configure Database Logging wizard
GUI in the Control Center, or by calling the db2CfgSet API.
Before you begin
To configure database logging options, you must have SYSADM,
SYSCTRL, or SYSMAINT authority.
Procedure
- To configure database logging options using the UPDATE
DATABASE CONFIGURATION command on the command line processor:
- Specify whether you want to use circular logging or
archive logging. If you want to use circular logging, the logarchmeth1 and logarchmeth2 database
configuration parameters must be set to OFF. This
is the default setting. To use archive logging, you must set at least
one of these database configuration parameters to a value other than OFF.
For example, if you want to use archive logging and you want to
save the archived logs to disk, issue the following:
db2 update db configuration for mydb using logarchmeth1
disk:/u/dbuser/archived_logs
The
archived logs will be placed in a directory called /u/dbuser/archived_logs.
- Specify values for other database logging configuration
parameters, as required. The following are additional configuration
parameters for database logging:
- archretrydelay
- blk_log_dsk_ful
- failarchpath
- logarchopt1
- logarchopt2
- logbufsz
- logfilsiz
- logprimary
- logretain
- logsecond
- max_log
- mirrorlogpath
- newlogpath
- mincommit
- numarchretry
- num_log_span
- overflowlogpath
- userexit
For more information on these database logging configuration
parameters, refer to
Configuration parameters for database logging.
- To configure database logging options
by using IBM® Data Studio,
use the task assistant for the UPDATE DATABASE CONFIGURATION command.
- To open the Configure Database Logging wizard:
- From the Control Center, expand the object tree until
you find the database for which you want to set up logging.
- Right-click on the database and select Configure
Database Logging from the pop-up menu. The Configure
Database Logging wizard opens.
- Detailed information is provided through the online help
facility within the Control Center.