JP4730330B2 - Database recovery method, database recovery device, and database recovery program - Google Patents
Database recovery method, database recovery device, and database recovery program Download PDFInfo
- Publication number
- JP4730330B2 JP4730330B2 JP2007091634A JP2007091634A JP4730330B2 JP 4730330 B2 JP4730330 B2 JP 4730330B2 JP 2007091634 A JP2007091634 A JP 2007091634A JP 2007091634 A JP2007091634 A JP 2007091634A JP 4730330 B2 JP4730330 B2 JP 4730330B2
- Authority
- JP
- Japan
- Prior art keywords
- journal
- recovery
- database
- serial number
- base
- 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
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Description
本発明は、データベース復旧方法、データベース復旧装置及びデータベース復旧プログラムに関し、特に整合性のあるDBをリカバリすることが出来るデータベース復旧方法、データベース復旧装置及びデータベース復旧プログラムに関する。 The present invention relates to a database recovery method, a database recovery apparatus, and a database recovery program, and more particularly to a database recovery method, a database recovery apparatus, and a database recovery program capable of recovering a consistent DB.
従来のデータベース(以下「DB」と称す)の管理システムとして、DBのバックアップを単一のジャーナル・ファイルにより実行し、かかるジャーナル・ファイルに基づくDB遅延更新方法が提案されている(例えば特許文献1参照)。 As a management system for a conventional database (hereinafter referred to as “DB”), a DB delayed update method based on a journal file in which DB backup is executed using a single journal file has been proposed (for example, Patent Document 1). reference).
また、地震や火災などにより、DBとジャーナルの双方に障害が発生した場合は、無停止でデータをバックアップしていた。
しかしながら、上記のように、基底ジャーナルと累積ジャーナルを無停止でバックアップした場合、基底ジャーナルと累積ジャーナルの双方のバックアップが非同期に行なわれるため、基底ジャーナルと累積ジャーナルの各ジャーナルレコード間の出力順序が判別できなくなるという問題があった。 However, as described above, when the base journal and the cumulative journal are backed up without interruption, both the base journal and the cumulative journal are backed up asynchronously. There was a problem that it could not be determined.
業務無停止でのDB、ジャーナルのバックアップからDBがリカバリ出来ない動作例について図を用いて説明する。図11は、従来のジャーナルレコードをバックアップする例を示し、基底ジャーナルは点線枠gで囲まれたジャーナルレコード、累積ジャーナルは点線枠hで囲まれたジャーナルレコード、DBは点線枠iで囲まれた状態がバックアップされたとする。かかるバックアップをリストアした状態を図12に示す。 An example of an operation in which a DB cannot be recovered from a backup of a DB or journal that is not suspended will be described with reference to the drawings. FIG. 11 shows an example of backing up a conventional journal record, in which the base journal is a journal record surrounded by a dotted frame g, the cumulative journal is a journal record surrounded by a dotted frame h, and the DB is surrounded by a dotted frame i. Suppose the state has been backed up. FIG. 12 shows a state where such a backup is restored.
ロールフォワードリカバリの動作について図13を用いて説明すると、ロールフォワードリカバリとして、累積ジャーナル上のジャーナルレコード35、36、37を用いてDBのレコードR1とR2を上書きしていく。この後、基底ジャーナルにはトランザクション終了ジャーナル(「T3終了」)が出力されていない未完了トランザクション(T3)があるため、ロールバックリカバリを行う必要がある。
The roll-forward recovery operation will be described with reference to FIG. 13. As roll-forward recovery, DB records R1 and R2 are overwritten using
ロールバックリカバリの動作について図14を用いて説明すると、基底ジャーナル上のジャーナルレコード38がロールバックリカバリの対象となるジャーナルレコードとなり、ジャーナルレコード38の記録をもとにDBのレコードR1を上書きする。
The rollback recovery operation will be described with reference to FIG. 14. The
ロールバックリカバリが完了した図14の状態が、業務無停止でバックアップされたジャーナルを用いたリカバリとなるが、DBのレコードR1とR2は、基底ジャーナルと累積ジャーナルに全てのジャーナルレコードがバックアップされているトランザクションT1終了時の状態でならなければいけないのに、ジャーナルリカバリ処理はトランザクションT1終了時とは異なる状態でリカバリが完了してしまい、DBに不整合が発生してしまう。 The state shown in FIG. 14 after the completion of the rollback recovery is the recovery using the journal backed up without stopping the business. However, in the records R1 and R2 of the DB, all journal records are backed up to the base journal and the cumulative journal. However, the journal recovery process completes the recovery in a state different from that at the end of the transaction T1, and the DB becomes inconsistent.
従って、地震や火災などによるDBとジャーナルの同時障害の対策としては、業務無停止のバックアップではなく、静止点におけるバックアップが必要であった。また、上記DBの不整合は、リストアされた基底ジャーナルと累積ジャーナルに、互いの関係を確認する連番が付加されていないため、リストアされたジャーナルレコードをそのままジャーナルリカバリ手段に渡すことしか出来ず、生じる問題である。 Therefore, as a countermeasure against simultaneous failure of the DB and the journal due to an earthquake or a fire, a backup at a stationary point is required instead of a backup without stopping business. In addition, the above-mentioned DB inconsistency is that the restored base record and the cumulative journal are not added with serial numbers for confirming the relationship between them, so that the restored journal record can only be passed to the journal recovery means as it is. This is a problem that arises.
本発明はこのような状況に鑑みてなされたものであり、基底ジャーナルと累積ジャーナルに、互いの関係を確認する連番を付加することにより、DBとジャーナルの両方の障害からのリカバリを目的としたバックアップを行い、業務無停止で整合性のあるDBをリカバリすることを目的としている。 The present invention has been made in view of such circumstances, and aims to recover from failures of both the DB and the journal by adding serial numbers for confirming the relationship between the base journal and the cumulative journal. The purpose of this is to recover a consistent DB without stopping business.
請求項1記載の発明は、データベースのデータファイルを所定の時点でジャーナルレコードとして保存する基底ジャーナル保存ステップと、前記基底ジャーナル保存ステップに保存されたジャーナルレコードが更新された場合に、更新後のジャーナルレコードを保存する累積ジャーナル保存ステップと、前記基底ジャーナル保存ステップと、前記累積ジャーナル保存ステップに保存されるジャーナルレコードに連番を付加する連番付加ステップと、前記データベース、基底ジャーナル保存ステップ、前記累積ジャーナル保存ステップが有するデータを記憶媒体へバックアップするバックアップステップと、前記記憶媒体から、データベース、基底ジャーナル保存ステップ、前記累積ジャーナル保存ステップへのリストアを実施するリストアステップと、前記リストアしたデータベース、基底ジャーナル保存ステップ、前記累積ジャーナル保存ステップのデータに基づきデータベースをリカバリするリカバリステップと、前記データベースのリカバリステップによるリカバリ時、前記連番付加ステップにより付加されたジャーナルレコードの連番を用いて、ジャーナルレコードの連番確認を行う連番確認ステップと、前記連番確認ステップにより全てのジャーナルレコードが揃っていると確認できた場合のみ前記リカバリステップの対象とするリカバリ可否判断ステップと、を備えることを特徴とするデータベース復旧方法である。 According to the first aspect of the present invention, there is provided a base journal storage step for storing a database data file as a journal record at a predetermined time point, and a journal after update when the journal record stored in the base journal storage step is updated. A cumulative journal storage step for storing records, the base journal storage step, a serial number addition step for adding serial numbers to journal records stored in the cumulative journal storage step, the database, a base journal storage step, and the cumulative A backup step for backing up data included in the journal storage step to a storage medium, and a restore step for performing restoration from the storage medium to the database, the base journal storage step, and the cumulative journal storage step. And a recovery step for recovering the database based on the data of the restored database, the base journal saving step, and the cumulative journal saving step, and the journal added by the serial number adding step at the time of recovery by the database recovery step The serial number confirmation step for confirming the serial number of the journal record using the serial number of the record, and the recovery subject to the recovery step only when it can be confirmed that all the journal records are prepared by the serial number confirmation step. A database restoration method comprising: an availability determination step.
請求項2記載の発明は、請求項1記載の方法において、前記リカバリステップによるリカバリに利用するジャーナルレコードの有効範囲を決定するリカバリ有効範囲決定ステップを備え、前記連番確認ステップは、前記決定された有効範囲内のジャーナルレコードの連番を確認し、前記リカバリ可否ステップは、前記決定された有効範囲内のジャーナルレコードの連番が全て揃っていると確認し、前記有効範囲内のリカバリが可能か否か判断することを特徴とする。 According to a second aspect of the present invention, in the method according to the first aspect of the present invention, the method further comprises a recovery effective range determining step for determining an effective range of journal records used for recovery by the recovery step, wherein the serial number confirmation step is the determined The serial number of the journal record within the valid range is confirmed, and the recovery enable / disable step confirms that all the serial numbers of the journal record within the determined valid range are prepared, and recovery within the valid range is possible. It is characterized by determining whether or not.
請求項3記載の発明は、請求項2記載の方法において、前記有効範囲は、トランザクション開始のジャーナルレコードから、対応するトランザクション終了のジャーナルレコードまでの範囲であることを特徴とする。 According to a third aspect of the present invention, in the method according to the second aspect, the valid range is a range from a transaction start journal record to a corresponding transaction end journal record.
請求項4記載の発明は、請求項2又は3記載の方法において、前記リカバリ有効範囲決定ステップは、前記有効範囲内で全ての連番が揃わなかった場合は、ジャーナルレコードを逆順に走査し、次の有効範囲を決定することを特徴とする。 According to a fourth aspect of the present invention, in the method according to the second or third aspect, the recovery effective range determining step scans journal records in reverse order when all the serial numbers are not aligned within the effective range, The following effective range is determined.
請求項5記載の発明は、請求項1から4のいずれか1項記載の方法において、前記バックアップステップによりデータをバックアップする記憶媒体は、外部記憶媒体であることを特徴とする。 According to a fifth aspect of the present invention, in the method according to any one of the first to fourth aspects, the storage medium for backing up data by the backup step is an external storage medium.
請求項6記載の発明は、データベースのデータファイルを所定の時点でジャーナルレコードとして保存する基底ジャーナル保存手段と、前記基底ジャーナル保存手段に保存されたジャーナルレコードが更新された場合に、更新後のジャーナルレコードを保存する累積ジャーナル保存手段と、前記基底ジャーナル保存手段と、前記累積ジャーナル保存手段に保存されるジャーナルレコードに連番を付加する連番付加手段と、前記データベース、基底ジャーナル保存手段、前記累積ジャーナル保存手段が有するデータを記憶媒体へバックアップするバックアップ手段と、前記記憶媒体から、データベース、基底ジャーナル保存手段、前記累積ジャーナル保存手段へのリストアを実施するリストア手段と、前記リストアしたデータベース、基底ジャーナル保存手段、前記累積ジャーナル保存手段のデータに基づきデータベースをリカバリするリカバリ手段と、前記データベースのリカバリ手段によるリカバリ時、前記連番付加手段により付加されたジャーナルレコードの連番を用いて、ジャーナルレコードの連番確認を行う連番確認手段と、前記連番確認手段により全てのジャーナルレコードが揃っていると確認できた場合のみ前記リカバリ手段の対象とするリカバリ可否判断手段と、を備えることを特徴とするデータベース復旧装置である。 According to a sixth aspect of the present invention, there is provided a base journal storage unit that stores a database data file as a journal record at a predetermined time point, and a journal that has been updated when the journal record stored in the base journal storage unit is updated. Cumulative journal storage means for storing records, the base journal storage means, serial number addition means for adding serial numbers to journal records stored in the cumulative journal storage means, the database, base journal storage means, and cumulative A backup unit that backs up data stored in the journal storage unit to a storage medium; a restore unit that performs a restore from the storage medium to the database, the base journal storage unit, and the cumulative journal storage unit; and the restored database and the base journal Null storage means, recovery means for recovering the database based on the data of the cumulative journal storage means, and at the time of recovery by the recovery means of the database, using the serial number of the journal record added by the serial number addition means, the journal record A serial number confirmation unit that performs serial number confirmation, and a recovery possibility determination unit that is a target of the recovery unit only when it is confirmed by the serial number confirmation unit that all journal records are prepared. It is a database recovery device.
請求項7記載の発明は、データベースのデータファイルを所定の時点でジャーナルレコードとして保存する基底ジャーナル保存処理と、前記基底ジャーナル保存処理に保存されたジャーナルレコードが更新された場合に、更新後のジャーナルレコードを保存する累積ジャーナル保存処理と、前記基底ジャーナル保存処理と、前記累積ジャーナル保存処理に保存されるジャーナルレコードに連番を付加する連番付加処理と、前記データベース、基底ジャーナル保存処理、前記累積ジャーナル保存処理が有するデータを記憶媒体へバックアップするバックアップ処理と、前記記憶媒体から、データベース、基底ジャーナル保存処理、前記累積ジャーナル保存処理へのリストアを実施するリストア処理と、前記リストアしたデータベース、基底ジャーナル保存処理、前記累積ジャーナル保存処理のデータに基づきデータベースをリカバリするリカバリ処理と、前記データベースのリカバリ処理によるリカバリ時、前記連番付加処理により付加されたジャーナルレコードの連番を用いて、ジャーナルレコードの連番確認を行う連番確認処理と、前記連番確認処理により全てのジャーナルレコードが揃っていると確認できた場合のみ前記リカバリ処理の対象とするリカバリ可否判断処理と、をコンピュータに実行させることを特徴とするデータベース復旧プログラムである。 According to a seventh aspect of the present invention, there is provided a base journal storage process for storing a database data file as a journal record at a predetermined time point, and a journal after the update when the journal record stored in the base journal storage process is updated. Cumulative journal storage processing for storing records, base journal storage processing, serial number addition processing for adding serial numbers to journal records stored in the cumulative journal storage processing, the database, base journal storage processing, and cumulative Backup processing for backing up data included in the journal storage processing to a storage medium, restore processing for performing restoration from the storage medium to the database, the base journal storage processing, and the cumulative journal storage processing, and the restored database and base journal Null save process, recovery process for recovering the database based on the data of the accumulated journal save process, and a journal record using the serial number of the journal record added by the serial number adding process at the time of recovery by the recovery process of the database The computer executes the serial number confirmation process for confirming the serial number and the recovery possibility determination process that is the target of the recovery process only when it is confirmed that all journal records are prepared by the serial number confirmation process. This is a database recovery program.
本発明によれば、基底ジャーナルと累積ジャーナルに出力されるジャーナルレコードに連番を付加することで、無停止で採取されたDBとジャーナルのバックアップを使用して、整合性のあるDBをリカバリすることを可能とする。 According to the present invention, by adding serial numbers to the journal records output to the base journal and the cumulative journal, a consistent DB is recovered by using the backup of the DB collected without stopping and the journal. Make it possible.
本発明では、基底ジャーナルと累積ジャーナルとが別々に構成されるトランザクション処理システム(Transaction Processing System)において、地震や火災などにより、DBとジャーナルの双方に障害が発生した場合、無停止でDBとジャーナルをバックアップしたとしても整合性のあるDBのリカバリを行う。以下、本発明の実施形態について、図面を用いて詳細に説明する。なお、以下に述べる実施の形態は、本発明の好適な実施の形態であるから、技術的に好ましい種々の限定が付されているが、本発明の範囲は、以下の説明において特に本発明を限定する旨の記載がない限り、これらの態様に限られるものではない。 In the present invention, in a transaction processing system in which a base journal and a cumulative journal are separately configured, when a failure occurs in both the DB and the journal due to an earthquake or a fire, the DB and the journal are stopped without interruption. Even if the database is backed up, a consistent DB is recovered. Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. The embodiments described below are preferred embodiments of the present invention, and thus various technically preferable limitations are given. However, the scope of the present invention is particularly limited in the following description. As long as there is no description which limits, it is not restricted to these aspects.
まず、本発明が適用されるトランザクション処理システムについて説明する。図1は、トランザクション処理と、基底ジャーナル、累積ジャーナル、DBレコード(R1)、DBレコード(R2)の動作処理の流れを対応させている。なお、図1に示すように、本発明の実施形態が適用されるトランザクション処理システムは、基底ジャーナルと累積ジャーナルとが別ファイルで構成されているトランザクション処理システムである。 First, a transaction processing system to which the present invention is applied will be described. FIG. 1 associates the flow of transaction processing with the operation processing of the base journal, cumulative journal, DB record (R1), and DB record (R2). As shown in FIG. 1, the transaction processing system to which the embodiment of the present invention is applied is a transaction processing system in which the base journal and the cumulative journal are configured as separate files.
ここでジャーナル(Journal)とは、コンピュータ・システムの稼働中に、システムが記録する更新情報などの履歴のことで、かかる記録はシステムに障害が発生したときなどに、原因究明や復旧のために使用される。本実施形態では、ジャーナルの出力性能向上と容量拡大のために、ジャーナルを基底ジャーナルと累積ジャーナルに分散して管理している。基底ジャーナルにはトランザクション開始(図1、「T(Transaction)1開始」)、トランザクション終了(図1、「T(Transaction)1終了」)、更新前イメージの各ジャーナルレコード(図1、「R1:X」「R2:Y」)が出力され、累積ジャーナルには更新後イメージのジャーナルレコード(図1、「R1:A」「R2:L」)が出力される。 Here, the journal is a history of update information recorded by the system while the computer system is running. This record is used to investigate the cause and recover when the system fails. used. In this embodiment, in order to improve the output performance of the journal and expand the capacity, the journal is managed by being distributed to the base journal and the cumulative journal. For the base journal, each journal record (FIG. 1, “R1: Start of T (Transaction) 1”), transaction end (FIG. 1, “T (Transaction) 1 end”), and pre-update image journal records. X "" R2: Y ") is output, and the journal record of the updated image (" R1: A "" R2: L ") is output to the cumulative journal.
本発明の特徴は、基底ジャーナルおよび累積ジャーナルに出力されるジャーナルレコードに連番を付加することであり、かかる連番を付加したジャーナルレコードの出力例を図2に示す。 A feature of the present invention is that serial numbers are added to journal records output to the base journal and the cumulative journal, and FIG. 2 shows an output example of journal records to which such serial numbers are added.
本発明の実施形態に係るホストコンピュータ1のブロック構成図を図3に示す。なお、図3にはホストコンピュータ1の他、DB、基底ジャーナル、累積ジャーナルのセーブデータを保持する外部媒体13も参考に示している。
FIG. 3 shows a block diagram of the
ホストコンピュータ1は、トランザクション制御部2と、DBMS(database management system;データベース管理システム)3と、連番保存領域4と、連番付加部5と、ジャーナル出力部6と、ジャーナルリカバリ部7と、ジャーナル有効範囲決定部8と、バックアップ/リストア部9と、累積ジャーナル10と、基底ジャーナル11と、DB12から構成される。
The
トランザクション制御部2は、トランザクションの実行を制御し、ジャーナルの出力をDBMS3に通知する。DBMS3は、トランザクション制御部2と連携して、DB、基底ジャーナル、累積ジャーナルの入出力を制御する。
The
連番付加部5は、連番保存領域4に保存された連番を利用し、1ジャーナルレコードの出力ごとに1増加していく連番をジャーナルレコードに付加する。
The serial
ジャーナル出力部6は、累積ジャーナル10と基底ジャーナル11へジャーナルレコードを出力する。
The
ジャーナルリカバリ部7は、累積ジャーナル10と基底ジャーナル11のジャーナルレコードを元に、DB12のリカバリを行う。
The
ジャーナル有効範囲決定部8は、連番付加部5がジャーナルレコードに付加した連番を参照し、ジャーナルリカバリ部7がリカバリを行うときに利用されるジャーナルレコードの範囲を決定する。
The journal effective
バックアップ/リストア部9は、累積ジャーナル10と基底ジャーナル11とDB12を外部媒体13へのバックアップと、外部媒体13から基底ジャーナル11と累積ジャーナル10とDB12へのリストア(Restore;復元)を行う。ここで、リストアとは、プログラム作成におけるデータを元の場所に戻すことであり、具体的にはバックアップしたプログラムやデータを元に戻すことである。
The backup / restore unit 9 backs up the cumulative journal 10, the base journal 11, and the DB 12 to the
次に、本実施形態に係るDB復元方法の動作処理について図を用いて説明する。まず、ジャーナルレコード出力時の動作処理を示すフローチャート(図4)を用いて説明する。ジャーナル出力部6が基底ジャーナル11または累積ジャーナル10にジャーナルレコードを出力する時、連番付加部5は、連番保存領域4に保存されていた現在の連番を読み出し(ステップS1)、ステップS1で取得した連番に1を加算し(ステップS2)、ジャーナル出力部6が出力するジャーナルレコードへ書き込み(ステップS3)、ステップS3で連番を付加したジャーナルレコードをジャーナル出力部6を用いて基底ジャーナル11または累積ジャーナル10に出力し(ステップS4)、現在保持している連番を連番保存領域4へ書き込む(ステップS5)。
Next, operation processing of the DB restoration method according to the present embodiment will be described with reference to the drawings. First, a description will be given using a flowchart (FIG. 4) showing an operation process at the time of journal record output. When the
無停止でのバックアップは、バックアップ/リストア部9を用いて、外部媒体13にバックアップする。DBとジャーナルをバックアップする動作を図5に示す。図5では、基底ジャーナルは点線枠aで囲まれたジャーナルレコード、累積ジャーナルは点線枠bで囲まれたジャーナルレコード、DBは点線枠cで囲まれた状態がそれぞれ外部媒体13にバックアップされたとする。以降の説明も図5に示したバックアップ状態を前提として説明を行う。
Non-stop backup is backed up to the
次に、DBのリカバリ処理についてフローチャート(図6)を用いて説明する。DBのリカバリを行う時は、バックアップ/リストア部9を用いて外部媒体13から累積ジャーナル10、基底ジャーナル11、DB12へのリストアを実施し(ステップS6)、ジャーナル有効範囲決定部8を用いてリカバリに利用するジャーナルレコードの範囲を決定し(ステップS7)、ステップS7で決定されたジャーナルレコードの範囲に対しジャーナルリカバリ部7を使用しDB12のリカバリを行い(ステップS8)、DB12のリカバリが完了する。
Next, DB recovery processing will be described with reference to a flowchart (FIG. 6). When performing DB recovery, restore from the external medium 13 to the cumulative journal 10, the base journal 11, and the DB 12 using the backup / restore unit 9 (step S6), and recovery using the journal effective
次に、上記ステップS7におけるジャーナル有効範囲決定部8を用いたリカバリに利用するジャーナルレコードの範囲の決定処理を、図を用いて詳細に説明する。まず、基底ジャーナルの終端に位置づけを行い(図7 ステップS10)、トランザクション終了ジャーナルを逆順に走査する(ステップS11)。
Next, the process of determining the range of journal records used for recovery using the journal effective
図8を用いてステップS10の動作を説明する。図8の矢印で示すように、基底ジャーナルの終端からジャーナルレコード25と24を飛び越え、ジャーナルレコード23でトランザクション終了ジャーナル(「T2終了」)を見つけ、図7のステップS10の走査を完了する。
The operation of step S10 will be described with reference to FIG. As shown by the arrow in FIG. 8, the journal records 25 and 24 are skipped from the end of the base journal, the transaction end journal (“T2 end”) is found in the
次に、ステップS10で発見したトランザクション終了ジャーナル(図8 ジャーナルレコード23)に対応するトランザクション開始ジャーナル(「T2開始」)を見つけ、トランザクション開始ジャーナルからトランザクション終了ジャーナルまでの全ジャーナルレコードが全て揃っているか確認する。つまり、トランザクション開始ジャーナルが持つ連番と、トランザクション終了ジャーナルがもつ連番の間の全ての連番が、リストアされたジャーナルレコードから見つけ出せるかを検査する(図7 ステップS12)。 Next, a transaction start journal (“T2 start”) corresponding to the transaction end journal (FIG. 8 journal record 23) found in step S10 is found, and all the journal records from the transaction start journal to the transaction end journal are complete. Check. That is, it is checked whether all serial numbers between the serial numbers of the transaction start journal and the serial numbers of the transaction end journal can be found from the restored journal record (step S12 in FIG. 7).
上記ステップS12の動作について、図8を用いて詳細に説明する。トランザクション終了ジャーナル23と対応するトランザクション開始ジャーナルがジャーナルレコード20となるので、トランザクション開始ジャーナル20がもつ連番7から、トランザクション終了ジャーナル23がもつ連番12までの連番8、9、10、11が、リストアされた基底ジャーナルと累積ジャーナルのジャーナルレコードから見つけられるかを検査することとなる。図8では、連番11を持つジャーナルレコードを見つけることが出来ないため、トランザクション開始ジャーナル20で始まり、トランザクション終了ジャーナル23で終わるトランザクションT2はリカバリ不可能と判断される。
The operation in step S12 will be described in detail with reference to FIG. Since the transaction start journal corresponding to the
ステップS12での検査で、全ての連番が揃わないと判断された場合(ステップS13/No)、再びステップS11に戻り、トランザクション終了ジャーナルの走査を繰り返し、発見したトランザクション終了ジャーナルを基準にステップS12の検査を行う。 If it is determined in step S12 that all the serial numbers are not complete (step S13 / No), the process returns to step S11 again, the transaction end journal is repeatedly scanned, and the step S12 is performed based on the found transaction end journal. Perform the inspection.
図8で示した連番の検査では、連番11が見つからなかったため、再びトランザクション終了ジャーナルを逆順に走査する必要がある。再度トランザクション終了ジャーナルが発見してからの動作を図9に示す。発見されたトランザクション終了ジャーナル(「T1終了」)30と対応するトランザクション開始ジャーナル(「T1開始」)はジャーナルレコード27なので、トランザクション開始ジャーナル27が持つ連番1とトランザクション終了ジャーナル30が持つ連番6までの連番、つまり連番2、3、4、5がリストアされた基底ジャーナルと累積ジャーナルのジャーナルレコードから見つけられるかを検査することとなる。
In the serial number inspection shown in FIG. 8, since the serial number 11 was not found, it is necessary to scan the transaction end journal again in the reverse order. The operation after the transaction end journal is found again is shown in FIG. Since the transaction start journal (“T1 start”) corresponding to the found transaction end journal (“T1 end”) 30 is a
図9では、連番2、3、4、5を持つジャーナルレコードが全て発見できるため(ジャーナルレコード28、30、29、31参照)、トランザクション開始ジャーナル27で始まりトランザクション終了ジャーナル30で終わるトランザクションT1は、ジャーナルリカバリ部7でリカバリ可能であると判断される。
In FIG. 9, since all journal records having
ステップS13で全ての連番が揃っていることが確認されると(ステップS13/Yes)、ジャーナルレコードの有効範囲決定部8による有効範囲決定処理(図6のステップS7)は終了し、ジャーナルレコードの有効範囲に対してジャーナルリカバリ部7によるDBのリカバリを実施する(図6 ステップS8)。
When it is confirmed in step S13 that all the serial numbers are aligned (step S13 / Yes), the effective range determination process (step S7 in FIG. 6) by the effective
図9で有効範囲と判断されたトランザクションT1のジャーナルレコードに対してジャーナルリカバリを実施する動作を図10に示す。累積ジャーナルのジャーナルレコード33、34をロールフォワード(Roll Forward;DBに反映されていない更新情報をDBに反映すること)リカバリ(Recovery;障害回復)に使用し、DBのレコードR1、R2の上書きをする。トランザクションT1はトランザクション終了ジャーナルが出力されている完了トランザクションなので、ロールバックリカバリ(Rollback;ログ・ファイルを見て、DBを処理開始前の状態に戻すこと。)は行わずリカバリは終了する。 FIG. 10 shows an operation for performing journal recovery on the journal record of the transaction T1 determined to be the valid range in FIG. The journal records 33 and 34 of the cumulative journal are used for roll forward (Roll Forward; reflecting update information not reflected in the DB to the DB) recovery (Recovery; failure recovery), and the records R1 and R2 in the DB are overwritten. To do. Since the transaction T1 is a completed transaction for which a transaction end journal has been output, the recovery ends without performing rollback recovery (Rollback; seeing the log file and returning the DB to the state before the start of processing).
上記実施形態により、基底ジャーナルと累積ジャーナルをもつトランザクション処理システムにおいて、地震や火災などによるDBとジャーナルの両方の障害からのリカバリを目的としたバックアップのために業務を停止させる必要がなく、業務無停止で採取されたDBおよびジャーナルから、ジャーナルレコードに付加された連番を用いることで、DBのリカバリが可能になる。 According to the above embodiment, in a transaction processing system having a base journal and a cumulative journal, there is no need to stop the operation for backup for the purpose of recovery from a failure of both the DB and the journal due to an earthquake or a fire. The DB can be recovered by using the serial number added to the journal record from the DB and journal collected by the stop.
なお、各図のフローチャートに示す処理を、CPUが実行するためのプログラムは本発明によるプログラムを構成する。このプログラムを記録する記録媒体としては、半導体記憶部や光学的及び/又は磁気的な記憶部等を用いることができる。このようなプログラム及び記録媒体を、前述した各実施形態とは異なる構成のシステム等で用い、そこのCPUで上記プログラムを実行させることにより、本発明と実質的に同じ効果を得ることができる。 Note that the program for the CPU to execute the processing shown in the flowcharts of the drawings constitutes a program according to the present invention. As a recording medium for recording the program, a semiconductor storage unit, an optical and / or magnetic storage unit, or the like can be used. By using such a program and a recording medium in a system having a configuration different from that of each of the above-described embodiments and causing the CPU to execute the program, substantially the same effect as the present invention can be obtained.
以上、本発明を好適な実施の形態に基づき具体的に説明したが、本発明は上記のものに限定されるものではなく、その要旨を逸脱しない範囲で種々変更可能であることは言うまでもない。 Although the present invention has been specifically described above based on the preferred embodiments, it is needless to say that the present invention is not limited to the above-described ones and can be variously modified without departing from the gist thereof.
1 ホストコンピュータ
2 トランザクション制御部2
3 DBMS
4 連番保存領域
5 連番付加部
6 ジャーナル出力部
7 ジャーナルリカバリ部
8 ジャーナル有効範囲決定部
9 バックアップ/リストア部
10 累積ジャーナル
11 基底ジャーナル
12 DB
1
3 DBMS
4 Serial
Claims (7)
前記基底ジャーナル保存ステップに保存されたジャーナルレコードが更新された場合に、更新後のジャーナルレコードを保存する累積ジャーナル保存ステップと、
前記基底ジャーナル保存ステップと、前記累積ジャーナル保存ステップに保存されるジャーナルレコードに連番を付加する連番付加ステップと、
前記データベース、基底ジャーナル保存ステップ、前記累積ジャーナル保存ステップが有するデータを記憶媒体へバックアップするバックアップステップと、
前記記憶媒体から、データベース、基底ジャーナル保存ステップ、前記累積ジャーナル保存ステップへのリストアを実施するリストアステップと、
前記リストアしたデータベース、基底ジャーナル保存ステップ、前記累積ジャーナル保存ステップのデータに基づきデータベースをリカバリするリカバリステップと、
前記データベースのリカバリステップによるリカバリ時、前記連番付加ステップにより付加されたジャーナルレコードの連番を用いて、ジャーナルレコードの連番確認を行う連番確認ステップと、
前記連番確認ステップにより全てのジャーナルレコードが揃っていると確認できた場合のみ前記リカバリステップの対象とするリカバリ可否判断ステップと、を備えることを特徴とするデータベース復旧方法。 A base journal storage step for storing a database data file as a journal record at a predetermined time;
A cumulative journal storage step for storing the updated journal record when the journal record stored in the base journal storage step is updated;
A base number adding step for adding a serial number to journal records stored in the base journal storing step, and the cumulative journal storing step;
A backup step of backing up data stored in the database, base journal storage step, and cumulative journal storage step to a storage medium;
A restore step for performing a restore from the storage medium to a database, a base journal saving step, and the cumulative journal saving step;
A recovery step of recovering the database based on the data of the restored database, the base journal storage step, and the cumulative journal storage step;
At the time of recovery by the recovery step of the database, using the serial number of the journal record added by the serial number addition step, a serial number confirmation step of performing serial number confirmation of the journal record,
A database recovery method comprising: a recovery possibility determination step that is a target of the recovery step only when it is confirmed that all journal records are prepared by the serial number confirmation step.
前記連番確認ステップは、前記決定された有効範囲内のジャーナルレコードの連番を確認し、
前記リカバリ可否ステップは、前記決定された有効範囲内のジャーナルレコードの連番が全て揃っていると確認し、前記有効範囲内のリカバリが可能か否か判断することを特徴とする請求項1記載のデータベース復旧方法。 A recovery effective range determining step of determining an effective range of journal records used for recovery by the recovery step;
The serial number confirmation step confirms the serial number of the journal record within the determined effective range,
2. The recovery enable / disable step confirms that all serial numbers of journal records within the determined effective range are prepared, and determines whether or not recovery within the effective range is possible. Database recovery method.
前記基底ジャーナル保存手段に保存されたジャーナルレコードが更新された場合に、更新後のジャーナルレコードを保存する累積ジャーナル保存手段と、
前記基底ジャーナル保存手段と、前記累積ジャーナル保存手段に保存されるジャーナルレコードに連番を付加する連番付加手段と、
前記データベース、基底ジャーナル保存手段、前記累積ジャーナル保存手段が有するデータを記憶媒体へバックアップするバックアップ手段と、
前記記憶媒体から、データベース、基底ジャーナル保存手段、前記累積ジャーナル保存手段へのリストアを実施するリストア手段と、
前記リストアしたデータベース、基底ジャーナル保存手段、前記累積ジャーナル保存手段のデータに基づきデータベースをリカバリするリカバリ手段と、
前記データベースのリカバリ手段によるリカバリ時、前記連番付加手段により付加されたジャーナルレコードの連番を用いて、ジャーナルレコードの連番確認を行う連番確認手段と、
前記連番確認手段により全てのジャーナルレコードが揃っていると確認できた場合のみ前記リカバリ手段の対象とするリカバリ可否判断手段と、を備えることを特徴とするデータベース復旧装置。 Base journal storage means for storing a database data file as a journal record at a predetermined time point;
Cumulative journal storage means for storing the updated journal record when the journal record stored in the base journal storage means is updated;
Said base journal storage means; serial number addition means for adding serial numbers to journal records stored in said cumulative journal storage means;
Backup means for backing up the data stored in the database, base journal storage means, and cumulative journal storage means to a storage medium;
A restore unit for performing a restore from the storage medium to a database, a base journal storage unit, and the cumulative journal storage unit;
Recovery means for recovering the database based on data of the restored database, base journal storage means, and cumulative journal storage means;
At the time of recovery by the database recovery means, serial number confirmation means for performing serial number confirmation of journal records using the serial number of journal records added by the serial number addition means,
A database recovery apparatus comprising: a recovery possibility determination unit that is a target of the recovery unit only when it is confirmed by the serial number confirmation unit that all journal records are available.
前記基底ジャーナル保存処理に保存されたジャーナルレコードが更新された場合に、更新後のジャーナルレコードを保存する累積ジャーナル保存処理と、
前記基底ジャーナル保存処理と、前記累積ジャーナル保存処理に保存されるジャーナルレコードに連番を付加する連番付加処理と、
前記データベース、基底ジャーナル保存処理、前記累積ジャーナル保存処理が有するデータを記憶媒体へバックアップするバックアップ処理と、
前記記憶媒体から、データベース、基底ジャーナル保存処理、前記累積ジャーナル保存処理へのリストアを実施するリストア処理と、
前記リストアしたデータベース、基底ジャーナル保存処理、前記累積ジャーナル保存処理のデータに基づきデータベースをリカバリするリカバリ処理と、
前記データベースのリカバリ処理によるリカバリ時、前記連番付加処理により付加されたジャーナルレコードの連番を用いて、ジャーナルレコードの連番確認を行う連番確認処理と、
前記連番確認処理により全てのジャーナルレコードが揃っていると確認できた場合のみ前記リカバリ処理の対象とするリカバリ可否判断処理と、をコンピュータに実行させることを特徴とするデータベース復旧プログラム。 Base journal storage processing for storing database data files as journal records at a predetermined time point;
A cumulative journal storage process that stores the updated journal record when the journal record stored in the base journal storage process is updated;
A serial number addition process for adding serial numbers to journal records stored in the base journal storage process, and the cumulative journal storage process;
Backup processing for backing up data stored in the database, base journal storage processing, and cumulative journal storage processing to a storage medium;
A restore process for performing a restore from the storage medium to a database, a base journal save process, and the cumulative journal save process;
A recovery process for recovering the database based on the restored database, base journal saving process, and cumulative journal saving process data;
At the time of recovery by the recovery process of the database, using the serial number of the journal record added by the serial number addition process, a serial number confirmation process for performing serial number confirmation of the journal record,
A database recovery program that causes a computer to execute a recovery possibility determination process that is a target of the recovery process only when it can be confirmed that all journal records are prepared by the serial number confirmation process.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007091634A JP4730330B2 (en) | 2007-03-30 | 2007-03-30 | Database recovery method, database recovery device, and database recovery program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007091634A JP4730330B2 (en) | 2007-03-30 | 2007-03-30 | Database recovery method, database recovery device, and database recovery program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2008250717A JP2008250717A (en) | 2008-10-16 |
JP4730330B2 true JP4730330B2 (en) | 2011-07-20 |
Family
ID=39975579
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2007091634A Expired - Fee Related JP4730330B2 (en) | 2007-03-30 | 2007-03-30 | Database recovery method, database recovery device, and database recovery program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4730330B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP7007017B2 (en) * | 2018-03-22 | 2022-01-24 | Necソリューションイノベータ株式会社 | Storage systems, control methods, and programs |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH08235044A (en) * | 1995-02-28 | 1996-09-13 | N T T Data Tsushin Kk | Journal retrieval systm |
JP2001306379A (en) * | 2000-04-19 | 2001-11-02 | Nec Soft Ltd | Method and device for automatically recovering data at occurrence of fault and storage medium |
JP2004062781A (en) * | 2002-07-31 | 2004-02-26 | Fujitsu Ltd | Information managing device |
JP2004062759A (en) * | 2002-07-31 | 2004-02-26 | Hitachi Ltd | Database log management method, its device and its program |
US7065589B2 (en) * | 2003-06-23 | 2006-06-20 | Hitachi, Ltd. | Three data center remote copy system with journaling |
JP4377790B2 (en) * | 2004-09-30 | 2009-12-02 | 株式会社日立製作所 | Remote copy system and remote copy method |
JP2006279501A (en) * | 2005-03-29 | 2006-10-12 | Nec Corp | Mailbox system and device and journal transfer control method therefor |
-
2007
- 2007-03-30 JP JP2007091634A patent/JP4730330B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2008250717A (en) | 2008-10-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8566282B2 (en) | Creating a buffer point-in-time copy relationship for a point-in-time copy function executed to create a point-in-time copy relationship | |
JP4321705B2 (en) | Apparatus and storage system for controlling acquisition of snapshot | |
US7720817B2 (en) | Method and system for browsing objects on a protected volume in a continuous data protection system | |
US20070185923A1 (en) | Database recovery method applying update journal and database log | |
JP2004501449A (en) | Differential logging method and apparatus for parallel recovery operation in main memory transaction processing system | |
CN110188068B (en) | Volume-level backup method and device for guaranteeing consistency of file system data | |
US10613923B2 (en) | Recovering log-structured filesystems from physical replicas | |
JP2014142852A (en) | Storage system and control device | |
CN104166605A (en) | Data backup method and system based on incremental data files | |
JP5720366B2 (en) | File management system and backup method | |
TW201516655A (en) | System and method for recovering distributed file system | |
CN114356650A (en) | Data backup method, device, equipment, system and storage medium | |
JP4730330B2 (en) | Database recovery method, database recovery device, and database recovery program | |
EP0881569A2 (en) | File system and file management method which realize distributed replication in system having shared type raid | |
JP2013235317A (en) | Virtual computer system | |
JP2008033778A (en) | Computer system, database restoration method, and database restoration program | |
JP2007188463A (en) | Failure recovering method and recording apparatus | |
KR102049417B1 (en) | Data storing and restoring method based on In-memory database using NVDIMM | |
CN112596954B (en) | Data backup and reconstruction method, device, equipment and storage medium | |
CN104461782A (en) | Method for redirecting read-write data of iSCSI mounting volume and backup and recovery system thereof | |
JP2003280963A (en) | Document management system, restoration method, program for performing restoration, and recording medium with program recorded thereon | |
JP5180578B2 (en) | Business continuity system | |
JP5952631B2 (en) | Information processing apparatus, snapshot creation program, and method | |
JPWO2014147707A1 (en) | Information processing apparatus, information processing method, and information processing program | |
US9104620B2 (en) | Backup method and information processing apparatus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20110311 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20110322 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20110404 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140428 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 4730330 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |