JP3514332B2 - Database backup method - Google Patents
Database backup methodInfo
- Publication number
- JP3514332B2 JP3514332B2 JP21098494A JP21098494A JP3514332B2 JP 3514332 B2 JP3514332 B2 JP 3514332B2 JP 21098494 A JP21098494 A JP 21098494A JP 21098494 A JP21098494 A JP 21098494A JP 3514332 B2 JP3514332 B2 JP 3514332B2
- Authority
- JP
- Japan
- Prior art keywords
- update
- secondary storage
- processing
- type
- type field
- 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 - Lifetime
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Description
【発明の詳細な説明】
【0001】
【産業上の利用分野】本発明は、主記憶上に全データベ
ースが常駐し、2次記憶上にデータベースデータのバッ
クアップとログ情報を持つメモリデータベースのバック
アップを作成する方法に関する。
【0002】
【従来の技術】メモリデータベースは、データベースに
含まれる全テーブルをメモリ上に常駐することにより、
高速なデータベースアクセスを実現する方法である。
【0003】一般に、メモリデータベースの運用では、
応用プログラムの障害やデータベース管理システムを含
んだシステムの障害、あるいは固定ディスクなどの2次
記憶の媒体障害などの、種々の障害が発生する。そのた
めに、データベースのバックアップを2次記憶に取得
し、障害が発生したときには、このバックアップしたデ
ータよりデータベースを復元することが行われる。
【0004】以下、従来のメモリデータベースにおける
バックアップ方法を説明する。
【0005】データベースアクセスを行うトランザクシ
ョンからUPDATE/INSERT/DELETEな
どのステートメントに基づく更新処理が、メモリデータ
ベースに格納されているテーブルに対して行われると、
更新部分がI/Oバッファに格納され、さらに更新対象
の更新前の値と更新後の値がそれぞれ、更新前ログバッ
ファと更新後ログバッファに時間順に格納される。これ
らのうち、更新前ログについては、該トランザクション
が異常終了したときにメモリ上でデータベースを更新前
の状態に戻すロールバック処理に使われる。更新後ログ
については、該トランザクションが正常終了したとき
に、2次記憶上に出力され、I/Oバッファからバック
アップを更新している最中に発生するシステム障害に備
える。また、I/Oバッファについては、該トランザク
ションが正常終了したときに、2次記憶上のデータベー
スのバックアップを更新するのに使われる。
【0006】これらの更新処理のうち、更新結果を2次
記憶に取得する必要がない場合がある。そのような例と
して、1つの電話番号で複数の回線を使用する代表電話
サービスがある。一般的に、この例をデータベースを用
いて管理する場合、電話番号と準備された回線の空き数
を示すカラムからなるテーブルを作成する。そのテーブ
ルに対して、以下のような操作を行う。
(1)新規にサービスを登録する処理
INSERTステートメントにより、新規に登録する電
話番号とその番号に準備された回線数からなるデータを
テーブルに挿入する。
(2)該当電話番号への呼び出し処理
SELECTステートメントにより、現在該当電話番号
に許されている回線数を参照する。そして空き回線があ
れば、UPDATEステートメントにより、許されてい
る回線数を1だけデクリメントした値でテーブルを更新
する。その後に該当回線への接続処理を行う。
(3)該当回線への電話の切断処理
該当回線の切断処理を行う。SELECTステートメン
トにより現在該当電話番号に許されている回線数を参照
し、その値を1だけインクリメントした値で、UPDA
TEステートメントによりテーブルを更新する。
(4)準備された回線数の変更処理
UPDATEステートメントにより新規回線数をテーブ
ルに反映する。
(5)代表電話サービスを停止処理
DELETEステートメントによりテーブルに挿入した
該当電話番号とその番号に許される回線数を削除する。
【0007】また、本データベースのリカバリ処理で
は、テーブルが初期状態に戻されるために全回線が未使
用状態になる。そのため、1つの電話番号に許される回
線数は上記の(1),(4),(5)のどれかの処理の
うち、最新値を復元すればよく、(2),(3)の更新
結果についてはバックアップを行う必要がない。
【0008】
【発明が解決しようとする課題】この例のように、更新
対象のテーブルによっては、UPDATEステートメン
トにより変更される処理結果をバックアップする必要が
ない場合がある。しかし、従来の方法では、このバック
アップを行う必要がない更新についても、2次記憶上の
バックアップとログ情報を更新していた。
【0009】これらの2次記憶を更新するのにはI/O
処理が必要となる。一般的に、I/O処理には、数ミリ
秒から数十ミリ秒の処理時間が必要となる。そのため、
このような不要なバックアップを行うため、トランザク
ションの処理時間が長くなるという問題がある。
【0010】本発明の目的は、トランザクションの処理
時間を短縮するデータベースバックアップ方法を提供す
ることである。
【0011】
【課題を解決するための手段】本発明のデータベースバ
ックアップ方法は、データが格納されるテーブルに対し
て、処理結果を2次記憶からのリカバリ処理で常に保証
する種別と、特定の更新処理に対してのみ2次記憶から
のリカバリ処理で保証する種別を指定するフィールドで
あるデータ種別フィールドをデータベース管理情報に設
け、データベースにアクセスするトランザクションに対
して、更新ステートメントの処理結果を2次記憶からの
リカバリ処理で常に保証する種別と、特定のテーブルに
対しては保証しない種別を指定するフィールドである処
理種別フィールドをトランザクション管理情報に設け、
トランザクションの正常終了時に、挿入ステートメント
と削除ステートメントについては、処理結果の2次記憶
上のバックアップへの反映と更新後の値のログ情報の追
加を行い、更新ステートメントについては、前記データ
種別フィールドが処理結果を2次記憶からのリカバリ処
理で常に保証する種別であるならば、前記処理種別フィ
ールドの種別によらず、2次記憶上のバックアップに対
する更新結果の反映と更新後の値のログ情報への追加を
行い、前記データ種別フィールドが特定の更新処理に対
してのみ2次記憶からのリカバリ処理で保証する種別
で、前記処理種別フィールドが更新ステートメントの処
理結果を2次記憶からのリカバリ処理で常に保証する種
別ならば、2次記憶上のバックアップに対する更新結果
の反映と更新後の値のログ情報への追加を行い、前記デ
ータ種別フィールドが特定の更新処理に対してのみ2次
記憶からのリカバリ処理で保証する種別で、前記処理種
別フィールドが更新ステートメントの処理結果を2次記
憶からのリカバリ処理で特定のテーブルに対しては保証
しない種別ならば、2次記憶上のバックアップに対する
更新結果の反映もログ情報の更新も行なわない。
【0012】
【作用】本発明では、データベースに格納されているテ
ーブルに対して、テーブル作成時に常にデータをバック
アップする種別(パーシステント指定)と、更新処理を
行うトランザクションの種別によってはバックアップを
行わない種別(テンポラリ指定)を指定するデータ種別
フィールドをスキーマ情報に追加し設定する。また、更
新処理を行うトランザクションに対して、該トランザク
ションから発行されるUPDATEステートメントの処
理結果を、常に2次記憶上で保証する種別(全保証指
定)と、処理対象テーブルによっては2次記憶上で保証
しない場合がある種別(非保証指定)を指定する処理種
別フィールドをトランザクション管理情報に追加し設定
する。
【0013】そして、トランザクションの終了契機に、
INSERT/DELETEステートメントに基づいた
更新処理の結果については、データ種別フィールドおよ
び処理種別フィールドの指定値によらず、更新後ログの
出力と2次記憶上のバックアップに対して反映を行う。
【0014】UPDATEステートメントに基づいた更
新処理の結果については、(1)データ種別フィールド
がパーシステント指定のときは、処理種別フィールドの
指定値によらず、更新後ログの出力と2次記憶上のバッ
クアップに対して反映を行い、(2)データ種別フィー
ルドがテンポラリ指定で、処理種別フィールドが全保証
指定のときは、更新後ログの出力と2次記憶上のバック
アップに対して反映を行い、(3)データ種別フィール
ドがテンポラリ指定で、処理種別フィールドが非保証指
定のときは、更新後ログの出力と2次記憶上のバックア
ップに対する反映は行わない。
【0015】このように、本発明では、データ種別がテ
ンポラリ指定であるテーブルに対して、処理種別が非保
証指定であるトランザクションからのUPDATEステ
ートメントによる更新処理についてはI/Oを行わない
ため、トランザクションの処理時間を短縮できる。
【0016】
【実施例】次に、本発明の実施例について図面を参照し
て説明する。
【0017】図1は本発明の一実施例で、テーブルを作
成する処理を実現する構成を説明するための図である。
【0018】テーブル作成機構102はテーブル作成命
令101により起動されてメモリDB103上にテーブ
ル104とデータ種別フィールド105を作成する。ま
た、テーブル作成機構102は2次記憶106上にテー
ブル104のバックアップ107とデータ種別フィール
ド105のバックアップ108を作成する。
【0019】図2は図1に示された構成において、テー
ブル104を作成する処理のフローチャートである。
(1)テーブル作成命令101は、テーブル作成機構1
02を起動する(ステップ200)。
(2)テーブル作成機構102は、テーブル作成命令1
01のパラメータによりメモリDB103上にテーブル
104を作成する(ステップ201)。
(3)テーブル作成機構102は、メモリDB103上
にテーブル104のデータ種別フィールド105を作成
する(ステップ202)。
(4)テーブル作成機構102は、テーブル作成命令1
01のパラメータにより、データ種別フィールド105
に常にデータをバックアップする種別(パーシステント
指定とする)と、更新処理を行うトランザクションの種
別によってはバックアップを行わない種別(テンポラリ
指定とする)のどちらかを設定する(ステップ20
3)。
(5)テーブル作成機構102は、2次記憶106上に
テーブル104のバックアップ107を作成する(ステ
ップ204)。
(6)テーブル作成機構102は、2次記憶106上に
データ種別フィールド105のバックアップ108を作
成する(ステップ205)。
【0020】以上の手続きにより、データ種別が指定さ
れたテーブル104がメモリDB103上に作成され
る。
【0021】図3は、本発明に基づいて、トランザクシ
ョンからの2次記憶の更新処理を実現する構成を説明す
るための図である。
【0022】トランザクション109は開始命令110
と更新命令111と終了命令112を含む。アクセス機
構113はトランザクションの開始、更新、終了の各処
理を行う。
【0023】図4は、図3の構成に基づくトランザクシ
ョンの開始処理のフローチャートである。
【0024】トランザクションの開始処理は以下の手続
きで行われる。
(1)開始命令110はアクセス機構113にトランザ
クションの開始を指示する(ステップ300)。
(2)アクセス機構113は、メモリDB103上に該
トランザクション109の処理種別フィールド114を
確保する(ステップ301)。
(3)アクセス機構113は、開始命令110のパラメ
ータにしたがい、該トランザクション109から発行さ
れるUPDATEステートメントの処理結果を常に2次
記憶106上に保証する種別(全保証指定とする)と処
理対象テーブルによっては、2次記憶106上で保証し
ない場合がある種別(非保証指定とする)を処理種別フ
ィールド114に設定する(ステップ302)。
【0025】図5は、図3の構成に基づく、トランザク
ションの更新処理のフローチャートである。
【0026】トランザクションの更新処理は以下の手続
きで行われる。
(1)更新命令111はアクセス機構113にデータベ
ースの更新を指示する(ステップ400)。
(2)アクセス機構113は更新命令111から発行さ
れたUPDATE/INSERT/DELETEステー
トメントにしたがい、テーブル104の更新前の値を更
新前ログバッファ115に時間順に格納する(ステップ
401)。
(3)アクセス機構113は更新命令110から発行さ
れたUPDATE/INSERT/DELETEステー
トメントにしたがい、更新対象のテーブル104を更新
する(ステップ402)。
(4)更新ステートメントを判定する(ステップ40
3)。
(5)更新命令111から発行されたステートメントが
INSERTかDELETEのときは、アクセス機構1
13は、(3)で行ったテーブル104の更新結果をI
/Oバッファ117に格納する(ステップ404)。
(6)アクセス機構113は、テーブル104の更新後
の値を更新後ログバッファ116に時間順に格納する
(ステップ405)。
(7)更新命令111から発行されたステートメントが
UPDATEのときは更新テーブル104のデータ種別
フィールド105を判定する(ステップ406)。
(8)データ種別フィールド105がパーシステントの
ときは、(5),(6)の処理を行う。
(9)データ種別フィールド105がテンポラリのとき
は、処理種別フィールド114を判定する(ステップ4
07)。
(10)トランザクションの処理種別フィールド114
が全保証のときは(5),(6)の処理を行う。非保証
のときはそのまま終る。
【0027】図6は、図3の構成に基づく、トランザク
ションの終了処理のフローチャートである。
【0028】トランザクションの終了処理は以下の手続
きで行われる。
(1)終了命令112は、アクセス機構113にトラン
ザクションの終了を指示する(ステップ500)。
(2)終了命令112を判定する(ステップ501)。
(3)アクセス機構113は、終了命令112よりCO
MMITが発行された場合、アクセス機構113は、更
新後ログバッファ116の内容を、2次記憶106上の
更新後ログファイル118に追加する(ステップ50
2)。
(4)アクセス機構113は、I/Oバッファ117の
内容を、2次記憶106上のテーブルバックアップ10
7に反映する(ステップ503)。
(5)終了命令112がROLLBACKのとき、アク
セス機構113は、更新前ログバッファ115に基づい
て、テーブル104への更新処理をロールバックに指示
する(ステップ504)。
【0029】以上の手続きにより、データ種別がテンポ
ラリのテーブルに対して、処理種別が非保証のトランザ
クションから発行されるUPDATEステートメントの
更新処理の結果については、2次記憶106に反映され
ず、その分のI/Oを削減できる。
【0030】図7は、本発明に基づいて、取得した2次
記憶106上のテーブルバックアップ107と更新後ロ
グ情報とデータ種別フィールド105からデータベース
を復元する処理を実現する構成を説明するための図であ
る。
【0031】復元機構120は復元命令119によりデ
ータベースを復元する処理を行う。
【0032】図8は、図7の構成に基づくデータベース
の復元処理のフローチャートである。
【0033】データベースの復元処理は以下の手続きに
より行われる。
(1)復元命令119は、復元機構120にデータベー
スの復元を指示する(ステップ600)。
(2)復元機構120は、2次記憶106上にあるテー
ブル104のバックアップ107をメモリDB103上
にロードする(ステップ601)。
(3)復元機構120は、2次記憶106上にあるデー
タ種別フィールド121の値をデータ種別フィールド1
05に設定する(ステップ602)。
(4)全テーブルについて(2),(3)の処理が終了
したかどうか判定する(ステップ603)。終了してい
なければ、(2),(3)の処理を繰り返す。
(5)全テーブルについて(2),(3)の処理が終了
したならば、復元機構120は、更新後ログファイル1
18を時間順に読み出し、メモリDB103上のテーブ
ル104を更新する。
【0034】以上の手続きにより、データ種別がパーシ
ステントに指定されたテーブルについては、常に最新値
が保証され、データ種別がテンポラリに指定されたテー
ブルについては、INSERTステートメントか、処理
種別が全保証であるトランザクションのUPDATEス
テートメントのうち、最新の更新値が復元される。
【0035】
【発明の効果】以上説明したように、本発明は、データ
種別フィールドをデータベース管理情報に設け、処理種
別フィールドをトランザクション管理情報に設け、障害
時にデータベースを復元するのに必要な更新処理の結果
のみ2次記憶へ取得することにより、更新処理内のI/
Oを削減することができ、これにより、従来に比べて高
速なDBアクセスが可能となる効果がある。Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a backup of database data and a backup of a memory database having log information on a secondary storage. How to create. 2. Description of the Related Art A memory database stores all tables contained in the database on a memory, thereby providing a memory database.
This is a method to realize high-speed database access. In general, in the operation of a memory database,
Various failures occur, such as a failure of an application program, a failure of a system including a database management system, or a failure of a secondary storage medium such as a fixed disk. For this reason, a backup of the database is acquired in the secondary storage, and when a failure occurs, the database is restored from the backed up data. Hereinafter, a conventional backup method for a memory database will be described. When an update process based on a statement such as UPDATE / INSERT / DELETE is performed on a table stored in a memory database from a transaction for performing database access,
The updated portion is stored in the I / O buffer, and the pre-update value and the post-update value to be updated are stored in the pre-update log buffer and the post-update log buffer, respectively, in chronological order. Of these, the pre-update log is used for rollback processing for returning the database to the pre-update state on the memory when the transaction ends abnormally. The post-update log is output to the secondary storage when the transaction ends normally, to prepare for a system failure that occurs while updating the backup from the I / O buffer. The I / O buffer is used to update the database backup on the secondary storage when the transaction ends normally. [0006] Of these update processes, it may not be necessary to obtain the update result in the secondary storage. One such example is a representative telephone service that uses multiple lines with one telephone number. In general, when this example is managed using a database, a table including columns indicating telephone numbers and the number of available lines is prepared. The following operation is performed on the table. (1) Processing for Registering a New Service According to an INSERT statement, data including a telephone number to be newly registered and the number of lines prepared for the number is inserted into a table. (2) Call processing to the corresponding telephone number The number of lines currently permitted for the corresponding telephone number is referred to by the SELECT statement. If there is a free line, the UPDATE statement updates the table with a value obtained by decrementing the number of permitted lines by one. After that, connection processing to the corresponding line is performed. (3) Processing for disconnecting the telephone line to the relevant line The processing for disconnecting the relevant line is performed. UPDA refers to the number of lines currently permitted for the telephone number by the SELECT statement, and increments the value by 1.
Update the table with the TE statement. (4) Change processing of the prepared number of lines The number of new lines is reflected in the table by the UPDATE statement. (5) Stop the representative telephone service Delete the corresponding telephone number inserted into the table by the DELETE statement and the number of lines permitted by the number. Further, in the recovery processing of this database, all the lines are in an unused state because the table is returned to the initial state. Therefore, the number of lines permitted for one telephone number can be obtained by restoring the latest value in any of the above processes (1), (4) and (5), and updating (2) and (3). There is no need to back up the results. [0008] As in this example, depending on the table to be updated, it may not be necessary to back up the processing result changed by the UPDATE statement. However, according to the conventional method, the backup and the log information on the secondary storage are updated even for the update that does not require the backup. To update these secondary storages, I / O
Processing is required. Generally, I / O processing requires a processing time of several milliseconds to several tens of milliseconds. for that reason,
Since such unnecessary backup is performed, there is a problem that the transaction processing time becomes long. [0010] It is an object of the present invention to provide a database backup method for reducing transaction processing time. [0011] According to the database backup method of the present invention, for a table in which data is stored, a type for which a processing result is always guaranteed by recovery processing from secondary storage, and a specific update method A data type field, which is a field for specifying a type guaranteed by the recovery process from the secondary storage for the process only, is provided in the database management information, and the processing result of the update statement is stored in the secondary storage for the transaction accessing the database. The transaction management information is provided with a processing type field which is a field for designating a type that is always guaranteed by the recovery process from the above and a type that is not guaranteed for a specific table,
At the end of normal transaction, for insert statements and delete statements, the processing result is reflected in the backup on the secondary storage and log information of the updated value is added. For the update statement, the data type field is processed. If the type is such that the result is always guaranteed in the recovery process from the secondary storage , the process type file
Regardless of the field type, backup to secondary storage
Update results and add the updated values to the log information.
And the data type field corresponds to a specific update process.
Type guaranteed by recovery processing from secondary storage only
If the processing type field guarantees the processing result of the update statement in the recovery processing from the secondary storage at all times , the update result is reflected in the backup on the secondary storage and the updated value is added to the log information. And the data type field is a type that guarantees only a specific update process in the recovery process from the secondary storage, and the process type field is a type in which the processing result of the update statement is specified in the recovery process from the secondary storage . Guaranteed for tables
If you do not type, for backups on secondary storage
Reflection of the update result also does not perform also updates the log information. According to the present invention, backup of a table stored in a database is not performed depending on the type of data that is always backed up at the time of table creation (persistent designation) and the type of transaction that performs update processing. Add a data type field that specifies the type (temporary specification) to the schema information and set it. In addition, for the transaction for which the update process is performed, the type (all guarantee designation) that always guarantees the processing result of the UPDATE statement issued from the transaction on the secondary storage and, depending on the processing target table, the secondary storage A process type field that specifies a type that may not be guaranteed (non-guaranteed specification) is added to the transaction management information and set. [0013] Then, at the end of the transaction,
Regarding the result of the update processing based on the INSERT / DELETE statement, the updated log output and the backup on the secondary storage are reflected regardless of the specified values of the data type field and the processing type field. Regarding the result of the update process based on the UPDATE statement, (1) When the data type field is persistently specified, the output of the updated log and the secondary storage in the secondary storage are performed regardless of the specified value of the process type field. (2) When the data type field is specified as temporary and the processing type field is specified as all guarantees, the update is performed on the output of the updated log and the backup on the secondary storage. 3) When the data type field is temporary and the processing type field is non-guaranteed, the output of the updated log and the reflection on the backup on the secondary storage are not performed. As described above, according to the present invention, the I / O is not performed for the update processing by the UPDATE statement from the transaction whose processing type is non-guaranteed for a table whose data type is temporary specification. Processing time can be reduced. Next, an embodiment of the present invention will be described with reference to the drawings. FIG. 1 is a diagram for explaining a configuration for realizing a process for creating a table in one embodiment of the present invention. The table creation mechanism 102 is activated by the table creation command 101 and creates a table 104 and a data type field 105 on the memory DB 103. The table creation mechanism 102 creates a backup 107 of the table 104 and a backup 108 of the data type field 105 on the secondary storage 106. FIG. 2 is a flowchart of a process for creating the table 104 in the configuration shown in FIG. (1) The table creation instruction 101 is the table creation mechanism 1
02 is started (step 200). (2) The table creation mechanism 102 executes the table creation instruction 1
A table 104 is created on the memory DB 103 using the parameter 01 (step 201). (3) The table creation mechanism 102 creates the data type field 105 of the table 104 on the memory DB 103 (Step 202). (4) The table creation mechanism 102 executes the table creation instruction 1
01, the data type field 105
In this case, one of a type for always backing up data (designated as persistent) and a type for not performing backup (designated as temporary) is set depending on the type of transaction for which update processing is performed (step 20).
3). (5) The table creation mechanism 102 creates a backup 107 of the table 104 on the secondary storage 106 (Step 204). (6) The table creation mechanism 102 creates a backup 108 of the data type field 105 on the secondary storage 106 (Step 205). According to the above procedure, the table 104 in which the data type is specified is created on the memory DB 103. FIG. 3 is a diagram for explaining a configuration for realizing a process of updating a secondary storage from a transaction according to the present invention. The transaction 109 is a start instruction 110
And an update instruction 111 and an end instruction 112. The access mechanism 113 performs each process of starting, updating, and ending a transaction. FIG. 4 is a flowchart of a transaction start process based on the configuration of FIG. The transaction start processing is performed according to the following procedure. (1) The start command 110 instructs the access mechanism 113 to start a transaction (step 300). (2) The access mechanism 113 secures the processing type field 114 of the transaction 109 on the memory DB 103 (Step 301). (3) In accordance with the parameters of the start instruction 110, the access mechanism 113 always guarantees the processing result of the UPDATE statement issued from the transaction 109 on the secondary storage 106 (designated as all guarantees) and the processing target table In some cases, a type that may not be guaranteed on the secondary storage 106 (designated as non-guaranteed) is set in the processing type field 114 (step 302). FIG. 5 is a flowchart of a transaction update process based on the configuration of FIG. The transaction update processing is performed according to the following procedure. (1) The update instruction 111 instructs the access mechanism 113 to update the database (step 400). (2) In accordance with the UPDATE / INSERT / DELETE statement issued from the update instruction 111, the access mechanism 113 stores the pre-update values of the table 104 in the pre-update log buffer 115 in chronological order (step 401). (3) The access mechanism 113 updates the update target table 104 according to the UPDATE / INSERT / DELETE statement issued from the update instruction 110 (step 402). (4) Determine update statement (step 40)
3). (5) When the statement issued from the update instruction 111 is INSERT or DELETE, the access mechanism 1
13 shows the result of updating the table 104 performed in (3) as I
It is stored in the / O buffer 117 (step 404). (6) The access mechanism 113 stores the updated values of the table 104 in the updated log buffer 116 in chronological order (step 405). (7) When the statement issued from the update instruction 111 is UPDATE, the data type field 105 of the update table 104 is determined (step 406). (8) If the data type field 105 is persistent, the processing of (5) and (6) is performed. (9) If the data type field 105 is temporary, the processing type field 114 is determined (step 4).
07). (10) Transaction processing type field 114
If is guaranteed, the processing of (5) and (6) is performed. In the case of non-guarantee, it ends as it is. FIG. 6 is a flowchart of a transaction end process based on the configuration of FIG. The transaction end processing is performed according to the following procedure. (1) The end command 112 instructs the access mechanism 113 to end the transaction (Step 500). (2) Determine the end command 112 (step 501). (3) The access mechanism 113 sends CO
When the MMIT is issued, the access mechanism 113 adds the contents of the post-update log buffer 116 to the post-update log file 118 on the secondary storage 106 (step 50).
2). (4) The access mechanism 113 stores the contents of the I / O buffer 117 in the table backup 10 on the secondary storage 106.
7 (step 503). (5) When the end instruction 112 is ROLLBACK, the access mechanism 113 instructs the update processing to the table 104 to rollback based on the pre-update log buffer 115 (step 504). According to the above procedure, the result of the update processing of the UPDATE statement issued from the transaction whose processing type is not guaranteed for the table whose data type is temporary is not reflected in the secondary storage 106, but is updated accordingly. I / O can be reduced. FIG. 7 is a diagram for explaining a configuration for realizing a process of restoring a database from the acquired table backup 107 on the secondary storage 106, updated log information, and the data type field 105 according to the present invention. It is. The restoration mechanism 120 performs a process of restoring the database according to the restoration instruction 119. FIG. 8 is a flowchart of a database restoration process based on the configuration of FIG. The database is restored according to the following procedure. (1) The restore command 119 instructs the restore mechanism 120 to restore the database (step 600). (2) The restoration mechanism 120 loads the backup 107 of the table 104 on the secondary storage 106 into the memory DB 103 (Step 601). (3) The restoration mechanism 120 sets the value of the data type field 121 on the secondary storage 106 to the data type field 1
05 (step 602). (4) It is determined whether the processing of (2) and (3) has been completed for all tables (step 603). If not completed, the processes of (2) and (3) are repeated. (5) When the processes of (2) and (3) are completed for all tables, the restoration mechanism 120
18 are read out in order of time, and the table 104 in the memory DB 103 is updated. By the above procedure, the latest value is always guaranteed for a table whose data type is designated as persistent, and the INSERT statement or the processing type is guaranteed for a table whose data type is designated as temporary. The latest update value of the UPDATE statement of a certain transaction is restored. As described above, according to the present invention, the data type field is provided in the database management information, the processing type field is provided in the transaction management information, and the update processing necessary for restoring the database in the event of a failure. By obtaining only the result of I / O to the secondary storage, the I /
O can be reduced, thereby providing an effect that DB access can be performed at a higher speed than before.
【図面の簡単な説明】
【図1】テーブルを作成する処理を実現する構成を説明
するための図である。
【図2】テーブルを作成する処理のフローチャートであ
る。
【図3】トランザクションからの2次記憶106の更新
処理を実現する構成を説明するための図である。
【図4】トランザクションの開始処理のフローチャート
である。
【図5】トランザクションの更新処理のフローチャート
である。
【図6】トランザクションの終了処理のフローチャート
である。
【図7】取得した2次記憶106上のテーブルバックア
ップ107と更新後ログ情報とデータ種別フィールド1
05からデータベースを復元する処理を実現する構成を
説明するための図である。
【図8】データベースの復元処理のフローチャートであ
る。
【符号の説明】
101 テーブル作成命令
102 テーブル作成機構
103 メモリDB
104 データ種別フィールド
105 テーブル
106 2次記憶
107 テーブルバックアップ
108 データ種別フィールド
109 トランザクション
110 開始命令
111 更新命令
112 終了命令
113 アクセス機構
114 処理種別フィールド
115 更新前ログバッファ
116 更新後ログバッファ
117 I/Oバッファ
118 更新後ログファイル
119 復元命令
120 復元機構
200〜205 ステップ
300〜302 ステップ
400〜407 ステップ
500〜504 ステップ
600〜604 ステップBRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a diagram for explaining a configuration for realizing a process for creating a table. FIG. 2 is a flowchart of a process for creating a table. FIG. 3 is a diagram for explaining a configuration for realizing a process of updating a secondary storage from a transaction; FIG. 4 is a flowchart of a transaction start process. FIG. 5 is a flowchart of a transaction update process. FIG. 6 is a flowchart of a transaction end process. FIG. 7 shows an acquired table backup 107 on the secondary storage 106, log information after update, and data type field 1
FIG. 14 is a diagram for explaining a configuration for realizing a process of restoring a database from the database 05. FIG. 8 is a flowchart of a database restoration process. [Description of Signs] 101 Table creation instruction 102 Table creation mechanism 103 Memory DB 104 Data type field 105 Table 106 Secondary storage 107 Table backup 108 Data type field 109 Transaction 110 Start instruction 111 Update instruction 112 End instruction 113 Access mechanism 114 Processing type Field 115 Log buffer before update 116 Log buffer after update 117 I / O buffer 118 Log file after update 119 Restore instruction 120 Restore mechanism 200 to 205 Step 300 to 302 Step 400 to 407 Step 500 to 504 Step 600 to 604 Step
フロントページの続き (56)参考文献 特開 平5−61751(JP,A) 特開 平3−78047(JP,A) Jagadish H.V.,Rec overing From Main− Memory Lapse,Proce edings of the 19th VLDB Conference,米 国,1993年,p.391−404,URL,h ttp://www.informat ik.uni−trier.de/〜l ey/db/conf/vldb/Ja gadishSS93.html (58)調査した分野(Int.Cl.7,DB名) G06F 12/00 Continuation of front page (56) References JP-A-5-61751 (JP, A) JP-A-3-78047 (JP, A) V. , Recovering From Main-Memory Lapse, Proceedings of the 19th VLDB Conference, USA, 1993, p. 391-404, URL, http: // www. inform ik. uni-trier. de / ~ ley / db / conf / vldb / J gadish SS93. html (58) Field surveyed (Int. Cl. 7 , DB name) G06F 12/00
Claims (1)
次記憶上にデータベースデータのバックアップとログ情
報を持つメモリデータベースのバックアップ方法であっ
て、 データが格納されるテーブルに対して、処理結果を2次
記憶からのリカバリ処理で常に保証する種別と、特定の
更新処理に対してのみ2次記憶からのリカバリ処理で保
証する種別を指定するフィールドであるデータ種別フィ
ールドをデータベース管理情報に設け、 データベースにアクセスするトランザクションに対し
て、更新ステートメントの処理結果を2次記憶からのリ
カバリ処理で常に保証する種別と、特定のテーブルに対
しては保証しない種別を指定するフィールドである処理
種別フィールドをトランザクション管理情報に設け、 トランザクションの正常終了時に、挿入ステートメント
と削除ステートメントについては、処理結果の2次記憶
上のバックアップへの反映と更新後の値のログ情報の追
加を行い、更新ステートメントについては、前記データ
種別フィールドが処理結果を2次記憶からのリカバリ処
理で常に保証する種別であるならば、前記処理種別フィ
ールドの種別によらず、2次記憶上のバックアップに対
する更新結果の反映と更新後の値のログ情報への追加を
行い、前記データ種別フィールドが特定の更新処理に対
してのみ2次記憶からのリカバリ処理で保証する種別
で、前記処理種別フィールドが更新ステートメントの処
理結果を2次記憶からのリカバリ処理で常に保証する種
別ならば、2次記憶上のバックアップに対する更新結果
の反映と更新後の値のログ情報への追加を行い、前記デ
ータ種別フィールドが特定の更新処理に対してのみ2次
記憶からのリカバリ処理で保証する種別で、前記処理種
別フィールドが更新ステートメントの処理結果を2次記
憶からのリカバリ処理で特定のテーブルに対しては保証
しない種別ならば、2次記憶上のバックアップに対する
更新結果の反映もログ情報の更新も行なわないデータベ
ースバックアップ方法。(57) [Claims] [Claim 1] All databases are resident in main storage, and 2
A method of backing up database data and storing log data having log information on a secondary storage, and a method for always guaranteeing a processing result for a table storing data in a recovery process from a secondary storage, In the database management information, a data type field, which is a field for specifying a type guaranteed by the recovery processing from the secondary storage only for the update processing of the secondary storage, is provided. A transaction type field that specifies the type that is always guaranteed in the recovery process from the next storage and the type that is not guaranteed for a specific table is set in the transaction management information. about The processing result is reflected in the backup on the secondary storage and the log information of the updated value is added, and for the update statement, the data type field always guarantees the processing result in the recovery processing from the secondary storage. If the type is
Regardless of the field type, backup to secondary storage
Update results and add the updated values to the log information.
And the data type field corresponds to a specific update process.
Type guaranteed by recovery processing from secondary storage only
If the processing type field guarantees the processing result of the update statement in the recovery processing from the secondary storage at all times , the update result is reflected in the backup on the secondary storage and the updated value is added to the log information. And the data type field is a type that guarantees only a specific update process in the recovery process from the secondary storage, and the process type field is a type in which the processing result of the update statement is specified in the recovery process from the secondary storage . Guaranteed for tables
If you do not type, for backups on secondary storage
Database backup method that reflects the update result also does not perform also updates the log information.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP21098494A JP3514332B2 (en) | 1994-09-05 | 1994-09-05 | Database backup method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP21098494A JP3514332B2 (en) | 1994-09-05 | 1994-09-05 | Database backup method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH0877047A JPH0877047A (en) | 1996-03-22 |
| JP3514332B2 true JP3514332B2 (en) | 2004-03-31 |
Family
ID=16598391
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP21098494A Expired - Lifetime JP3514332B2 (en) | 1994-09-05 | 1994-09-05 | Database backup method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3514332B2 (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP4550215B2 (en) * | 2000-03-29 | 2010-09-22 | 株式会社東芝 | Analysis equipment |
| CN111459720B (en) * | 2020-04-02 | 2023-07-07 | 上海新炬网络技术有限公司 | Mysql data recovery method based on transaction log |
-
1994
- 1994-09-05 JP JP21098494A patent/JP3514332B2/en not_active Expired - Lifetime
Non-Patent Citations (1)
| Title |
|---|
| Jagadish H.V.,Recovering From Main−Memory Lapse,Proceedings of the 19th VLDB Conference,米国,1993年,p.391−404,URL,http://www.informatik.uni−trier.de/〜ley/db/conf/vldb/JagadishSS93.html |
Also Published As
| Publication number | Publication date |
|---|---|
| JPH0877047A (en) | 1996-03-22 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5724581A (en) | Data base management system for recovering from an abnormal condition | |
| CA2422176C (en) | Method and apparatus for interrupting updates to a database to provide read-only access | |
| US5590318A (en) | Method and system for tracking files pending processing | |
| JP3270216B2 (en) | File name detection method | |
| US5504883A (en) | Method and apparatus for insuring recovery of file control information for secondary storage systems | |
| EP1461700B1 (en) | Appliance for management of data replication | |
| US5201044A (en) | Data processing method for file status recovery includes providing a log file of atomic transactions that may span both volatile and non volatile memory | |
| JP4324616B2 (en) | Data processing method in storage system | |
| US6185699B1 (en) | Method and apparatus providing system availability during DBMS restart recovery | |
| US7340645B1 (en) | Data management with virtual recovery mapping and backward moves | |
| EP0733235B1 (en) | Incremental backup system | |
| US5437026A (en) | Removing uncommitted changes made to stored data by a database management system | |
| US20030135783A1 (en) | Data management appliance | |
| WO1995014273A9 (en) | Method and system for tracking changed files | |
| US7487385B2 (en) | Apparatus and method for recovering destroyed data volumes | |
| JPH01261746A (en) | Recovery of data base | |
| JPH09101912A (en) | Differential backup method | |
| US6192376B1 (en) | Method and apparatus for shadowing a hierarchical file system index structure to enable error recovery | |
| US7188124B2 (en) | Method, system, computer product for recovering dropped database table specifying one or more table spaces, recovering the table space being restored using the dropped table history data structure | |
| CN112463450A (en) | Incremental backup management method, system, electronic equipment and storage medium | |
| JP3514332B2 (en) | Database backup method | |
| JP2001344139A (en) | Database management device | |
| JPH09244933A (en) | Database backup method and apparatus | |
| JP2748402B2 (en) | Database failure recovery method | |
| JP2631185B2 (en) | Database backup method |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| RD03 | Notification of appointment of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7423 Effective date: 20040108 |
|
| RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20040108 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20040108 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090123 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090123 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100123 Year of fee payment: 6 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110123 Year of fee payment: 7 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110123 Year of fee payment: 7 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120123 Year of fee payment: 8 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130123 Year of fee payment: 9 |
|
| S531 | Written request for registration of change of domicile |
Free format text: JAPANESE INTERMEDIATE CODE: R313531 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| EXPY | Cancellation because of completion of term |