JP2708610B2 - Database log management processing method - Google Patents

Database log management processing method

Info

Publication number
JP2708610B2
JP2708610B2 JP2150605A JP15060590A JP2708610B2 JP 2708610 B2 JP2708610 B2 JP 2708610B2 JP 2150605 A JP2150605 A JP 2150605A JP 15060590 A JP15060590 A JP 15060590A JP 2708610 B2 JP2708610 B2 JP 2708610B2
Authority
JP
Japan
Prior art keywords
log
database
write
recovery
page
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.)
Expired - Fee Related
Application number
JP2150605A
Other languages
Japanese (ja)
Other versions
JPH0443441A (en
Inventor
克己 林
知博 林
裕 関根
義徳 下雅意
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2150605A priority Critical patent/JP2708610B2/en
Publication of JPH0443441A publication Critical patent/JPH0443441A/en
Application granted granted Critical
Publication of JP2708610B2 publication Critical patent/JP2708610B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

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

Description

【発明の詳細な説明】 〔概要〕 データベースの更新時に,データベースの復旧に用い
る更新後イメージログを取得するデータベース管理シス
テムにおけるデータベースのログ管理処理方式に関し, 不要な更新後イメージログを効率的に検索および圧縮
し,ダウンリカバリの高速化を可能とすることを目的と
し, 取得した更新後イメージログを格納する不揮発二次記憶
媒体上のログ域と,データベースのバッファをデータベ
ースに書き戻したときに,あるページが書き戻されたこ
とを示し,間接的にそのページの更新後イメージログを
識別する情報を持つライトバックログを,前記ログ域に
書き出すライトバックログ取得部と,前記ログ域におけ
るライトバックログを参照し,データベースへの書き戻
しによって不要となった更新後イメージログを抽出して
削除する,またはログ域上の不要なログをアーカイブす
る更新後イメージログ・パージ処理部とを備えるように
構成する。
DETAILED DESCRIPTION OF THE INVENTION [Overview] Regarding a database log management processing method in a database management system that acquires an updated image log used for restoring a database when updating the database, an unnecessary updated image log is efficiently searched. When the log area on the non-volatile secondary storage medium that stores the acquired updated image log and the buffer of the database are written back to the database, A write-back log acquisition unit that writes, in the log area, a write-back log indicating that a page has been written back and that indirectly identifies an updated image log of the page; The updated image that is no longer needed by referring to the log and writing back to the database The system is configured to include a post-update image log purging unit that extracts and deletes logs or archives unnecessary logs in a log area.

〔産業上の利用分野〕[Industrial applications]

本発明は,データベースの更新時に,データベースの
復旧に用いる更新後イメージログを取得するデータベー
ス管理システムにおけるデータベースのログ管理処理方
式に関する。
The present invention relates to a log management processing method for a database in a database management system that acquires an updated image log used for restoring the database when the database is updated.

〔従来の技術〕[Conventional technology]

一般に、データベース管理システムでは,大量のバッ
ファを用意し,バッファ上でデータの更新などを行い,
トランザクションのコミット時や他の適当な機会に,バ
ッファ上で更新された内容をデータベースに書き戻す処
理を行う。また,システムダウン時のデータベースのリ
カバリのために,通常,バッファの更新後,トランザク
ションをコミットするまでに,更新後イメージログ(以
下,AIログという)を取得する。
Generally, in a database management system, a large amount of buffers are prepared, data is updated on the buffers, and so on.
At the time of committing the transaction or at another appropriate occasion, the content updated on the buffer is written back to the database. Also, in order to recover the database when the system goes down, an updated image log (hereinafter, referred to as an AI log) is usually acquired after updating the buffer and before committing the transaction.

(参考文献) ・Gray,J. “Notes on data base operating systems",Lecture
Notes on Computer Science,vol.60,. ・Haerder,T.,Reuter.A. “Principles of Transaction−Oriented Database R
ecovery",ACM Computing Surveys,Vol.15,No.4 このようなダウンリカバリをAIログを使用して行うデ
ータベース管理システムは,データベースのバッファを
データベースに書き戻すことによって,データが不揮発
の外部記憶媒体に保存される場合は,そのページを更新
したコミットされたトランザクションのAIログは不要と
なる。
(References) ・ Gray, J. “Notes on data base operating systems”, Lecture
Notes on Computer Science, vol.60, .Haerder, T., Reuter.A. “Principles of Transaction-Oriented Database R
ecovery ", ACM Computing Surveys, Vol.15, No.4 A database management system that performs such a down recovery using an AI log uses a non-volatile external storage medium whose data is written back to the database buffer. If it is stored in the, the AI log of the committed transaction that updated the page is not needed.

また,他のデータベース管理システムでは,AIログが
不要となっても,特別な処理はしないで,そのままログ
域に残存させるようにしていた。
In other database management systems, even if the AI log is no longer needed, no special processing is performed and the AI log remains in the log area.

AIログを用いたダウンリカバリの処理は,従来,次の
ように行っていた。
Conventionally, down recovery processing using AI logs has been performed as follows.

第6図は従来のダウンリカバリの例,第7図は従来の
ダウンリカバリの処理フローを示す。
FIG. 6 shows an example of conventional down recovery, and FIG. 7 shows a processing flow of conventional down recovery.

第6図において,10は不揮発ログ域,14はデータベー
ス,20はメモリ,T1,T2はトランザクション,P1,P2はデー
タベースのページ,L1〜L7はログであって,特にL3,L7は
コミットログ,他はAIログを表す。
In FIG. 6, 10 is a non-volatile log area, 14 is a database, 20 is a memory, T1 and T2 are transactions, P1 and P2 are database pages, L1 to L7 are logs, and especially L3 and L7 are commit logs, Others represent AI logs.

トランザクションT1が,ページP1とページP2内のレコ
ードを更新または挿入して,コミットしたとする。ま
た,トランザクションT2も,ページP1,ページP2内のレ
コードを更新または挿入してコミットしたとする。その
後,システムダウンすると,不揮発ログ域10には,ログ
L1〜L7が残る これを基に,ダウンリカバリを行う場合,従来,第7
図に示すように処理していた。以下,第7図に示す〜
に従って説明する。なお,ここでは,ログデータはそ
のログを適用可能な直前のデータベースの状態を前提と
した方式を参考(特開昭60−220438号公報)に,そのリ
カバリ方法を示している。アイデンポテント(idempote
nt=冪等)なログの場合,以降に述べる,では,無
条件にログの適用を行い,へ戻る処理となる。アイデ
ンポテントなログとは,ログを適用するページの状態が
どのような場合でも,そのログは状態に依存せず,いつ
でも同じ効果をもたらす(最新の状態にすることができ
る)ログである。したがって,アンデンポテントなログ
の場合には,システムクラッシュがどのようなタイミン
グで発生しても,ログによる復旧は状態に依存せず,最
新の状態まで適用可能である。
It is assumed that the transaction T1 updates or inserts records in the pages P1 and P2 and commits. It is also assumed that transaction T2 also updates or inserts records in page P1 and page P2 and commits. Then, when the system goes down, the non-volatile log area 10
L1 to L7 remain. Based on this, when performing down recovery,
Processing was performed as shown in the figure. Hereinafter, shown in FIG.
It will be described according to. Here, the recovery method of the log data is shown with reference to a method based on the state of the database immediately before the log is applicable (Japanese Patent Application Laid-Open No. 60-220438). Idenpotent (idempote
In the case of a log (nt = idempotent), in the following description, the process is to apply the log unconditionally and return to. The log that is an IDENTOTENT is a log that does not depend on the state of the page to which the log is applied and that has the same effect at any time (can be updated). Therefore, in the case of an undenpotable log, even if a system crash occurs at any time, the recovery by the log does not depend on the state and can be applied to the latest state.

不揮発ログ域10の最旧ログからAIログをすべてメモ
リ20に読み込む(I/O要)。なお,1ブロックずつ読ん
で,以下の処理を行っても同様な処理となる。
Read all AI logs from the oldest log in the nonvolatile log area 10 into the memory 20 (I / O required). Note that the same processing is performed even if the following processing is performed by reading one block at a time.

メモリ20上のログが終了するまで,以下の処理を繰
り返す。ログが終了したならば,処理を終了する。な
お,実際にはこの後,アンドゥ(undo)リカバリに移る
が,本発明には関係しないので,リドゥ(redo)リカバ
リのみを説明する。
The following processing is repeated until the log on the memory 20 ends. When the log is completed, the processing ends. Actually, after that, the process proceeds to the undo recovery, but since it is not related to the present invention, only the redo recovery will be described.

コミットログかどうかを判定する。コミットログで
あれば,処理へ移る。
Determine whether it is a commit log. If it is a commit log, the process moves to processing.

コミットログでなければ,トランザクション単位に
分類してAIログを抽出する。その後,処理へ戻る。
If it is not a commit log, extract AI logs by classifying them into transaction units. Then, the process returns.

抽出したAIログが終了するまで,以下の処理〜
を繰り返す。終了したならば,処理へ移る。
Until the extracted AI log ends, the following processing ~
repeat. When the processing is completed, the processing moves to the next step.

AIログが示すデータベースのページを読み込む。 Read the database page indicated by the AI log.

AIログの取得時刻と,ページ中に記入されている書
き込み時刻とを比較し,リカバリ要/不要を判定する。
ページ中に記入されている書き込み時刻がAIログの取得
時刻よりも新しければ,リカバリ不要であるので,処理
へ戻る。
The acquisition time of the AI log is compared with the write time written in the page to determine whether recovery is necessary or not.
If the writing time entered in the page is later than the acquisition time of the AI log, recovery is unnecessary, and the process returns.

AIログの取得時刻のほうが新しければ,リカバリ要
であるので,そのAIログをデータベースから読み込んだ
ページに反映する。その後,処理へ戻る。
If the acquisition time of the AI log is newer, recovery is necessary, so the AI log is reflected on the page read from the database. Then, the process returns.

抽出したAIログが終了したならば,リカバリしたペ
ージをデータベースに書き戻す。その後,処理へ戻
り,同様に処理を繰り返す。
When the extracted AI log ends, write the recovered page back to the database. Thereafter, the process returns to the process, and the process is repeated in the same manner.

第6図に示す例の場合,データベース14からページP1
とページP2を読み込み,これとAIログの取得時刻とを比
較することによって,ページP2の書き戻しだけが行われ
ることになる(アイデンポテント(idempotent)なログ
ではページP1も更新)。
In the case of the example shown in FIG.
Then, by reading the page P2 and comparing this with the acquisition time of the AI log, only the write-back of the page P2 is performed (the page P1 is also updated in the case of an idempotent log).

〔発明が解決しようとする課題〕[Problems to be solved by the invention]

従来技術によれば,データベースのバッファをデータ
ベースに書き戻すことによって,AIログが不要になって
も,なんら対処はなかった。
According to the prior art, no action was taken even if the AI log became unnecessary by writing back the database buffer to the database.

また,不要AIログをそのまま残しておくことにより,
ダウン時にデータベースを復旧する際,不揮発ログ域に
書き出されているAIログと,データベース中のページを
見比べながら,必要なAIログを見つけ出さなければなら
ないか,不要なログまでリカバリの対象としなければな
らないので,AIログの数が多くなることにより,データ
ベースを復旧するのに多大な時間がかかるという問題が
あった。
Also, by leaving the unnecessary AI logs as they are,
When restoring a database in the event of a downtime, the AI log written to the non-volatile log area must be compared with the pages in the database to find the required AI log, or the unnecessary logs must be recovered. Since the number of AI logs increases, it takes a long time to recover the database.

本発明は上記問題点の解決を図り,不要な更新後イメ
ージ(AI)ログを効率的に圧縮し,ダウンリカバリの高
速化を可能とすることを目的としている。
SUMMARY OF THE INVENTION It is an object of the present invention to solve the above-mentioned problems, to efficiently compress unnecessary after-image (AI) logs, and to speed up down-recovery.

〔課題を解決するための手段〕[Means for solving the problem]

第1図は本発明の原理説明図である。 FIG. 1 is a diagram illustrating the principle of the present invention.

第1図において,10は不揮発二次記憶媒体上のログ域
であって,ダウン時にも情報が失われないようになって
いるログ格納用の記憶領域,11−1ないし11−3は更新
後イメージ(AI)ログ,12はそれ以前のAIログのパージ
が可能であることを示すライトバックログ,13はデータ
ベースのバッファ,14は磁気ディスク装置などの外部記
憶装置に用意されるデータベース,15はバッファ13につ
いてのデータベース14への書き戻しを検出するバッファ
書き戻し検出部,16はライトバックログ取得部,17はAIロ
グ・パージ処理部,18はシステムダウン時にデータベー
ス14を復旧するデータベース復旧処理部を表す。
In FIG. 1, reference numeral 10 denotes a log area on a non-volatile secondary storage medium, which is a storage area for storing a log so that information is not lost even in the event of a downtime, and 11-1 to 11-3 after updating. An image (AI) log, 12 is a write-back log indicating that the previous AI log can be purged, 13 is a database buffer, 14 is a database prepared in an external storage device such as a magnetic disk device, and 15 is a database. A buffer write-back detection unit that detects write-back of the buffer 13 to the database 14, a write-back log acquisition unit 16, an AI log purge processing unit 17, and a database recovery processing unit 18 that recovers the database 14 when the system goes down. Represents

不揮発ログ域10は,AIログ11−1等が格納される二次
記憶媒体であり,ここに格納される各AIログ11−1,11−
2,…には,データベース14のページ識別情報やログの取
得時刻情報が含まれる。
The non-volatile log area 10 is a secondary storage medium in which the AI log 11-1 and the like are stored, and each of the AI logs 11-1 and 11-
2,... Include page identification information of the database 14 and log acquisition time information.

データベース14は,バッファ13を介して参照,更新さ
れる。バッファ書き戻し検出部15は,バッファ13の内容
がデータベース14に書き戻されるのを監視し,書き戻し
があると,バッファ書き戻し完了通知をライトバックロ
グ取得部16に対して行う。
The database 14 is referenced and updated via the buffer 13. The buffer write-back detection unit 15 monitors the contents of the buffer 13 being written back to the database 14, and when there is a write-back, notifies the write-back log acquisition unit 16 of a buffer write-back completion notification.

ライトバックログ取得部16は,バッファ書き戻し通知
により、そのページ識別情報とか書き戻し時刻情報と
か,不要なログの位置を示す情報とかを持つライトバッ
クログ12を,不揮発ログ域10に書き出す。
The write-back log acquisition unit 16 writes the write-back log 12 having the page identification information, the write-back time information, and the information indicating the position of the unnecessary log to the nonvolatile log area 10 in response to the buffer write-back notification.

AIログ・パージ処理部17は,ライトバックログ取得部
16がライトバックログ12を取得した後,システムの負荷
が低くなった時点で,起動されるようになっており,ラ
イトバックログ12の書き戻し時刻よりも古いAIログまた
はライトバックログにより示されるAIログの位置以前の
AIログを抽出して,そのパージ処理およびアーカイブを
行う。アーカイブとは,保存用の外部記憶媒体に書き出
す処理のことである。なお,AIログ・パージ処理部17
を,システム管理者が任意の時点で動作させるようにし
てもよい。
AI log / purge processing unit 17 is a write-back log acquisition unit
16 is started after the system load becomes low after acquiring the write-back log 12, and is indicated by an AI log or write-back log that is older than the write-back time of the write-back log 12. Before the AI log position
Extracts AI logs, purges them, and archives them. Archive is a process of writing to an external storage medium for storage. The AI log / purge processing unit 17
May be operated at any time by the system administrator.

ライトバックログ12は,システムダウン後のデータベ
ース14のリカバリ処理にも使用される。
The write back log 12 is also used for recovery processing of the database 14 after the system goes down.

データベース復旧処理部18は,ダウン後にデータベー
ス14の復旧指示があると,AIログをもとにデータベース1
4のリカバリを行う。この際,不揮発ログ域10における
ライトバックログ12を参照することにより,データベー
ス14への書き戻し時刻以降または不要AIログ位置以降の
AIログのみをリカバリの対象として抽出する。ライトバ
ックログ12中の書き戻し時刻を参照するので,データベ
ース14にアクセスして,不要なページの書き込み時刻を
参照する処理やアイデンポテント(idempotent)なログ
の適用を削減することができる。
When the database recovery processing unit 18 is instructed to recover the database 14 after it goes down, the database recovery processing unit 18
Perform 4 recovery. At this time, by referring to the write-back log 12 in the non-volatile log area 10, the time after the time of writing back to the database 14 or the position after the unnecessary AI log
Extract only AI logs as targets for recovery. Since the write-back time in the write-back log 12 is referred to, the process of accessing the database 14 and referring to the write time of an unnecessary page and the application of an idempotent log can be reduced.

〔作用〕[Action]

本発明では,データベースのバッファ13を,データベ
ース14に書き戻したことが判明したときに,ライトバッ
クログ12を不揮発ログ域10に取得する。したがって,書
き戻したページに関連するAIログで不要なAIログがある
場合に,ライトバックログ12を参照して,そのAIログを
削除することができる。ログの削除は,ライトバックロ
グの取得回数がある値になったときに行ったり,一定時
間間隔に無条件に行ったり,単純にログ量だけで判定し
て行ったりする場合などがある。
In the present invention, when it is determined that the database buffer 13 has been written back to the database 14, the write-back log 12 is acquired in the non-volatile log area 10. Therefore, when there is an unnecessary AI log in the AI log related to the rewritten page, the AI log can be deleted by referring to the write-back log 12. The log may be deleted when the number of times that the write-back log is acquired reaches a certain value, may be performed unconditionally at fixed time intervals, or may be determined based solely on the log amount.

バッファ書き戻し完了の通知は,バッファ13の書き戻
しを監視するバッファ書き戻し検出部15を設けて行って
もよいし,またデータベースのバッファ管理(図示省
略)がバッファの書き戻しが終了した以降,任意の時点
で行ってもよい。
The buffer write-back completion notification may be provided by providing the buffer write-back detection unit 15 that monitors the write-back of the buffer 13, or after the buffer management (not shown) of the database has completed the buffer write-back. It may be performed at any time.

また,データベース復旧処理部18は,ライトバックロ
グ12を参照することにより,リカバリに必要なAIログか
どうかを,AIログ取得時刻とライトバックログ12中の書
き戻し時刻との比較によって判定することができる。
The database recovery processing unit 18 refers to the write-back log 12 to determine whether the log is an AI log necessary for recovery by comparing the AI log acquisition time with the write-back time in the write-back log 12. Can be.

〔実施例〕 第2図は本発明の実施例によるAIログのパージ説明
図,第3図は本発明の実施例に係るAIログ・パージ処理
部の処理フロー,第4図は本発明の実施例に係るダウン
リカバリの例,第5図は本発明の実施例に係るデータベ
ース復旧処理部の処理フローを示す。
[Embodiment] FIG. 2 is an explanatory diagram of the purging of an AI log according to an embodiment of the present invention, FIG. 3 is a processing flow of an AI log purging unit according to an embodiment of the present invention, and FIG. FIG. 5 shows an example of a down recovery according to the example, and shows a processing flow of the database recovery processing unit according to the embodiment of the present invention.

例えば第2図に示すように,AIログ11−1〜11−3が
収集されたとする。途中で,ページP1についてのバッフ
ァの書き戻しがあると,それより古いAIログ11−1は不
要となる。
For example, assume that AI logs 11-1 to 11-3 are collected as shown in FIG. If the buffer of the page P1 is written back on the way, the older AI log 11-1 becomes unnecessary.

本発明では,第2図に示すライトバックログ12のよう
に,書き戻しのあったページ識別情報(P1)とその時刻
(13:15)または不要となったAIログのログ上の位置が
ログとして収集されるので,これを参照することによ
り,随時,不要なAIログ11−1を検索して,そのパージ
を行うことができる。なお,第2図では簡単化のため,
分単位の時刻でライトバックログを実現したことを示し
ている。
In the present invention, as in the write-back log 12 shown in FIG. 2, the page identification information (P1) that has been written back and its time (13:15) or the position of the unnecessary AI log in the log are recorded in the log. Thus, by referring to this, the unnecessary AI log 11-1 can be searched and purged at any time. In FIG. 2, for simplicity,
This indicates that the write-back log has been realized in minutes.

第1図に示すAIログ・パージ処理部17は,例えば第3
図に示す処理により,パージを行う。以下,第3図に示
す〜に従って説明する。
The AI log purge processing unit 17 shown in FIG.
Purging is performed by the processing shown in the figure. Hereinafter, description will be made in accordance with the flowchart shown in FIG.

不揮発ログ域のログをメモリに読み込む。この際
に,ライトバックログがあれば,それを抽出する。
Reads logs in the nonvolatile log area into memory. At this time, if there is a write back log, it is extracted.

各AIログについて,ログが終了するまで,以下の処
理〜を繰り返す。
The following processing is repeated for each AI log until the log is completed.

同じページに対するAIログの取得時刻とライトバッ
クログの書き戻し時刻とを比較する。
Compare the acquisition time of the AI log and the write-back time of the write-back log for the same page.

AIログの取得時刻のほうが最新であれば,データベ
ースへの書き戻しは行われていないので,そのAIログは
そのままとして,処理へ戻る。
If the acquisition time of the AI log is newer, writing back to the database has not been performed, so that the AI log is left as it is, and the process returns.

ライトバックログの書き戻し時刻のほうが新しけれ
ば,書き戻し済みであり,そのAIログは不要であるので
パージする。その後,処理へ戻って,次のAIログにつ
いて同様に処理を繰り返す。
If the write-back log has a newer write-back time, the write-back log has already been written back, and the AI log is unnecessary. Then, the process returns to the process, and the same process is repeated for the next AI log.

以上のように,不要となったAIログが事前にパージさ
れるので,ダウンリカバリ時において検査が必要となる
AIログの数を削減することができる。さらに,パージさ
れなかったAIログが存在しても,本発明によれば,以下
に説明するように,ダウンリカバリを高速化することが
可能である。
As described above, unnecessary AI logs are purged in advance, so inspection is required during down recovery.
The number of AI logs can be reduced. Further, even if there are unpurged AI logs, according to the present invention, it is possible to speed up the down recovery as described below.

第4図は,本発明によるダウンリカバリの例を示して
いる。第4図において,10は不揮発ログ域,14はデータベ
ース,20はメモリ,T1,T2はトランザクション,P1,P2はデ
ータベースのページ,L1〜L9はログであって,特にL3,L9
はコミットログ,L6,L7はライトバックログ,他はAIログ
を表す。
FIG. 4 shows an example of down recovery according to the present invention. In FIG. 4, reference numeral 10 denotes a non-volatile log area, 14 denotes a database, 20 denotes a memory, T1 and T2 denote transactions, P1 and P2 denote database pages, and L1 to L9 denote logs, particularly L3 and L9.
Represents a commit log, L6 and L7 represent a write-back log, and the others represent AI logs.

トランザクションT1が,ページP1とページP2内のレコ
ードを更新または挿入して,コミットしたとする。ま
た,トランザクションT2も,ページP1,ページP2内のレ
コードを更新または挿入してコミットしたとする。この
例では,トランザクションT2がページP2を最初に更新し
た時点で,ページP1およびページP2のデータベース14へ
の書き戻しが行われている。
It is assumed that the transaction T1 updates or inserts records in the pages P1 and P2 and commits. It is also assumed that transaction T2 also updates or inserts records in page P1 and page P2 and commits. In this example, when the transaction T2 first updates the page P2, the pages P1 and P2 are written back to the database 14.

本発明では,このデータベース14への書き戻しによ
り,ライトバックログL6,L7が採取される。これには,
ページ識別情報および書き戻し時刻が格納される。
In the present invention, write-back logs L6 and L7 are collected by writing back to the database 14. This includes
The page identification information and the write-back time are stored.

トランザクションT2がコミットした後,システムダウ
ンすると,不揮発ログ域10には,第4図に示すように,
ログL1〜L9が残る。
When the system goes down after the transaction T2 commits, the non-volatile log area 10 contains, as shown in FIG.
Logs L1 to L9 remain.

これを基に,ダウンリカバリを行う場合,本発明で
は,例えば第5図に示すように処理する。以下,第5図
に示す〜に従って説明する。
In the case of performing a down recovery based on this, in the present invention, for example, processing is performed as shown in FIG. Hereinafter, the description will be made in accordance with the flowcharts shown in FIG.

なお,ここでは,ログデータはそのログを適用可能な
直前のデータベースの状態を前提とした方式を参考(特
開昭60−220438号公報)に,そのリカバリ方法を示して
いる。アイデンポテント(idempotent=冪等)なログの
場合,以降に述べる,では,コミットログの判定お
よびライトバックログの判定をした後,リカバリ対象の
ログであれば無条件にログの適用を行う処理となる。
Here, the recovery method of the log data is shown with reference to a method based on the state of the database immediately before the log is applicable (Japanese Patent Application Laid-Open No. 60-220438). In the case of an Idenpotent log (idempotent = idempotent), in the following description, after determining the commit log and the writeback log, the log is unconditionally applied if it is a log to be recovered Becomes

不揮発ログ域10の最旧ログからAIログをすべてメモ
リ20に読み込む。この際に,ライトバックログがあれ
ば,それを抽出し,ページ識別情報と最新の書き戻し時
刻とを記憶しておく。
All the AI logs from the oldest log in the nonvolatile log area 10 are read into the memory 20. At this time, if there is a write-back log, it is extracted and the page identification information and the latest write-back time are stored.

メモリ20上のログが終了するまで,以下の処理を繰
り返す。ログが終了したならば,処理を終了する。な
お,実際にはこの後,アンドゥ(undo)リカバリに移る
が,本発明には関係しないので,リドゥ(redo)リカバ
リのみを説明する。
The following processing is repeated until the log on the memory 20 ends. When the log is completed, the processing ends. Actually, after that, the process proceeds to the undo recovery, but since it is not related to the present invention, only the redo recovery will be described.

コミットログかどうかを判定する。コミットログで
あれば,処理へ移る。
Determine whether it is a commit log. If it is a commit log, the process moves to processing.

コミットログでなければ,AIログの取得時刻とライ
トバックログの書き戻し時刻とを比較し,そのページが
リカバリ対象となるかどうかを判定する。AIログの取得
時刻がライトバックログの書き戻し時刻よりも古いと
き,そのAIログについてのリカバリは不要であるので,
処理へ戻る。
If it is not a commit log, the time at which the AI log was obtained is compared with the time at which the write-back log was written back, and it is determined whether or not the page is a target for recovery. When the acquisition time of the AI log is older than the write-back time of the write-back log, it is not necessary to recover the AI log.
Return to processing.

AIログの取得時刻のほうが新しい場合には,リカバ
リ対象となるので,トランザクション単位に分類してAI
ログを抽出する。その後,処理へ戻る。
If the acquisition time of the AI log is later, it will be subject to recovery.
Extract logs. Then, the process returns.

コミットログがあれば,そのトランザクションにつ
いての抽出したAIログが終了するまで,以下の処理〜
を繰り返す。終了したならば,処理へ移る。
If there is a commit log, the following processing until the extracted AI log for that transaction ends
repeat. When the processing is completed, the processing moves to the next step.

AIログが示すデータベースのページを読み込む。 Read the database page indicated by the AI log.

AIログの取得時刻と,ページ中に記入されている書
き込み時刻とを比較し,リカバリ要/不要を判定する。
ページ中に記入されている書き込み時刻がAIログの取得
時刻よりも新しければ,リカバリ不要であるので,処理
へ戻る。
The acquisition time of the AI log is compared with the write time written in the page to determine whether recovery is necessary or not.
If the writing time entered in the page is later than the acquisition time of the AI log, recovery is unnecessary, and the process returns.

AIログの取得時刻のほうが新しければ,リカバリ要
であるので,そのAIログをデータベースから読み込んだ
ページに反映する。その後,処理へ戻る。
If the acquisition time of the AI log is newer, recovery is necessary, so the AI log is reflected on the page read from the database. Then, the process returns.

抽出したAIログが終了したならば,リカバリしたペ
ージをデータベースに書き戻す。その後,処理へ戻
り,同様に処理を繰り返す。
When the extracted AI log ends, write the recovered page back to the database. Thereafter, the process returns to the process, and the process is repeated in the same manner.

第4図に示す例の場合,ライトバックログL6,L7によ
り,ページP1,P2については,それ以後のAIログだけを
リカバリ対象とすればいいことがわかり,実際にデータ
ベース14から読み込んでリカバリするのは,AIログL8に
よるページP2だけでよいことになる。
In the case of the example shown in FIG. 4, the write-back logs L6 and L7 show that only the AI logs after the pages P1 and P2 need to be recovered, and the data is actually read from the database 14 and recovered. This means that only the page P2 based on the AI log L8 is required.

データベース14に対するリカバリ時のI/O回数につい
て,従来技術と本発明とを比較してみると,以下のとお
りである。
The comparison between the prior art and the present invention with respect to the number of I / Os at the time of recovery for the database 14 is as follows.

(i)AIログのI/O回数 (a) 従来技術の場合,AIログの読み込みが必要で,I/
O回数はログ量に依存する。
(I) I / O count of AI log (a) In the case of the conventional technology, reading of the AI log is necessary,
The number of O depends on the amount of log.

(b) 本発明の場合も従来技術と同様で,I/O回数はロ
グ量に依存する。ログ量がライトバックログ分多くなる
が,ほとんど問題にならない。
(B) In the case of the present invention, the same as in the prior art, the number of I / O times depends on the log amount. Although the log volume increases by the amount of the write-back log, there is almost no problem.

(ii)ページ読み込みのI/O回数 (a) 従来技術の場合,すべてのコミット済みAIログ
が示すページが,リカバリの可能性のあるページと判断
されるので,その読み込みが必要である。第6図に示す
例の場合,ページP1とページP2の2回のI/Oが必要にな
る。4回のI/Oが必要である。
(Ii) Number of I / Os of page read (a) In the case of the conventional technology, the page indicated by all committed AI logs is determined to be a page that is likely to be recovered, so that it is necessary to read the page. In the case of the example shown in FIG. 6, two I / Os of page P1 and page P2 are required. Four I / Os are required.

(b) 本発明の場合,リカバリが必要なページをライ
トバックログにより選択できるので,第6図と同様な第
4図の例で,ページP2についての1回のI/Oでよい。
(B) In the case of the present invention, the page requiring recovery can be selected by the write-back log, so that only one I / O for page P2 is required in the example of FIG. 4 similar to FIG.

〔発明の効果〕〔The invention's effect〕

以上説明したように,本発明によれば,クラッシュリ
カバリに不要なAIログであることを,システムに負荷を
かけることなく取得し,不要なAIログの効率的なパージ
が可能になる。また,ダウン時にダウンリカバリが動作
した時点で,不要なAIログが削除されていなくても,ラ
イトバックログとAIログとを見比べて,不要なAIログを
直ちに容易に検出することができるので,ダウンリカバ
リを高速化することも可能になる。
As described above, according to the present invention, it is possible to acquire an AI log unnecessary for crash recovery without imposing a load on the system, and to efficiently purge unnecessary AI logs. In addition, even when unnecessary AI logs are not deleted at the time of the down recovery operation at the time of downtime, unnecessary AI logs can be easily detected immediately by comparing the write-back log with the AI log. It is also possible to speed up the down recovery.

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

第1図は本発明の原理説明図, 第2図は本発明の実施例によるAIログのパージ説明図, 第3図は本発明の実施例に係るAIログ・パージ処理部の
処理フロー, 第4図は本発明の実施例に係るダウンリカバリの例, 第5図は本発明の実施例に係るデータベース復旧処理部
の処理フロー, 第6図は従来のダウンリカバリの例, 第7図は従来のダウンリカバリの処理フローを示す。 図中,10は不揮発ログ域,11−1〜11−3はAIログ,12は
ライトバックログ,13はバッファ,14はデータベース,15
はバッファ書き戻し検出部,16はライトバックログ取得
部,17はAIログ・パージ処理部,18はデータベース復旧処
理部を表す。
FIG. 1 is a diagram illustrating the principle of the present invention, FIG. 2 is a diagram illustrating the purging of an AI log according to an embodiment of the present invention, FIG. 3 is a processing flow of an AI log purging unit according to the embodiment of the present invention, 4 is an example of a down recovery according to the embodiment of the present invention, FIG. 5 is a processing flow of a database recovery processing unit according to the embodiment of the present invention, FIG. 6 is an example of a conventional down recovery, and FIG. 2 shows a processing flow of a down recovery. In the figure, 10 is a nonvolatile log area, 11-1 to 11-3 are AI logs, 12 is a write-back log, 13 is a buffer, 14 is a database, 15
Denotes a buffer write-back detection unit, 16 denotes a write-back log acquisition unit, 17 denotes an AI log / purge processing unit, and 18 denotes a database recovery processing unit.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 関根 裕 神奈川県川崎市中原区上小田中1015番地 富士通株式会社内 (72)発明者 下雅意 義徳 神奈川県川崎市中原区上小田中1015番地 富士通株式会社内 (56)参考文献 特開 昭64−68850(JP,A) ──────────────────────────────────────────────────続 き Continuing on the front page (72) Inventor Hiroshi Sekine 1015 Kamidadanaka, Nakahara-ku, Kawasaki City, Kanagawa Prefecture Inside Fujitsu Limited (72) Yoshinori Shimo Masanori 1015 Kamidadanaka, Nakahara-ku, Kawasaki City, Kanagawa Prefecture Fujitsu Limited (56) References JP-A-64-68850 (JP, A)

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】データベースの更新時に,データベースの
復旧に用いる更新後イメージログ(11−1,…)を取得す
るデータベース管理システムにおけるデータベースのロ
グ管理処理方式において, 取得した更新後イメージログを格納する不揮発二次記憶
媒体上のログ域(10)と, データベースのバッファをデータベースに書き戻したと
きに,書き戻されたページを識別する情報と書き戻し時
刻情報または不要となった更新後イメージログの位置を
示す情報を含み,それ以前の更新後イメージログのパー
ジが可能であることを示すライトバックログを,前記ロ
グ域に書き出すライトバックログ取得部(16)と, 前記ログ域におけるライトバックログを参照し,データ
ベースへの書き戻しによってクラッシュリカバリ対象外
となり不要となった更新後のイメージログを抽出して削
除する,またはログの削除の前にログ域上の不要なログ
をアーカイブする更新後イメージログ・パージ処理部
(17)とを備えたことを特徴とするデータベースのログ
管理処理方式。
When a database is updated, the acquired updated image log is stored in a database log management processing method in a database management system for acquiring an updated image log (11-1,...) Used for restoring the database. The log area (10) on the non-volatile secondary storage medium, the information for identifying the page that was written back when the database buffer was written back to the database, and the write-back time information or the updated image log that became unnecessary A write-back log acquisition unit (16) for writing, in the log area, a write-back log that includes information indicating a position and indicating that the post-update image log can be purged, and a write-back log in the log area That is no longer subject to crash recovery by writing back to the database A database log, comprising: an updated image log purging unit (17) for extracting and deleting an existing image log or archiving an unnecessary log in a log area before deleting the log. Management processing method.
【請求項2】データベースの更新時に,データベースの
復旧に用いる更新後イメージログ(11−1,…)を取得す
るデータベース管理システムにおけるデータベースのロ
グ管理処理方式において, 取得した更新後イメージログを格納する不揮発二次記憶
媒体上のログ域(10)と, データベースのバッファをデータベースに書き戻したと
きに,書き戻されたページを識別する情報と書き戻し時
刻情報または不要となった更新後イメージログの位置を
示す情報を含み,それ以前の更新後イメージログのパー
ジが可能であることを示すライトバックログを,前記ロ
グ域に書き出すライトバックログ取得部(16)と, ダウンリカバリ時に,前記ログ域におけるライトバック
ログを参照することにより,データベースへの書き戻し
時刻以降の更新後イメージログのみをリカバリの対象と
して抽出して,リカバリの処理を行うデータベース復旧
処理部(18)とを備えたことを特徴とするデータベース
のログ管理処理方式。
2. A database management system for acquiring an updated image log (11-1,...) Used for restoring the database when updating the database, stores the acquired updated image log in a database log management processing method. The log area (10) on the non-volatile secondary storage medium, the information for identifying the page that was written back when the database buffer was written back to the database, and the write-back time information or the updated image log that became unnecessary A write-back log acquisition unit (16) for writing, to the log area, a write-back log that includes information indicating a position and indicating that it is possible to purge the previously updated image log; By referring to the write-back log in the database, the updated image after the time of writing back to the database Extracts log only as the recovery of the target, the log management processing method database which is characterized in that a database recovery processing unit for processing the recovery (18).
JP2150605A 1990-06-08 1990-06-08 Database log management processing method Expired - Fee Related JP2708610B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2150605A JP2708610B2 (en) 1990-06-08 1990-06-08 Database log management processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2150605A JP2708610B2 (en) 1990-06-08 1990-06-08 Database log management processing method

Publications (2)

Publication Number Publication Date
JPH0443441A JPH0443441A (en) 1992-02-13
JP2708610B2 true JP2708610B2 (en) 1998-02-04

Family

ID=15500541

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2150605A Expired - Fee Related JP2708610B2 (en) 1990-06-08 1990-06-08 Database log management processing method

Country Status (1)

Country Link
JP (1) JP2708610B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6427213B1 (en) * 1998-11-16 2002-07-30 Lucent Technologies Inc. Apparatus, method and system for file synchronization for a fault tolerate network
US7158991B2 (en) * 2003-09-30 2007-01-02 Veritas Operating Corporation System and method for maintaining temporal data in data storage
JP5432596B2 (en) * 2009-05-29 2014-03-05 日本電信電話株式会社 Log file management device, log file management system, log file management method and program thereof

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6468850A (en) * 1987-09-10 1989-03-14 Fujitsu Ltd System crush recovery processing system

Also Published As

Publication number Publication date
JPH0443441A (en) 1992-02-13

Similar Documents

Publication Publication Date Title
US8775386B2 (en) Device and method for generating copy of database
US5561795A (en) Method and apparatus for audit trail logging and data base recovery
US10235375B1 (en) Persistent file system objects for management of databases
CA2933790C (en) Apparatus and method for creating a real time database replica
US5333314A (en) Distributed data base system of composite subsystem type, and method of fault recovery for the system
US5504883A (en) Method and apparatus for insuring recovery of file control information for secondary storage systems
US6578041B1 (en) High speed on-line backup when using logical log operations
US5404502A (en) Error-detection in database update processes
US5740434A (en) System for maintenance of database integrity
US8296269B2 (en) Apparatus and method for read consistency in a log mining system
JPH0812631B2 (en) Database transaction and query processing system
US7620785B1 (en) Using roll-forward and roll-backward logs to restore a data volume
US5850508A (en) Method of prevention of dangling transaction occurrence using a transaction table initialization technique at an analysis step
Eich Main memory database recovery
JP2708610B2 (en) Database log management processing method
KR100501414B1 (en) Method of and apparatus for logging and restoring the meta data in file system
JP2004062759A (en) Database log management method, its device and its program
JP2001229063A (en) Data managing system
JPS62245348A (en) Method and device for updating data base
JPH0962555A (en) File recovery method
JPH08314784A (en) File management device
JP2001188690A (en) Computer system and checkpoint information preserving method
JP2658265B2 (en) Disaster recovery method
Shin et al. An efficient log-based crash recovery scheme for nested transactions
JPH0350648A (en) Fault restoration method for data base

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20071017

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081017

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081017

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091017

Year of fee payment: 12

LAPS Cancellation because of no payment of annual fees