Hitachi

Hitachi Advanced Database Setup and Operation Guide


6.3.18 Determining the memory requirement for executing the adbreorgsystemdata command

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

Note that the table to be processed here means the system table (base table).

▪ Shared memory
  • Process common memory (PROC_REORGSZ)

  • Real thread private memory (RTHD_REORGSZ)

▪ Process memory
  • Heap memory (HEAP_REORGSZ)

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 adbreorgsystemdata command)

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

Formula (kilobytes)

[Figure]

Explanation of variables

PROC_MNG

Process common memory used for managing reorganization of system tables

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

PROC_IDX

Process common memory used for creating B-tree indexes

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

PROC_IDXBUILD

Process common memory used for creating B-tree indexes

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

PROC_DBUPDINF

Process common memory required for storing DB area, table, index, and chunk update information

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

PROC_RTHDUPDINF

Processing real thread update information

Determine the value as explained in (e) Determining the variable PROC_RTHDUPDINF.

PROC_UNLOAD_BUFF

Buffer used for reorganizing system tables

Determine the value as explained in (f) Determining the variable PROC_UNLOAD_BUFF.

(a) Determining the variable PROC_MNG

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

Formula (kilobytes)

[Figure]

#

Add this value when the audit trail facility is enabled.

Explanation of variables

DIC

Memory for acquiring the definition information of the table to be processed

Use the following formula to determine this value.

Formula (kilobytes)

[Figure]

col_num

Number of columns in the table to be processed

Refer to Table 6‒15: Variable value corresponding to system table and substitute the value for the table to be processed.

max_rowsz

Maximum row length

Refer to Table 6‒15: Variable value corresponding to system table and substitute the value for the table to be processed.

idx_num

Number of indexes defined for the table to be processed

Refer to Table 6‒15: Variable value corresponding to system table and substitute the value for the table to be processed.

Table 6‒15: Variable value corresponding to system table

No.

Name of table to be processed

Value of col_num variable

Value of var_col_num variable

Value of max_rowsz variable

Value of Σ(DATASIZE) variable

Value of idx_num variable

Value of max_idx_col_num variable

Value of max_keysz variable

1

STATUS_TABLES

12

2

318

1,556

1

2

203

2

STATUS_COLUMNS

11

6

32,588

257,088

1

3

304

3

STATUS_INDEXES

8

3

476

701

2

2

203

4

STATUS_CHUNKS

10

3

1,312

2,575

1

3

212

5

STATUS_SYNONYM_DICTIONARIES

10

6

2,108

4,152

1

1

121

IOA

Memory for creating the data image to be stored in the database

Use the following formula to determine this value.

Formula (kilobytes)

[Figure]

IOA_UNLOAD

Memory to be used for unloading

Use the following formula to determine this value.

Formula

[Figure]

sql_size

Use the following formula to determine this value.

[Figure]

scan_buff_size

Use the following formula to determine this value.

[Figure]

offset_area

Use the following formula to determine this value.

[Figure]

col_num

Number of columns in the table to be processed

Refer to Table 6‒15: Variable value corresponding to system table and substitute the value for the table to be processed.

Σ(DATASIZE)

Sum of the largest data lengths (in character format) for the data types of all columns in the processing-target table

Refer to Table 6‒15: Variable value corresponding to system table and substitute the value for the table to be processed.

scan_rthd

Substitute 1.

IOA_RELOAD

Memory to be used for reloading

Use the following formula to determine this value.

Formula

[Figure]

max_rowsz

Maximum row length

Refer to Table 6‒15: Variable value corresponding to system table and substitute the value for the table to be processed.

col_num

Number of columns in the table to be processed

Refer to Table 6‒15: Variable value corresponding to system table and substitute the value for the table to be processed.

idx_num

Number of indexes defined for the table to be processed

Refer to Table 6‒15: Variable value corresponding to system table and substitute the value for the table to be processed.

dba_num

Substitute 1.

load_rthd

Substitute 1.

LOD

Memory required for reloading

Use the following formula to determine this value.

Formula (kilobytes)

[Figure]

read_size

Substitute 1,024.

read_buff_num

Substitute 3.

load_rthd

Substitute 1.

input_edit_area

