JPH09204337A - Data base management system - Google Patents

Data base management system

Info

Publication number
JPH09204337A
JPH09204337A JP8012571A JP1257196A JPH09204337A JP H09204337 A JPH09204337 A JP H09204337A JP 8012571 A JP8012571 A JP 8012571A JP 1257196 A JP1257196 A JP 1257196A JP H09204337 A JPH09204337 A JP H09204337A
Authority
JP
Japan
Prior art keywords
data
file
page
database
log
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP8012571A
Other languages
Japanese (ja)
Inventor
Hiroshi Hayata
宏 早田
Miki Watanabe
美樹 渡辺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuji Xerox Co Ltd filed Critical Fuji Xerox Co Ltd
Priority to JP8012571A priority Critical patent/JPH09204337A/en
Publication of JPH09204337A publication Critical patent/JPH09204337A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PROBLEM TO BE SOLVED: To recover from a system fault and to simultaneously access a data base file at a high speed. SOLUTION: A data access means 4a outputs an access request to the data base file. When the access request is outputted, a mapping data management means 5a selects mapping object data to be accessed from the data base file and a log file and outputs the position of the mapping object data as position information. At the time of receiving the position information, the data access means 4a specifies data indicated by the position information and outputs a mapping request. At the time of receiving the mapping request, a mapping means 6 maps the specified data in an area inside a shared memory 3 accessible by the data access means 4a. Thus, a client process 4 provided with the data access means 4a maps required data and reads them at a high speed.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は更新されたデータベ
ースの内容をログとして保存するログ機能を有するデー
タベース管理システムに関し、特にマップドファイルに
よるメモリ共有機構をもつオペレーティングシステム
(OS)で動作するデータベース管理システムに関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a database management system having a log function for saving the contents of an updated database as a log, and particularly to database management operating on an operating system (OS) having a memory sharing mechanism by a mapped file. Regarding the system.

【0002】[0002]

【従来の技術】データベース管理システムにおいて、シ
ステム障害からの回復の方式としてログ方式が知られて
いる。システム障害とは、電源障害などにより稼働中の
データベース管理システムが停止し、処理中のすべての
トランザクションが影響を受ける障害である。
2. Description of the Related Art In a database management system, a log method is known as a method for recovering from a system failure. A system failure is a failure in which a running database management system is stopped due to a power failure or the like, and all transactions being processed are affected.

【0003】ログ方式は、データベースファイルに対す
る更新を二次記憶装置などの永続的なログファイルに記
録し、その更新の処理単位が正しく終了(トランザクシ
ョンがコミット)した時点以降に、処理単位内での更新
をまとめてデータベースファイルへ反映させる。このこ
とで、システム障害からの回復を可能とし、不完全なデ
ータベースファイルの変更がないこと、すなわちデータ
ベースファイルの一貫性を保証している。
In the log method, an update to a database file is recorded in a permanent log file such as a secondary storage device, and after the processing unit of the update is correctly completed (transaction is committed), the processing is performed within the processing unit. Updates are collectively reflected in the database file. This makes it possible to recover from a system failure and guarantees that there are no incomplete database file changes, that is, database file consistency.

【0004】このようなログ方式の詳細は1986年、
Addison Wesley社発行の「Introduction to Database S
ystem(1986) 」の第18章(第1の文献)に記載されてい
る。また、サーバプロセスとクライアントプロセスとで
分散してデータを管理するデータベース管理システムに
おいては、あるまとまったデータの単位(ページ)でデ
ータを管理するページサーバアーキテクチャが利用され
ている。このページサーバアーキテクチャでは、サーバ
プロセスはデータベースファイルから要求されたデータ
を読み出してクライアントプロセスへページ単位で転送
する。そして、クライアントプロセスは、応用プログラ
ムからの処理要求に応じて、ページ単位の内容を解釈
し、アクセスあるいは更新して応用プログラムからの処
理を実行する。
The details of such a log system are described in 1986,
`` Introduction to Database S '' issued by Addison Wesley
ystem (1986) ”, Chapter 18 (first document). Further, in a database management system that manages data in a distributed manner by server processes and client processes, a page server architecture that manages data in units of a certain unit (page) is used. In this page server architecture, the server process reads the requested data from the database file and transfers it to the client process page by page. Then, the client process interprets the contents in page units in response to a processing request from the application program, accesses or updates the contents, and executes the processing from the application program.

【0005】図9は従来のログ機能をもつデータベース
管理システムを示す図である。これは、ページサーバア
ーキテクチャのオブジェクト指向データベースの構成を
示している。このデータベース管理システムには、デー
タベースファイル130とログファイル131とが設け
られている。そして、これらのファイルを操作するため
に、サーバプロセス120とクライアントプロセス11
0とを有している。さらに、各プロセスに対応してペー
ジバッファ115、126が設けられている。なお、デ
ータベースファイル130とログファイル131とに
は、ページ単位でデータが格納されている。
FIG. 9 is a diagram showing a conventional database management system having a log function. This shows the structure of the object-oriented database of the page server architecture. This database management system is provided with a database file 130 and a log file 131. Then, in order to operate these files, the server process 120 and the client process 11
0. Further, page buffers 115 and 126 are provided for each process. The database file 130 and the log file 131 store data in page units.

【0006】クライアントプロセス110は、応用プロ
グラム111、オブジェクト管理部112、ページバッ
ファ管理部113、および通信管理部114で構成され
ている。応用プログラム111は、データベースファイ
ル130を操作するためのさまざまな機能を提供するプ
ログラムであり、オブジェクト指向で作成されている。
ユーザはこの応用プログラム111を用いてデータベー
スを使用する。オブジェクト管理部112は、応用プロ
グラム111で作成されたオブジェクトを管理してお
り、オブジェクトを介して与えられたデータベースファ
イル130に対するアクセス要求を解読しページバッフ
ァ管理部113へ伝える。
The client process 110 is composed of an application program 111, an object management section 112, a page buffer management section 113, and a communication management section 114. The application program 111 is a program that provides various functions for operating the database file 130, and is created in an object-oriented manner.
The user uses the database by using this application program 111. The object management unit 112 manages the objects created by the application program 111, decodes the access request to the database file 130 given via the object, and transmits it to the page buffer management unit 113.

【0007】ページバッファ管理部113は、ページバ
ッファ115へ格納するページを管理しており、オブジ
ェクトを介して入力されたデータベースファイル130
へのアクセス要求がページバッファ内に存在するページ
であればそのページへのアクセスを許可し、ページバッ
ファ内にないページへのアクセス要求であれば、そのペ
ージの読み出し要求を出力する。通信管理部114は、
サーバプロセス120との間の通信を制御しており、ペ
ージバッファ管理部113からページの読み出し要求を
サーバプロセス120へ伝えたり、あるいは更新したペ
ージをサーバプロセス120へ転送する。このクライア
ントプロセス110とサーバプロセス120との間の通
信にはリモート・プロシージャ・コール(RPC)が用
いられる。
The page buffer management unit 113 manages pages to be stored in the page buffer 115, and the database file 130 input via an object.
If the access request to the page exists in the page buffer, the access to the page is permitted, and if the access request is to the page not in the page buffer, the read request for the page is output. The communication management unit 114
It controls communication with the server process 120, transmits a page read request from the page buffer management unit 113 to the server process 120, or transfers an updated page to the server process 120. A remote procedure call (RPC) is used for communication between the client process 110 and the server process 120.

【0008】サーバプロセス120は、通信管理部12
1、トランザクション管理部122、ログ管理部12
3、ページバッファ管理部124、およびディスク入出
力部125から構成されている。通信管理部121は、
クライアントプロセス110との間の通信を制御してお
り、クライアントプロセス110からの各種要求を受け
取るとともに、クライアントプロセス110へ渡すべき
ページなどを出力する。トランザクション管理部122
は、複数のクライアントプロセスからの各種処理要求を
一単位とするトランザクションを管理しており、クライ
アントプロセス110からページの読み出し要求があれ
ば、その要求を1つのトランザクションとして処理を実
行する。
The server process 120 includes a communication management unit 12
1, transaction management unit 122, log management unit 12
3, a page buffer management unit 124, and a disk input / output unit 125. The communication management unit 121
It controls communication with the client process 110, receives various requests from the client process 110, and outputs a page to be passed to the client process 110. Transaction management unit 122
Manages a transaction in which various processing requests from a plurality of client processes are used as one unit, and if a page read request is issued from the client process 110, the request is processed as one transaction.

【0009】ログ管理部123は、データベースファイ
ル130内のページが更新されると、更新後のページを
一時的にログファイル131に格納し、所定のタイミン
グで更新後の内容をデータベースファイル130に反映
させるとともに、現在の最新のページがどちらのファイ
ルに格納されているのかを管理している。そして、デー
タベースファイル130へのアクセス要求があれば、そ
のアクセスに適当なページを選択する。
When a page in the database file 130 is updated, the log management unit 123 temporarily stores the updated page in the log file 131 and reflects the updated content in the database file 130 at a predetermined timing. In addition to that, it manages in which file the latest current page is stored. Then, if there is an access request to the database file 130, a page suitable for the access is selected.

【0010】ページバッファ管理部124は、ページバ
ッファ126へ格納するページを管理しており、データ
ベースファイル130内のページの読み出し要求で要求
されたページがページバッファ126内に存在するペー
ジであればそのページをクライアントプロセス110へ
送信する。ページバッファ126内にないページへのア
クセス要求であれば、データベースファイル130ある
いはログファイル131から該当するページをページバ
ッファ126へロードした後、そのページをクライアン
トプロセス110へ送信する。ディスク入出力部125
は、ページバッファ管理部124からの要求に従い、デ
ータベースファイル130およびログファイル131に
対するページの読み出し、書き込み処理を行う。
The page buffer management unit 124 manages the pages to be stored in the page buffer 126, and if the page requested by the page read request in the database file 130 is the page existing in the page buffer 126, then the page buffer management unit 124 stores the page. Send the page to the client process 110. If the access request is for a page that is not in the page buffer 126, the corresponding page is loaded from the database file 130 or the log file 131 into the page buffer 126, and then the page is transmitted to the client process 110. Disk input / output unit 125
Performs page read / write processing on the database file 130 and the log file 131 in accordance with a request from the page buffer management unit 124.

【0011】以上のような構成により、ログ機能がサー
バプロセス120のログ管理部123として実現されて
いる。ページの更新の際には、まずユーザが応用プログ
ラムを用いて、データバッファ115に保持しているペ
ージに対して更新作業を行う。サーバプロセス120
は、クライアントプロセス110から更新されたページ
を受け取り、そのページをログファイル131に格納す
る。これは、トランザクションのコミットが確定する前
に行われる。ログ管理部123は、トランザクションの
コミットが確定後にログファイルのログ情報をデータベ
ースファイルへ反映する。
With the above configuration, the log function is realized as the log management unit 123 of the server process 120. When updating a page, the user first uses an application program to update the page held in the data buffer 115. Server process 120
Receives the updated page from the client process 110 and stores the page in the log file 131. This is done before committing the transaction. The log management unit 123 reflects the log information of the log file in the database file after the commit of the transaction is confirmed.

【0012】一方、ページの参照を行う場合には、対象
のページの最新の一貫した内容が、データベースファイ
ルに保存されているか、ログファイルに保存されている
かをログ管理部123が判断する。そして、対象のペー
ジの一貫した内容がクライアントプロセス110側のペ
ージバッファ115に読み出され、クライアントプロセ
ス110は、ページバッファ115に読み出されたペー
ジを参照する。
On the other hand, when referring to a page, the log management unit 123 determines whether the latest consistent content of the target page is stored in the database file or the log file. Then, the consistent content of the target page is read into the page buffer 115 on the client process 110 side, and the client process 110 refers to the page read into the page buffer 115.

【0013】また、ログに関する方式は、特開平3−3
046号公報(第2の文献)ならびに特開平6−318
165号公報(第3の文献)にも開示されている。第2
の文献では、トランザクション障害(データ更新の処理
単位が異常終了する障害)での復帰操作の高速化を課題
として、アドレス空間の一部分をプロセス間で共有でき
る領域をもたせることでログ情報を読み書きする方式を
開示している。第3の文献では、障害回復時の新たなト
ランザクションによる処理を課題として、再起動時のデ
ータ回復中でもデータベースファイルへの参照や更新を
可能にする方式を開示している。
A method relating to a log is disclosed in Japanese Patent Laid-Open No. 3-3.
046 (second document) and JP-A-6-318.
It is also disclosed in Japanese Patent No. 165 (the third document). Second
In the reference, a method of reading and writing log information by allocating a part of the address space to an area that can be shared between processes, with the goal of speeding up the return operation in the event of a transaction failure (failure in which the processing unit of data update ends abnormally). Is disclosed. The third document discloses a method of making it possible to refer to or update a database file even during data recovery at the time of restart, with the problem of processing by a new transaction at the time of failure recovery.

【0014】[0014]

【発明が解決しようとする課題】しかし、従来のデータ
ベース管理システムでは、システム障害からの回復を可
能とし、同時にデータベースファイルの書き込みまたは
読み出し処理を高速に行うことが困難であった。
However, in the conventional database management system, it is difficult to recover from a system failure and at the same time, it is difficult to write or read a database file at high speed.

【0015】例えば、図9に示すログを用いたデータベ
ース管理システムでは、クライアントプロセスが参照し
ようとするページがデータバッファ内に保持されていな
い場合には、サーバプロセスを介してでなければ必要な
ページを取得することができない。また、更新したペー
ジをログファイルに書き込む際にも、サーバプロセスを
介さなければならない。つまり、データベースファイ
ル、あるいはログファイルへのアクセスは常にサーバプ
ロセスを介して行われることが処理手順の増加を招き、
処理の高速化を妨げている。
For example, in the database management system using the log shown in FIG. 9, if the page to be referred to by the client process is not held in the data buffer, the page required only through the server process. Can't get Also, the server process must be used to write the updated page to the log file. In other words, access to the database file or log file is always performed through the server process, which leads to an increase in processing procedures.
It hinders the processing speed.

【0016】なお、第2の文献で開示されているデータ
ベース管理システムでは、メモリを共有することにより
トランザクション障害から回復する方式を提供している
が、システム障害からの回復については考えられていな
い。そのため、システム障害時の一貫したデータを保証
するものではない。一方、第3の文献で開示されている
データベース管理システムは、障害回復のための再起動
時のトランザクション処理を問題としており、通常動作
中の処理の高速化には何ら寄与しない。
The database management system disclosed in the second document provides a method for recovering from a transaction failure by sharing a memory, but recovery from a system failure is not considered. Therefore, it does not guarantee consistent data at the time of system failure. On the other hand, the database management system disclosed in the third document has a problem of transaction processing at the time of restart for failure recovery, and does not contribute to speeding up of processing during normal operation.

【0017】本発明はこのような点に鑑みてなされたも
のであり、システム障害からの回復を可能とすると同時
にデータベースファイルへのアクセスを高速に行うこと
ができるデータベース管理システムを提供することを目
的とする。
The present invention has been made in view of the above circumstances, and it is an object of the present invention to provide a database management system capable of recovering from a system failure and simultaneously accessing a database file at high speed. And

【0018】[0018]

【課題を解決するための手段】図1は本発明のデータベ
ース管理システムの原理構成図である。上記課題を解決
するために、第1の発明のマップドファイルによるメモ
リ共有機能とデータベースに対するログ機能とを持った
データベース管理システムでは、データベースファイル
を格納するデータベースファイル記憶手段1と、前記デ
ータベースファイルの更新内容であるログファイルを格
納するログファイル記憶手段2と、複数のプロセスから
アクセス可能であり、前記データベースファイルと前記
ログファイルとをマップドファイルとして写像されたデ
ータを保持する共有メモリ3と、前記データベースファ
イルに対するアクセス要求を出力するとともに、位置情
報を受け取ると、前記位置情報で示されたデータを指定
して写像要求を出力するデータアクセス手段4aと、前
記アクセス要求が出力されると、アクセスさせるべき写
像対象データを前記データベースファイルと前記ログフ
ァイルとの中から選択し、前記写像対象データの位置を
前記位置情報として出力する写像データ管理手段5a
と、前記写像要求を受け取ると、前記データアクセス手
段のアクセス可能な前記共有メモリ3内の領域に、指定
されたデータを写像する写像手段6と、を有することを
特徴とするデータベース管理システムが提供される。
FIG. 1 is a block diagram showing the principle of a database management system according to the present invention. In order to solve the above-mentioned problems, in a database management system having a memory sharing function by a mapped file and a log function for a database of the first invention, a database file storage means 1 for storing a database file and a database file storage means A log file storage unit 2 for storing a log file that is an update content; a shared memory 3 that is accessible from a plurality of processes and holds data in which the database file and the log file are mapped as a mapped file; A data access unit 4a that outputs an access request to the database file and outputs a mapping request by designating the data indicated by the position information when the position information is received, and an access request when the access request is output. Mapping to be made Select elephants data from among said database file and the log file, mapping data management means 5a for outputting the position of the mapping target data as the positional information
And a mapping means (6) for mapping specified data to an area in the shared memory (3) accessible by the data access means when the mapping request is received. To be done.

【0019】この構成によれば、データベースファイル
がデータベースファイル記憶手段1に格納され、データ
ベースファイルの更新内容であるログファイルがログフ
ァイル記憶手段2に格納されている。そして、データア
クセス手段4aが、データベースファイルに対するアク
セス要求を出力する。アクセス要求が出力されると、写
像データ管理手段5aが、アクセスさせるべき写像対象
データをデータベースファイルとログファイルとの中か
ら選択し、写像対象データの位置を位置情報として出力
する。データアクセス手段4aは、位置情報を受け取る
と、位置情報で示されたデータを指定して写像要求を出
力する。写像手段6は写像要求を受け取ると、データア
クセス手段4aがアクセス可能な共有メモリ3内の領域
に、指定されたデータを写像する。
According to this structure, the database file is stored in the database file storage means 1, and the log file which is the update content of the database file is stored in the log file storage means 2. Then, the data access means 4a outputs an access request for the database file. When the access request is output, the mapping data management unit 5a selects the mapping target data to be accessed from the database file and the log file, and outputs the position of the mapping target data as position information. Upon receiving the position information, the data access unit 4a designates the data indicated by the position information and outputs a mapping request. When the mapping means 6 receives the mapping request, it maps the designated data onto an area in the shared memory 3 accessible by the data access means 4a.

