DB2 Server for VSE & VM: Database Administration


Chapter 9. DB2 Server for VM Database Configurations

This chapter provides an overview of some of the many possible configurations. (For detailed information on how to establish any particular configuration, see the DB2 Server for VM System Administration manual.) It also contains information on VSE Guest Sharing, and on the VM/ESA operating environment.


DB2 Server for VM Concepts

The following terms are used in the descriptions of the DB2 Server for VM configurations that follow:

Database
A collection of CMS minidisks that store both user and system information. The latter includes data used to secure and manage the database, such as a list of valid users.

Database Manager
A program that provides database management services. This program executes in its own virtual machine, referred to as the database machine.

The database manager controls any updates or deletes made to the database, and maintains its security and integrity.

To protect the integrity of the database, users do not have direct access to it. Rather, their requests are sent to the database manager, which processes them and returns the results to the users.

Service Machine
A virtual machine required by any processor that does not have its own DB2 Server for VM database machine, and has users who want to access a DB2 Server for VM database in a collection.

Notes:

  1. A collection is a group of VM processors that are connected together using channel-to-channel, binary synchronous lines, or local area networks.

  2. The term local applies to either resources or users. The service machine provides essential DB2 Server for VM support to users by allowing access to the production minidisk.

User Machine
A virtual machine that runs either ISQL, DBS Utility, or a user-written application program that uses SQL.

User machines cannot make changes directly to the database. They must send SQL statements to the database manager.

Resource Adapter
The DB2 Server for VM code used by ISQL, the DBS Utility, and application programs to communicate with the database machine. It enables users to communicate with the database manager. Users need not be aware of it.

Operating Modes for the Database Machine

The database machine can run in two modes of operation: multiple user or single user. The DB2 Server for VM operator (the person logged onto the database machine) selects the mode when he or she starts up the database machine.

In multiple user mode, the most common mode of operation, one or more users or applications concurrently access the same database. The database manager runs in its own virtual machine, while one or more DB2 Server for VM applications run in other virtual machines.

In single user mode, the database manager and an application program run in a single VM machine, and no other users are allowed access. Some maintenance tasks, such as adding auxiliary storage to the database, require this mode.

It is also possible to operate more than one DB2 Server for VM database machine in multiple user mode: that is, multiple databases are being accessed by many users concurrently. This is called "multiple database mode".


Example Configurations

The following configurations all assume that the database machines are operating in multiple user mode.

One Database Machine with One Database

In the simplest configuration, there is one database machine and one database. (This environment is created by the installation process.)

Figure 47 shows an example. Here, all virtual machines reside on the same processor.

Figure 47. Example of One Database Machine Running One Database


View figure.

Points (1) and (2) in the figure are as follows:

  1. The SQLMACH database machine was set up to use the DB01 database.

    The operator selects a database when the database machine is started.

  2. Three user virtual machines (MARYLOU, STEVE, and CINDY) communicate with the SQLMACH database machine to access the DB01 database. They must enter:
       SQLINIT DBNAME(DB01)
    

    to specify DB01 as the default database. Then, when they invoke ISQL, the DBS Utility, or an application program, this default database will be accessed. See SQLINIT EXEC for information on the SQLINIT EXEC.

One Database Machine with Two Databases

In Figure 48, all virtual machines reside on the same processor.

Figure 48. One Database Machine that Owns More than One Database


View figure.

Points (1) and (2) in the figure are as follows:

  1. The database machine was set up to use the DB01 database.

    The operator selects a database when the database machine is started. In this example, the operator had the choice of selecting the DB01 or DB02 database. The DB01 database was chosen.

    Note that a database machine can only access one database at a time. To access the DB02 database, the operator must restart the SQLMACH database machine, specifying the DB02 database.

  2. Three user virtual machines (MARYLOU, STEVE, and CINDY) communicate with the database machine to access the DB01 database. They must enter:
       SQLINIT DBNAME(DB01)
    

    to specify DB01 as the default database. Then, when they invoke ISQL, the DBS Utility, or an application program, this default database will be accessed. (See SQLINIT EXEC for information on the SQLINIT EXEC.)

    Here, users cannot access the DB02 database. If they entered "SQLINIT DBNAME(DB02)" and then tried to access DB02 (using ISQL, the DBS Utility, or an application program), an SQL error would occur.

    If users need to access DB02, the operator will have to restart the SQLMACH database machine, specifying that DB02 is to be accessed. DB01 must be stopped before DB02 can be restarted.

