Example: Setting up a relational database directory

 

The Spiffy Corporation network example illustrates how the relational database directory is set up and used on systems in a distributed relational database network.

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: Figure 1. Relational database directory set up for two systems

Relational Database Directory Set up for Two servers The relational database directory for each regional office must contain an entry for the local relational database and an entry for the remote relational database because each system is both an application requester (AR) and an application server (AS). The commands to create the relational database directory for the MP000 system are:

ADDRDBDIRE    RDB(MP000) RMTLOCNAME(*LOCAL) TEXT('Minneapolis region database')
 
ADDRDBDIRE    RDB(KC000) RMTLOCNAME(KC000) TEXT('Kansas City region database')
In the preceding example, the MP000 system identifies itself as the local relational database by specifying *LOCAL for the RMTLOCNAME parameter. There is only one relational database on a System i™ platform. You can simplify identification of your network relational databases by making the relational database names in the RDB directory the same as the system name. The entry for the local location can have the same name as the local system name, and the entry for the remote location name can have the same name as the remote system name.

The system name is specified on the SYSNAME parameter of the Change Network Attributes (CHGNETA) command. The local system is identified on the LCLLOCNAME parameter of the CHGNETA command during communications configuration. Remote locations using SNA (APPC) are identified with the RMTCPNAME parameter on the Create Controller Description (APPC) (CRTCTLAPPC) command during communications configuration. Using the same names for system names, network locations, and database names can help avoid confusion, particularly in complex networks. The corresponding entries for the KC000 system relational database directory are:

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 the MP000 system must be expanded to include an entry for each of its dealerships. Figure 2. Relational database directory setup for multiple systems

Relational database directory setup for multiple servers

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 have 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 system.

The most time-consuming and error-prone method is to create a relational database directory at each system by using the Add Relational Database Directory Entry (ADDRDBDIRE) command to create each directory entry on all systems 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 system. The distributed relational database administrator can copy this CL program for each of the dealership systems. To customize this program for each dealership, the database administrator changes the remote location name of the MP000 system 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 system 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 system. Each system can 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 system directory for the local system.

 

Parent topic:

Using the relational database directory

 

Related tasks


Saving and restoring relational database directories

 

Related reference


Add Relational Database Directory Entry (ADDRDBDIRE) command
Change Relational Database Directory Entry (CHGRDBDIRE) command
Create Controller Description (APPC) (CRTCTLAPPC) command
Display Network Attributes (DSPNETA) command
Display Relational Database Directory Entry (DSPRDBDIRE) command