【0020】これにより、データアクセス手段4aを有
するクライアントプロセス4は、必要なデータをデータ
ベースファイルあるいはログファイルから写像し、高速
に読み出しを行うことができる。
As a result, the client process 4 having the data access means 4a can map necessary data from the database file or the log file and read it at high speed.

【0021】また、第2の発明では、第1の発明におけ
る前記写像データ管理手段は、前記データベースファイ
ルに対するアクセス要求が、参照のためのアクセス要求
である場合には前記データベースファイルと前記ログフ
ァイルとの中の最新のデータを写像対象データとし、更
新のためのアクセス要求の場合には最新のデータを前記
ログファイル内に設けて、前記ログファイル内のデータ
を写像対象データとすることを特徴とするデータベース
管理システムが提供される。
Further, in the second invention, the mapping data management means in the first invention, if the access request to the database file is an access request for reference, the mapping file management unit stores the database file and the log file. In the case of an access request for updating, the latest data in the log file is provided in the log file, and the data in the log file is the mapping target data. A database management system is provided.

【0022】この構成によれば、アクセス要求が参照の
ためのアクセス要求であれば、データベースファイルと
ログファイルとの中の最新のデータが写像対象データと
なり、アクセス要求が更新のためのアクセス要求であれ
ば、最新のデータがログファイル内に設けられ、そのデ
ータが写像対象データとなる。これにより、更新処理は
常にログファイル内のデータに対して実施され、データ
ベースファイル内のデータが直接更新されることがな
く、システム障害が発生してもデータの一貫性が保たれ
る。
According to this structure, if the access request is an access request for reference, the latest data in the database file and the log file is the mapping target data, and the access request is the access request for updating. If so, the latest data is provided in the log file, and that data becomes the mapping target data. As a result, the update process is always performed on the data in the log file, the data in the database file is not directly updated, and the data consistency is maintained even if a system failure occurs.

【0023】また、第3の発明では、第1の発明の構成
に加え、更新のためのデータ処理が実行された場合に、
データ更新処理命令の履歴をコマンドログファイル記憶
手段へ書き込むコマンドログエントリ書込手段を有する
データベース管理システムが提供される。
Further, in the third invention, in addition to the configuration of the first invention, when data processing for updating is executed,
There is provided a database management system having command log entry writing means for writing the history of data update processing instructions to the command log file storage means.

【0024】この構成によれば、更新のためのアクセス
要求が実行されると、その際の命令の内容がコマンドロ
グファイル記憶手段へ書き込まれる。これにより、更新
された後のログファイルとは別の場所に命令の履歴が格
納されるため、データの処理がページ単位で行われる場
合であっても、命令の履歴から更新処理が正常終了した
か否かを判別することができる。
According to this structure, when the access request for updating is executed, the content of the instruction at that time is written in the command log file storage means. As a result, the instruction history is stored in a location different from the updated log file, so even if the data processing is performed in page units, the update processing ends normally from the instruction history. It is possible to determine whether or not.

【0025】[0025]

【発明の実施の形態】以下、本発明の実施の形態を図面
に基づいて説明する。図1は本発明のデータベース管理
システムの原理構成図である。このデータベース管理シ
ステムは、データベースに対するログ機能を有してお
り、データベースファイルを格納するデータベースファ
イル記憶手段1と、データベースファイルの更新内容で
あるログファイルを格納するデータログファイル記憶手
段2とが設けられている。また、マップドファイルによ
るメモリ共有機能も有しており、複数のプロセスからア
クセス可能であり、データベースファイルとログファイ
ルとをマップドファイルとして写像されたデータを保持
する共有メモリ3が設けられている。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing the principle of the database management system of the present invention. This database management system has a log function for a database, and is provided with a database file storage means 1 for storing a database file and a data log file storage means 2 for storing a log file which is the update content of the database file. ing. Further, it also has a memory sharing function by a mapped file, is accessible from a plurality of processes, and is provided with a shared memory 3 for holding data mapped as a database file and a log file as a mapped file. .

【0026】クライアントプロセス4はデータアクセス
手段4aを有している。このデータアクセス手段4a
は、データベースファイルに対する処理要求が発生する
とデータベースファイルに対するアクセス要求を出力す
る。そして、位置情報を受け取ると、位置情報で示され
たデータを指定して写像要求を出力する。
The client process 4 has data access means 4a. This data access means 4a
Outputs an access request for a database file when a processing request for the database file occurs. When the position information is received, the data indicated by the position information is designated and a mapping request is output.

【0027】一方、サーバプロセス5は写像データ管理
手段5aを有している。写像データ管理手段5aは、デ
ータアクセス手段4aからアクセス要求が出力される
と、アクセスさせるべきデータをデータベースファイル
とログファイルとの中から選択する。そして、選択して
データの位置を位置情報としてデータアクセス手段4a
に対して出力する。
On the other hand, the server process 5 has a mapping data managing means 5a. When the access request is output from the data access unit 4a, the mapping data management unit 5a selects the data to be accessed from the database file and the log file. Then, the data access means 4a selects and uses the data position as position information.
Output to

【0028】写像手段6は、データアクセス手段から写
像要求を受け取ると、データアクセス手段4aのアクセ
ス可能な共有メモリ3内の領域に、指定されたデータを
写像する。
When the mapping means 6 receives the mapping request from the data access means, it maps the designated data to the accessible area in the shared memory 3 of the data access means 4a.

【0029】なお、写像とは、個々のプロセスの仮想メ
モリ空間の一部分に、ハードディスク装置のような二次
記憶上でのマップドファイルからロードしたデータのメ
モリアドレスを対応させ、同一のデータを複数のプロセ
スの個々の仮想メモリ空間に保持させる処理である。こ
れは、マップドファイルを用いたメモリ共有のために行
われる処理機能であり、この機能を備えたOSとして
は、例えばUNIXや米Microsoft 社のWindows NTが
ある。
The mapping means that a part of the virtual memory space of each process is made to correspond to a memory address of data loaded from a mapped file on a secondary storage such as a hard disk device, and a plurality of identical data is stored. Is a process to be held in each virtual memory space of the process. This is a processing function performed for memory sharing using a mapped file, and examples of OSs having this function include UNIX and Windows NT of Microsoft Corporation.

【0030】このような構成により、クライアントプロ
セス4からデータベースファイルへアクセスする場合に
は、対象となるデータが共有メモリ3に写像されていれ
ばそのページが保持された領域のアドレスを指定してア
クセスすることができる。対象となるデータが、自己の
アクセス可能な領域に写像されていない場合には、デー
タアクセス手段4aがサーバプロセス5に対してアクセ
ス要求を出力する。
With this configuration, when the client process 4 accesses the database file, if the target data is mapped in the shared memory 3, the address of the area holding the page is designated and accessed. can do. When the target data is not mapped to the area accessible by itself, the data access unit 4a outputs an access request to the server process 5.

【0031】サーバプロセス5では、アクセス要求を受
け取ると、写像データ管理手段5aがアクセスの対象と
なるデータをデータベースファイルとログファイルとの
中から選択する。そして、選択したデータの位置情報を
クライアントプロセス4に対して出力する。
In the server process 5, when the access request is received, the mapping data management means 5a selects the data to be accessed from the database file and the log file. Then, the position information of the selected data is output to the client process 4.

【0032】クライアントプロセス4のデータアクセス
手段4aは、位置情報を受け取ると、位置情報で示され
たデータを指定して写像要求を出力する。写像手段6
は、写像要求で指定されたデータを、クライアントプロ
セス4がアクセスすることができる共有メモリ3の領域
に写像する。
Upon receiving the position information, the data access means 4a of the client process 4 designates the data indicated by the position information and outputs a mapping request. Mapping means 6
Maps the data specified by the mapping request onto an area of the shared memory 3 that the client process 4 can access.

【0033】データアクセス手段4aの写像要求に基づ
いて写像が行われると、クライアントプロセス4の仮想
メモリ空間に、指定したデータが格納された共有メモリ
3内のアドレスが設定される。そして、クライアントプ
ロセス4は、そのアドレスに対してアクセスすることに
より、そのデータの参照や更新の操作を行うことができ
る。
When the mapping is performed based on the mapping request of the data access means 4a, the virtual memory space of the client process 4 is set with the address in the shared memory 3 in which the designated data is stored. Then, the client process 4 can refer to or update the data by accessing the address.

【0034】このように、写像データ管理手段5aがク
ライアントプロセス4に写像させるべきデータを管理す
ることにより、データベースファイルとログファイルと
をマップドファイルとして、これらのデータを共有メモ
リ上で使用することができる。その結果、クライアント
プロセスは必要なデータを共有メモリにロードし、高速
にアクセスすることが可能となる。
In this way, the mapping data management means 5a manages the data to be mapped by the client process 4, so that the database file and the log file are used as mapped files and these data are used on the shared memory. You can As a result, the client process can load necessary data into the shared memory and can access it at high speed.

