3 4
-.......^v TUC ... forwarding the updated data unit from the first
SUMMARY OF THE INVENTION DBMS tQ the sgcond DBMS and providing the version
It is, therefore, an object of the invention to provide number of the updated data unit from the first DBMS to
an improved method and structure for providing fast the global lock manager;
access to data resources by multiple users on multiple 5 forwarding the version number received from the
instances of a DBMS while ensuring coherency of the first DBMS by the global lock manager to the second
data resources. DBMS;
A further object of this invention is to provide a if the version number provided to the second DBMS locking procedure which supports inter-DBMS transfer is greater than the version number in the updated data of units of data without storage to disk. 10 unit received by the second DBMS or if the updated A still further object of this invention is to avoid disk data unit has not been received at the second DBMS I/O in a multiple user, data-sharing environment by when the version number arrives, writing the updated transferring a modified unit of data from the buffer of data unit to a disk from the first DBMS, providing the one DBMS to another DBMS which needs it. data unit to the second DBMS from the disk and readIt is a further object of this invention to permit up- 15 ing the record; otherwise, dates to a unit of data to be made by several systems reading the record from the updated data unit transbefore the unit is written back to disk. ferred to the second DBMS from the first DBMS.
According to the invention, a multiple user, data- In the event that the second DBMS wants to update
sharing arrangement permits a plurality of instances of a the record, the global lock manager forwards a request
DBMS which may be executing on one or more central 20 to the first DBMS to transfer the data unit. The first
electronic complexes to gain access to data stored in DBMS transfers the data unit to the second DBMS,
one or more disks available to all instances of the while providing the version number for the updated
DBMS. In this arrangement, lock management is pro- data unit to the global lock manager and writing the
vided by a global locking system which manages locks updated data unit to a disk. The first DBMS then re
on units of data and data records for all instances of the 25 leases its P lock and the global lock manager provides
DBMS. Fast access to units of data requested by trans- the version number to the DBMS. If the second DBMS
actions executing on different DBMS instances is pro- has received the updated data unit by the time it re
vided by inter-DBMS transfer of requested data units ceives the version number, it accepts the updated data
without disk I/O and with the guarantee of the integrity unit if the version number matches the version number
of the transferred data unit by the method of: 30 in the updated data unit. Otherwise, the updated data
maintaining a global lock table at a global lock man- unit is provided to the second DBMS from the disk,
ager, the global lock table including one or more The second DBMS then updates the record in the up
entries, each entry corresponding to a lock granted to a dated data unit. DBMS;
issuing a P lock for updating a data unit to a first 35
DBMS; FIG. 1 is a block diagrammatic representation of a
entering an entry for the P lock in the global lock typical computing system environment for operation of
table; the invention.
providing the data unit from a disk to a buffer of the FIG. 2 is a block diagrammatic representation showfirst DBMS; 40 ing, in greater detail, functional elements and data struc
generating an updated data unit in the buffer by up- tures necessary for practice of the invention,
dating the data unit at the first DBMS; FIGS 3A', 3A", 3B and 3C form a flow diagram
in response to updating the data unit: representing detection in one DBMS instance of an
generating a version number for the updated data unit updated data unit in another DBMS instance and trans
at the first DBMS, the version number being a mono- 45 fer of the updated data unit between the instances, tonically increasing number;
attaching the version number to the updated data unit
in the buffer of the first DBMS; and In the IBM DB2 database system, updated pages are
storing the version number in the entry for the P lock not written to disk at transaction commit time in order
in the global lock table; 50 to improve the transaction response time and concur
issuing a request for an L lock to read a record on the rency. An updated page which has been obtained from
data unit from a second DBMS; disk and updated by a process is called a "dirty" page.
in response to a request for the L lock, providing the Retention of a dirty page in the buffer of an updating
second DBMS with the version number stored in the system is called "caching" a dirty page. In order to
global lock table and granting the L lock; 55 guarantee proper completion of recovery in the event
if a version of the data unit is in a buffer of the second of a DBMS failure, enough information is recorded in
DBMS, comparing the version number in the data unit - the updating system's log at checkpoint to redo updates
with the version number from the global lock table and contained in the dirty page. In a data sharing environ
requesting the data unit in the global lock manager if the ment, each DBMS instance has its own buffer pool to
version number in the data unit is less than the version 60 cache pages and also has a local log. If a dirty page is
number from the global lock table; otherwise, cached in one system (referred to as the "owner"), then
if the data unit is not in a buffer of the second DBMS, another system requesting the page must get the current issuing a request from the second DBMS to the global version of the page from the owner. The owner could lock manager for a P lock to read the data unit; transfer the page to the requestor by a) a memory-toproviding a request from the global lock manager to 65 memory transfer between database systems (hereinafter, the first DBMS to transfer the data unit to the second "a page transfer"), or b) writing the page to disk and DBMS in response to the P lock request or the request then making the requestor read it from the disk. Manifor the data unit; festly, the response time and concurrency advantages