DRDA defines types of distributed database management system functions. DB2 for MVS/ESA V2R3 supports remote unit of work. With remote unit of work, an application program executing in one system can access data at a remote DBMS using the SQL provided by that remote DBMS. DB2 for MVS/ESA V3R1 supports distributed unit of work. With distributed unit of work, an application program executing in one system can access data at multiple remote DBMSs using SQL provided by remote DBMSs. For more information on the types of distribution defined by DRDA, see the DRDA Connectivity Guide.
As shown in Figure 2, DB2 for MVS/ESA supports three configurations of distributed database connections using two access methods:
[1] System-directed access allows a DB2 for MVS/ESA requester to connect to one or more DB2 for MVS/ESA servers. The connection established between the DB2 for MVS/ESA requester and server does not adhere to the protocols defined in DRDA and cannot be used to connect non-DB2 for MVS/ESA products to DB2 for MVS/ESA. This type of connection is established by coding three-part names or aliases in the application.
[2] Application-directed access allows a DB2 for MVS/ESA or non-DB2 for MVS/ESA requester such as DB2 Connect to connect to one or more DB2 for MVS/ESA or non-DB2 for MVS/ESA application servers such as DB2 Universal Database and DB2 Universal Database for AS/400 using DRDA protocols. The number of application servers that can be connected to the application requester at one time depends on the level of DB2 for MVS/ESA of the application requester. If the application requester is DB2 for MVS/ESA V2R3, then only one application server can be connected at a time. This type of connection is established by coding SQL CONNECT statements in the application. If the application requester is DB2 for MVS/ESA V3R1, then one or more application servers can be connected at a time.
[3] Application-directed and system-directed access can be used together to establish connections.
The term secondary server describes systems acting as servers to the application server.
If all systems in a configuration support two-phase commit, then distributed unit of work (multiple-site read and multiple-site update) is supported. If not all systems support two-phase commit, updates within a unit of work are either restricted to a single site that does not support two-phase commit, or to the subset of sites that support two-phase commit.
Figure 2. DB2 for MVS/ESA Distributed Connections
Table 1 compares the DB2 for MVS/ESA distributed database connection
types.
Table 1. Comparison of DB2 for MVS/ESA Distributed Database Connections
[1] System-Directed Access | [2] Application-Directed Access (with all systems having two-phase commit) | [3] Application-Directed and System-Directed Accesses |
---|---|---|
All partners must be DB2 for MVS/ESA systems | Can interconnect any two DRDA systems | Application requester can be any DRDA system; servers must be DB2 for MVS/ESA systems |
Can connect directly to many partners | Can connect directly to many partners | Application requester connects directly to Application Servers; Application Servers can connect to many DB2 for MVS/ESA secondary servers |
Each SQL application can have multiple APPC conversations with each server | Each SQL application has one APPC conversation with each server | SQL application has one APPC conversation with each server; DB2 for MVS/ESA application server can establish many APPC conversations to each server for the application |
Can access both local and remote resources in one commit scope | Can access both local and remote resources in one commit scope | Application requester and Application Server can access local and remote data |
More efficient at large queries and multiple concurrent queries | More efficient at SQL statements that are executed very few times in one commit scope | Application requester-Application Server connection behaves like [2]; secondary server connections behave like [1] |
Can support static or dynamic SQL, but server dynamically binds static SQL the first time it is executed in a commit scope | Can issue static or dynamic SQL | Application requester and Application Server can issue static or dynamic SQL; secondary servers support static or dynamic SQL, but dynamically bind static SQL the first time it is executed in a commit scope |
Limited to SQL INSERT, DELETE, and UPDATE statements, and to statements that support SELECT | Can use any statement supported by the system that executes the statement | Application servers supports any SQL; secondary servers support only DML SQL (for example, CREATE or ALTER) |