【0035】ところで、このようなマップドファイルを
用いたメモリ共有機能は、ページ単位でデータを操作す
ることが一般的である。従って、データベースファイル
とデータログファイルとは、ページ単位で管理される。
そのためには、データベースファイルが更新された後の
ページと、更新操作の履歴とは別々に格納する必要があ
る。
By the way, the memory sharing function using such a mapped file generally operates data in page units. Therefore, the database file and the data log file are managed in page units.
For that purpose, it is necessary to store the page after the database file is updated and the history of the update operation separately.

【0036】そこで、ページ単位でデータが取り扱われ
る場合の本発明のデータベース管理システムを具体的に
説明する。図2は本発明のログ機能をもつデータベース
管理システムの全体構成を示す図である。これは、ペー
ジサーバアーキテクチャのオブジェクト指向データベー
スの構成を示している。このデータベース管理システム
には、データベースファイル30、データログファイル
31、及びコマンドログファイル32とが設けられてい
る。これらのファイルは、ハードディスク装置のような
二次記憶装置に格納されている。また、データベースフ
ァイル30とデータログファイル31とはマップドファ
イルであり、各プロセスからの写像の対象とされる。
Therefore, the database management system of the present invention in the case where data is handled page by page will be specifically described. FIG. 2 is a diagram showing the overall configuration of a database management system having a log function of the present invention. This shows the structure of the object-oriented database of the page server architecture. The database management system is provided with a database file 30, a data log file 31, and a command log file 32. These files are stored in a secondary storage device such as a hard disk device. Further, the database file 30 and the data log file 31 are mapped files and are targets of mapping from each process.

【0037】これらのファイルを操作するプロセスとし
て、サーバプロセス20とクライアントプロセス10と
がある。この例では、単一の情報処理装置内に、クライ
アントプロセス10とサーバプロセス20とが存在して
いるものとする。そして、複数のプロセスからアクセス
可能なページバッファ40が設けられている。このペー
ジバッファ40は、データベース管理システムの主記憶
装置内の一部の領域に設定される。
There are a server process 20 and a client process 10 as processes for operating these files. In this example, it is assumed that the client process 10 and the server process 20 exist in a single information processing device. A page buffer 40 that can be accessed by a plurality of processes is provided. The page buffer 40 is set in a partial area in the main storage device of the database management system.

【0038】クライアントプロセス10は、応用プログ
ラム11、オブジェクト管理部12、ページバッファ管
理部13、および通信管理部14で構成されている。応
用プログラム11は、データベースファイル30を操作
するためのさまざまな機能を提供するプログラムであ
り、オブジェクト指向で作成されている。ユーザはこの
応用プログラム11を用いてデータベースを使用する。
オブジェクト管理部12は、応用プログラム11で作成
されたオブジェクトを管理しており、オブジェクトを介
して与えられたデータベースファイル30に対するアク
セス要求を解読しページバッファ管理部13へ伝える。
The client process 10 is composed of an application program 11, an object management unit 12, a page buffer management unit 13, and a communication management unit 14. The application program 11 is a program that provides various functions for operating the database file 30, and is created in an object-oriented manner. The user uses the database by using this application program 11.
The object management unit 12 manages the object created by the application program 11, decodes the access request to the database file 30 given via the object, and transmits it to the page buffer management unit 13.

【0039】ページバッファ管理部13は、ページバッ
ファ40に自己の要求により写像されたページを認識し
ており、アクセス要求の対象となるページが写像されて
いればそのページへアクセスし、写像されていなければ
そのページへのアクセス要求を出力する。通信管理部1
4は、サーバプロセス20との間の通信を制御してお
り、ページバッファ管理部13からアクセス要求がある
と、その要求をサーバプロセス20へ伝える。このクラ
イアントプロセス10とサーバプロセス20との間の通
信にはリモート・プロシージャ・コール(RPC)が用
いられる。
The page buffer management unit 13 recognizes the page mapped in the page buffer 40 by its own request. If the page to be the access request is mapped, the page is accessed and mapped. If not, the access request to the page is output. Communication management unit 1
Reference numeral 4 controls communication with the server process 20, and when there is an access request from the page buffer management unit 13, the request is transmitted to the server process 20. A remote procedure call (RPC) is used for communication between the client process 10 and the server process 20.

【0040】サーバプロセス20は、通信管理部21、
トランザクション管理部22、ログ管理部23、ページ
バッファ管理部24、およびディスク入出力部25から
構成されている。通信管理部21は、クライアントプロ
セス10との間の通信を制御しており、クライアントプ
ロセス10からの各種要求を受け取るとともに、クライ
アントプロセスに写像させるべきページの位置情報をク
ライアントプロセス10へ出力する。トランザクション
管理部22は、複数のクライアンントプロセスからの各
処理要求を単位とするトランザクションを管理してお
り、排他制御などを行う。そして、クライアントプロセ
ス10からアクセス要求があれば、その要求を1つのト
ランザクションとして処理を実行する。
The server process 20 includes a communication management unit 21,
It is composed of a transaction management unit 22, a log management unit 23, a page buffer management unit 24, and a disk input / output unit 25. The communication management unit 21 controls communication with the client process 10, receives various requests from the client process 10, and outputs position information of a page to be mapped to the client process 10 to the client process 10. The transaction management unit 22 manages transactions in units of processing requests from a plurality of client processes, and performs exclusive control and the like. Then, if there is an access request from the client process 10, the request is processed as one transaction.

【0041】ログ管理部23は、データベースファイル
30内のページが更新されログファイル31に格納され
ると、所定のタイミングで更新後の内容をデータベース
ファイル30に反映させるとともに、現在の最新のペー
ジがどちらのファイルに格納されているのかを管理して
いる。そして、データベースファイル30へのアクセス
要求があれば、クライアントプロセス10に写像させる
べきページを、データベースファイル30とデータログ
ファイル31との中から選択する。また、ページの更新
操作の命令の内容をコマンドログファイル32へ書き込
む。
When the pages in the database file 30 are updated and stored in the log file 31, the log management unit 23 reflects the updated contents in the database file 30 at a predetermined timing, and updates the current latest page. It manages which file is stored. Then, if there is an access request to the database file 30, the page to be mapped by the client process 10 is selected from the database file 30 and the data log file 31. Also, the content of the command for the page update operation is written to the command log file 32.

【0042】ページバッファ管理部24は、サーバプロ
セス20が写像しているページを管理している。ディス
ク入出力部25は、ページバッファ管理部24からの要
求に従い、データベースファイル30およびログファイ
ル31に対するページの読み出し、書き込み処理を行
う。
The page buffer management unit 24 manages the page mapped by the server process 20. The disk input / output unit 25 performs a page read / write process on the database file 30 and the log file 31 in accordance with a request from the page buffer management unit 24.

【0043】上記の構成において、まずクライアントプ
ロセス10の応用プログラム11からの参照のためのア
クセス要求によって、データベースファイル30の任意
のページをページバッファへ読み出す手順を説明する。
クライアントプロセス10の応用プログラム11からデ
ータベースファイル30への参照のためのアクセス要求
が発生すると、その要求がオブジェクト管理部12で認
識され、ページバッファ管理部13に伝えられる。ペー
ジバッファ管理部13は、そのページが自己のアクセス
可能なページバッファ40に写像されていないことを確
認する。そして、通信管理部14がRPCにより、その
ページの参照のための読み出し要求をサーバプロセス2
0へ送る。
In the above configuration, a procedure for reading an arbitrary page of the database file 30 into the page buffer in response to an access request for reference from the application program 11 of the client process 10 will be described first.
When an access request for reference to the database file 30 is generated from the application program 11 of the client process 10, the request is recognized by the object management unit 12 and transmitted to the page buffer management unit 13. The page buffer management unit 13 confirms that the page is not mapped in the page buffer 40 accessible by itself. Then, the communication management unit 14 uses the RPC to issue a read request for referencing the page to the server process 2.
Send to 0.

【0044】サーバプロセス20では、ページの読み出
し要求を通信管理部21が受け取り、トランザクション
制御部22が並行処理制御を行う。ログ管理部23はそ
のページの最新の一貫した内容がデータベースファイル
30にあるのか、あるいはデータログファイル31にあ
るのかを判断し、読み出すページを決定する。この決定
したページの位置を、通信管理部21を介してクライア
ントプロセス10に送る。
In the server process 20, the communication management unit 21 receives a page read request, and the transaction control unit 22 controls parallel processing. The log management unit 23 determines whether the latest consistent content of the page is in the database file 30 or the data log file 31, and determines the page to read. The determined page position is sent to the client process 10 via the communication management unit 21.

【0045】クライアントプロセス10のページバッフ
ァ管理部13は、サーバプロセス20から送られてきた
ページの位置を指定して、写像要求を出力する。この写
像要求はOSが有する写像機能によって処理され、クラ
イアントプロセス10のアクセス可能なページバッファ
40内の領域に指定したページが写像される。これによ
り、クライアントプロセス10はそのページを参照する
ことができる。
The page buffer management unit 13 of the client process 10 specifies the position of the page sent from the server process 20 and outputs a mapping request. This mapping request is processed by the mapping function of the OS, and the specified page is mapped to the accessible area in the page buffer 40 of the client process 10. This allows the client process 10 to refer to the page.