Several Database Machines with Many Databases

In Figure 49, all virtual machines reside on the same processor.

Figure 49. Two Database Machines with Three Databases


View figure.

Points (1), (2), and (3) of the figure are as follows:

  1. The SQLMACH database machine was set up to use the DB01 database.

    The SQLMACH operator selects a database when the database machine is started. In this example, the operator had the choice of selecting the DB01 or DB02 database. The DB01 database was chosen.

    Note that a database machine can only access one database at a time. To access the DB02 database, the operator must restart the SQLMACH database machine, specifying the DB02 database.

  2. The SQLMFB database machine was set up to use the DB03 database.

    Note that it is possible for one database machine to access a database "owned" by another database machine, as long as the virtual machines reside on the same processor. For example, the SQLMFB database machine could access the DB02 database, provided that the SQLMFB operator knows the minidisk passwords for the DB02 database minidisks.
    Note:A database machine "owns" a database if its virtual machine directory contains the MDISK statements for the database minidisks.

  3. Five user virtual machines (MARYLOU, STEVE, CINDY, MIKE and MARY) communicate with the database machines. MARYLOU, STEVE, and CINDY must enter:
       SQLINIT DBNAME(DB01)
    

    to specify DB01 as their default database, while MIKE and MARY must enter:

       SQLINIT DBNAME(DB03)
    

    to specify DB03 as their default database. (See SQLINIT EXEC for information on the SQLINIT EXEC.)

    Here, users cannot access the DB02 database. If they entered "SQLINIT DBNAME(DB02)" and then tried to access DB02 (using ISQL, the DBS Utility, or an application program), an SQL error would occur.

    If users need to access DB02, the SQLMACH database machine operator will have to restart the SQLMACH database machine, specifying that DB02 is to be accessed. Restarting the SQLMACH database machine to access DB02 will stop users from accessing DB01.

    Users can change the database they are accessing in two ways:

    1. Using the SQLINIT EXEC to specify a new default.
    2. Using the CONNECT statement to switch databases. This can be done from within an application (ISQL, the DBS Utility, or an application program).

      For example, suppose MARYLOU is accessing DB01 using ISQL. She can switch to DB03 by entering the following SQL statement:

         CONNECT TO DB03
      

      See Connecting to an Application Server in VM for more information.

Multiple Database Machines on Different Processors

Users can access a database that resides on another processor, provided both processors are running on VM/ESA systems, and are connected in TSAF, SNA or TCP/IP network. (Refer to the DB2 Server for VM System Administration manual for information about network configurations.)

Figure 50 shows an example of accessing a database located on another processor.

Figure 50. User Accessing a Database on Another Processor


View figure.

