JP2000163294A - Method and device for managing database and machine- readable recording medium with program recorded thereon - Google Patents
Method and device for managing database and machine- readable recording medium with program recorded thereonInfo
- Publication number
- JP2000163294A JP2000163294A JP10355335A JP35533598A JP2000163294A JP 2000163294 A JP2000163294 A JP 2000163294A JP 10355335 A JP10355335 A JP 10355335A JP 35533598 A JP35533598 A JP 35533598A JP 2000163294 A JP2000163294 A JP 2000163294A
- Authority
- JP
- Japan
- Prior art keywords
- page
- database
- updated
- application program
- page information
- 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
Links
- 238000000034 method Methods 0.000 title description 36
- 239000000872 buffer Substances 0.000 claims abstract description 151
- 230000003111 delayed effect Effects 0.000 claims description 20
- 238000011084 recovery Methods 0.000 claims description 9
- 230000004913 activation Effects 0.000 claims description 3
- 238000007726 management method Methods 0.000 claims 8
- 230000006870 function Effects 0.000 claims 1
- 230000004044 response Effects 0.000 claims 1
- 238000010586 diagram Methods 0.000 description 10
- 230000007717 exclusion Effects 0.000 description 8
- 230000001360 synchronised effect Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 1
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
【0001】[0001]
【発明の属する技術分野】本発明は計算機におけるデー
タベース管理に関し、特に遅延更新方式を用いたデータ
ベース管理に関する。[0001] 1. Field of the Invention [0002] The present invention relates to database management in a computer, and more particularly to database management using a delayed update method.
【0002】[0002]
【従来の技術】データベースは一般に計算機の二次記憶
上に構築されるため、主記憶上にデータバッファと呼ば
れるデータ領域を確保し、アプリケーションプログラム
からデータアクセス要求があった場合にデータバッファ
の内容を調べ、データバッファ中に該当するページがな
ければ二次記憶上のデータベースから該当するページを
データバッファに読み込むが、存在すればデータバッフ
ァ上のページを使用することにより、二次記憶アクセス
の回数を削減している。データバッファは揮発性の主記
憶に確保されているため、データバッファ上で更新され
たデータは、何れはデータベースの元のページに書き戻
す必要がある。2. Description of the Related Art Since a database is generally constructed on a secondary storage of a computer, a data area called a data buffer is secured on a main storage, and the contents of the data buffer are stored when a data access request is made from an application program. If the corresponding page is not found in the data buffer, the corresponding page is read from the database on the secondary storage into the data buffer.If there is, the number of secondary storage accesses is determined by using the page on the data buffer. Has been reduced. Since the data buffer is secured in volatile main storage, any data updated in the data buffer must be written back to the original page of the database.
【0003】アプリケーションプログラムによりデータ
バッファ上で更新されたデータを二次記憶上のデータベ
ースに書き戻す方式は、同期式と非同期式とに大別され
る。同期式は、アプリケーションプログラムからコミッ
ト要求があった時点でデータバッファ上の更新データを
二次記憶に書き戻す方式である。この方式では、データ
が二次記憶上で更新されたことが静止点の確立をもって
保証されるため、データの保全を保つことができる。し
かし、アプリケーションプログラムは二次記憶にデータ
が反映されるまで待ち合わせる必要があり、アプリケー
ションプログラムの高速実行が困難になる。また、二次
記憶へのデータの出力が一時に行われるため、瞬間的
に、二次記憶I/Oが集中し、ハードウェアの処理性能
によってデータベースアクセスのスループットが下がる
という問題がある。このような方式の問題点を解決する
ために考え出された方式が、非同期式である。非同期式
は、アプリケーションプログラムからのコミット要求と
は非同期に二次記憶上のデータベースを更新するもの
で、遅延更新方式と呼ばれる。本発明は、この遅延更新
方式を採用したデータベース管理に関する。[0005] The method of writing back the data updated on the data buffer by the application program to the database on the secondary storage is roughly classified into a synchronous type and an asynchronous type. The synchronous method is a method in which the update data in the data buffer is written back to the secondary storage when a commit request is made from the application program. In this method, it is ensured that the data has been updated on the secondary storage by establishing the stationary point, so that data integrity can be maintained. However, the application program needs to wait until the data is reflected in the secondary storage, which makes it difficult to execute the application program at high speed. In addition, since data is output to the secondary storage at one time, the secondary storage I / O is momentarily concentrated, and there is a problem that the throughput of database access is reduced due to the processing performance of hardware. A method devised to solve the problem of such a method is an asynchronous method. The asynchronous method updates a database on secondary storage asynchronously with a commit request from an application program, and is called a delayed update method. The present invention relates to database management employing this delayed update method.
【0004】遅延更新方式を採用したデータベース管理
方式の一例が特開平3−288244号公報に記載され
ている。同公報では、アプリケーションプログラムによ
り更新されたデータを二次記憶上の遅延更新ログに格納
し、その後非同期に、遅延更新ログに格納されたデータ
に基づいてデータベースを更新する。しかし、この方式
では、遅延更新ログへの格納時に1度、データベースへ
の反映時に2度、それぞれ二次記憶へのアクセスが必要
になる。[0004] An example of a database management system employing a delayed update system is described in Japanese Patent Application Laid-Open No. 3-288244. In this publication, data updated by an application program is stored in a delay update log on a secondary storage, and then the database is asynchronously updated based on the data stored in the delay update log. However, in this method, it is necessary to access the secondary storage once when storing the information in the delayed update log and twice when reflecting it in the database.
【0005】そこで、二次記憶へのアクセス回数をより
削減する遅延更新方式として、次のような方式が考えら
れている。図10に示すように、主記憶100上に同じ
サイズの2組のデータバッファ101,102を設け、
一方をアプリケーションプログラム103からの参照,
更新用に使用し、他方をデータベース104の遅延更新
用に使用する。アプリケーションプログラム103から
データベース104中の或るページ105,106,1
07へのアクセス要求があると、バッファ管理手段10
8は、該当ページをデータバッファ101の空き領域に
読み出す。アプリケーションプログラム103はこのデ
ータバッファ101上でページ105,106,107
を参照し、更新する。今、ページ105,106,10
7の元のデータをa,b,cとし、更新後のデータを
A,B,Cとする。The following method has been considered as a delayed update method for further reducing the number of accesses to the secondary storage. As shown in FIG. 10, two sets of data buffers 101 and 102 of the same size are provided on the main memory 100,
One is referred from the application program 103,
It is used for updating, and the other is used for delayed updating of the database 104. Certain pages 105, 106, 1 in the database 104 from the application program 103
07, the buffer management means 10
8 reads the corresponding page into a free area of the data buffer 101. The application program 103 stores pages 105, 106, and 107 on the data buffer 101.
See and update. Now, pages 105, 106, 10
7 is a, b, and c, and the updated data is A, B, and C.
【0006】アプリケーションプログラム103がコミ
ット要求を出すと、コミット処理手段109は、データ
バッファ101上のページ105,106,107の更
新データA,B,Cをデータバッファ102にコピーす
る。また、システム障害時におけるデータベースのリカ
バリに備えて、ページ105,106,107の更新イ
メージ111をジャーナルファイル110に出力する。When the application program 103 issues a commit request, the commit processing means 109 copies the update data A, B, and C of the pages 105, 106, and 107 on the data buffer 101 to the data buffer 102. In addition, the update image 111 of the pages 105, 106, and 107 is output to the journal file 110 in preparation for recovery of the database in the event of a system failure.
【0007】その後、遅延更新処理手段112は、コミ
ット処理手段109の処理と非同期に、データバッファ
102からページ105,106,107の更新データ
A,B,Cを読み出し、データベース104を更新す
る。After that, the delayed update processing means 112 reads the update data A, B, and C of the pages 105, 106, and 107 from the data buffer 102 and updates the database 104 asynchronously with the processing of the commit processing means 109.
【0008】[0008]
【発明が解決しようとする課題】図10に示した従来の
遅延更新方式では、アプリケーションプログラムにより
更新されたデータを主記憶上の他のデータバッファにコ
ピーし、その後非同期に、そのデータバッファに格納さ
れたデータに基づいて二次記憶上のデータベースを更新
するため、コミット処理時に二次記憶へのアクセスは不
要であり、またデータベースへの反映時も読み出しのた
めの二次記憶アクセスが不要になり、特開平3−288
244号公報に記載された方式より二次記憶へのアクセ
ス回数が少なくなる。In the conventional delay update method shown in FIG. 10, data updated by an application program is copied to another data buffer on a main memory, and then stored in that data buffer asynchronously. Since the database on the secondary storage is updated based on the data that has been read, access to the secondary storage is not required during the commit process, and access to the secondary storage for reading is also unnecessary when reflecting on the database. JP-A-3-288
The number of accesses to the secondary storage is smaller than that of the method described in Japanese Patent No. 244.
【0009】しかし、図10に示した従来の遅延更新方
式では、主記憶上に同じサイズのデータバッファが2組
必要になり、主記憶の必要容量が増大する欠点がある。However, the conventional delayed update method shown in FIG. 10 requires two sets of data buffers of the same size on the main memory, and has a disadvantage that the required capacity of the main memory increases.
【0010】本発明の目的は、1組のデータバッファだ
けを使用して遅延更新処理が行えるようにし、主記憶の
必要容量を削減することにある。An object of the present invention is to make it possible to perform delayed update processing using only one set of data buffers, and to reduce the required capacity of main storage.
【0011】[0011]
【課題を解決するための手段】本発明は上記の目的を達
成するために、二次記憶上のデータベースに対する参照
および更新を主記憶に設けたデータバッファ上で行い且
つ該データバッファ上で更新されたページの前記データ
ベースへの反映をアプリケーションプログラムによる処
理と非同期に行う計算機において、アプリケーションプ
ログラムからのコミット要求時、そのアプリケーション
プログラムによりデータバッファ上で更新されたページ
を特定する情報を未更新ページ情報として未更新ページ
情報記録部に記録しておき、アプリケーションプログラ
ムによる処理と非同期に、未更新ページ情報記録部に記
録された未更新ページ情報が示すページのうち、何れの
アプリケーションプログラムにも現在使用されていない
ページのみをデータベースに反映する。According to the present invention, in order to achieve the above-mentioned object, reference and update to a database on a secondary storage are performed on a data buffer provided in a main storage and updated on the data buffer. When a commit request is made from the application program, information specifying the page updated on the data buffer by the application program is used as unupdated page information in a computer that reflects the updated page in the database asynchronously with the processing by the application program. It is recorded in the non-updated page information recording unit, and is currently used by any application program among the pages indicated by the non-updated page information recorded in the non-updated page information recording unit asynchronously with the processing by the application program. Only pages that are not To reflect on the base.
【0012】データバッファが1組しかないと、或るア
プリケーションプログラムからコミット要求が出された
とき、そのアプリケーションプログラムで更新されたデ
ータバッファ上のページを従来のように他のデータバッ
ファにコピーすることはできないため、本発明では、コ
ミット処理手段が、コミット処理時に、どのページが遅
延処理の対象となったかを未更新ページ情報記録部に記
録する。遅延更新処理手段は、アプリケーションプログ
ラムとは非同期に、未更新ページ情報記録部を参照し、
遅延処理の対象となったページをデータベースに反映す
る。但し、コミット要求を出したアプリケーションプロ
グラムが参照,更新していたデータバッファ上のページ
は、その後、他のアプリケーションプログラムによって
参照,更新され得るため、遅延更新処理手段は、未更新
ページ情報記録部に記録された遅延処理対象のページで
あっても、現在何れかのアプリケーションプログラムで
使用中のページはデータベースに掃き出さない。つま
り、その時点では遅延更新処理の対象としない。その理
由は、未だコミット要求が出されていない時点の更新ペ
ージでデータベースを更新することはできないからであ
る。When there is only one set of data buffers, when a commit request is issued from a certain application program, a page on the data buffer updated by the application program is copied to another data buffer as in the related art. Therefore, in the present invention, the commit processing means records which page has been subjected to the delay processing in the non-updated page information recording unit during the commit processing. The delayed update processing unit refers to the unupdated page information recording unit asynchronously with the application program,
Reflect the target page of the delay processing in the database. However, since the page on the data buffer that has been referenced and updated by the application program that has issued the commit request can be subsequently referenced and updated by another application program, the delayed update processing unit stores the page in the unupdated page information recording unit. Even if the recorded pages are subject to delay processing, pages currently used by any application program are not flushed to the database. That is, at that time, it is not targeted for delayed update processing. The reason is that the database cannot be updated with the update page at the time when the commit request has not been issued yet.
【0013】また本発明では、遅延更新されずに未更新
ページ情報記録部に記録されたままになっている遅延処
理対象ページの情報を定期的に調査し、その有無及び存
在する場合にはその情報を含むチェックポイント情報を
ジャーナルファイルに出力するチェックポイント処理手
段を備える。ジャーナルファイルには、コミット処理手
段が従来と同様にコミット要求時に更新イメージを出力
しているため、この更新イメージと前記チェックポイン
ト情報とからシステム障害時のデータベースのリカバリ
が可能であり、データの保全性が確保される。Further, according to the present invention, the information of the page to be subjected to the delay processing, which is recorded in the non-updated page information recording section without being delayedly updated, is periodically inspected, and if there is any such information, if there is, the information is checked. Checkpoint processing means for outputting checkpoint information including information to a journal file is provided. Since the commit processing means outputs an update image to the journal file at the time of a commit request as in the past, it is possible to recover the database in the event of a system failure from this update image and the checkpoint information. Nature is secured.
【0014】[0014]
【発明の実施の形態】図1は本発明のデータベース管理
装置の実施形態の一例を示すブロック図である。図1に
おいて、1はデータベース、2はデータバッファ、3は
ジャーナルファイル、4は未更新ページ情報記録部、1
1はジャーナルスタック、12はバッファ管理テーブ
ル、13は排他管理テーブルである。データベース1及
びジャーナルファイル3は、磁気ディスク装置あるいは
それに準ずる二次記憶上に設けられ、データバッファ
2,未更新ページ情報記録部4,ジャーナルスタック1
1,バッファ管理テーブル12,排他管理テーブル13
は主記憶上に設けられている。また、5〜10は計算機
のCPU及び制御プログラムによって実現された機能手
段であり、5はデータベースアクセス処理手段、6はバ
ッファ管理手段、7はコミット処理手段、8は遅延更新
処理手段、9はチェックポイント処理手段、10はリカ
バリ処理手段である。FIG. 1 is a block diagram showing an example of an embodiment of a database management apparatus according to the present invention. In FIG. 1, 1 is a database, 2 is a data buffer, 3 is a journal file, 4 is an unupdated page information recording unit, 1
1 is a journal stack, 12 is a buffer management table, and 13 is an exclusion management table. The database 1 and the journal file 3 are provided on a magnetic disk device or a secondary storage equivalent thereto, and include a data buffer 2, an unupdated page information recording unit 4, and a journal stack 1.
1, buffer management table 12, exclusive management table 13
Is provided on the main memory. Reference numerals 5 to 10 denote functional units realized by the CPU and the control program of the computer, 5 denotes a database access processing unit, 6 denotes a buffer management unit, 7 denotes a commit processing unit, 8 denotes a delay update processing unit, and 9 denotes a check. Point processing means 10 is recovery processing means.
【0015】データベース1は、複数のファイルから構
成され、各ファイルは複数のページで構成される。デー
タバッファ2との間の入出力は、ページ単位で行われ
る。The database 1 is composed of a plurality of files, and each file is composed of a plurality of pages. Input / output to / from the data buffer 2 is performed in page units.
【0016】データバッファ2は、複数のページを格納
できる容量を持つ。図10に示した従来技術と異なり、
データバッファ2は1面しか設けられていない。データ
バッファ2は、各々1つのページを格納する多数のバッ
ファに論理的に分割されて使用される。The data buffer 2 has a capacity to store a plurality of pages. Unlike the prior art shown in FIG.
Only one data buffer 2 is provided. The data buffer 2 is used by being logically divided into a number of buffers each storing one page.
【0017】ジャーナルスタック11は、アプリケーシ
ョンプログラムのトランザクションにより参照更新され
たページの更新前イメージと更新後イメージとを含む更
新ジャーナルを格納する。The journal stack 11 stores an update journal including a pre-update image and a post-update image of a page referenced and updated by a transaction of an application program.
【0018】未更新ページ情報記録部4は、データバッ
ファ2上で更新されたが、データベース1に未だ反映さ
れていないページを特定する情報(未更新ページ情報)
を記録する。図2に未更新ページ情報記憶部4の構成例
を示す。複数のエントリから構成され、各エントリに
は、当該エントリが有効か否かを示す有効ビット41
と、データベース1に未だ反映されていないページの識
別子(データベース1上で当該ページを唯一に識別する
ためのもの)42とが記録される。The non-updated page information recording section 4 is information for specifying a page that has been updated in the data buffer 2 but has not yet been reflected in the database 1 (unupdated page information).
Record FIG. 2 shows a configuration example of the non-updated page information storage unit 4. Each entry has a valid bit 41 indicating whether the entry is valid or not.
And an identifier 42 of a page not yet reflected in the database 1 (for uniquely identifying the page on the database 1).
【0019】ジャーナルファイル3は、トランザクショ
ンの開始,終了の情報、更新前後のイメージ、未更新ペ
ージ情報などを記録する。The journal file 3 records information on the start and end of a transaction, images before and after an update, unupdated page information, and the like.
【0020】バッファ管理テーブル12は、データバッ
ファ2中の各バッファ毎の管理情報を格納する。その構
成例を図3に示す。各バッファに1対1に対応するエン
トリから構成され、各エントリには、当該バッファをデ
ータバッファ2上で一意に識別するためのバッファ番号
(例えばバッファの先頭アドレスなど)121と、当該
バッファに格納されているページの識別子122と、そ
のページがデータバッファ2上で更新されたか否かを示
す更新有無123とが設定される。なお、初期状態で
は、各エントリのバッファ番号121だけが設定されて
おり、ページ識別子122はNULL、更新有無123
は更新無しになっている。The buffer management table 12 stores management information for each buffer in the data buffer 2. An example of the configuration is shown in FIG. Each buffer is made up of an entry corresponding to each buffer, and each entry has a buffer number (for example, a head address of the buffer) 121 for uniquely identifying the buffer on the data buffer 2 and stored in the buffer. An identifier 122 of the page that has been set and an update presence / absence 123 indicating whether the page has been updated in the data buffer 2 are set. In the initial state, only the buffer number 121 of each entry is set, the page identifier 122 is NULL, and the update status 123 is set.
Is not updated.
【0021】排他管理テーブル13は、データベース1
をページ単位で排他制御するための情報を格納する。そ
の構成例を図4に示す。各ページに1対1に対応するエ
ントリから構成され、各エントリには、当該ページの識
別子131と、当該ページを使用しているアプリケーシ
ョンプログラムの識別子(使用中AP)132とが設定
される。なお、初期状態では、各エントリのページ識別
子131だけが設定されており、使用中AP132はN
ULLになっている。The exclusion management table 13 stores the database 1
For exclusive control of each page. FIG. 4 shows an example of the configuration. Each page is composed of an entry corresponding to each page, and in each entry, an identifier 131 of the page and an identifier (AP in use) 132 of an application program using the page are set. In the initial state, only the page identifier 131 of each entry is set, and the in-use AP 132
It is ULL.
【0022】バッファ管理手段6は、データベースアク
セス処理手段5がデータベース1の各ページをデータバ
ッファ2上で参照,更新できるように、データバッファ
2を管理すると共に排他制御を行う。その処理の一例を
図5に示す。The buffer management means 6 manages the data buffer 2 and performs exclusive control so that the database access processing means 5 can refer to and update each page of the database 1 on the data buffer 2. FIG. 5 shows an example of the processing.
【0023】データベースアクセス処理手段5からアク
セスしたいページの識別子及びアクセス元のアプリケー
ションプログラム識別子を指定したデータバッファ要求
があると、先ず、そのページ識別子で図4の排他管理テ
ーブル13を検索して、使用中AP132の値を調べ、
使用可否を判定する(ステップS1)。既に他のアプリ
ケーションプログラムが使用中であるときは、使用不可
と判定し、その旨をデータベースアクセス処理手段5に
通知し(ステップS2)、図5の処理を終える。When there is a data buffer request specifying the identifier of the page to be accessed and the application program identifier of the access source from the database access processing means 5, first, the exclusive management table 13 of FIG. Check the value of medium AP132,
It is determined whether or not it can be used (step S1). If another application program is already in use, it is determined that the application is unusable, and the fact is notified to the database access processing means 5 (step S2), and the processing in FIG. 5 is terminated.
【0024】当該ページが何れのアプリケーションプロ
グラムでも使用されていない場合、使用可と判定し、今
回アクセスしようとするアプリケーションプログラムの
識別子を排他管理テーブル13の当該ページに対応する
エントリに設定する(ステップS3)。そして、当該ペ
ージ識別子でバッファ管理テーブル12を検索し、その
ページがデータバッファ2の何れかのバッファに存在す
るか否かを調べる(ステップS4)。存在する場合は、
そのバッファの番号をデータベースアクセス処理手段5
に通知し(ステップS14)、図5の処理を終える。If the page is not used by any application program, it is determined that the page is usable, and the identifier of the application program to be accessed this time is set in the entry of the exclusive management table 13 corresponding to the page (step S3). ). Then, the buffer management table 12 is searched with the page identifier, and it is checked whether the page exists in any of the data buffers 2 (step S4). If present,
The number of the buffer is stored in the database access processing means 5
(Step S14), and the processing of FIG. 5 ends.
【0025】要求されたページがデータバッファ2に存
在しない場合、データベース1の該当ページをデータバ
ッファ2に読み込むための空きのバッファがあるか否か
をバッファ管理テーブル12を参照して調べる(ステッ
プS5)。空きバッファが存在する場合、データベース
1から該当するページを読み出して前記空きバッファに
格納し(ステップS12)、バッファ管理テーブル12
の今回格納したバッファのページ識別子122に当該ペ
ージの識別子を設定する(ステップS13)。そして、
そのバッファの番号をデータベースアクセス処理手段5
に通知し(ステップS14)、図5の処理を終える。If the requested page does not exist in the data buffer 2, it is checked with reference to the buffer management table 12 whether there is an empty buffer for reading the corresponding page of the database 1 into the data buffer 2 (step S5). ). If there is a free buffer, the corresponding page is read from the database 1 and stored in the free buffer (step S12).
Is set to the page identifier 122 of the buffer stored this time (step S13). And
The number of the buffer is stored in the database access processing means 5
(Step S14), and the processing of FIG. 5 ends.
【0026】データバッファ2に空きバッファが存在し
ない場合、掃き出すバッファをLRU等の任意のアルゴ
リズムによって選択する(ステップS6)。次に、この
選択したバッファの更新有無123が更新なしであれば
(ステップS7でNO)、バッファ管理テーブル12中
の当該バッファのページ識別子122を一旦NULLに
して空きバッファとする(ステップS11)。そして、
データベース1から該当するページを読み出して前記空
きバッファに格納し(ステップS12)、バッファ管理
テーブル12の今回格納したバッファのページ識別子1
22に当該ページの識別子を設定する(ステップS1
3)。次に、そのバッファの番号をデータベースアクセ
ス処理手段5に通知し(ステップS14)、図5の処理
を終える。If there is no empty buffer in the data buffer 2, a buffer to be flushed is selected by an arbitrary algorithm such as LRU (step S6). Next, if the update presence / absence 123 of the selected buffer is not updated (NO in step S7), the page identifier 122 of the buffer in the buffer management table 12 is temporarily set to NULL to make it an empty buffer (step S11). And
The corresponding page is read from the database 1 and stored in the empty buffer (step S12), and the page identifier 1 of the buffer stored this time in the buffer management table 12 is read.
22 is set to the identifier of the page (step S1).
3). Next, the number of the buffer is notified to the database access processing means 5 (step S14), and the processing in FIG. 5 ends.
【0027】前記選択したバッファが更新ありであれば
(ステップS7でYES)、そのバッファに格納されて
いるページをデータベース1の元のページに書き込む
(ステップS8)。次に、当該ページの識別子を含む未
更新ページ情報が未更新ページ情報記録部4に記録され
ているか否かを調べ(ステップS9)、記録されていれ
ば未更新ページ情報記録部4からその未更新ページ情報
を削除する(ステップS10)。そして、バッファ管理
テーブル12中の当該バッファのページ識別子122を
一旦NULLにして空きバッファとし(ステップS1
1)、データベース1から該当するページを読み出して
前記空きバッファに格納し(ステップS12)、バッフ
ァ管理テーブル12の今回格納したバッファのページ識
別子122に当該ページの識別子を設定し(ステップS
13)、そのバッファの番号をデータベースアクセス処
理手段5に通知する(ステップS14)。If the selected buffer has been updated (YES in step S7), the page stored in the buffer is written to the original page of the database 1 (step S8). Next, it is checked whether or not unupdated page information including the page identifier is recorded in the unupdated page information recording unit 4 (step S9). The updated page information is deleted (step S10). Then, the page identifier 122 of the buffer in the buffer management table 12 is temporarily set to NULL to make it an empty buffer (step S1).
1) The corresponding page is read from the database 1 and stored in the empty buffer (step S12), and the page identifier 122 of the buffer stored this time is set in the buffer management table 12 (step S12).
13), the number of the buffer is notified to the database access processing means 5 (step S14).
【0028】再び図1を参照すると、データベースアク
セス処理手段5は、図示しないアプリケーションプログ
ラムからの要求に従って、データベース1のページをデ
ータバッファ2上で参照,更新する。或るアプリケーシ
ョンプログラムで或るトランザクションが開始される
と、そのトランザクションの識別子を含むトランザクシ
ョン開始ジャーナルをジャーナルファイル3に出力す
る。また、そのトランザクションから参照,更新するペ
ージの識別子が通知されると、前述したようにバッファ
管理手段6に対してアクセスしたいページの識別子及び
アクセス元のアプリケーションプログラム識別子を指定
したデータバッファ要求を出し、バッファ番号が返却さ
れたら、データバッファ2中の当該バッファ番号で識別
されるバッファ上で、当該ページを参照,更新する。ペ
ージの更新時は、更新したバッファ番号をバッファ管理
手段6に通知し、バッファ管理手段6は、バッファ管理
テーブル12の該当バッファ番号を持つエントリの更新
有無123を更新ありに変更する。また、データベース
アクセス処理手段5は、ページを更新する毎に、そのペ
ージ識別子と更新前イメージと更新後イメージとを1つ
のジャーナルとしてジャーナルスタック11に格納す
る。Referring again to FIG. 1, the database access processing means 5 refers to and updates the page of the database 1 on the data buffer 2 according to a request from an application program (not shown). When a certain transaction is started by a certain application program, a transaction start journal including the identifier of the transaction is output to the journal file 3. Also, when the identifier of the page to be referred to or updated is notified from the transaction, a data buffer request specifying the identifier of the page to be accessed and the application program identifier of the access source is issued to the buffer management means 6 as described above. When the buffer number is returned, the page is referenced and updated on the buffer identified by the buffer number in the data buffer 2. When the page is updated, the buffer management unit 6 is notified of the updated buffer number, and the buffer management unit 6 changes the update presence / absence 123 of the entry having the corresponding buffer number in the buffer management table 12 to “updated”. Further, each time a page is updated, the database access processing means 5 stores the page identifier, the pre-update image, and the post-update image in the journal stack 11 as one journal.
【0029】コミット処理手段7は、図示しないアプリ
ケーションプログラムからのトランザクションにかかる
コミット要求を処理する。コミット要求があると、その
トランザクションに関してジャーナルスタック11に格
納されたジャーナルを読み出し、更新されたページの識
別子を未更新ページ情報記録部4に全て記録する。つま
り、図2の有効ビット41が無効となっている1つのエ
ントリのページ識別子42に、更新ページの識別子を記
録してその有効ビット41を有効とする処理を、全ての
更新ページについて繰り返す。また、コミット処理手段
7は、トランザクション終了処理開始ジャーナル、ジャ
ーナルスタック11から読み出した更新ジャーナル、ト
ランザクション終了処理終了ジャーナルをジャーナルフ
ァイル3に記録する。更にコミット処理手段7は、トラ
ンザクションを終了したアプリケーションプログラムの
識別子をバッファ管理手段6に通知する。バッファ管理
手段6は、排他管理テーブル13を更新し、当該アプリ
ケーションプログラムで使用中であったページを、未使
用状態に変更する。The commit processing means 7 processes a commit request for a transaction from an application program (not shown). When a commit request is issued, the journal stored in the journal stack 11 for the transaction is read, and the identifiers of the updated pages are all recorded in the unupdated page information recording unit 4. That is, the process of recording the identifier of the updated page in the page identifier 42 of one entry in which the valid bit 41 of FIG. 2 is invalid and validating the valid bit 41 is repeated for all the updated pages. Further, the commit processing means 7 records the transaction end processing start journal, the update journal read from the journal stack 11, and the transaction end processing end journal in the journal file 3. Further, the commit processing unit 7 notifies the buffer management unit 6 of the identifier of the application program that has completed the transaction. The buffer management unit 6 updates the exclusion management table 13 and changes the page being used by the application program to an unused state.
【0030】遅延更新処理手段8は、コミット処理手段
7の処理とは非同期に、データバッファ2上で更新され
たページをデータベース1に反映する処理を行う。遅延
更新処理手段8の起動は、タイマによって一定周期毎に
起動する方式、データバッファ2の使用率(使用中ペー
ジ数/データバッファ上の最大ページ数)が予め定めら
れた値以上となった時点で起動する方式、バッファ管理
テーブル12中の更新有りのバッファ数が予め定められ
た値以上となった時点で起動する方式など、任意の方式
を採用することができる。遅延更新処理手段8の処理例
を図6に示す。The delayed update processing means 8 performs processing for reflecting the page updated on the data buffer 2 in the database 1 asynchronously with the processing of the commit processing means 7. The delay update processing means 8 is activated by a method in which the timer is activated at regular intervals by a timer. , And an arbitrary method such as a method of starting when the number of updated buffers in the buffer management table 12 becomes equal to or greater than a predetermined value. FIG. 6 shows a processing example of the delay update processing means 8.
【0031】まず、未更新ページ情報記録部4を参照
し、有効ビット41が有効になっているエントリが1つ
以上あるか否かを調べる(ステップS21)。無けれ
ば、今回の処理を終了する。有れば、有効ビット41が
有効になっている1つの未更新ページ情報に注目し(ス
テップS22)、排他管理テーブル13を当該未更新ペ
ージのページ識別子で検索して、当該ページが現在参
照,更新中か否かを調べる(ステップS23)。参照中
か更新中であれば、データベース1に反映できないの
で、当該未更新ページ情報についての処理を終え、ステ
ップS27に進む。参照中でも更新中でもない場合、バ
ッファ管理テーブル12から当該ページを格納するバッ
ファ番号を得て、そのバッファから更新ページを読み出
し、データベース1の元のページに書き込む(ステップ
S24)。そして、未更新ページ情報記録部4から当該
未更新ページ情報を削除する(ステップS25)。つま
り、該当する有効ビット41を無効にする。次に、バッ
ファ管理テーブル12の当該ページに対応するエントリ
の更新有無123を更新無しに変更する(ステップS2
6)。そして、ステップS27へ進む。First, referring to the unupdated page information recording unit 4, it is checked whether or not there is one or more entries for which the valid bit 41 is valid (step S21). If not, this process ends. If there is, attention is paid to one piece of unupdated page information for which the validity bit 41 is effective (step S22), and the exclusive management table 13 is searched by the page identifier of the unupdated page. It is checked whether or not updating is in progress (step S23). If it is being referred to or being updated, it cannot be reflected in the database 1, so the processing for the unupdated page information is completed, and the process proceeds to step S27. If neither reference nor update is being performed, a buffer number for storing the page is obtained from the buffer management table 12, the updated page is read from the buffer, and written to the original page of the database 1 (step S24). Then, the non-updated page information is deleted from the non-updated page information recording unit 4 (Step S25). That is, the corresponding valid bit 41 is invalidated. Next, the update status 123 of the entry corresponding to the page in the buffer management table 12 is changed to no update (step S2).
6). Then, the process proceeds to step S27.
【0032】ステップS27では、未更新ページ情報記
録部4に未更新ページ情報が残っているか否かを調べ
る。残っていれば、その内の1つの未更新ページ情報に
注目を移して(ステップS28)、ステップS23に戻
り、上述した処理を繰り返す。残っていなければ、今回
の処理を終える。In step S27, it is checked whether or not unupdated page information remains in the unupdated page information recording unit 4. If it remains, attention is shifted to one of the unupdated page information (step S28), the process returns to step S23, and the above-described processing is repeated. If not, the process ends.
【0033】チェックポイント処理手段9は、定期的に
動作し、ジャーナルファイル3にチェックポイント情報
を出力する。チェックポイント処理手段9の起動は、タ
イマによって一定周期毎に起動する方式、コミット処理
手段7によるコミット処理完了直後に起動する方式、遅
延更新処理手段8の動作直後に起動する方式など、任意
の方式を採用することができる。ジャーナルファイル3
に出力されるチェックポイント情報は、チェックポイン
ト情報である旨の識別子と、その時点に未更新ページ情
報記録部4に存在した全ての未更新ページ情報とが含ま
れる。なお、その時点で未更新ページ情報が1つも存在
しない場合は、その旨が含まれる。The checkpoint processing means 9 operates periodically and outputs checkpoint information to the journal file 3. The checkpoint processing unit 9 can be activated by any method such as a method of starting at regular intervals by a timer, a method of starting immediately after the commit processing by the commit processing unit 7 is completed, and a method of starting immediately after the operation of the delayed update processing unit 8 Can be adopted. Journal file 3
The checkpoint information output to the server includes an identifier indicating the checkpoint information and all the non-updated page information existing in the non-updated page information recording unit 4 at that time. If there is no unupdated page information at that time, this is included.
【0034】リカバリ処理手段10は、ホスト系のシス
テム障害などがあったときに、ジャーナルファイル3の
内容に基づいてデータベース1を復元する手段である。The recovery processing means 10 is means for restoring the database 1 based on the contents of the journal file 3 when a host system failure or the like occurs.
【0035】以下、本実施形態の動作を遅延更新時の動
作を中心に説明する。例としては、或るアプリケーショ
ンプログラムA1がデータベース1中の3つのページ
a,b,cを参照および更新し、別のアプリケーション
プログラムA2がページcを参照および更新する状況を
想定する。図7はそのときのデータ等の流れを示してい
る。Hereinafter, the operation of this embodiment will be described focusing on the operation at the time of delayed update. As an example, assume a situation in which one application program A1 references and updates three pages a, b, and c in the database 1, and another application program A2 references and updates page c. FIG. 7 shows the flow of data and the like at that time.
【0036】アプリケーションプログラムA1の或るト
ランザクションにおいて、データベース1の3つのペー
ジa,b,cを参照,更新する場合、アプリケーション
プログラムA1からの要求に従い、データベースアクセ
ス処理手段5はバッファ管理手段6に対してページa,
b,cを参照,更新するためのバッファを要求する。バ
ッファ管理手段6は図5に示した処理を実行することに
より、ページa,b,cが既にデータバッファ2に存在
すればそのバッファ番号を通知し、存在しなければデー
タベース1からデータバッファ2にページa,b,cを
読み出し、そのバッファ番号を通知する。この時点で、
排他管理テーブル13にはページa,b,cがアプリケ
ーションプログラムA1で使用中であることが記録され
る。その後、データベースアクセス処理手段5は、通知
された番号のバッファ上でページa,b,cを参照,更
新する。ページa,b,cの更新時には、バッファ管理
テーブル12中のページa,b,cを格納するバッファ
の更新有無123が更新有りに変更される。また、ペー
ジa,b,cの更新前後のイメージを含むジャーナルが
ジャーナルスタック11に出力される。When referring to and updating three pages a, b, and c of the database 1 in a certain transaction of the application program A1, the database access processing means 5 sends a request to the buffer management means 6 in accordance with a request from the application program A1. Page a,
Requests a buffer for referencing and updating b and c. The buffer management unit 6 executes the processing shown in FIG. 5 to notify the buffer numbers if the pages a, b, and c already exist in the data buffer 2, and if not, the database 1 to the data buffer 2. Pages a, b, and c are read, and their buffer numbers are notified. at this point,
The exclusion management table 13 records that pages a, b, and c are being used by the application program A1. Thereafter, the database access processing means 5 refers to and updates the pages a, b, and c on the buffer of the notified number. When the pages a, b, and c are updated, the update status 123 of the buffer storing the pages a, b, and c in the buffer management table 12 is changed to updated. Further, a journal including images before and after updating the pages a, b, and c is output to the journal stack 11.
【0037】その後、アプリケーションプログラムA1
から当該トランザクションにかかるコミット要求が出さ
れると、コミット処理手段7は、ジャーナルスタック1
1を参照して、ページa,b,cの各々についての未更
新ページ情報を未更新ページ情報記録部4に記録する。
また、ページa,b,cに関するジャーナルをジャーナ
ルファイル3に出力する。更に、アプリケーションプロ
グラムA1の識別子をバッファ管理手段6に通知する。
バッファ管理手段6は、ページa,b,cがアプリケー
ションプログラムA1で使用されていない状態に排他管
理テーブル13を更新する。Thereafter, the application program A1
Issues a commit request for the transaction, the commit processing means 7
1, the non-updated page information for each of the pages a, b, and c is recorded in the non-updated page information recording unit 4.
The journals for pages a, b, and c are output to journal file 3. Further, the buffer management unit 6 is notified of the identifier of the application program A1.
The buffer management unit 6 updates the exclusion management table 13 so that the pages a, b, and c are not used by the application program A1.
【0038】その後、アプリケーションプログラムA2
の或るトランザクションにおいてページcを参照,更新
しようとしたために、データベースアクセス処理手段5
がページcのバッファをバッファ管理手段6に要求する
と、ページcは何れのアプリケーションプログラムにも
使用されていないため使用可と判断し、且つ、既にデー
タバッファ2上に存在するため、直ちにそのバッファ番
号をデータベースアクセス処理手段5に通知する。この
とき、バッファ管理手段6は排他管理テーブル13を更
新し、ページcがアプリケーションプログラムA2で使
用中であることを管理する。Thereafter, the application program A2
In a certain transaction, an attempt was made to refer to and update page c, so that database access processing means 5
Requests the buffer of the page c from the buffer management means 6, it judges that the page c is usable because it is not used by any application program, and since the page c already exists in the data buffer 2, the buffer number is immediately To the database access processing means 5. At this time, the buffer management unit 6 updates the exclusion management table 13 and manages that the page c is being used by the application program A2.
【0039】以上のように、アプリケーションプログラ
ムA1によってページa,b,cが更新され、アプリケ
ーションプログラムA2によってページcが参照,更新
されている時に、遅延更新処理手段8が起動したとす
る。未更新ページ情報4には、ページa,b,cの3つ
の未更新ページ情報が記録されているが、その内、ペー
ジcはアプリケーションプログラムA2によって現在使
用中であることが排他管理テーブル13で認識できる。
このため、遅延更新処理手段8は、ページa,bだけを
遅延更新対象とする。つまり、データバッファ2からペ
ージa,bを読み出してデータベース1に反映し、未更
新ページ情報記録部4からページa,bの未更新ページ
情報を削除する。これにより、未更新ページ情報記録部
4には、ページcの未更新ページ情報だけが残る。As described above, it is assumed that the delayed update processing means 8 is activated when the pages a, b, and c are updated by the application program A1 and the page c is referenced and updated by the application program A2. The non-updated page information 4 records three pieces of non-updated page information of pages a, b, and c. Among them, the exclusive management table 13 indicates that the page c is currently being used by the application program A2. Can be recognized.
For this reason, the delay update processing means 8 sets only the pages a and b as the delay update targets. That is, the pages a and b are read from the data buffer 2 and reflected in the database 1, and the unupdated page information of the pages a and b is deleted from the unupdated page information recording unit 4. As a result, only the unupdated page information of the page c remains in the unupdated page information recording unit 4.
【0040】従ってこの時点でチェックポイント処理手
段9が起動したとすると、チェックポイント処理手段9
は、ページcの未更新ページ情報を含むチェックポイン
ト情報をジャーナルファイル3に出力する。Therefore, if the checkpoint processing means 9 is activated at this time, the checkpoint processing means 9
Outputs the checkpoint information including the unupdated page information of the page c to the journal file 3.
【0041】以上のようにして、本実施例では、1面の
データバッファ2だけを使用して遅延更新を実現してい
る。As described above, in this embodiment, the delay update is realized using only one data buffer 2.
【0042】次に、ジャーナルファイル3に出力された
チェックポイント情報の利用例について、簡単な例を挙
げて説明する。Next, an example of using the checkpoint information output to the journal file 3 will be described with reference to a simple example.
【0043】図8は、2つのトランザクションが初期イ
メージABCのページaを更新していく様子を示す図で
ある。トランザクション1は、その開始(TS1)後、
ページaを参照し(ABC)、Cの部分をDに変更し
(ABD)、更にDの部分をEに変更し(ABE)、終
了している(TE1)。それに応じてジャーナルスタッ
ク11には、更新前後のイメージ(ABC,D),(A
BD,E)が格納され、ジャーナルファイル3には、ト
ランザクション1の開始ジャーナル(TS1)、トラン
ザクション1の終了処理開始ジャーナル(TE1S)、
更新前後のイメージ(ABC,D),(ABD,E)、
トランザクション1の終了処理終了ジャーナル(TE1
E)が格納されている。また、トランザクション2は、
トランザクション1の終了後に開始し(TS2)、AB
EをACEに変更し、未だトランザクション継続中であ
る。このため、ジャーナルスタック11には、更新前後
のイメージ(ABE,C)が格納され、ジャーナルファ
イルにはトランザクション2の開始ジャーナル(TS
2)だけが格納されている。そして、遅延更新処理は未
だ行われていないことから、データベース1上のページ
aは初期イメージABCのままになっている。FIG. 8 is a diagram showing how two transactions update page a of the initial image ABC. Transaction 1 starts after (TS1)
Referring to page a (ABC), the part of C is changed to D (ABD), the part of D is changed to E (ABE), and the processing is completed (TE1). Accordingly, the images (ABC, D) before and after the update, (A
BD, E) are stored in the journal file 3, and the start journal (TS1) of the transaction 1, the end processing start journal (TE1S) of the transaction 1,
Images before and after updating (ABC, D), (ABD, E),
Transaction 1 end processing end journal (TE1
E) is stored. Transaction 2 is
Start after the end of transaction 1 (TS2), AB
E is changed to ACE, and the transaction is still ongoing. For this reason, the image (ABE, C) before and after the update is stored in the journal stack 11, and the start journal (TS
Only 2) is stored. Then, since the delayed update processing has not been performed yet, the page a on the database 1 remains as the initial image ABC.
【0044】以上のような動作状況の下で、☆1のタイ
ミングでホスト系のシステム障害が発生したとする。こ
のタイミングでは、トランザクション1が終了している
ため、データベース1のページaをABEまで復元する
ことが望まれる。リカバリ処理手段10は、ジャーナル
ファイル3を時刻順で最新のジャーナルから過去のジャ
ーナル方向にサーチし、最も最近に出力されたチェック
ポイント情報CP1(空)を見つける。そして、この見
つけたチェックポイント情報CP1(空)が未更新ペー
ジ情報無しを示しているので、その時点より最近(新し
い)のジャーナルを入力し、更新後イメージを使って、
トランザクション1の終了処理終了ジャーナル(TE1
E)まで、更新後イメージを反映する処理を実行する。
つまり、チェックポイントCP1時点のページaの内容
ABCのCの部分に更新後イメージD,Eを順に反映
し、ABEを復元する。It is assumed that a host system failure has occurred at the timing of * 1 under the above operating conditions. At this timing, since transaction 1 has been completed, it is desired to restore page a of database 1 to ABE. The recovery processing means 10 searches the journal file 3 in time order from the latest journal to the past journal, and finds the most recently output checkpoint information CP1 (empty). Then, since the found checkpoint information CP1 (empty) indicates that there is no unupdated page information, the latest (newer) journal is input from that time, and the updated image is used.
Transaction 1 end processing end journal (TE1
Until E), the processing for reflecting the updated image is executed.
That is, the updated images D and E are sequentially reflected on the portion C of the content ABC of the page a at the time of the checkpoint CP1, and the ABE is restored.
【0045】他方、☆2や☆3のタイミングでホスト系
のシステム障害が発生したとする。このタイミングで
は、トランザクション2は開始しているが終了していな
いので、終了しているトランザクション1の時点までデ
ータベース1を復元することが望まれる。つまり、☆1
と同じくページaをABEまで復元する。リカバリ処理
手段10は、ジャーナルファイル3を時刻順で最新のジ
ャーナルから過去のジャーナル方向にサーチし、最も最
近に出力されたチェックポイント情報CP2(a)を見
つける。そして、この見つけたチェックポイント情報C
P2(a)が未更新ページ情報有りを示しているので、
前記チェックポイント情報CP2(a)に記載されたペ
ージaの未更新情報が記録されていないチェックポイン
ト情報が見つかるまでサーチを続け、CP1(空)を取
得する。そして、その時点より最近のジャーナルを入力
し、更新後イメージを使って、トランザクション1の終
了処理終了ジャーナル(TE1E)まで、更新後イメー
ジを反映する処理を実行し、ページaの内容をABEに
復元する。On the other hand, suppose that a host system failure has occurred at the timing of * 2 or * 3. At this timing, since the transaction 2 has started but not ended, it is desired to restore the database 1 to the time of the ended transaction 1. That is, ☆ 1
The page a is restored up to the ABE in the same manner as the above. The recovery processing means 10 searches the journal file 3 in time order from the latest journal to the past journal, and finds the checkpoint information CP2 (a) output most recently. And this found checkpoint information C
Since P2 (a) indicates that there is unupdated page information,
The search is continued until the checkpoint information in which the unupdated information of the page a described in the checkpoint information CP2 (a) is not recorded is found, and CP1 (empty) is obtained. Then, a journal that is more recent than that point in time is input, a process of reflecting the updated image is executed using the updated image up to the end processing end journal (TE1E) of transaction 1, and the contents of page a are restored to ABE. I do.
【0046】このようにチェックポイント処理手段9が
出力するチェックポイント情報は、データベースのリカ
バリ時に、どこまで過去に戻れば、データベース1の内
容が保証されているかの情報を与える。このため、チェ
ックポイント処理手段9の起動周期が余り長いと、過去
に遡る期間が長くなる。他方、周期を短くすれば、チェ
ックポイント処理手段9の動作によるオーバヘッドが大
きくなる。従って、実際のシステムにおいては、両者を
勘案してチェックポイント処理手段9の起動周期が定め
られる。As described above, the checkpoint information output by the checkpoint processing means 9 gives information as to how far back in the database recovery, the contents of the database 1 are guaranteed. Therefore, if the activation cycle of the checkpoint processing unit 9 is too long, the period going back to the past becomes longer. On the other hand, if the period is shortened, the overhead due to the operation of the checkpoint processing means 9 increases. Therefore, in an actual system, the activation cycle of the checkpoint processing means 9 is determined in consideration of both.
【0047】図9は本発明を適用した計算機の一例を示
すブロック図である。中央処理装置1000と二次記憶
装置1001と記録媒体1002とから構成され、中央
処理装置1000はCPU1003及び主記憶1004
を含んでいる。二次記憶装置1001は磁気ディスク装
置などで構成され、図1に示したデータベース1,ジャ
ーナルファイル3の格納用に使用される。記録媒体10
02は、CD−ROM、半導体メモリ、磁気ディスク等
の機械読み取り可能な記録媒体であり、データベース管
理プログラムを記録する。記録媒体1002に記録され
たデータベース管理プログラムは、中央処理装置100
0の立ち上げ時や電源投入時などの時点で、CPU10
03によって読み取られ、主記憶装置1004上に図1
に示したデータバッファ2、未更新ページ情報記録部
4、バッファ管理テーブル12、排他管理テーブル1
3、ジャーナルスタック11などの記憶部を初期生成す
ると共に、CPU1003の動作を制御することによ
り、CPU1003上に図1に示したデータベースアク
セス処理手段5、バッファ管理手段6、コミット処理手
段7、遅延更新処理手段8、チェックポイント処理手段
9、リカバリ処理手段10を実現する。FIG. 9 is a block diagram showing an example of a computer to which the present invention is applied. The central processing unit 1000 includes a central processing unit 1000, a secondary storage device 1001, and a recording medium 1002.
Contains. The secondary storage device 1001 is composed of a magnetic disk device or the like, and is used for storing the database 1 and the journal file 3 shown in FIG. Recording medium 10
Reference numeral 02 denotes a machine-readable recording medium such as a CD-ROM, a semiconductor memory, and a magnetic disk, which records a database management program. The database management program recorded on the recording medium 1002 is
When the CPU 10 starts up or when the power is turned on, the CPU 10
03 and stored in the main storage device 1004 in FIG.
, The unupdated page information recording unit 4, the buffer management table 12, the exclusion management table 1
3, the storage unit such as the journal stack 11 is initially generated, and the operation of the CPU 1003 is controlled so that the database access processing unit 5, the buffer management unit 6, the commit processing unit 7, the delay update unit shown in FIG. The processing unit 8, the checkpoint processing unit 9, and the recovery processing unit 10 are realized.
【0048】[0048]
【発明の効果】以上説明したように本発明によれば、ア
プリケーションプログラムからのコミット要求時にデー
タバッファ上で更新されたページを特定する情報を未更
新ページ情報として未更新ページ情報記録部に記録して
おき、その後、アプリケーションプログラムによる処理
と非同期に、未更新ページ情報記録部に記録された未更
新ページ情報が示すページのうち、何れのアプリケーシ
ョンプログラムにも現在使用されていないページのみを
データベースに反映することで、遅延更新を実現してい
るため、従来技術のようにデータバッファを2面設ける
必要がなくなり、主記憶の必要容量を削減することがで
きる。As described above, according to the present invention, information for specifying a page updated on the data buffer at the time of a commit request from an application program is recorded as unupdated page information in the unupdated page information recording unit. After that, out of pages indicated by the unupdated page information recorded in the unupdated page information recording unit, only pages not currently used by any application program are reflected in the database asynchronously with the processing by the application program. Thus, since the delay update is realized, it is not necessary to provide two data buffers as in the related art, and the required capacity of the main storage can be reduced.
【図1】本発明のデータベース管理装置の実施形態の一
例を示すブロック図である。FIG. 1 is a block diagram showing an example of an embodiment of a database management device of the present invention.
【図2】未更新ページ情報記録部の構成例を示す図であ
る。FIG. 2 is a diagram illustrating a configuration example of a non-updated page information recording unit.
【図3】バッファ管理テーブルの構成例を示す図であ
る。FIG. 3 is a diagram illustrating a configuration example of a buffer management table.
【図4】排他管理テーブルの構成例を示す図である。FIG. 4 is a diagram illustrating a configuration example of an exclusion management table.
【図5】バッファ管理手段の処理の一例を示すフローチ
ャートである。FIG. 5 is a flowchart illustrating an example of a process of a buffer management unit.
【図6】遅延更新処理手段の処理例を示すフローチャー
トである。FIG. 6 is a flowchart illustrating a processing example of a delay update processing unit.
【図7】本発明の実施形態の動作説明図である。FIG. 7 is an operation explanatory diagram of the embodiment of the present invention.
【図8】2つのトランザクションが初期イメージABC
のページaを更新していく様子を示す図である。FIG. 8 shows two transactions as an initial image ABC
It is a figure which shows a mode that the page a of this is updated.
【図9】本発明を適用した計算機の一例を示すブロック
図である。FIG. 9 is a block diagram illustrating an example of a computer to which the present invention has been applied.
【図10】遅延更新方式の従来例を示すブロック図であ
る。FIG. 10 is a block diagram showing a conventional example of a delay update method.
1…データベース 2…データバッファ 3…ジャーナルファイル 4…未更新ページ情報記録部 5…データベースアクセス処理手段 6…バッファ管理手段 7…コミット処理手段 8…遅延更新処理手段 9…チェックポイント処理手段 10…リカバリ処理手段 11…ジャーナルスタック 12…バッファ管理テーブル 13…排他管理テーブル DESCRIPTION OF SYMBOLS 1 ... Database 2 ... Data buffer 3 ... Journal file 4 ... Unupdated page information recording part 5 ... Database access processing means 6 ... Buffer management means 7 ... Commit processing means 8 ... Delayed update processing means 9 ... Checkpoint processing means 10 ... Recovery Processing means 11: Journal stack 12: Buffer management table 13: Exclusive management table
Claims (8)
および更新を主記憶に設けたデータバッファ上で行い且
つ更新されたページの前記データベースへの反映をアプ
リケーションプログラムによる処理と非同期に行う計算
機において、 アプリケーションプログラムからのコミット要求時、該
アプリケーションプログラムにより前記データバッファ
上で更新されたページを特定する情報を未更新ページ情
報として未更新ページ情報記録部に記録するステップ
と、 アプリケーションプログラムによる処理と非同期に、前
記未更新ページ情報記録部に記録された未更新ページ情
報が示すページのうち、何れのアプリケーションプログ
ラムにも現在使用されていないページのみを前記データ
ベースに反映するステップとを含むことを特徴とするデ
ータベース管理方法。1. A computer which performs reference and update to a database on a secondary storage on a data buffer provided in a main storage and reflects updated pages on the database asynchronously with processing by an application program. At the time of a commit request from a program, a step of recording information specifying a page updated on the data buffer by the application program as unupdated page information in an unupdated page information recording unit, asynchronously with processing by the application program, Reflecting only pages not currently used by any application programs among the pages indicated by the unupdated page information recorded in the unupdated page information recording unit in the database. Based management methods.
を参照して、未更新ページ情報が存在すればその存在し
た未更新ページ情報を含むチェックポイント情報をジャ
ーナルファイルに出力し、存在しなければ1つも未更新
ページ情報が存在しない旨を示すチェックポイント情報
を前記ジャーナルファイルに出力するステップを含むこ
とを特徴とする請求項1記載のデータベース管理方法。2. If the non-updated page information exists, checkpoint information including the existing non-updated page information is periodically output to a journal file by referring to the non-updated page information recording unit. 2. The database management method according to claim 1, further comprising a step of outputting checkpoint information indicating that no unupdated page information does not exist to the journal file.
および更新を主記憶に設けたデータバッファ上で行い且
つ更新されたページの前記データベースへの反映をアプ
リケーションプログラムによる処理と非同期に行う計算
機において、アプリケーションプログラムからのコミッ
ト要求時、該アプリケーションプログラムによりデータ
バッファ上で更新されたページを特定する情報を未更新
ページ情報として未更新ページ情報記録部に記録するコ
ミット処理手段と、 どのページが現在使用中かを示す情報を保持するテーブ
ルと、 アプリケーションプログラムによる処理と非同期に、前
記未更新ページ情報記録部に記録された未更新ページ情
報が示すページのうち、何れのアプリケーションプログ
ラムにも現在使用されていないことが前記テーブルで示
されているページのみを前記データベースに反映する遅
延更新処理手段とを含むことを特徴とするデータベース
管理装置。3. A computer which performs reference and update on a database on a secondary storage on a data buffer provided in a main storage and reflects an updated page on the database asynchronously with processing by an application program. At the time of a commit request from the program, commit processing means for recording information identifying the page updated on the data buffer by the application program as unupdated page information in the unupdated page information recording unit, and which page is currently in use And a table holding information indicating that the page is not currently used by any application program among the pages indicated by the non-updated page information recorded in the non-updated page information recording unit asynchronously with the processing by the application program. Is the Database management system which comprises only page shown Le and delay updating processing means for reflecting in the database.
を参照して、未更新ページ情報が存在すればその存在し
た未更新ページ情報を含むチェックポイント情報をジャ
ーナルファイルに出力し、存在しなければ1つも未更新
ページ情報が存在しない旨を示すチェックポイント情報
を前記ジャーナルファイルに出力するチェックポイント
処理手段を含むことを特徴とする請求項3記載のデータ
ベース管理装置。4. If the non-updated page information is present, checkpoint information including the existing non-updated page information is periodically output to a journal file by referring to the non-updated page information recording unit. 4. The database management apparatus according to claim 3, further comprising a checkpoint processing unit that outputs checkpoint information indicating that no unupdated page information does not exist to the journal file.
算機において、 主記憶上に設けられ、前記データベースを構成するペー
ジを複数格納し得る容量を有するデータバッファと、 アプリケーションプログラムからの要求に従って前記デ
ータバッファ上でページを参照更新するデータベースア
クセス処理手段と、 前記データベースアクセス処理手段からの要求に従っ
て、前記データベースを構成するページを前記データバ
ッファに読み込むバッファ管理手段と、 どのページが現在使用中かを示す情報を保持するテーブ
ルと、 主記憶上に設けられた未更新ページ情報記録部と、 アプリケーションプログラムからのコミット要求時、該
アプリケーションプログラムにより前記データバッファ
上で更新されたページを特定する情報を未更新ページ情
報として前記未更新ページ情報記録部に記録するコミッ
ト処理手段と、 アプリケーションプログラムによる処理と非同期に、前
記未更新ページ情報記録部に記録された未更新ページ情
報が示すページのうち、何れのアプリケーションプログ
ラムにも現在使用されていないことが前記テーブルで示
されているページのみを前記データベースに反映する遅
延更新処理手段とを含むことを特徴とするデータベース
管理装置。5. A computer for managing a database on a secondary storage, a data buffer provided on a main storage and having a capacity capable of storing a plurality of pages constituting the database, wherein the data is stored in accordance with a request from an application program. Database access processing means for referring to and updating a page on a buffer; buffer management means for reading a page constituting the database into the data buffer in response to a request from the database access processing means; and indicating which page is currently in use. A table for holding information, a non-updated page information recording unit provided on the main memory, and, when a commit request is made from the application program, information for identifying a page updated on the data buffer by the application program, has not been updated. page A commit processing unit that records information in the unupdated page information recording unit; and any application program among pages indicated by the unupdated page information recorded in the unupdated page information recording unit, asynchronously with processing by the application program. And a delayed update processing means for reflecting only the pages which are not currently used in the table in the table to the database.
ンプログラムによるページ更新の更新イメージジャーナ
ルを保持するジャーナルファイルと、 定期的に、前記未更新ページ情報記録部を参照して、未
更新ページ情報が存在すればその存在した未更新ページ
情報を含むチェックポイント情報を前記ジャーナルファ
イルに出力し、存在しなければ1つも未更新ページ情報
が存在しない旨を示すチェックポイント情報を前記ジャ
ーナルファイルに出力するチェックポイント処理手段を
含むことを特徴とする請求項5記載のデータベース管理
装置。6. A journal file which is provided on a secondary storage and holds an update image journal of page update by an application program, and the non-updated page information is periodically referenced by referring to the non-updated page information recording unit. If it exists, checkpoint information including the existing non-updated page information is output to the journal file; otherwise, checkpoint information indicating that no unupdated page information exists is output to the journal file. 6. The database management apparatus according to claim 5, further comprising a point processing unit.
て前記データベースを復元するリカバリ処理手段を備え
ることを特徴とする請求項6記載のデータベース管理装
置。7. The database management apparatus according to claim 6, further comprising recovery processing means for restoring the database based on the contents of the journal file.
算機を、 アプリケーションプログラムからの要求に従って、主記
憶のデータバッファ上でページを参照更新するデータベ
ースアクセス処理手段、 前記データベースアクセス処理手段からの要求に従っ
て、前記データベースを構成するページを前記データバ
ッファに読み込むバッファ管理手段、 アプリケーションプログラムからのコミット要求時、該
アプリケーションプログラムにより前記データバッファ
上で更新されたページを特定する情報を未更新ページ情
報として主記憶上の未更新ページ情報記録部に記録する
コミット処理手段、 アプリケーションプログラムによる処理と非同期に、前
記未更新ページ情報記録部に記録された未更新ページ情
報が示すページのうち、何れのアプリケーションプログ
ラムにも現在使用されていないページのみを前記データ
ベースに反映する遅延更新処理手段、 として機能させるプログラムを記録した機械読み取り可
能な記録媒体。8. A computer for managing a database on the secondary storage, a database access processing means for referring to and updating a page on a data buffer of the main storage in accordance with a request from an application program, and in accordance with a request from the database access processing means. Buffer management means for reading a page constituting the database into the data buffer; when a commit request is made from an application program, information specifying a page updated on the data buffer by the application program is stored as unupdated page information in a main storage. A commit processing means for recording in the above-mentioned non-updated page information recording unit; and an application among the pages indicated by the non-updated page information recorded in the non-updated page information recording unit, asynchronously with the processing by the application program. Delaying update processing unit, a machine-readable recording medium recording a program to function as to reflect only the pages that the Activation program is not currently being used in the database.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP10355335A JP2000163294A (en) | 1998-11-30 | 1998-11-30 | Method and device for managing database and machine- readable recording medium with program recorded thereon |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP10355335A JP2000163294A (en) | 1998-11-30 | 1998-11-30 | Method and device for managing database and machine- readable recording medium with program recorded thereon |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2000163294A true JP2000163294A (en) | 2000-06-16 |
Family
ID=18443346
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP10355335A Pending JP2000163294A (en) | 1998-11-30 | 1998-11-30 | Method and device for managing database and machine- readable recording medium with program recorded thereon |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2000163294A (en) |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2002149454A (en) * | 2000-08-30 | 2002-05-24 | Internatl Business Mach Corp <Ibm> | Transaction support on logical disk |
| JP2005222110A (en) * | 2004-02-03 | 2005-08-18 | Hitachi Ltd | Storage subsystem |
| US7644097B2 (en) | 2002-06-06 | 2010-01-05 | Ricoh Company, Ltd. | Full-text search device performing merge processing by using full-text index-for-registration/deletion storage part with performing registration/deletion processing by using other full-text index-for-registration/deletion storage part |
| US7899799B2 (en) | 2008-05-02 | 2011-03-01 | Toru Furuya | Transaction processing system of database using multi-operation processing providing concurrency control of transactions |
| JP2016540285A (en) * | 2013-10-21 | 2016-12-22 | アビニシオ テクノロジー エルエルシー | Checkpoint creation of a set of data units |
-
1998
- 1998-11-30 JP JP10355335A patent/JP2000163294A/en active Pending
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2002149454A (en) * | 2000-08-30 | 2002-05-24 | Internatl Business Mach Corp <Ibm> | Transaction support on logical disk |
| US7644097B2 (en) | 2002-06-06 | 2010-01-05 | Ricoh Company, Ltd. | Full-text search device performing merge processing by using full-text index-for-registration/deletion storage part with performing registration/deletion processing by using other full-text index-for-registration/deletion storage part |
| US7702666B2 (en) | 2002-06-06 | 2010-04-20 | Ricoh Company, Ltd. | Full-text search device performing merge processing by using full-text index-for-registration/deletion storage part with performing registration/deletion processing by using other full-text index-for-registration/deletion storage part |
| US7730069B2 (en) | 2002-06-06 | 2010-06-01 | Ricoh Company, Ltd. | Full-text search device performing merge processing by using full-text index-for-registration/ deletion storage part with performing registration/deletion processing by using other full-text index-for-registration/deletion storage part |
| JP2005222110A (en) * | 2004-02-03 | 2005-08-18 | Hitachi Ltd | Storage subsystem |
| US7899799B2 (en) | 2008-05-02 | 2011-03-01 | Toru Furuya | Transaction processing system of database using multi-operation processing providing concurrency control of transactions |
| JP2016540285A (en) * | 2013-10-21 | 2016-12-22 | アビニシオ テクノロジー エルエルシー | Checkpoint creation of a set of data units |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US7266669B2 (en) | File system with file management function and file management method | |
| JP3593366B2 (en) | Database management method | |
| US7991749B2 (en) | Database recovery method applying update journal and database log | |
| US7310714B2 (en) | Method and apparatus for creating a virtual data copy | |
| US6883074B2 (en) | System and method for efficient write operations for repeated snapshots by copying-on-write to most recent snapshot | |
| CN101183322B (en) | Method for deferred logging and apparatus thereof | |
| JPH07175700A (en) | Database management method | |
| US7640276B2 (en) | Backup system, program and backup method | |
| JPH0823841B2 (en) | Data processing system and method | |
| JPH0683677A (en) | Method and system for increment time-zero backup copy of data | |
| CN116303346B (en) | Database migration method and system | |
| US20060069888A1 (en) | Method, system and program for managing asynchronous cache scans | |
| US11593352B2 (en) | Cloud-native object storage for page-based relational database | |
| JP2006268139A (en) | Data reproduction device, method and program and storing system | |
| JPH11120051A (en) | Computer system for correcting information in database and its correcting | |
| JP2000163294A (en) | Method and device for managing database and machine- readable recording medium with program recorded thereon | |
| JPH10133927A (en) | Computer system and file management method | |
| US7949632B2 (en) | Database-rearranging program, database-rearranging method, and database-rearranging apparatus | |
| KR100365891B1 (en) | Backup/recovery Apparatus and method for non-log processing of real-time main memory database system | |
| CN114528355B (en) | Cloud native object storage of page-based relational databases | |
| WO2024199464A1 (en) | Database system and data management method therefor | |
| JPH0816881B2 (en) | Database update method | |
| JP4139642B2 (en) | Database management method and system | |
| KR20010055981A (en) | Method for recovering main memory database system using stable memory | |
| JPS63132351A (en) | Memory data base processor |