【0046】次に、クライアントプロセス10の応用プ
ログラム11からの更新要求によって、データベースフ
ァイル30の任意のページをページバッファ40へ読み
出す手順を説明する。RPCを用いた更新のための読み
出し要求の送受信や、トランザクションの並行処理制御
はリード要求の場合と同様である。
Next, a procedure for reading an arbitrary page of the database file 30 into the page buffer 40 in response to an update request from the application program 11 of the client process 10 will be described. Transmission / reception of a read request for updating using RPC and parallel processing control of transactions are the same as in the case of a read request.

【0047】ログ管理部23は要求に応じてクライアン
トプロセス10に写像させるべきページについて、最新
の内容のページを決定する。決定されたページがデータ
ログファイル31内のページであれば、そのページの位
置を写像対象のページ位置としてクライアンントプロセ
ス10に出力する。一方、決定されたページがデータベ
ースファイル30内のページであれば、その内容をデー
タログファイル31の最後に追加し、この追加した位置
を写像対象のページ位置としてクライアンントプロセス
10に出力する。クライアントプロセス10は写像対象
のページ位置を受け取ることで、その位置を指定して写
像要求を出力する。その結果、ベージバッファ40内の
クライアントプロセス10がアクセス可能な領域へ、そ
のデータが写像される。
The log management unit 23 determines the page with the latest contents of the page to be mapped by the client process 10 in response to the request. If the determined page is the page in the data log file 31, the position of the page is output to the client process 10 as the page position of the mapping target. On the other hand, if the determined page is a page in the database file 30, the content is added to the end of the data log file 31, and the added position is output to the client process 10 as the page position of the mapping target. Upon receiving the page position of the mapping target, the client process 10 specifies the position and outputs a mapping request. As a result, the data is mapped to an area in the page buffer 40 accessible by the client process 10.

【0048】これにより、クライアントプロセス10
は、そのページの更新処理を行うことができる。このと
き、ログ管理部23は、データログファイル31へペー
ジを追加したという情報をコマンドログファイル32に
書き込む。
As a result, the client process 10
Can update the page. At this time, the log management unit 23 writes, in the command log file 32, information that the page has been added to the data log file 31.

【0049】さらに、更新のための読み出しを行ったク
ライアントプロセス10が、応用プログラム11からの
更新の終了要求(トランザクションの終了要求)を受け
た場合のページの書き込み手順を説明する。更新の終了
要求が出力される更新後のページはデータログファイル
31へ書き込まれる。また、更新のトランザクションの
終了情報がクライアントプロセス10からサーサプロセ
ス20へ送られる。サーバプロセス20のログ管理部2
3は、トランザクションの正常終了の情報をコマンドロ
グファイル32に書き込む。これにより、クライアント
プロセス10からの更新結果は、データログファイル3
1とコマンドログファイル32に書き込まれたことにな
る。
Further, a page writing procedure in the case where the client process 10 which has read for updating receives a request for ending updating (transaction ending request) from the application program 11 will be described. The updated page from which the update end request is output is written to the data log file 31. Also, the end information of the update transaction is sent from the client process 10 to the searcher process 20. Log management unit 2 of server process 20
3 writes information on the normal end of the transaction in the command log file 32. As a result, the update result from the client process 10 is displayed in the data log file 3
1 and the command log file 32 have been written.

【0050】なお、データログファイル31の更新内容
のデータベースファイル30への反映は、トランザクシ
ョンが正常終了した以降の任意の時点で行われる。これ
は、ログ管理部23が適切なタイミングで行う。
The update contents of the data log file 31 are reflected in the database file 30 at any time after the transaction is normally completed. This is performed by the log management unit 23 at an appropriate timing.

【0051】図3はデータログファイルとコマンドログ
ファイルとの内容例を示す図である。データログファイ
ル31にはページ単位のデータが格納されている。コマ
ンドログファイル32にはトランザクション操作や、ペ
ージ操作などの操作情報が格納されてる。コマンドログ
ファイル32内の操作情報は、ページに対して十分小さ
なログエントリとして保持されている。
FIG. 3 is a diagram showing an example of the contents of the data log file and the command log file. The data log file 31 stores data in page units. The command log file 32 stores operation information such as transaction operations and page operations. The operation information in the command log file 32 is held as a log entry that is sufficiently small for the page.

【0052】この例では、「Transaction1」と「Transa
ction2」との2つのトランザクションによる書き込み要
求が発生した場合である。このとき、コマンドログファ
イル32には、まず「Transaction1オープン」、「Tran
saction2オープン」というトランザクション操作情報3
2a,32bが格納される。次に、「Transaction1での
File0,Page6 はオフセット0」というページ操作情報3
2cが格納される。このページ操作情報32cは、「Tr
ansaction1」が操作を行い、「File0 」のデータベース
ファイルの6ページ目「Page6 」をデータログファイル
32内の「オフセット0」の領域に格納したことを示し
ている。同様に、「Transaction2でのFile1,Page8 はオ
フセット1」、「Transaction1でのFile0,Page3 はオフ
セット2」というページ操作情報32d,32eが格納
される。そして、最後に、「Transaction1コミット」と
いうトランザクション操作情報32fが格納される。
In this example, "Transaction 1" and "Transa
This is the case when a write request is generated by two transactions with "ction2". At this time, in the command log file 32, first, "Transaction 1 open" and "Tran
saction2 open ”transaction operation information 3
2a and 32b are stored. Next, "Transaction 1
File0, Page6 is offset 0 "Page operation information 3
2c is stored. This page operation information 32c is "Tr
It indicates that ansaction 1 ”is operated and the sixth page“ Page 6 ”of the database file“ File 0 ”is stored in the area of“ offset 0 ”in the data log file 32. Similarly, page operation information 32d and 32e that "File1, Page8 in Transaction2 is offset 1" and "File0 and Page3 in Transaction1 are offset 2" are stored. Finally, the transaction operation information 32f called "Transaction1 commit" is stored.

【0053】以上の2つのトランザクション終了時点で
のデータログファイル31には、「オフセット0」の領
域31aに「Transaction1でのFile0,Page6 のデータ」
が格納され、「オフセット1」の領域31bに「Transa
ction2でのFile1,Page8 のデータ」が格納され、「オフ
セット2」の領域31cに「Transaction3でのFile0,Pa
ge3 のデータ」が格納されている。
In the data log file 31 at the end of the above two transactions, "Data 0 of File0, Page6 in Transaction 1" is written in the area 31a of "offset 0".
Is stored, and "Transa" is stored in the area 31b of "offset 1".
“Data of File1, Page8 in ction2” is stored, and “File0, Pa in Transaction3 is stored in the area 31c of“ offset 2 ”.
ge3 data ”is stored.

【0054】このようなログの操作は、ログ管理部23
(図2に示す)により行われる。図4はログ管理部23
の内部機能を示すブロック図である。ログ管理部は、ペ
ージ管理表23a、読み出しページ管理部23b、コマ
ンドログエントリ書き込み部23c、及びログファイル
書き込み部23dで構成されている。
Such log operation is performed by the log management unit 23.
(Shown in FIG. 2). FIG. 4 shows the log management unit 23
It is a block diagram showing the internal function of. The log management unit includes a page management table 23a, a read page management unit 23b, a command log entry writing unit 23c, and a log file writing unit 23d.

【0055】ページ管理表23aは、オープン中のトラ
ンザクションで処理中のページを管理するための情報が
格納されている。読み出しページ管理部23bは、デー
タベースもしくはログファイルからページバッファへ読
み出すべきページの管理を行う。コマンドログエントリ
書き込み部23cは、コマンドログファイルへのログエ
ントリの書き込み処理を行う。ログファイル書き込み部
23dは、ログファイルの内容をデータベースへ書き込
み、データベースファイルの内容を最新のものにするた
めの処理を行う。
The page management table 23a stores information for managing pages being processed by open transactions. The read page management unit 23b manages pages to be read from the database or log file into the page buffer. The command log entry writing unit 23c performs a log entry writing process to the command log file. The log file writing unit 23d writes the contents of the log file into the database, and performs processing for updating the contents of the database file.

【0056】ページ管理表23aには、データベースフ
ァイルのページを識別するページ識別子「Page ID 」、
操作トランザクションを識別するトランザクション識別
子「Transaction ID」、および操作トランザクションが
処理対象としているページの実際のデータの位置を示す
位置識別子「Location」が登録されている。位置識別子
が、データベースファイルを示していれば参照のための
読み出しであり、データログファイルを示していれば更
新のための読み出しである。
The page management table 23a includes a page identifier "Page ID" for identifying a page of the database file,
A transaction identifier "Transaction ID" for identifying the operation transaction and a location identifier "Location" indicating the actual data position of the page targeted by the operation transaction are registered. If the position identifier indicates a database file, the reading is for reference, and if the position identifier indicates a data log file, the reading is for updating.