Length of the input data editing area

Use the following formula to determine this value.

Formula

[Figure]

input_recsize

input record length

Use the following formula to determine this value.

Formula

[Figure]

Σ(DATASIZE)

Sum of the largest data lengths (in character format) for the data types of all columns in the processing-target table

Refer to Table 6‒15: Variable value corresponding to system table and substitute the value for the table to be processed.

col_num

Number of columns in the table to be processed

Refer to Table 6‒15: Variable value corresponding to system table and substitute the value for the table to be processed.

input_file_num

Substitute 1,024.

IMPORTBUF_CTL

Buffer control information for reorganizing system tables

Use the following formula to determine this value.

Formula (kilobytes)

[Figure]

BUFBLK

For details, see the description of the variable BUFBLK in (f) Determining the variable PROC_UPDSZ under (1) Determining the process common memory requirement (during normal operation) in 6.3.4 Determining the memory requirement during normal operation.

load_rthd

Substitute 1.

STS

Memory used for saving status information

Use the following formula to determine this value.

Formula (kilobytes)

[Figure]

idx_num

Number of indexes defined for the table to be processed

Refer to Table 6‒15: Variable value corresponding to system table and substitute the value for the table to be processed.

load_rthd

Substitute 1.

PAGEALLOC

Page allocation control information for reloading

Use the following formula to determine this value.

Formula (kilobytes)

[Figure]

dataload_rthd

Substitute 1.

dividx_rthd

Substitute 1.

EXPF

Memory to be used for processing files

Use the following formula to determine this value.

Formula (kilobytes)

[Figure]

exp_rthd

Substitute 1.

PROC_AUDINFSZ

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

(b) Determining the variable PROC_IDX

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

Formula (kilobytes)

[Figure]

Explanation of variables

idxf_buff_size

Substitute 1,024.

max_keysz

Maximum index key length among indexes defined for the table to be processed (bytes)

Refer to Table 6‒15: Variable value corresponding to system table under (a) Determining the variable PROC_MNG in (1) Determining the process common memory requirement (for executing the adbreorgsystemdata command) of 6.3.18 Determining the memory requirement for executing the adbreorgsystemdata command, and substitute the value for the table to be processed.

idx_num

Number of indexes defined for the table to be processed

Refer to Table 6‒15: Variable value corresponding to system table under (a) Determining the variable PROC_MNG in (1) Determining the process common memory requirement (for executing the adbreorgsystemdata command) of 6.3.18 Determining the memory requirement for executing the adbreorgsystemdata command, and substitute the value for the table to be processed.

load_rthd

Substitute 1.

cmd_d_opt

Substitute 1.

rd_buff_size

Substitute 1,024.

ld_buff_size

Substitute 1,024.

dividx_rthd

Substitute 1.

(c) Determining the variable PROC_IDXBUILD

Use the following formula to determine the variable PROC_IDXBUILD.

Formula (kilobytes)

[Figure]

Explanation of variables

idx_num

Number of indexes defined for the table to be processed

Refer to Table 6‒15: Variable value corresponding to system table under (a) Determining the variable PROC_MNG in (1) Determining the process common memory requirement (for executing the adbreorgsystemdata command) of 6.3.18 Determining the memory requirement for executing the adbreorgsystemdata command, and substitute the value for the table to be processed.

PROC_IDXCREATE_MEM(k)

Memory required to batch-create k-th index defined for the table to be processed

Use the following formula to determine this value.

Formula (kilobytes)

[Figure]

idx_col_num

Number of indexed columns in index

Refer to Table 6‒16: Values of variables idx_col_num and KEYSZ for indexes of system tables and substitute the value that corresponds to the index name.

idx_lv

Number of levels in the index

Calculate the recursion formula Formula 1 (for determining PIDX(k)) in (2) Determining the number of storage pages used in the upper page segment (variable IP_UPPER(i)) under 5.8.3 Determining the number of storage pages for each B-tree index segment and substitute the value of n when PIDX(n) results in 1.

Note that in the case of PIDX(1) = 1, the number of levels in the B-tree index is 2.

The following shows the values to be substituted for the variables used in the preceding formula:

  • page_size

    Substitute 4,096.

  • pctfree

    Substitute 0.

  • dbarea_file_num

    Substitute 1.