Points (1), (2), and (3) of the figure are as follows:

  1. The SQLMACH database machine was set up to use the DB01 database.

    The SQLMACH operator selects a database when the database machine is started. In this example, the operator had the choice of selecting the DB01 or DB02 database. The DB01 database was chosen.

    Note that a database machine can only access one database at a time. To access the DB02 database, the operator must restart the SQLMACH database machine, specifying the DB02 database.

  2. The SQLREM database machine was set up to use the DB04 database.

    The database is established as a global resource.
    Note:Databases can be classified as either local or global. A local database can only be accessed by users located on the same processor as itself, while a global one can also be accessed by users located on other processors within the collection.

    The SQLREM operator specified the DB04 database at startup.

    It is possible for a database machine to access a database "owned" by another database machine, provided the virtual machines reside on the same processor. The SQLREM database machine cannot access the DB01 database (owned by SQLMACH), because SQLMACH and DB01 are on a different processor.

  3. Four user virtual machines (MARYLOU, STEVE, CINDY and RALPH) communicate with the database machines.

    MARYLOU and STEVE enter:

       SQLINIT DBNAME(DB01)
    

    to specify DB01 as their default database, while CINDY and RALPH enter:

       SQLINIT DBNAME(DB04)
    

    to specify DB04 as their default database.

    Note that although CINDY is on a different processor from RALPH, both access the DB04 database in the same way, and CINDY is able to specify DB04 as her default database.

    Users can change the database they are accessing in two ways:

    1. Using the SQLINIT EXEC to specify a new default database.

      After establishing a new default database, the user could then access the database using ISQL, the DBS Utility, or application programs.

    2. Using the SQL CONNECT statement.

      This can be done from within an application (ISQL, the DBS Utility or application program).

      For example, suppose MARYLOU is accessing DB01 using ISQL. She can switch DB04 by entering the following SQL statement:

         CONNECT TO DB04
      

      Refer to Connecting to an Application Server in VM for more information.

Accessing a Database from a Processor that Does Not Have One

Users on processors that do not have a database machine or a database can access a database on another processor. (The processors must be running on VM/ESA systems, and all user IDs must be unique between processors.) Figure 51 shows an example.

Figure 51. Accessing a Database from Another Processor


View figure.

Points (1), (2), and (3) of the figure are as follows:

  1. The SQLMACH database machine was set up to use the DB01 database.

    The SQLMACH operator selects a database when the database machine is started. This database is established as a global resource.

  2. Four user virtual machines (MARYLOU, STEVE, CINDY, and JOHN) communicate with the database machine (SQLMACH) to access DB01. MARYLOU, STEVE, CINDY, and JOHN enter:
       SQLINIT DBNAME(DB01)
    

    to specify DB01 as their default database.

    When MARYLOU, STEVE, CINDY, or JOHN invoke ISQL, the DBS Utility, or an application program, DB01 will be accessed.

  3. JOHN is on Processor 2 which does not have a database machine or database.

    JOHN must have a link to the service machine disk in order to access the database on Processor 1. This service machine must be installed on Processor 2.


Performance Considerations with Multiple Databases

Most of the processing time for any transaction is spent in the database machine and not in an application program. It is possible to have users on one processor accessing data stored on another processor if the operating systems are VM/ESA systems. However, because of the processor overhead of inter-processor communication, a database should be placed on a processor that is closest to its greatest number of users, preferably on the same one.

If you plan to have users on one processor accessing a database on another processor, you should consider the overhead of inter-processor communication. Most message traffic between the user and the database machine should flow within a single processor. Only a small percentage of messages should flow between processors, as happens when users infrequently access data located on other processors.

Although the end user does not need to know the physical location of a database, you must have a good understanding of user-group requirements in a particular business environment. Users should first be grouped according to the business tasks they perform. Databases and tables can then be arranged so that they are always accessed by most users in a particular group. A good understanding of the business environment and the needs of various user groups can aid in determining whether users on one processor are allowed to access databases on other processors.

When planning your database configuration, you should generally avoid:

Database configurations should be designed so that:

For more information on performance considerations, see the DB2 Server for VM System Administration manual.


VSE Guest Sharing (On VM/ESA Systems Only)

If you have VSE/AF 4.1.0 or higher running as a guest under a VM/ESA system, VSE users can access DB2 Server for VM databases through VSE Guest Sharing. The database accessed can be on the same VM/ESA system as the one that supports the VSE guest, or on another VM/ESA system in the same TSAF collection, SNA or TCP/IP network. A VSE guest user can use database switching to target another database. An example of a DB2 Server for VM database with VSE Guest Sharing support is shown in Figure 52.

Figure 52. VSE Guest Sharing Configuration


View figure.

In a VSE Guest Sharing environment, VM/ESA users and applications can use the same functions they use in a VM/ESA environment without being aware of guest sharing.

For more information on VSE Guest Sharing, and on the DB2 Server for VM configurations that you can implement, see the DB2 Server for VM System Administration manual.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]