【0057】図中最初のエントリは、「File0,Page0 」
のページが「Transaction1」によってデータベースファ
イルの「File0,Page0 」から参照のための読み出し要求
により読み出されていることを示している。次のエント
リは、「File0,Page3 」のページが「Transaction1」に
よってデータログファイルのページオフセット「2」の
位置「Log,Page2 」から更新のための読み出し要求によ
り読み出されていることを示している。
The first entry in the figure is "File0, Page0"
Indicates that the page is read by "Transaction1" from "File0, Page0" of the database file by a read request for reference. The following entry shows that the page of "File0, Page3" has been read by "Transaction1" by the read request for update from position "Log, Page2" of page offset "2" of the datalog file. There is.

【0058】このような構成のログ管理部23により、
コマンドログファイルに随時ログエントリが登録され、
このログエントリから更新のためのページ操作の情報を
再現できる。つまり、システム障害が発生した場合に
は、コマンドログファイルを参照し、コミットされたト
ランザクションが更新したページは、一貫性が保たれて
いることが分かる。また、コミットされていないトラン
ザクションが更新したページは、内容の一貫性が保証で
きないことが分かる。ログファイル書き込み部23d
は、障害回復時には、一貫性が保たれたページのみを、
データログファイルからデータベースファイルに反映さ
せる。
With the log management unit 23 having such a configuration,
Log entries are registered in the command log file at any time,
The information of the page operation for updating can be reproduced from this log entry. In other words, when a system failure occurs, the command log file is referenced, and it can be seen that the pages updated by the committed transaction are consistent. Also, it can be seen that the page updated by an uncommitted transaction cannot guarantee the consistency of the content. Log file writing unit 23d
Only recovers consistent pages during disaster recovery.
Reflect from the data log file to the database file.

【0059】図5はデータベースファイルの中のページ
の状態の遷移状況を示す図である。ページには4種類の
状態がある。第1の状態51は「データベースファイル
の中にあり写像されていない」という状態である。第2
の状態52は「データベースファイルからページバッフ
ァへ写像されている」という状態である。第3の状態5
3は「ログファイルからページバッファへ写像されてい
る」という状態である。第4の状態54は「ログファイ
ルの中にあり写像されていない」という状態である。
FIG. 5 is a diagram showing transition states of the states of pages in the database file. The page has four states. The first state 51 is a state "in the database file and not mapped". Second
State 52 is a state of "mapped from database file to page buffer". Third state 5
The state 3 is "mapped from log file to page buffer". The fourth state 54 is a state "in the log file and not mapped".

【0060】図中の矢印が各状態間の遷移方向を示して
いる。第1の状態51から第2の状態52へは、クライ
アントプロセスの応用プログラムによる参照のための読
み出し要求に基づくクライアントプロセスからの読み出
しによって遷移する。逆に、第2の状態52から第1の
状態51へは、その読み出しの終了によって遷移する。
The arrows in the figure indicate the transition directions between the states. A transition from the first state 51 to the second state 52 is made by reading from the client process based on a read request for reference by the application program of the client process. On the contrary, the second state 52 transits to the first state 51 upon completion of the reading.

【0061】第1の状態51から第3の状態53へは、
クライアントプロセスの応用プログラムによる更新のた
めの読み出し要求に基づくクライアントプロセスからの
読み出しによって遷移する。逆に、第3の状態53から
第1の状態51へは、その読み出しが異常終了し、ログ
ファイル内の対応するページの情報が失われている場合
に遷移する。
From the first state 51 to the third state 53,
The transition is made by reading from the client process based on a read request for updating by the application program of the client process. Conversely, the third state 53 transits to the first state 51 when the reading is abnormally terminated and the information of the corresponding page in the log file is lost.

【0062】第3の状態53から第4の状態54へは、
次の3通りの場合に遷移する。第1に、更新のための読
み出し要求に基づくクライアントプロセスからの読み出
しが正常に終了するか、あるいは異常終了したときにロ
グファイル内に対応するページの情報が存在している場
合である。第2に、参照のための読み出し要求に基づく
クライアントプロセスからの読み出しがログファイルか
ら行われ、それが正常に終了するか、あるいは異常終了
したときにログファイル内に対応するページの情報が存
在している場合である。第3に、ページバッファが満杯
となり、ページバッファ内から追い出された場合であ
る。逆に、第4の状態54から第3の状態53へは、ロ
グファイル中にあるときに参照、あるいは更新の読み出
し要求があった場合に遷移する。
From the third state 53 to the fourth state 54,
Transition occurs in the following three cases. First, there is a case where the information of the corresponding page exists in the log file when the reading from the client process based on the reading request for updating is normally completed or abnormally ended. Secondly, the read from the client process based on the read request for reference is performed from the log file, and when it is completed normally or abnormally, the information of the corresponding page exists in the log file. That is the case. Third, the page buffer is full and has been evicted from within the page buffer. On the contrary, the fourth state 54 transits to the third state 53 when a reference or update read request is issued while the log file is present.

【0063】第4の状態54から第1の状態51へは、
更新が正常終了した後の任意の時点で、ログファイルの
内容がデータベースファイルへ書き込まれた場合に遷移
する。
From the fourth state 54 to the first state 51,
Transition occurs when the contents of the log file are written to the database file at any point after the update has completed normally.

【0064】図6はページバッファへの読み出しの処理
手順を示すフローチャートである。この処理は、任意の
クライアントプロセスからの読み出し要求をうけたサー
バプロセスのログ管理部が実行する処理である。この読
み出し要求は、トランザクション管理部を介してログ管
理部に渡され、「TransactionID 」、「PageID」、およ
び処理の内容(参照のための読み出しか、更新のための
読み出しか)の情報を 含んでいる。〔S1〕指定「TransactionID 」での指定
「PageID」のページに該当するページエントリがページ
管理表にあるか否を判断し、ページ管理表にあればステ
ップ8(S8)に進み、ページ管理表になければステッ
プ2(S2)に進む。 〔S2〕指定「TransactionID 」での指定「PageID」の
エントリをページ管理表に追加する。 〔S3〕指定「TransactionID 」での指定「PageID」の
処理の内容が、更新のための読み出しか参照のための読
み出しかを判断し、更新のための読み出しであればステ
ップ4(S4)に進み、参照のための読み出しであれば
ステップ7(S7)に進む。 〔S4〕指定されたページの最新の内容がデータベース
ファイルにあれば、そのページをデータベースファイル
から読み出し、データログファイルの新たな領域に追加
する。なお、すでに最新の内容がデータログファイル内
にあれば、このステップでは何も行われない。 〔S5〕データログファイル内の指定されたページが格
納された位置を示すログエントリを、コマンドログファ
イルに追加する。 〔S6〕データログファイル内の指定されたページが格
納された位置を、ページ管理表内の指定されたページを
示すエントリの「Location」に登録する。 〔S7〕指定されたページが格納されている位置を、ペ
ージ管理表内の指定されたページを示すエントリの「Lo
cation」に登録する。この場合、最新の内容がデータベ
ースファイル内にあれば、データベースファイル内のそ
のページの位置を、最新の内容がデータログファイル内
にあれば、データログファイル内のそのページの位置
を、「Location」に登録する。 〔S8〕ページ管理表内の指定されたページを示すエン
トリの「Location」をクライアントプロセスに対して出
力する。
FIG. 6 is a flow chart showing the processing procedure of reading to the page buffer. This process is a process executed by the log management unit of the server process that receives a read request from an arbitrary client process. This read request is passed to the log management unit via the transaction management unit, and includes the information of "TransactionID", "PageID", and the content of the processing (read for reference or read for update). There is. [S1] It is determined whether or not there is a page entry corresponding to the page specified by "PageID" in the specified "TransactionID" in the page management table, and if it exists in the page management table, the process proceeds to step 8 (S8), and the page management table is displayed. If not, the process proceeds to step 2 (S2). [S2] The entry of the designation "PageID" in the designation "TransactionID" is added to the page management table. [S3] It is determined whether the content of the process of the designated "PageID" in the designated "TransactionID" is read for update or read for reference, and if read for update, the process proceeds to step 4 (S4). , If read for reference, the process proceeds to step 7 (S7). [S4] If the latest contents of the specified page are found in the database file, the page is read from the database file and added to a new area of the data log file. Note that if the latest contents are already in the data log file, nothing is done in this step. [S5] A log entry indicating the position where the designated page is stored in the data log file is added to the command log file. [S6] The position where the designated page is stored in the data log file is registered in the "Location" of the entry indicating the designated page in the page management table. [S7] The position where the designated page is stored is changed to "Lo" of the entry indicating the designated page in the page management table.
Register to "cation". In this case, if the latest contents are in the database file, the position of the page in the database file, and if the latest contents are in the data log file, the position of the page in the data log file is "Location". Register with. [S8] The "Location" of the entry indicating the designated page in the page management table is output to the client process.