dividx_rthd

Substitute 1.

KEYSZ

Key length of index (bytes)

Refer to Table 6‒16: Values of variables idx_col_num and KEYSZ for indexes of system tables and substitute the value that corresponds to the index name.

page_size

Substitute 4,096.

Table 6‒16: Values of variables idx_col_num and KEYSZ for indexes of system tables

No.

Name of table to be processed

Index name

Value of idx_col_num variable

Value of KEYSZ variable

1

STATUS_TABLES

STATUSINDEXM01

2

203

2

STATUS_COLUMNS

STATUSINDEXM02

3

304

3

STATUS_INDEXES

STATUSINDEXM03

2

203

4

STATUSINDEXM04

2

203

5

STATUS_CHUNKS

STATUSINDEXM05

3

212

6

STATUS_SYNONYM_DICTIONARIES

STATUSINDEXS01

1

121

(d) Determining the variable PROC_DBUPDINF

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

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

Number of entries in the DB area, table, index, and chunk update information

This value changes depending on whether the multi-node function is used.

When the multi-node function is not used

Substitute 1.

When the multi-node function is used

Use the following formula to determine this value.

Formula (count)

[Figure]

idx_num

Number of indexes defined for the table to be processed

(e) Determining the variable PROC_RTHDUPDINF

Use the following formula to determine the variable PROC_RTHDUPDINF.

Formula (kilobytes)

[Figure]

Explanation of variables

rthd_num

Substitute 1.

(f) Determining the variable PROC_UNLOAD_BUFF

Substitute the following value for the variable PROC_UNLOAD_BUFF.

Value (kilobytes)

[Figure]

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

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

Formula (kilobytes)

[Figure]

Explanation of variables

RTHD_UNLOADSZ

Real thread private memory that the adbreorgsystemdata command uses during unloading

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

RTHD_RELOADSZ

Real thread private memory that the adbreorgsystemdata command uses during reloading

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

(a) Determining the variable RTHD_UNLOADSZ

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

Formula (kilobytes)

[Figure]

Explanation of variables

uthd_num

Value specified for the adb_sys_uthd_num operand in the server definition

SGTBL

Number of segments in table to be processed

Refer to the following table and substitute the value for the table to be processed.

Table 6‒17: Estimating the segment size of system tables

No.

Name of table to be processed

Determining the SGTBL variable

1

STATUS_TABLES

↑(STBLTABLESSIZE ÷ 64)↑

2

STATUS_COLUMNS

↑(STBLCOLUMNSSIZE ÷ 64)↑

3

STATUS_INDEXES

↑(STBLINDEXESSIZE ÷ 64)↑

4

STATUS_CHUNKS

↑(STBLCHUNKSSIZE ÷ 64)↑

5

STATUS_SYNONYM_DICTIONARIES

↑(STBLSYNONYMDICSIZE ÷ 64)↑

For details about the variables STBLTABLESSIZE, STBLCOLUMNSSIZE, STBLINDEXESSIZE, STBLCHUNKSSIZE, and STBLSYNONYMDICSIZE, see 5.12 Estimating the size of the system-table DB area.

(b) Determining the variable RTHD_RELOADSZ

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

Formula (kilobytes)

[Figure]

Explanation of variables

RELOADBUF

Use the following formula to determine this value.

Formula (kilobytes)

RELOADBUF = ↑(IMP_SQBLK + IMP_SQIO + IMP_SQPGE + IMP_SQHS) /1,024↑

IMP_SQBLK

Use the following formula to determine this value.

Formula (bytes)

IMP_SQBLK = imp_blknum × (112 + ↑IMP_BLKSZ ÷ imp_pagesize ÷ 64↑ × 24)

imp_blknum

Substitute 64.

IMP_BLKSZ

Use the following formula to determine this value.

IMP_BLKSZ = 4,096 x 1,024

imp_pagesize

Substitute 4,096.

IMP_SQIO

Use the following formula to determine this value.

Formula (bytes)

IMP_SQIO = 568 × imp_blknum

IMP_SQPGE

Use the following formula to determine this value.

Formula (bytes)

