Appendix C.3 Example 3 (HiRDB/Parallel Server)

This example creates system definitions for HiRDB/Parallel Server. The system configuration is shown as follows:

Unit configuration

[Figure]

System files configuration for UNT1

[Figure]

[Figure]

System files configuration for UNT2

[Figure]

[Figure]

System files configuration for UNT3

[Figure]

[Figure]

Organization of this subsection
(1) System common definition
(2) Unit control information definition of UNT1
(3) Unit control information definition of UNT2
(4) Unit control information definition of UNT3
(5) Front-end server definition
(6) Dictionary server definition
(7) Back-end server definition of bes1
(8) Back-end server definition of bes2
(9) Back-end server definition of bes3
(10) UAP environment definition

(1) System common definition

set pd_system_id = PDB1                                            1
set pd_name_port = 20001                                           2
set pd_master_file_name = "C:\rdarea\mast\mast01"                  3
set pd_max_users = 100                                             4
set pd_max_server_process = 520                                    5
set pd_max_access_tables = 50                                      6
set pd_sql_object_cache_size = 3000                                7
set pd_max_rdarea_no = 200                                         8
set pd_max_file_no = 600                                           9
set pd_optimize_level = "PRIOR_NEST_JOIN","PRIOR_OR_INDEXES", \    10
   "SORT_DATA_BES","DETER_AND_INDEXES","RAPID_GROUPING", \
   "DETER_WORK_TABLE_FOR_UPDATE", \
   "APPLY_ENHANCED_KEY_COND"
set pd_additional_optimize_level = "COST_BASE_2"                   11
pdunit -x host1 -u UNT1 -d "C:\HiRDB"                              12
pdunit -x host2 -u UNT2 -d "C:\HiRDB"
pdunit -x host3 -u UNT3 -d "C:\HiRDB"
pdstart -t MGR -u UNT1                                             13
pdstart -t FES -s fes -u UNT1
pdstart -t DIC -s dic -u UNT2
pdstart -t BES -s bes1 -u UNT1
pdstart -t BES -s bes2 -u UNT2
pdstart -t BES -s bes3 -u UNT3
pdbuffer -a gbuf01 -r RDMAST,RDDIC,RDDIR -n 1000                   14
pdbuffer -a gbuf02 -r RDAREA1,RDAREA2,RDAREA3 -n 1000              15
pdbuffer -a gbuf03 -r RDAREA4,RDAREA5,RDAREA6 -n 1000              16
pdbuffer -a gbuf04 -o -n 1000                                      17
putenv SHMMAX 16                                                   18

Explanation
  1. Specifies the HiRDB identifier.
  2. Specifies the HiRDB port number.
  3. Specifies the first HiRDB file in the master directory RDAREA.
  4. Specifies the maximum number of concurrent connections.
  5. Specifies the maximum number of server processes that can be activated concurrently.
  6. Specifies the maximum number of base tables that can be accessed concurrently.
  7. Specifies the SQL object buffer length.
  8. Specifies the maximum number of RDAREAs allowed.
  9. Specifies the maximum number of HiRDB files that comprise an RDAREA.
  10. Specifies SQL optimization options.
  11. Specifies an SQL extension optimizing option.
  12. Specifies the configurations of the units in the HiRDB/Parallel Server:
    -x: Host name
    -u: Unit identifier
    -d: HiRDB directory name
  13. Specifies the configurations of the servers in the HiRDB/Parallel Server:
    -t: Server type
    -s: Server name
    -u: Unit identifier
  14. Allocates the master directory RDAREA, data dictionary RDAREA, and data directory RDAREA to a global buffer.
  15. Allocates user RDAREAs (RDAREA1-RDAREA3) to a global buffer.
  16. Allocates user RDAREAs (RDAREA4-RDAREA6) to a global buffer.
  17. Allocates other RDAREAs to a global buffer.
  18. Specifies the maximum number of shared memory segments.

(2) Unit control information definition of UNT1

set pd_unit_id = UNT1                                                      1
set pd_syssts_file_name_1 = "u1sts1","D:\unt1\sysfile_a\u1sts1a",\         2
                                    "E:\unt1\sysfile_b\u1sts1b"
set pd_syssts_file_name_2 = "u1sts2","D:\unt1\sysfile_a\u1sts2a",\
                                    "E:\unt1\sysfile_b\u1sts2b"

Explanation
  1. Specifies the unit identifier.
  2. Specifies the configuration of the unit status files.

(3) Unit control information definition of UNT2

