The Spiffy Corporation network provides an example to illustrate how the relational database directory is used on servers in a distributed relational database network and show how each is set up. The example assumes the use of Advanced Program-to-Program Communication (APPC) for communications, as opposed to TCP/IP, which would be simpler to set up.
However, some elements of the example are protocol-independent. The RDB directory entries needed for APPC use are also needed in a TCP/IP network, but the parameters differ. Host names or IP addresses and port identifications would replace logical unit (LU) names, device descriptions, modes, TPNs, and so forth.
A simple relationship to consider is the one between two regional offices as shown in the following figure:
ADDRDBDIRE RDB(MP000) RMTLOCNAME(*LOCAL) TEXT('Minneapolis region database') ADDRDBDIRE RDB(KC000) RMTLOCNAME(KC000) TEXT('Kansas City region database')
ADDRDBDIRE RDB(KC000) RMTLOCNAME(*LOCAL) TEXT('Kansas City region database') ADDRDBDIRE RDB(MP000) RMTLOCNAME(MP000) TEXT('Minneapolis region database')
A more complex example to consider is that of a regional office to its dealerships. For example, to access relational databases in the network shown in the following figure, the relational database directory for MP000 server must be expanded to include an entry for each of its dealerships.
A sample of the commands used to complete the MP000 relational database directory to include all its dealer databases is as follows:
PGM ADDRDBDIRE RDB(MP000) RMTLOCNAME(*LOCAL) + TEXT('Minneapolis region database') ADDRDBDIRE RDB(KC000) RMTLOCNAME(KC000) TEXT('Kansas City region database') ADDRDBDIRE RDB(MP101) RMTLOCNAME(MP101) TEXT('Dealer database MP101') ADDRDBDIRE RDB(MP002) RMTLOCNAME(MP110) TEXT('Dealer database MP110') . . . ADDRDBDIRE RDB(MP215) RMTLOCNAME(MP201) TEXT('Dealer database MP201') ENDPGM
In the preceding example, each of the region dealerships is included in the Minneapolis relational database directory as a remote relational database.
Because each dealership can serve as an AR to MP000 and to other dealership application servers, each dealership must have a relational database directory that has an entry for itself as the local relational database and the regional office and all other dealers as remote relational databases. The database administrator has several options to create a relational database directory at each dealership server.
The most time-consuming and error-prone method is to create a relational database directory at each server by using the Add Relational Database Directory Entry (ADDRDBDIRE) command to create each directory entry on all servers that are part of the MP000 distributed relational database network.
A better alternative is to create a control language (CL) program like the one shown in the preceding example for the MP000. The distributed relational database administrator can copy this CL program for each of the dealership servers. To customize this program for each dealership, the database administrator changes the remote location name of the MP000 server to MP000, and changes the remote location name of the local dealership to *LOCAL. The distributed relational database administrator can distribute the customized CL program to each dealership to be run on that server to build its unique relational database directory.
A third method is to write a program that reads the relational database directory information sent to an output file as a result of using the Display Relational Database Directory Entry (DSPRDBDIRE) command. This program can be distributed to the dealerships, along with the output file containing the relational database directory entries for the MP000 server. Each server could read the MP000 output file to create a local relational database directory. The Change Relational Database Directory Entry (CHGRDBDIRE) command can then be used to customize the MP000 server directory for the local server.