【0065】図7はログエントリをコマンドログファイ
ルに追加する際の処理手順を示すフローチャートであ
る。これは、図6のステップ5(S5)で行われる処理
の詳細を示している。 〔S11〕ログエントリを書き込むべき領域をコマンド
ログファイル内に確保する。 〔S12〕ログエントリの先頭に、エントリの種類を識
別するための識別番号を記入する。エントリの種類と
は、「Transaction オープン」、「Transaction 正常終
了」、「Transaction 異常終了」、「ファイル生成」、
「ファイル削除」、「データログファイル内のページ情
報」などである。 〔S13〕ログエントリに、登録するエントリの種類に
応じて必要な付加情報を記入する。「Transaction オー
プン」の場合には「TransactionID 」が付加情報であ
り、「ファイル生成」の場合には「TransactionID 」、
「ファイルパス名」、「パスを識別するファイル番号」
が付加情報である。
FIG. 7 is a flowchart showing a processing procedure for adding a log entry to the command log file. This has shown the detail of the process performed by step 5 (S5) of FIG. [S11] An area for writing the log entry is secured in the command log file. [S12] An identification number for identifying the type of entry is entered at the beginning of the log entry. The types of entries are "Transaction open", "Transaction normal end", "Transaction abnormal end", "File generation",
Examples include "file deletion" and "page information in data log file". [S13] In the log entry, add necessary additional information according to the type of entry to be registered. In the case of "Transaction open", "TransactionID" is additional information, in the case of "file generation", "TransactionID",
"File path name", "File number that identifies the path"
Is additional information.

【0066】図8はデータログファイルからデータベー
スファイルへの書込手順を示すフローチャートである。
これは、ログ管理部が適当なタイミングで実行する処理
である。 〔S21〕指定「TransactionID 」の状態が、「オープ
ン中」、「正常終了」、「異常終了」の中のどれである
のかを判別する。「オープン中」であれば、なにもせず
に処理を終了する。「正常終了」であればステップ22
(S22)に進み、「異常終了」であればステップ24
(S24)に進む。 〔S22〕ページ管理表の該当するデータの示すエント
リの「Location」がデータログファイルを示しているか
否かを判断し、データログファイルを示していればステ
ップ23に進み、データログファイルを示していなけれ
ばステップ26に進む。 〔S23〕ページ管理表の該当するデータの示すエント
リの「Location」で示されたページを、データログファ
イルから読み出し、データベースファイルへ書き込む。 〔S24〕コマンドログファイル中の、データベースフ
ァイルへ書き込んだページに関するエントリを除去す
る。 〔S25〕データログファイル中の、データベースファ
イルへ書き込んだページに対応する領域を除去する。 〔S26〕ページ管理表の、データベースファイルへ書
き込んだページに関するエントリを除去する。
FIG. 8 is a flow chart showing the procedure for writing from the data log file to the database file.
This is a process that the log management unit executes at an appropriate timing. [S21] It is determined whether the state of the designated "TransactionID" is "opening", "normal end", or "abnormal end". If "open", the process ends without doing anything. If “normal end”, step 22
The process proceeds to (S22), and if "abnormal end", step 24
Proceed to (S24). [S22] It is determined whether or not the "Location" of the entry indicated by the corresponding data in the page management table indicates a data log file. If it indicates a data log file, the process proceeds to step 23, and a data log file is indicated. If not, the process proceeds to step 26. [S23] The page indicated by "Location" of the entry indicated by the corresponding data in the page management table is read from the data log file and written in the database file. [S24] The entry relating to the page written in the database file in the command log file is removed. [S25] The area of the data log file corresponding to the page written in the database file is removed. [S26] The entry relating to the page written in the database file in the page management table is removed.

【0067】これにより、トランザクションが正常終了
してる場合において、操作対象がデータベースファイル
内のページであれば、ページ管理表のエントリを除去し
て処理が終了となる。一方、操作対象がデータログファ
イル内のページであれば、そのページの内容が、データ
ベースファイル内のそのページがもともと格納されてい
た位置に書き込まれる。そして、ページ管理表とコマン
ドログファイルとの対応するエントリが除去されるとと
もに、データログファイル内の該当するページが除去さ
れ、終了する。
As a result, when the transaction ends normally, if the operation target is a page in the database file, the entry in the page management table is removed and the process ends. On the other hand, if the operation target is a page in the data log file, the content of the page is written in the position where the page was originally stored in the database file. Then, the corresponding entries in the page management table and the command log file are removed, the corresponding page in the data log file is removed, and the process ends.

【0068】なお、トランザクションがオープン中であ
れば、データログファイルからデータベースファイルへ
の書き込み処理は行われない。以上のようにして、デー
タベースファイルとログファイルとをマップドファイル
として、複数のプロセスからアクセス可能なページバッ
ファに写像するすることができる。その結果、以下のよ
うな効果が得られる。
If the transaction is open, the writing process from the data log file to the database file is not performed. As described above, the database file and the log file can be mapped as a mapped file to a page buffer accessible by a plurality of processes. As a result, the following effects are obtained.

【0069】まず第1の効果は、データを読み出す場合
に、ページバッファから読み出すことができることであ
る。ページバッファからの読み出しは、二次記憶装置に
対して入力命令を送るときと比べ、高速に行うことがで
きる。
The first effect is that when data is read, it can be read from the page buffer. Reading from the page buffer can be performed faster than when an input command is sent to the secondary storage device.

【0070】第2の効果は、ページの内容が更新されト
ランザクションがコミットする場合に、二次記憶装置に
対する出力命令を送ることなく、更新内容をデータログ
ファイルに反映することができることである。この際の
更新内容のデータログファイルへの反映は、OSによっ
て高速に行われる。
The second effect is that when the content of the page is updated and the transaction commits, the updated content can be reflected in the data log file without sending an output command to the secondary storage device. At this time, the update contents are reflected in the data log file at high speed by the OS.

【0071】第3の効果は、データを更新したトランザ
クションが異常終了した場合には、ページバッファ内で
更新されたページについて、ページ管理表のエントリを
除去することで、その更新を破棄できることである。つ
まり、ページ管理表のエントリがなければ、データベー
スファイル内の該当するページが最新のものであると判
断されるため、データログファイル内のページは無効と
なる。
A third effect is that if the transaction that updated the data ends abnormally, the update can be discarded by removing the entry in the page management table for the updated page in the page buffer. . In other words, if there is no entry in the page management table, it is determined that the corresponding page in the database file is the latest one, so the page in the data log file becomes invalid.

【0072】第4の効果は、複数のクライアントプロセ
スがページを読み出す場合、データファイルもしくはデ
ータログファイルのページを各プロセスがアクセスでき
るページバッファに写像することで、複数のクライアン
トプロセスでページを共有できることである。
A fourth effect is that when a plurality of client processes read a page, the page of the data file or the data log file is mapped to a page buffer accessible by each process, so that the page can be shared by the plurality of client processes. Is.

【0073】なお、上記の説明では、1つの情報処理装
置をホストマシンとして、その中にサーバプロセスと複
数のクライアントプロセスとが存在している場合を説明
したが、ネットワークで接続された複数のホストマシン
のそれぞれで動作するプロセスのデータの共有も可能で
ある。マップドファイルは通常のファイルと同じファイ
ルであるため、米サン・マイクロシステムズ社が開発し
たNFS(Network File System)などの分散ファイルシ
ステムの機構と合わせて利用することで、複数のホスト
マシンの各々のプロセスがメモリ共有の機構でデータ共
有できる。そのため、前述の第4の効果は、1つのホス
トマシンで複数のプロセスがデータを共有する場合も、
ネットワークで接続された複数のホストマシンの各々の
プロセスがデータを共有する場合にも有効である。
In the above description, the case where one information processing device is used as a host machine and a server process and a plurality of client processes exist therein is described. However, a plurality of hosts connected by a network are used. It is also possible to share data of processes running on each of the machines. Since the mapped file is the same file as a normal file, it can be used with a distributed file system mechanism such as NFS (Network File System) developed by Sun Microsystems, Inc. Processes can share data using the memory sharing mechanism. Therefore, the fourth effect described above is achieved even when a plurality of processes share data in one host machine.
It is also effective when processes of a plurality of host machines connected by a network share data.

【0074】ただし、本発明でのメモリ共有の機構を利
用したデータベース管理システムを1つのホストマシン
で構成し、そのホストマシン内の複数のプロセスで利用
すれば、バッファを複数のプロセスで共有できるため
に、全体のメモリ使用量を減らすことができるという効
果もある。
However, if the database management system using the memory sharing mechanism of the present invention is configured by one host machine and is used by a plurality of processes in the host machine, the buffer can be shared by a plurality of processes. Moreover, there is an effect that the total memory usage can be reduced.

【0075】また、上記の説明では、アクセス要求を受
け取ったサーバプロセスは、クライアントプロセスへ写
像すべきページの位置を知らせるだけであるが、サーバ
プロセスが該当するページをページバッファへロードす
ることも可能である。サーバプロセスが予めロードする
ことにより、クライアントプロセスの要求により写像が
行われる際には、ロードされた領域のアドレスをクライ
アントプロセスの仮想メモリ空間に設定するだけです
む。
Further, in the above description, the server process receiving the access request only informs the client process of the position of the page to be mapped, but the server process can load the corresponding page into the page buffer. Is. Since the server process preloads, when the mapping is performed by the request of the client process, the address of the loaded area only needs to be set in the virtual memory space of the client process.

【0076】[0076]