set pd_unit_id = UNT2                                                       1
set pd_syssts_file_name_1 = "u2sts1","D:\unt2\sysfile_a\u2sts1a",\          2
                                    "E:\unt2\sysfile_b\u2sts1b"
set pd_syssts_file_name_2 = "u2sts2","D:\unt2\sysfile_a\u2sts2a",\
                                    "E:\unt2\sysfile_b\u2sts2b"

Explanation
  1. Specifies the unit identifier.
  2. Specifies the configuration of the unit status files.

(4) Unit control information definition of UNT3

set pd_unit_id = UNT3                                                      1
set pd_syssts_file_name_1 = "u3sts1","D:\unt3\sysfile_a\u3sts1a",\         2
                                    "E:\unt3\sysfile_b\u3sts1b"
set pd_syssts_file_name_2 = "u3sts2","D:\unt3\sysfile_a\u3sts2a",\
                                    "E:\unt3\sysfile_b\u3sts2b"

Explanation
  1. Specifies the unit identifier.
  2. Specifies the configuration of the unit status files.

(5) Front-end server definition

set pd_log_dual = N                                                       1
set pd_sts_file_name_1 = "fsts1","D:\unt1\sysfile_a\fsts1a",\             2
                                "E:\unt1\sysfile_b\fsts1b"
set pd_sts_file_name_2 = "fsts2","D:\unt1\sysfile_a\fsts2a",\
                                "E:\unt1\sysfile_b\fsts2b"
pdlogadfg -d sys -g flog1 ONL                                             3
pdlogadfg -d sys -g flog2 ONL
pdlogadfg -d sys -g flog3 ONL
pdlogadfg -d sys -g flog4 ONL
pdlogadpf -d sys -g flog1 -a "D:\unt1\sysfile_a\flog1a"
pdlogadpf -d sys -g flog2 -a "D:\unt1\sysfile_a\flog2a"
pdlogadpf -d sys -g flog3 -a "D:\unt1\sysfile_a\flog3a"
pdlogadpf -d sys -g flog4 -a "D:\unt1\sysfile_a\flog4a"
pdlogadfg -d spd -g fsync1 ONL                                            4
pdlogadfg -d spd -g fsync2 ONL
pdlogadfg -d spd -g fsync3 ONL
pdlogadfg -d spd -g fsync4 ONL
pdlogadpf -d spd -g fsync1 -a "D:\unt1\sysfile_a\fsync1"
pdlogadpf -d spd -g fsync2 -a "E:\unt1\sysfile_b\fsync2"
pdlogadpf -d spd -g fsync3 -a "D:\unt1\sysfile_a\fsync3"
pdlogadpf -d spd -g fsync4 -a "E:\unt1\sysfile_b\fsync4"

Explanation
  1. Specifies that dual system log files will not be used.
  2. Specifies the configuration of the server status files.
  3. Specifies the configuration of the system log files.
  4. Specifies the configuration of the synchronization point dump files.

(6) Dictionary server definition

set pd_dic_shmpool_size = 5000                                            1
set pd_log_dual = Y                                                       2
set pd_sts_file_name_1 = "dsts1","D:\unt2\sysfile_a\dsts1a",\             3
                                "E:\unt2\sysfile_b\dsts1b"
set pd_sts_file_name_2 = "dsts2","D:\unt2\sysfile_a\dsts2a",\
                                "E:\unt2\sysfile_b\dsts2b"
pdwork -v "C:\unt2\work01","C:\unt2\work02"                               4
pdlogadfg -d sys -g dlog1 ONL                                             5
pdlogadfg -d sys -g dlog2 ONL
pdlogadfg -d sys -g dlog3 ONL
pdlogadfg -d sys -g dlog4 ONL
pdlogadpf -d sys -g dlog1 -a "D:\unt2\sysfile_a\dlog1a"\
                         -b "E:\unt2\sysfile_b\dlog1b"
pdlogadpf -d sys -g dlog2 -a "D:\unt2\sysfile_a\dlog2a"\
                         -b "E:\unt2\sysfile_b\dlog2b"
pdlogadpf -d sys -g dlog3 -a "D:\unt2\sysfile_a\dlog3a"\
                         -b "E:\unt2\sysfile_b\dlog3b"
pdlogadpf -d sys -g dlog4 -a "D:\unt2\sysfile_a\dlog4a"\
                         -b "E:\unt2\sysfile_b\dlog4b"
