Retaining the Transaction Logs
Configure the database to retain the transaction logs for roll forward recovery by enabling one of the following parameter sets, depending on the database version.
-
DB2 LUW 9.5 and later:
Set the
LOGARCHMETH
parameters as follows:-
Set
LOGARCHMETH1
toLOGRETAIN
. -
Set
LOGARCHMETH2
toOFF
.
Alternatively, you can use any other
LOGARCHMETH
options, as long as forward recovery is enabled. For example, the following is valid:-
Set
LOGARCHMETH1
toDISK
. -
Set
LOGARCHMETH2
toTSM
.
-
To determine the log retention parameters:
-
Connect to the database.
db2 connect to
database
userusername
usingpassword
-
Get the database name.
db2 list db directory
-
Get the database configuration for the database.
db2 get db cfg for
database
The fields to view are:
Log retain for recovery status = RECOVERY User exit for logging status = YES
To set the log retention parameters: