Hitachi

Hitachi Advanced Database Setup and Operation Guide


6.3.16 Determining the memory requirement for executing the adbarchivechunk command

When the adbarchivechunk command is executed, the HADB server uses the following types of memory. Determine the requirement for each type of memory.

▪ Shared memory
  • Process common memory (PROC_ARCCKSZ)

  • Real thread private memory (RTHD_ARCCKSZ)

▪ Process memory
  • Heap memory (HEAP_ARCCKSZ)

The following subsections describe the formulas for determining the required amounts of these types of memory.

Organization of this subsection

(1) Determining the process common memory requirement (for executing the adbarchivechunk command)

Use the following formula to determine the process common memory (PROC_ARCCKSZ) required for executing the adbarchivechunk command.

Formula (kilobytes)

[Figure]

Explanation of variables

PROC_ARCCON

Determine the value as explained in (a) Determining the variable PROC_ARCCON.

PROC_MAC

Determine the value as explained in (b) Determining the variable PROC_MAC.

PROC_OUTFILE

Determine the value as explained in (c) Determining the variable PROC_OUTFILE.

PROC_DBUPDINF

Determine the value as explained in (d) Determining the variable PROC_DBUPDINF.

#1

If you execute the adbarchivechunk command for multiple chunks, determine the memory requirement for each chunk. Then, add the largest of the determined values to this variable.

#2

If you execute multiple adbarchivechunk commands concurrently, determine the memory requirement for each adbarchivechunk command. Then, add up the total memory requirements.

(a) Determining the variable PROC_ARCCON

Use the following formula to determine the value of variable PROC_ARCCON.

Formula (kilobytes)

[Figure]

#

Add this value when the audit trail facility is enabled.

Explanation of variables

PROC_AUDINFSZ

Determine the value of the variable PROC_AUDINFSZ according to (r) Determining the variable AUDINF in (3) Determining the process common memory requirement (for starting the HADB server) under 6.3.3 Determining the memory requirement for starting the HADB server.

(b) Determining the variable PROC_MAC

Use the following formula to determine the value of variable PROC_MAC.

Formula (kilobytes)

[Figure]

Explanation of variables

DIC

See the explanation of the variable DIC in (a) Determining the variable PROC_IMPT in (1) Determining the process common memory requirement (for executing the adbimport command) in 6.3.6 Determining the memory requirement for executing the adbimport command.

IOA

Use the following formula to determine this value.

Formula (kilobytes)

[Figure]

sql_size

Use the following formula to determine this value.

Formula

[Figure]

scan_buff_size

Use the following formula to determine this value.

Formula

[Figure]

offset_area

Use the following formula to determine this value.

Formula

[Figure]

scan_rthd

Use the following formula to determine the value:

↓(value-specified-for-archive-chunk-option-adb_arcv_rthd_num - 1) ÷ 2↓
EXPF

Use the following formula to determine this value.

Formula (kilobytes)

[Figure]

exp_rthd

Use the following formula to determine this value.

↓(value-specified-for-archive-chunk-option-adb_arcv_rthd_num - 1) ÷ 2↓
PROC_EXPSQLS

When the adbarchivechunk command is executed, the following SQL statement is executed once to archive the data in a chunk.

SELECT * FROM target-table-name;

Determine for each processing-target table the amount of memory required to execute a retrieval SQL statement by referring to (c) Determining the variable PROC_EXECSQLSZ in (1) Determining the process common memory requirement (during normal operation) under 6.3.4 Determining the memory requirement during normal operation. Then, substitute the largest of the determined values.

SGMTGRP

Use the following formula to determine this value.

Formula (kilobytes)

[Figure]

SGMTIDLIST

Use the following formula to determine this value.

Formula (kilobytes)

[Figure]

max_sgmtnum_in_chunks

Specify the number of segments in the largest table among the chunks to be archived.

Note that the number of index segments must be excluded.

To check the number of table segments for each chunk, use either of the following methods:

  • Execute the adbdbstatus command with the -d used and -c table options specified to output the information about the usage of DB areas, tables, and indexes. Then, obtain the number of table segments for each chunk from the value of Used_segments in the output results.

  • Use the following formula to determine the value of the variable chunk_sgmtnum for each chunk to be archived. Then, substitute the largest of the determined chunk_sgmtnum values.

    Formula

    [Figure]

chunk_sgmtnum

Specify the number of table segments stored in the chunk.

Note that the number of index segments must be excluded.

CHBP

See CHBP(i,k) in (f) Determining the variable SGROWTBL (for a multi-chunk table) under (2) Explanation of variables in 5.8.1 Determining the total number of pages in the data DB area.

CHVP

See CHVP(i,k) in (f) Determining the variable SGROWTBL (for a multi-chunk table) under (2) Explanation of variables in 5.8.1 Determining the total number of pages in the data DB area.

SEGSIZE

See SEGSIZE in (2) Explanation of variables under 5.8.1 Determining the total number of pages in the data DB area.

page_size

See Table 6‒3: DB area page size in (2) Determining the global buffer page requirement (for starting the HADB server) under 6.3.3 Determining the memory requirement for starting the HADB server.

SGMTGRPLIST

Use the following formula to determine this value.

Formula (kilobytes)

[Figure]

SGMTGRPNUM

The value of the variable SGMTGRPNUM changes according to the value of the variable max_sgmtnum_in_chunks. The following table shows the relationship between the variable max_sgmtnum_in_chunks and the variable SGMTGRPNUM.

Table 6‒13: Relationship between the variables max_sgmtnum_in_chunks and SGMTGRPNUM

No.

Value of the variable max_sgmtnum_in_chunks

Value of the variable SGMTGRPNUM

1

max_sgmtnum_in_chunks < 16

For SGMTGRPNUM, substitute 1.

2

16 ≤ max_sgmtnum_in_chunks

and

max_sgmtnum_in_chunks < 32

For SGMTGRPNUM, substitute 4.

3

32 ≤ max_sgmtnum_in_chunks

and

max_sgmtnum_in_chunks < 64

For SGMTGRPNUM, substitute 8.

4

64 ≤ max_sgmtnum_in_chunks

and

max_sgmtnum_in_chunks < 256

For SGMTGRPNUM, substitute 16.

5

256 ≤ max_sgmtnum_in_chunks

Use the following formula to determine the value of SGMTGRPNUM:

[Figure]

BINTREE

Use the following formula to determine this value.

Formula (kilobytes)

[Figure]

Use the formula in Table 6‒13: Relationship between the variables max_sgmtnum_in_chunks and SGMTGRPNUM to calculate the variable SGMTGRPNUM.

(c) Determining the variable PROC_OUTFILE

Use the following formula to determine the value of variable PROC_OUTFILE.

Formula (kilobytes)

[Figure]

Explanation of variables

OUTFMAX

Use the following formula to determine this value.

↓(value-specified-for-archive-chunk-option-adb_arcv_rthd_num - 1) ÷ 2↓

(d) Determining the variable PROC_DBUPDINF

Use the following formula to determine the value of variable PROC_DBUPDINF. Note that the formula to be used differs depending on whether the multi-node function is used.

Formula to be used when the multi-node function is not used (kilobytes)

[Figure]

Formula to be used when the multi-node function is used (kilobytes)

[Figure]

Explanation of variables

DBUPDINF_ENT_NUM

Use the following formula to determine this value.

Formula (count)

[Figure]

SGMTGRPNUM

See Table 6‒13: Relationship between the variables max_sgmtnum_in_chunks and SGMTGRPNUM in (b) Determining the variable PROC_MAC.

scan_rthd_num

Use the following formula to determine the value:

↓(value-specified-for-archive-chunk-option-adb_arcv_rthd_num - 1) ÷ 2↓

(2) Determining the real thread private memory requirement (for executing the adbarchivechunk command)

Use the following formula to determine the amount of real thread private memory (RTHD_ARCCKSZ) required to execute the adbarchivechunk command.

Formula (kilobytes)

[Figure]

Explanation of variables

RTHD_ARCSQL

Determine the value as explained in (a) Determining the variable RTHD_ARCSQL.

RTHD_ARCDIRPATH

Determine the value as explained in (b) Determining the variable RTHD_ARCDIRPATH.

(a) Determining the variable RTHD_ARCSQL

The following describes how to determine the value of the variable RTHD_ARCSQL.

When the adbarchivechunk command is executed, the following SQL statement is executed once to archive the data in a chunk.

SELECT * FROM target-table-name;

Determine for each processing-target table the amount of memory required to execute a retrieval SQL statement by referring to (c) Determining the variable RTHD_EXESQLSZ and (g) Determining the variable RTHD_EXESQLDICSZ in (2) Determining the real thread private memory requirement (during normal operation) under 6.3.4 Determining the memory requirement during normal operation. Then, substitute the largest of the determined values.

(b) Determining the variable RTHD_ARCDIRPATH

Use the following formula to determine the value of variable RTHD_ARCDIRPATH.

Formula (kilobytes)

[Figure]

Explanation of variables

SGMTGRPNUM

See Table 6‒13: Relationship between the variables max_sgmtnum_in_chunks and SGMTGRPNUM in (b) Determining the variable PROC_MAC under (1) Determining the process common memory requirement (for executing the adbarchivechunk command).

scan_rthd_num

Use the following formula to determine the value:

↓(value-specified-for-archive-chunk-option-adb_arcv_rthd_num - 1) ÷ 2↓

(3) Determining the heap memory requirement (for executing the adbarchivechunk command)

Use the following formula to determine the heap memory (HEAP_ARCCKSZ) required to execute the adbarchivechunk command.

Formula (kilobytes)

[Figure]

#

If you execute multiple adbarchivechunk commands concurrently, determine the heap memory requirement for each adbarchivechunk command. Then, add up the total heap memory requirements.

Explanation of variables

HEAP_ZLIB

Use the following formula to determine this value.

Formula (kilobytes)

[Figure]

archive_file_num

Specify the number of archive files for the archived chunk.

If you execute the adbarchivechunk command for multiple chunks, check the number of archive files for each chunk, and then substitute for this variable the largest of the numbers.

Use the adbdbstatus command to output the summary information of archived chunks, and then check the value of Archive_file_num for each chunk. For details about Archive_file_num, see the following section in the manual HADB Command Reference: List of items that are output in the summary information of archived chunks in Items that are output in the summary information of archived chunks in adbdbstatus (Analyze the Database Status).