Populating the communications database for use with VTAM

If you plan to use Db2 only as a server, you do not need to populate the CDB; default values are used. However, if you intend for Db2 to act as a requester, you need to insert one row for each remote system into SYSIBM.LOCATIONS and SYSIBM.LUNAMES.

About this task

For example, Spiffy's USIBMSTODB21 subsystem works as a server for many Windows requesters. It is not necessary for Spiffy to register all those requesters in the Db2 CDB.

You do not need to populate table SYSIBM.LULIST unlessDb2 is acting as a requester of data that resides in a data sharing group.

After you populate these tables, you can write queries that access data at a remote system.

Procedure

  • Add rows to the SYSIBM.LOCATIONS table.
    When you issue an SQL CONNECT statement, the LOCATION column of the SYSIBM.LOCATIONS table correlates the location name (or DRDA RDBNAM) with the VTAM® LU name. If necessary, the location name is also correlated with the transaction program names (TPNs). The following SYSIBM.LOCATIONS table columns relate to VTAM:
    DBALIAS VARCHAR(128) NOT NULL
    The name that is associated with the server. This name is used to access a remote database server. If DBALIAS is blank, the location name is used to access the remote database server. This column does not change database object names that are sent to the remote site using a location qualifier. Use the DBALIAS column to access data at two or more different remote locations when those remote locations have the same name. The LOCATION specifies where the database is in the network, and the DBALIAS is used to access the database server. This column does not change database object names that are executed in the application using the LOCATION. All fully qualified table names must reference the server's LOCATION name or one of its server LOCATION alias names, otherwise the SQL statement will fail because the table does not exist.
    LOCATION CHAR(16)
    The unique network location name, or DRDA RDBNAM, assigned to a system, remote or local. You must provide location names for any systems that you request data from. This column is the primary key for this table. If the remote LU exists in the same VTAM domain, specify the APPL name, not the ACBNAME. DBALIAS can override this name.
    LINKNAME CHAR(8)
    Identifies the VTAM attributes associated with this location. For each LINKNAME specified, you must have a row in SYSIBM.LUNAMES whose LUNAME matches the value specified in this column. Because this table is used for outbound requests, you must provide an LUNAME or your requests fail. Do not enter blanks in this column.
    TPN VARCHAR(64)
    This column is used to enter a transaction program name (TPN) for SNA conversations with non-Db2 systems. You only need to use this column if you are sending or receiving SQL requests from systems using non-default TPNs.

    For example, Spiffy's USIBMSTODB21 location wants a LOCATIONS table that looks like the following table.

    Table 1. Spiffy's LOCATIONS table
    LOCATION LINKNAME TPN  
    USIBMSTODB21 LUDB21    
    USIBMSTODB22 LUDB22    
    USIBMSTOSQL1 LUSQLDS TPNSQLDS2  
    USIBMSTOSQL2 LUSQLDS TPNSQLDS1  

    To add the second row, Spiffy can issue the following statement:

    INSERT INTO SYSIBM.LOCATIONS (LOCATION, LINKNAME)
      VALUES ('USIBMSTODB22','LUDB22');
    Tip: No row is needed for the local Db2 in the LUNAMES and LOCATIONS tables. For example, Spiffy's USIBMSTODB21 subsystem does not require a row that shows its own LU name and location name. However, for convenience, Spiffy decides to populate one LUNAMES table and one LOCATIONS table and to duplicate them entirely at each location. As a result, each table contains a row for its own LU name or location name.
  • Insert rows into the SYSIBM.LUNAMES table.
    The LUNAMES table defines the security and mode requirements for conversations with other systems. Decisions about how to populate this table depend on how you intend to use Db2.
    • If you use this system only as a server, Db2 can use a blank in the LUNAME column as a default. Db2 uses the values in the default row as defaults for LUs that are not explicitly defined in LUNAMES. If you do not have a row with a blank in the LUNAME column, Db2 rejects client connections that do not explicitly state a valid LUNAME. The DSNTIJSG installation job creates the default row in table SYSIBM.LUNAMES.
    • If this Db2 requests data from other systems, you need to provide LU names for those systems. If the remote LU exists in the same VTAM domain, specify the APPL name, not the ACBNAME.

    The LUNAMES table has the following columns:

    LUNAME CHAR(8)
    The LU name of the remote system. The default of 8 blanks indicates that this row is used for serving the requests of any system that is not specifically listed in the LUNAMES table. For example, because USIBMSTODB21 acts strictly as a server for many Windows requesters, Spiffy leaves the LUNAME column blank for those requesters and uses default values for the entire row.

    However, you must provide LU names for any remote system that uses different values from the defaults.

    SYSMODENAME CHAR(8)
    This column is ignored for DRDA access conversations.
    SECURITY_IN CHAR(1)
    Defines the security options that are accepted by this Db2 subsystem when an SNA client connects to Db2. The default, A, means that an incoming connection request is accepted if it includes any of these:
    • A user ID
    • A user ID and password
    • A user ID and RACF PassTicket
    • A Kerberos security ticket.
    SECURITY_OUT CHAR(1)
    Defines the security option that is used when local Db2 SQL applications connect to any remote server associated with this LUNAME. The default, A, means that outgoing connection requests contain an authorization ID without a password.
    ENCRYPTPSWDS CHAR(1)
    For now, Spiffy uses a blank to indicate no encryption of passwords.
    MODESELECT CHAR(1)
    Determines whether to use the default mode or to choose a mode from the MODESELECT table. Spiffy uses a blank to use the default IBMRDB mode for conversations using DRDA access.
    USERNAMES CHAR(1)
    This column is used for inbound and outbound requests to control authorization ID translation.

    Spiffy uses a blank to indicate that no authorization IDs are translated, and also that no passwords are sent to the server.

    GENERIC CHAR(1)
    A Y in this column indicates that a generic LU name is to be used for CNOS processing and SQL requests sent to the partner LU. A value of N or a blank indicates that the name specified in the LUNAME column is to be used.

    For example, Spiffy's USIBMSTODB21 location wants a LUNAMES table that looks like the following table.

    Table 2. Spiffy's SYSIBM.LUNAMES table. The row of blanks is a default row that Spiffy intends to use for Windows requesters in its initial testing.
    LUNAME SYSMODENAME USERSECURITY 1 ENCRYPTPSWDS MODESELECT USERNAMES
    LUDB21          
    LUDB22          
    LUSQLDS          
    (blanks)          
    Note:
    1. USERSECURITY refers to SECURITY_IN AND SECURITY_OUT
    Spiffy can use an SQL INSERT statement to add the appropriate rows. For example, they add the LU name for USIBMSTODB22 with this statement:
    INSERT INTO SYSIBM.LUNAMES (LUNAME)
      VALUES ('LUDB22');
  • Add rows in the SYSIBM.USERNAMES table.
    The SYSIBM.USERNAMES table contains information that is needed for outbound and inbound ID translation and also for come from checking. For more information, see SYSIBM.USERNAMES columns.