10.10.5 Using the statistics log files
- Organization of this subsection
(1) Information that is output to statistics log files
The following HADB server operation information is output to statistics log files:
-
SQL statement statistical information
You can check the information that is output to statistics log files by executing the adbstat command.
The HADB server automatically creates and uses four statistics log files.
- Important
-
Do not manually update the created statistics log files. Otherwise, the information that is output to the statistics log files might become corrupt.
You can change the maximum size for one statistics log file by using the adb_sta_log_max_size and adb_sta_log_size_unit operands in the server definition. For details about the adb_sta_log_max_size and adb_sta_log_size_unit operands in the server definition, see the following sections in 7.2.7 Operands related to statistical information (set format):
-
adb_sta_log_max_size operand
-
adb_sta_log_size_unit operand
When a statistics log file reaches the maximum size, the HADB server stops outputting logs to that statistics log file and outputs them to the next statistics log file. During this process, any old information that was stored in the switching-destination statistics log file is overwritten. Therefore, you need to execute the adbstat command periodically before the old information is overwritten if you want to keep the information that has been output to the statistics log files.
- Note
-
-
You can check which statistics log file will be used by checking the message KFAA80295-I, which is output to the server message log file when the HADB server starts.
-
When a statistics log file reaches the maximum size and is about to be switched to another statistics log file, the message KFAA80296-I is output to the server message log file.
-
To test a swap between statistics log files, you can change the unit of the maximum size of statistics log files to a smaller size (MB) by specifying the adb_sta_log_size_unit operand in the server definition.
-
(2) Guideline period during which statistical information is not overwritten
You can use the following formula to determine the guideline period during which statistical information in a statistics log file is not overwritten.
- Formula (days)
-
guideline-period-during-which-statistical-information-is-not-overwritten = (log_max x 4,294,967,296 ÷ output_info) ÷ 1,440
Explanation of variables
-
log_max: Value specified for the adb_sta_log_max_size operand in the server definition (4 is assumed when the operand is omitted)
-
output_info: Guideline size (bytes) of the statistical information that is output per minute
Use the following formula to determine its value.
690 + 432 x adbbuff_num + 960 x connect_num + 4,376 x sql_num
-
adbbuff_num: Number of global buffers defined in the adbbuff operand in the server definition (including the number of global buffers automatically defined by the HADB server)
- Note
-
For details about the global buffers automatically defined by the HADB server, see the explanation about the adbbuff operand in 7.2.11 Operands and options related to global buffers (command format).
-
connect_num: Number of concurrent connections to the HADB server
-
sql_num: Number of executed SQL statements per minute
-
- Calculation example
-
The following shows a calculation example of the guideline period during which statistical information in a statistics log file is not overwritten. In this example, the following conditions are assumed:
-
Value specified for the adb_sta_log_max_size operand: 4
-
Number of global buffers defined in the adbbuff operand: 128
-
Number of concurrent connections to the HADB server: 128
-
Number of executed SQL statements per minute: 120
- Guideline size of the statistical information that is output per minute (output_info)
-
= 690 + 432 x 128 + 960 x 128 + 4,376 x 120
= 703,986 (bytes)
- Guideline period during which statistical information is not overwritten
-
= (4 x 4,294,967,296 ÷ 703,986) ÷ 1,440
≈ approximately 17 days
Under the preceding conditions, the period during which statistical information is not overwritten is approximately 17 days.
-
(3) Changing the output destination of statistics log files
Statistics log files are output to the $ADBDIR/spool directory. However, you can change the output-destination directory of statistics log files by specifying the adb_sta_log_path operand in the server definition. For details about the adb_sta_log_path operand in the server definition, see 7.2.7 Operands related to statistical information (set format).
- Important
-
If you change the output-destination directory of statistics log files, the statistical information stored in the old statistics log files (that were used before the output destination was changed) cannot be referred. Therefore, before you change the output-destination directory of statistics log files, execute the adbstat command to output statistical information.
(4) Deleting statistics log files
The following describes the procedure for deleting statistics log files.
- Important
-
When you delete statistics log files, be sure to follow the following procedure. If you do not follow the procedure, the information that is output to the statistics log file might become corrupt.
- Note
-
After you perform an operation test of the HADB server, the statistics log files might be unnecessary, and you might want to delete them. In such a case, make sure that you perform the following procedure and delete the statistics log files.
Procedure:
-
Execute the adbstop command to terminate the HADB server normally.
If you are using the multi-node function, perform this step on all nodes on which you want to delete the statistics log files.
If you are using a cold standby configuration, terminate the cold standby configuration normally.
-
Use the rm command of the OS to delete the files under the output-destination directory for statistics log files.
Delete all the following files:
-
adbstatlogXX
XX in the file name is a sequential number between 01 and 04.
-
.adbstatlog
This file is a hidden file.
-
-
Execute the adbstart command to start the HADB server normally.