Appendix C.1 Example 1 (HiRDB/Single Server)

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

Unit configuration

[Figure]

System files configuration

[Figure]

Organization of this subsection
(1) System common definition
(2) Unit control information definition
(3) Single server definition
(4) 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 = 220                               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", \                  10
   "PRIOR_OR_INDEXES","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
pdstart -t SDS -s sds1 -u UNT1                                13
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 size.
  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 unit configuration:
    -x: Host name
    -u: Unit identifier
    -d: HiRDB directory name
  13. Specifies the server configuration:
    -t: Server type (SDS: single server)
    -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

set pd_unit_id = UNT1                                                 1
set pd_syssts_file_name_1 = "untsts1","D:\sysfile_a\usts1a",\         2
                                     "E:\sysfile_b\usts1b"
set pd_syssts_file_name_2 = "untsts2","D:\sysfile_a\usts2a",\
                                     "E:\sysfile_b\usts2b"

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

(3) Single server definition

set pd_sds_shmpool_size = 10000                                        1
set pd_log_dual = Y                                                    2
set pd_sts_file_name_1 = "svrsts1","D:\sysfile_a\ssts1a",\             3
                                  "E:\sysfile_b\ssts1b"
set pd_sts_file_name_2 = "svrsts2","D:\sysfile_a\ssts2a",\
                                  "E:\sysfile_b\ssts2b"
pdwork -v "C:\work01","C:\work02"                                      4
pdlogadfg -d sys -g log1 ONL                                           5
pdlogadfg -d sys -g log2 ONL
pdlogadfg -d sys -g log3 ONL
pdlogadfg -d sys -g log4 ONL
pdlogadpf -d sys -g log1 -a "D:\sysfile_a\log1a" -b "E:\sysfile_b\log1b"
pdlogadpf -d sys -g log2 -a "D:\sysfile_a\log2a" -b "E:\sysfile_b\log2b"
pdlogadpf -d sys -g log3 -a "D:\sysfile_a\log3a" -b "E:\sysfile_b\log3b"
pdlogadpf -d sys -g log4 -a "D:\sysfile_a\log4a" -b "E:\sysfile_b\log4b"
pdlogadfg -d spd -g sync1 ONL                                          6
pdlogadfg -d spd -g sync2 ONL
pdlogadfg -d spd -g sync3 ONL
pdlogadfg -d spd -g sync4 ONL
pdlogadpf -d spd -g sync1 -a "D:\sysfile_a\sync1"
pdlogadpf -d spd -g sync2 -a "E:\sysfile_b\sync2"
pdlogadpf -d spd -g sync3 -a "D:\sysfile_a\sync3"
pdlogadpf -d spd -g sync4 -a "E:\sysfile_b\sync4"

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

(4) 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).