pdlogadfg -d spd -g dsync1 ONL                                            6
pdlogadfg -d spd -g dsync2 ONL
pdlogadfg -d spd -g dsync3 ONL
pdlogadfg -d spd -g dsync4 ONL
pdlogadpf -d spd -g dsync1 -a "D:\unt2\sysfile_a\dsync1"
pdlogadpf -d spd -g dsync2 -a "E:\unt2\sysfile_b\dsync2"
pdlogadpf -d spd -g dsync3 -a "D:\unt2\sysfile_a\dsync3"
pdlogadpf -d spd -g dsync4 -a "E:\unt2\sysfile_b\dsync4"

Explanation
  1. Specifies the size of the shared memory to be used by the dictionary server.
  2. Specifies that dual system log files will be used.
  3. Specifies the configuration of the server status files.
  4. Specifies HiRDB file system areas for work table files.
  5. Specifies the configuration of the system log files.
  6. Specifies the configuration of the synchronization point dump files.

(7) Back-end server definition of bes1

set pd_bes_shmpool_size = 5000                                             1
set pd_log_dual = Y                                                        2
set pd_sts_file_name_1 = "b1sts1","D:\unt1\sysfile_a\b1sts1a",\            3
                                 "E:\unt1\sysfile_b\b1sts1b"
set pd_sts_file_name_2 = "b1sts2","D:\unt1\sysfile_a\b1sts2a",\
                                 "E:\unt1\sysfile_b\b1sts2b"
pdwork -v "C:\unt1\work01","C:\unt1\work02"                                4
pdlogadfg -d sys -g b1log1 ONL                                             5
pdlogadfg -d sys -g b1log2 ONL
pdlogadfg -d sys -g b1log3 ONL
pdlogadfg -d sys -g b1log4 ONL
pdlogadpf -d sys -g b1log1 -a "D:\unt1\sysfile_a\b1log1a"\
                          -b "E:\unt1\sysfile_b\b1log1b"
pdlogadpf -d sys -g b1log2 -a "D:\unt1\sysfile_a\b1log2a"\
                          -b "E:\unt1\sysfile_b\b1log2b"
pdlogadpf -d sys -g b1log3 -a "D:\unt1\sysfile_a\b1log3a"\
                          -b "E:\unt1\sysfile_b\b1log3b"
pdlogadpf -d sys -g b1log4 -a "D:\unt1\sysfile_a\b1log4a"\
                          -b "E:\unt1\sysfile_b\b1log4b"
pdlogadfg -d spd -g b1sync1 ONL                                            6
pdlogadfg -d spd -g b1sync2 ONL
pdlogadfg -d spd -g b1sync3 ONL
pdlogadfg -d spd -g b1sync4 ONL
pdlogadpf -d spd -g b1sync1 -a "D:\unt1\sysfile_a\b1sync1"
pdlogadpf -d spd -g b1sync2 -a "E:\unt1\sysfile_b\b1sync2"
pdlogadpf -d spd -g b1sync3 -a "D:\unt1\sysfile_a\b1sync3"
pdlogadpf -d spd -g b1sync4 -a "E:\unt1\sysfile_b\b1sync4"

Explanation
  1. Specifies the size of the shared memory to be used by the back-end server (bes1).
  2. Specifies that dual system log files will be used.
  3. Specifies the configuration of the server status files.
  4. Specifies HiRDB file system areas for work table files.
  5. Specifies the configuration of the system log files.
  6. Specifies the configuration of the synchronization point dump files.

(8) Back-end server definition of bes2

set pd_bes_shmpool_size = 5000                                              1
set pd_log_dual = Y                                                         2
set pd_sts_file_name_1 = "b2sts1","D:\unt2\sysfile_a\b2sts1a",\             3
                                 "E:\unt2\sysfile_b\b2sts1b"
set pd_sts_file_name_2 = "b2sts2","D:\unt2\sysfile_a\b2sts2a",\
                                 "E:\unt2\sysfile_b\b2sts2b"
pdwork -v "C:\unt2\work03","C:\unt2\work04"                                 4
pdlogadfg -d sys -g b2log1 ONL                                              5
pdlogadfg -d sys -g b2log2 ONL
pdlogadfg -d sys -g b2log3 ONL
pdlogadfg -d sys -g b2log4 ONL
pdlogadpf -d sys -g b2log1 -a "D:\unt2\sysfile_a\b2log1a"\
                          -b "E:\unt2\sysfile_b\b2log1b"
pdlogadpf -d sys -g b2log2 -a "D:\unt2\sysfile_a\b2log2a"\
                          -b "E:\unt2\sysfile_b\b2log2b"
