Monitor events for dynamically added logs

You can monitor the event alarms that are triggered when the database server dynamically adds logical log files to prevent transaction blocking. The DYNAMIC_LOGS configuration parameter value must be 1 or 2.

When each alarm is triggered, a message is written to the message log.

You can include the onparams command to add log files in your alarm script for event class ID 27, log file required. Your script can also run the onstat -d command to check for adequate space and run the onparams a -i command with the location that has enough space. You must use the -i option to add the new log right after the current log file.

Table 1. Event alarms for dynamically added log files
Class ID Severity Class message Message
26 3 Dynamically added log file log_number This message shows when the database server dynamically adds a log file.

Dynamically added log file log_number to DBspace dbspace_number.

27 4 Log file required This message shows when DYNAMIC_LOGS is set to 1 and the database server is waiting for you to add a log file.

ALERT: The oldest logical log log_number contains records from an open transaction transaction_address. Logical logging remains blocked until a log file is added. Add the log file with the onparams -a command, using the -i (insert) option, as in: onparams -a -d dbspace -s size-i

Then complete the transaction as soon as possible.

28 4 No space for log file ALERT: Because the oldest logical log log_number contains records from an open transaction transaction_address, the server is attempting to dynamically add a log file. But there is no space available. Add a dbspace or chunk, then complete the transaction as soon as possible.

The following table shows the actions that the database server takes for each setting of the DYNAMIC_LOGS configuration parameter.

Table 2. The DYNAMIC_LOGS settings
DYNAMIC_ LOGS value Meaning Event alarm Wait to add log? Dynamic log added?
2 (default) Allows automatic allocation of new log files to prevent open transactions from hanging the system. Yes (26, 28) No Yes
1 Allows manual addition of new log files. Yes (27) Yes No
0 Does not allocate log files but issues the following message about open transactions:
Warning: The oldest logical-log file log_number contains records from an open transaction transaction_address, but the dynamic log feature is turned off.
No No No

Copyright© 2019 HCL Technologies Limited