IMP_SQPGE = (176 + imp_pagesize + BUFLOG) x (IMP_BLKSZ / imp_pagesize) x imp_blknum

BUFLOG

For details, see the description of the variable BUFLOG in (d) Determining the variable BUFGLOBAL under (3) Determining the process common memory requirement (for starting the HADB server) in 6.3.3 Determining the memory requirement for starting the HADB server.

IMP_SQHS

Use the following formula to determine this value.

Formula (bytes)

IMP_SQHS = (8 x imp_blknum) + (40 x imp_blknum)

SORTIOBUF

Use the following formula to determine this value.

Formula (kilobytes)

SORTIOBUF = sort_io_buff_size x sort_rthd

sort_io_buff_size

Substitute 16.

sort_rthd

Substitute 1.

SORTBUF

Use the following formula to determine this value.

Formula (kilobytes)

SORTBUF = (48 + sort_buff_size x 1,024) x sort_rthd

sort_buff_size

Substitute 256.

RTHD_DATALOAD

Use the following formula to determine this value.

Formula (kilobytes)

[Figure]

col_num

Number of columns in the table to be processed

Refer to Table 6‒15: Variable value corresponding to system table under (a) Determining the variable PROC_MNG in (1) Determining the process common memory requirement (for executing the adbreorgsystemdata command) of 6.3.18 Determining the memory requirement for executing the adbreorgsystemdata command, and substitute the value for the table to be processed.

var_col_num

Number of VARCHAR-type and VARBINARY-type columns in the table to be processed

Refer to Table 6‒15: Variable value corresponding to system table under (a) Determining the variable PROC_MNG in (1) Determining the process common memory requirement (for executing the adbreorgsystemdata command) of 6.3.18 Determining the memory requirement for executing the adbreorgsystemdata command, and substitute the value for the table to be processed.

RTHD_IDXREC

Use the following formula to determine this value.

Formula (kilobytes)

RTHD_IDXREC =

↑(386 + 328 x (idx_num-1) + 32 x max_idx_col_num + (64 + buf_size x 1,024) x 2 x idx_num) /1,024↑

idx_num

Number of indexes defined for the table to be processed

Refer to Table 6‒15: Variable value corresponding to system table under (a) Determining the variable PROC_MNG in (1) Determining the process common memory requirement (for executing the adbreorgsystemdata command) of 6.3.18 Determining the memory requirement for executing the adbreorgsystemdata command, and substitute the value for the table to be processed.

max_idx_col_num

Maximum number of indexed columns among indexes defined for the table to be processed

Refer to Table 6‒15: Variable value corresponding to system table under (a) Determining the variable PROC_MNG in (1) Determining the process common memory requirement (for executing the adbreorgsystemdata command) of 6.3.18 Determining the memory requirement for executing the adbreorgsystemdata command, and substitute the value for the table to be processed.

buf_size

Substitute 1,024.

RTHD_IDXBUILD

Use the following formula to determine this value.

Formula (kilobytes)

[Figure]

idx_num

Number of indexes defined for the table to be processed

Refer to Table 6‒15: Variable value corresponding to system table under (a) Determining the variable PROC_MNG in (1) Determining the process common memory requirement (for executing the adbreorgsystemdata command) of 6.3.18 Determining the memory requirement for executing the adbreorgsystemdata command, and substitute the value for the table to be processed.

RTHD_IDXBUILD_MEM(k)

Memory required for creating at one time the k-th B-tree index defined for the table to be processed

Use the following formula to determine this value.

Formula (kilobytes)

[Figure]

KEYSZ

Key length of a B-tree index (bytes)

Refer to Table 6‒15: Variable value corresponding to system table under (a) Determining the variable PROC_MNG in (1) Determining the process common memory requirement (for executing the adbreorgsystemdata command) of 6.3.18 Determining the memory requirement for executing the adbreorgsystemdata command, and substitute the value for the table to be processed.

CTRL

Substitute 12 bytes.

page_size

Substitute 4,096 bytes.

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

Use the following formula to determine the heap memory (HEAP_REORGSZ) required when executing the adbreorgsystemdata command.

Formula (kilobytes)

[Figure]

Explanation of variables

sort_rthd

Substitute 1.