pdlogadpf -d sys -g b2log3 -a "D:\unt2\sysfile_a\b2log3a"\
                          -b "E:\unt2\sysfile_b\b2log3b"
pdlogadpf -d sys -g b2log4 -a "D:\unt2\sysfile_a\b2log4a"\
                          -b "E:\unt2\sysfile_b\b2log4b"
pdlogadfg -d spd -g b2sync1 ONL                                             6
pdlogadfg -d spd -g b2sync2 ONL
pdlogadfg -d spd -g b2sync3 ONL
pdlogadfg -d spd -g b2sync4 ONL
pdlogadpf -d spd -g b2sync1 -a "D:\unt2\sysfile_a\b2sync1"
pdlogadpf -d spd -g b2sync2 -a "E:\unt2\sysfile_b\b2sync2"
pdlogadpf -d spd -g b2sync3 -a "D:\unt2\sysfile_a\b2sync3"
pdlogadpf -d spd -g b2sync4 -a "E:\unt2\sysfile_b\b2sync4"

Explanation
  1. Specifies the size of the shared memory to be used by the back-end server (bes2).
  2. Specifies that dual system log files will be used.
  3. Specifies the configuration of the server status files
  4. Specifies HiRDB file system areas for work table files.
  5. Specifies the configuration of the system log files.
  6. Specifies the configuration of the synchronization point dump files.

(9) Back-end server definition of bes3

set pd_bes_shmpool_size = 5000                                             1
set pd_log_dual = Y                                                        2
set pd_sts_file_name_1 = "b3sts1","D:\unt3\sysfile_a\b3sts1a",\            3
                                 "E:\unt3\sysfile_b\b3sts1b"
set pd_sts_file_name_2 = "b3sts2","D:\unt3\sysfile_a\b3sts2a",\
                                 "E:\unt3\sysfile_b\b3sts2b"
pdwork -v "C:\unt3\work01","C:\unt3\work02"                                4
pdlogadfg -d sys -g b3log1 ONL                                             5
pdlogadfg -d sys -g b3log2 ONL
pdlogadfg -d sys -g b3log3 ONL
pdlogadfg -d sys -g b3log4 ONL
pdlogadpf -d sys -g b3log1 -a "D:\unt3\sysfile_a\b3log1a"\
                          -b "E:\unt3\sysfile_b\b3log1b"
pdlogadpf -d sys -g b3log2 -a "D:\unt3\sysfile_a\b3log2a"\
                          -b "E:\unt3\sysfile_b\b3log2b"
pdlogadpf -d sys -g b3log3 -a "D:\unt3\sysfile_a\b3log3a"\
                          -b "E:\unt3\sysfile_b\b3log3b"
pdlogadpf -d sys -g b3log4 -a "D:\unt3\sysfile_a\b3log4a"\
                          -b "E:\unt3\sysfile_b\b3log4b"
pdlogadfg -d spd -g b3sync1 ONL                                            6
pdlogadfg -d spd -g b3sync2 ONL
pdlogadfg -d spd -g b3sync3 ONL
pdlogadfg -d spd -g b3sync4 ONL
pdlogadpf -d spd -g b3sync1 -a "D:\unt3\sysfile_a\b3sync1"
pdlogadpf -d spd -g b3sync2 -a "E:\unt3\sysfile_b\b3sync2"
pdlogadpf -d spd -g b3sync3 -a "D:\unt3\sysfile_a\b3sync3"
pdlogadpf -d spd -g b3sync4 -a "E:\unt3\sysfile_b\b3sync4"

Explanation
  1. Specifies the size of the shared memory to be used by the back-end server (bes3).
  2. Specifies that dual system log files will be used.
  3. Specifies the configuration of the server status files.
  4. Specifies HiRDB file system areas for work table files.
  5. Specifies the configuration of the system log files.
  6. Specifies the configuration of the synchronization point dump files.

(10) UAP environment definition

set pd_uap_wait = Y                                        1
pdlbuffer -a localbuf1 -r RDAREA10 -n 1000 -p 16           2
pdlbuffer -a localbuf2 -r RDAREA11,RDAREA12 -n 1000        3
pdlbuffer -a localbuf3 -i USER01.INDX01 -n 1000            4

Explanation
  1. Specifies the action to be taken by the UAP when the RDAREA or index to be accessed using a local buffer is being used by another user.
  2. Allocates a local buffer to a user RDAREA (RDAREA10).
  3. Allocates a local buffer to user RDAREAs (RDAREA11 and RDAREA12).
  4. Allocates a local buffer to an index (INDX01).