【発明の効果】以上説明したように、第1の発明では、
データアクセス手段からデータベースファイルに対する
アクセス要求が出力された場合、写像データ管理手段
が、アクセスさせるべき写像対象データをデータベース
ファイルとログファイルとの中から選択し、写像対象デ
ータの位置を位置情報として出力するようにしたため、
データベースファイルとログファイルとをマップドファ
イルとして写像対象とすることができ、ログ機能による
システム障害からの回復とマップドファイルによるアク
セスの高速化の両立が可能になる。
As described above, in the first invention,
When an access request for the database file is output from the data access means, the mapping data management means selects the mapping target data to be accessed from the database file and the log file, and outputs the position of the mapping target data as position information. Because I decided to
A database file and a log file can be mapped as a mapped file, and recovery from a system failure by the log function and high-speed access by the mapped file can both be achieved.

【0077】第2の発明では、アクセス要求が更新のた
めのアクセス要求であれば、最新のデータがログファイ
ル内に設けられ、そのデータが写像対象データとなるた
め、更新処理は常にログファイル内のデータに対して実
施され、システム障害からの回復を確実に行うことがで
きる。
In the second aspect of the invention, if the access request is an access request for updating, the latest data is provided in the log file, and that data is the data to be mapped. Therefore, the update process is always performed in the log file. It is applied to the data of and the recovery from the system failure can be surely performed.

【0078】第3の発明では、更新のためのアクセス要
求が実行されると、その際の命令の内容をコマンドログ
ファイル記憶手段へ書き込むようにしたため、データの
処理がページ単位で行われる場合であっても、命令の履
歴から更新処理が正常終了したか否かを判別することが
できる。その結果、写像によるデータの読み取りをペー
ジ単位で高速に行いながらも、システム障害からの回復
時のデータの一貫性を保つことができる。
In the third invention, when the access request for updating is executed, the contents of the instruction at that time are written in the command log file storage means, so that the data processing is performed in page units. Even if there is, it is possible to determine from the history of instructions whether or not the update process has been completed normally. As a result, it is possible to read data by mapping at high speed on a page-by-page basis, while maintaining the consistency of data when recovering from a system failure.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明のデータベース管理システムの原理構成
図である。
FIG. 1 is a principle configuration diagram of a database management system of the present invention.

【図2】本発明のログ機能をもつデータベース管理シス
テムの全体構成を示す図である。
FIG. 2 is a diagram showing an overall configuration of a database management system having a log function of the present invention.

【図3】データログファイルとコマンドログファイルと
の内容例を示す図である。
FIG. 3 is a diagram showing an example of contents of a data log file and a command log file.

【図4】ログ管理部23の内部機能を示すブロック図で
ある。
FIG. 4 is a block diagram showing internal functions of a log management unit 23.

【図5】データベースファイルの中のページの状態の遷
移状況を示す図である。
FIG. 5 is a diagram showing transition states of page states in a database file.

【図6】ページバッファへの読み出しの処理手順を示す
フローチャートである。
FIG. 6 is a flowchart showing a processing procedure of reading to a page buffer.

【図7】ログエントリをコマンドログファイルに追加す
る際の処理手順を示すフローチャートである。
FIG. 7 is a flowchart showing a processing procedure for adding a log entry to a command log file.

【図8】データログファイルからデータベースファイル
への書込手順を示すフローチャートである。
FIG. 8 is a flowchart showing a writing procedure from a data log file to a database file.

【図9】従来のログ機能をもつデータベース管理システ
ムを示す図である。
FIG. 9 is a diagram showing a conventional database management system having a log function.

【符号の説明】[Explanation of symbols]

1 データベースファイル記憶手段 2 ログファイル記憶手段 3 共有メモリ 4 クライアントプロセス 4a データアクセス手段 5 サーバプロセス 5a 写像データ管理手段 6 写像手段 10 クライアントプロセス 20 サーバプロセス 30 データベースファイル 31 データログファイル 32 コマンドログファイル 40 ページバッファ 1 Database File Storage Means 2 Log File Storage Means 3 Shared Memory 4 Client Process 4a Data Access Means 5 Server Process 5a Mapping Data Management Means 6 Mapping Means 10 Client Processes 20 Server Processes 30 Database Files 31 Data Log Files 32 Command Log Files 32 pages buffer

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 マップドファイルによるメモリ共有機能
とデータベースに対するログ機能とを持ったデータベー
ス管理システムにおいて、 データベースファイルを格納するデータベースファイル
記憶手段と、 前記データベースファイルの更新内容であるログファイ
ルを格納するログファイル記憶手段と、 複数のプロセスからアクセス可能であり、前記データベ
ースファイルと前記ログファイルとをマップドファイル
として写像されたデータを保持する共有メモリと、 前記データベースファイルに対するアクセス要求を出力
するとともに、位置情報を受け取ると、前記位置情報で
示されたデータを指定して写像要求を出力するデータア
クセス手段と、 前記アクセス要求が出力されると、アクセスさせるべき
写像対象データを前記データベースファイルと前記ログ
ファイルとの中から選択し、前記写像対象データの位置
を前記位置情報として出力する写像データ管理手段と、 前記写像要求を受け取ると、前記データアクセス手段の
アクセス可能な前記共有メモリ内の領域に、指定された
データを写像する写像手段と、 を有することを特徴とするデータベース管理システム。
1. A database management system having a memory sharing function by a mapped file and a log function for a database, and a database file storage means for storing a database file, and a log file which is an update content of the database file. A log file storage means, a shared memory that is accessible from a plurality of processes and holds data mapped as the database file and the log file as a mapped file, and outputs an access request to the database file, When the position information is received, the data access means that outputs the mapping request by designating the data indicated by the position information; and when the access request is output, the mapping target data to be accessed is the database. File and the log file, and outputs the position of the mapping target data as the position information, mapping data management means; and, upon receiving the mapping request, in the shared memory accessible by the data access means. A database management system comprising: mapping means for mapping specified data in the area of.
【請求項2】 前記写像データ管理手段は、前記データ
ベースファイルに対するアクセス要求が、参照のための
アクセス要求である場合には前記データベースファイル
と前記ログファイルとの中の最新のデータを写像対象デ
ータとし、更新のためのアクセス要求の場合には最新の
データを前記ログファイル内に設けて、前記ログファイ
ル内のデータを写像対象データとすることを特徴とする
請求項1記載のデータベース管理システム。
2. The mapping data management means sets the latest data in the database file and the log file as mapping target data when the access request to the database file is an access request for reference. 2. The database management system according to claim 1, wherein in the case of an access request for updating, the latest data is provided in the log file and the data in the log file is used as the mapping target data.
【請求項3】 更新のためのデータ処理が実行された場
合は、データ更新処理命令の履歴をコマンドログファイ
ル記憶手段へ書き込むコマンドログエントリ書込手段を
さらに有することを特徴とする請求項1記載のデータベ
ース管理システム。
3. The method according to claim 1, further comprising a command log entry writing means for writing a history of data update processing instructions to a command log file storage means when data processing for updating is executed. Database management system.
JP8012571A 1996-01-29 1996-01-29 Data base management system Pending JPH09204337A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8012571A JPH09204337A (en) 1996-01-29 1996-01-29 Data base management system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8012571A JPH09204337A (en) 1996-01-29 1996-01-29 Data base management system

Publications (1)

Publication Number Publication Date
JPH09204337A true JPH09204337A (en) 1997-08-05

Family

ID=11809054

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8012571A Pending JPH09204337A (en) 1996-01-29 1996-01-29 Data base management system

Country Status (1)

Country Link
JP (1) JPH09204337A (en)

Similar Documents

Publication Publication Date Title
US7325110B2 (en) Method for acquiring snapshot
EP1179770B1 (en) File system
US8290899B2 (en) Group stamping style asynchronous replication utilizing a loosely-accurate global clock
US4593354A (en) Disk cache system
US6950915B2 (en) Data storage subsystem
US7925629B2 (en) Write ordering style asynchronous replication utilizing a loosely-accurate global clock
US6862632B1 (en) Dynamic RDF system for transferring initial data between source and destination volume wherein data maybe restored to either volume at same time other data is written
US5893097A (en) Database management system and method utilizing a shared memory
US5813016A (en) Device/system for processing shared data accessed by a plurality of data processing devices/systems
US5724581A (en) Data base management system for recovering from an abnormal condition
US9405680B2 (en) Communication-link-attached persistent memory system
US20030172227A1 (en) Reversing a communication path between storage devices
US7117249B1 (en) Computer system and data sharing method between computers
US5619691A (en) File sharing method and system for multiprocessor system
US10055139B1 (en) Optimized layout in a two tier storage
JPH07239808A (en) Distributed data managing system
US7694090B2 (en) Storage system with journal reflecting area control function
JP2830826B2 (en) Distributed file synchronization system and method
JPH09204337A (en) Data base management system
JPH11272628A (en) Transfer method and connection device for shared data
JP3330006B2 (en) Network system including information storage system, input system of the system, and
JP3335919B2 (en) Disk cache controller
JPH10340215A (en) Data backup system
JPH06259303A (en) Decentralized file system
US7702634B1 (en) Method and apparatus to support multi-node direct write access to a file managed by a single node file system