JPH0877047A - Database backup method - Google Patents
Database backup methodInfo
- Publication number
- JPH0877047A JPH0877047A JP6210984A JP21098494A JPH0877047A JP H0877047 A JPH0877047 A JP H0877047A JP 6210984 A JP6210984 A JP 6210984A JP 21098494 A JP21098494 A JP 21098494A JP H0877047 A JPH0877047 A JP H0877047A
- Authority
- JP
- Japan
- Prior art keywords
- update
- secondary storage
- type
- processing
- transaction
- 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.)
- Granted
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
(57)【要約】
【目的】 トランザクションの処理時間を短縮するデー
タベースバックアップ方法を提供する。
【構成】 データが格納されるテーブル104に対し
て、処理結果を2次記憶106からのリカバリ処理で常
に保証する種別と、特定の更新処理に対してのみ保証す
る種別を指定するデータ種別フィールド105をデータ
ベース管理情報に設け、データベースにアクセスするト
ランザクションに対して、更新ステートメントの処理結
果を2次記憶106からのリカバリ処理で保証する種別
と、特定のテーブルに対しては保証しない種別を指定す
る処理種別フィールド114をトランザクション管理情
報に設ける。トランザクションの正常終了時に、更新ス
テートメントの種類、データ種別フィールド105のデ
ータ種別と処理種別フィールド114の処理種別から、
2次記憶106上のバックアップに対する更新結果の反
映と更新後の値のログ情報への追加を行うか否かを判断
する。
(57) [Summary] [Purpose] To provide a database backup method that shortens transaction processing time. [Structure] For a table 104 in which data is stored, a data type field 105 for designating a type for which a process result is always guaranteed by a recovery process from a secondary storage 106 and a type for which only a specific update process is guaranteed. In the database management information, a process for specifying a type for which the processing result of the update statement is guaranteed by the recovery process from the secondary storage 106 and a type for which a certain table is not guaranteed for the transaction accessing the database. The type field 114 is provided in the transaction management information. At the normal end of the transaction, from the type of update statement, the data type of the data type field 105 and the process type of the process type field 114,
It is determined whether or not the update result is reflected on the backup on the secondary storage 106 and the updated value is added to the log information.
Description
【0001】[0001]
【産業上の利用分野】本発明は、主記憶上に全データベ
ースが常駐し、2次記憶上にデータベースデータのバッ
クアップとログ情報を持つメモリデータベースのバック
アップを作成する方法に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for creating a backup of a database database and a backup of a memory database having log information on a secondary storage in which all databases are resident on a main storage.
【0002】[0002]
【従来の技術】メモリデータベースは、データベースに
含まれる全テーブルをメモリ上に常駐することにより、
高速なデータベースアクセスを実現する方法である。2. Description of the Related Art A memory database has a structure in which all tables included in the database are resident in memory.
This is a method for realizing high-speed database access.
【0003】一般に、メモリデータベースの運用では、
応用プログラムの障害やデータベース管理システムを含
んだシステムの障害、あるいは固定ディスクなどの2次
記憶の媒体障害などの、種々の障害が発生する。そのた
めに、データベースのバックアップを2次記憶に取得
し、障害が発生したときには、このバックアップしたデ
ータよりデータベースを復元することが行われる。Generally, in the operation of a memory database,
Various failures occur such as failures of application programs, failures of systems including a database management system, and failures of secondary storage media such as fixed disks. Therefore, 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.
【0004】以下、従来のメモリデータベースにおける
バックアップ方法を説明する。A conventional backup method for a memory database will be described below.
【0005】データベースアクセスを行うトランザクシ
ョンからUPDATE/INSERT/DELETEな
どのステートメントに基づく更新処理が、メモリデータ
ベースに格納されているテーブルに対して行われると、
更新部分がI/Oバッファに格納され、さらに更新対象
の更新前の値と更新後の値がそれぞれ、更新前ログバッ
ファと更新後ログバッファに時間順に格納される。これ
らのうち、更新前ログについては、該トランザクション
が異常終了したときにメモリ上でデータベースを更新前
の状態に戻すロールバック処理に使われる。更新後ログ
については、該トランザクションが正常終了したとき
に、2次記憶上に出力され、I/Oバッファからバック
アップを更新している最中に発生するシステム障害に備
える。また、I/Oバッファについては、該トランザク
ションが正常終了したときに、2次記憶上のデータベー
スのバックアップを更新するのに使われる。When an update process based on a statement such as UPDATE / INSERT / DELETE from a database access transaction is performed on a table stored in the memory database,
The updated part is stored in the I / O buffer, and the pre-update value and the post-update value of the update target are stored in the pre-update log buffer and the post-update log buffer in chronological order. Among 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 is normally completed, and prepares for a system failure that occurs while the backup is being updated from the I / O buffer. The I / O buffer is used to update the backup of the database on the secondary storage when the transaction ends normally.
【0006】これらの更新処理のうち、更新結果を2次
記憶に取得する必要がない場合がある。そのような例と
して、1つの電話番号で複数の回線を使用する代表電話
サービスがある。一般的に、この例をデータベースを用
いて管理する場合、電話番号と準備された回線の空き数
を示すカラムからなるテーブルを作成する。そのテーブ
ルに対して、以下のような操作を行う。 (1)新規にサービスを登録する処理 INSERTステートメントにより、新規に登録する電
話番号とその番号に準備された回線数からなるデータを
テーブルに挿入する。 (2)該当電話番号への呼び出し処理 SELECTステートメントにより、現在該当電話番号
に許されている回線数を参照する。そして空き回線があ
れば、UPDATEステートメントにより、許されてい
る回線数を1だけデクリメントした値でテーブルを更新
する。その後に該当回線への接続処理を行う。 (3)該当回線への電話の切断処理 該当回線の切断処理を行う。SELECTステートメン
トにより現在該当電話番号に許されている回線数を参照
し、その値を1だけインクリメントした値で、UPDA
TEステートメントによりテーブルを更新する。 (4)準備された回線数の変更処理 UPDATEステートメントにより新規回線数をテーブ
ルに反映する。 (5)代表電話サービスを停止処理 DELETEステートメントによりテーブルに挿入した
該当電話番号とその番号に許される回線数を削除する。Of these update processes, there are cases where it is not necessary to obtain the update result in the secondary storage. One such example is a representative telephone service that uses a plurality of lines with one telephone number. In general, when managing this example using a database, a table is created that includes columns indicating the telephone numbers and the number of free lines prepared. The following operations are performed on the table. (1) Processing for newly registering a service By the INSERT statement, data including a telephone number to be newly registered and the number of lines prepared for that number is inserted into the table. (2) Call processing to the relevant telephone number The SELECT statement refers to the number of lines currently allowed for the relevant telephone number. Then, if there is a free line, the UPDATE statement updates the table with a value obtained by decrementing the number of allowed lines by one. After that, the connection process to the corresponding line is performed. (3) Call disconnection processing for the relevant line The disconnection processing for the relevant line is performed. The SELECT statement refers to the number of lines currently allowed for the corresponding telephone number, and increments the value by 1, and the UPDA
Update the table with the TE statement. (4) Processing for changing the number of prepared lines The new line number is reflected in the table by the UPDATE statement. (5) Stop processing of representative telephone service Delete the corresponding telephone number inserted in the table by the DELETE statement and the number of lines allowed for that number.
【0007】また、本データベースのリカバリ処理で
は、テーブルが初期状態に戻されるために全回線が未使
用状態になる。そのため、1つの電話番号に許される回
線数は上記の(1),(4),(5)のどれかの処理の
うち、最新値を復元すればよく、(2),(3)の更新
結果についてはバックアップを行う必要がない。Further, in the recovery processing of this database, since the table is returned to the initial state, all lines are in the unused state. Therefore, the number of lines allowed for one telephone number may be restored to the latest value in any one of the processes (1), (4), and (5) above, and the update of (2) and (3). There is no need to back up the results.
【0008】[0008]
【発明が解決しようとする課題】この例のように、更新
対象のテーブルによっては、UPDATEステートメン
トにより変更される処理結果をバックアップする必要が
ない場合がある。しかし、従来の方法では、このバック
アップを行う必要がない更新についても、2次記憶上の
バックアップとログ情報を更新していた。As in this example, it may not be necessary to back up the processing result changed by the UPDATE statement depending on the table to be updated. However, in the conventional method, the backup and the log information on the secondary storage are updated even for the update that does not need to be backed up.
【0009】これらの2次記憶を更新するのにはI/O
処理が必要となる。一般的に、I/O処理には、数ミリ
秒から数十ミリ秒の処理時間が必要となる。そのため、
このような不要なバックアップを行うため、トランザク
ションの処理時間が長くなるという問題がある。I / O is required to update these secondary memories.
Processing is required. Generally, processing time of several milliseconds to several tens of milliseconds is required for I / O processing. for that reason,
Since such unnecessary backup is performed, there is a problem that transaction processing time becomes long.
【0010】本発明の目的は、トランザクションの処理
時間を短縮するデータベースバックアップ方法を提供す
ることである。An object of the present invention is to provide a database backup method that shortens transaction processing time.
【0011】[0011]
【課題を解決するための手段】本発明のデータベースバ
ックアップ方法は、データが格納されるテーブルに対し
て、処理結果を2次記憶からのリカバリ処理で常に保証
する種別と、特定の更新処理に対してのみ2次記憶から
のリカバリ処理で保証する種別を指定するフィールドで
あるデータ種別フィールドをデータベース管理情報に設
け、データベースにアクセスするトランザクションに対
して、更新ステートメントの処理結果を2次記憶からの
リカバリ処理で保証する種別と、特定のテーブルに対し
ては保証しない種別を指定するフィールドである処理種
別フィールドをトランザクション管理情報に設け、トラ
ンザクションの正常終了時に、挿入ステートメントと削
除ステートメントについては、処理結果の2次記憶上の
バックアップへの反映と更新後の値のログ情報の追加を
行い、更新ステートメントについては、前記データ種別
フィールドが処理結果を2次記憶からのリカバリ処理で
常に保証する種別で、前記処理種別フィールドが更新ス
テートメントの処理結果を2次記憶からのリカバリ処理
で保証する種別ならば、2次記憶上のバックアップに対
する更新結果の反映と更新後の値のログ情報への追加を
行い、前記データ種別フィールドが特定の更新処理に対
してのみ2次記憶からのリカバリ処理で保証する種別
で、前記処理種別フィールドが更新ステートメントの処
理結果を2次記憶からのリカバリ処理で保証する種別な
らば、2次記憶上のバックアップもログ情報も更新しな
い。According to the database backup method of the present invention, for a table in which data is stored, a processing result is always guaranteed by a recovery process from secondary storage, and a specific update process is performed. Database management information is provided with a data type field that is a field that specifies the type guaranteed by the recovery process from the secondary storage, and the update statement processing result is recovered from the secondary storage for the transaction that accesses the database. The transaction management information is provided with a processing type field that is a field for specifying the type guaranteed by processing and the type not guaranteed for a specific table. When the transaction ends normally, insert statement and delete statement To backup on secondary storage The log information of the updated and updated values is added, and for the update statement, the data type field is a type that always guarantees the processing result in the recovery process from the secondary storage, and the processing type field is the processing of the update statement. If the type guarantees the result by the recovery process from the secondary storage, the update result is reflected on the backup on the secondary storage and the updated value is added to the log information, and the data type field is a specific update process. For a type that is guaranteed by the recovery process from the secondary storage only, and if the processing type field is a type that guarantees the processing result of the update statement by the recovery process from the secondary storage, the backup on the secondary storage is also logged. Information is not updated.
【0012】[0012]
【作用】本発明では、データベースに格納されているテ
ーブルに対して、テーブル作成時に常にデータをバック
アップする種別(パーシステント指定)と、更新処理を
行うトランザクションの種別によってはバックアップを
行わない種別(テンポラリ指定)を指定するデータ種別
フィールドをスキーマ情報に追加し設定する。また、更
新処理を行うトランザクションに対して、該トランザク
ションから発行されるUPDATEステートメントの処
理結果を、常に2次記憶上で保証する種別(全保証指
定)と、処理対象テーブルによっては2次記憶上で保証
しない場合がある種別(非保証指定)を指定する処理種
別フィールドをトランザクション管理情報に追加し設定
する。According to the present invention, a table stored in a database is always backed up at the time of table creation (persistent designation), and depending on the type of transaction for which update processing is performed, backup is not performed (temporary). Add and set the data type field that specifies (Specify) to the schema information. Also, for a transaction that performs an update process, the type (all guarantee specification) that always guarantees the processing result of the UPDATE statement issued from the transaction on the secondary storage, and on the secondary storage depending on the processing target table Add a processing type field that specifies the type that may not be guaranteed (non-guaranteed specification) to the transaction management information and set it.
【0013】そして、トランザクションの終了契機に、
INSERT/DELETEステートメントに基づいた
更新処理の結果については、データ種別フィールドおよ
び処理種別フィールドの指定値によらず、更新後ログの
出力と2次記憶上のバックアップに対して反映を行う。Then, at the end of the transaction,
The result of the update processing based on the INSERT / DELETE statement is reflected in the output of the updated log and the backup on the secondary storage regardless of the specified values of the data type field and the process type field.
【0014】UPDATEステートメントに基づいた更
新処理の結果については、(1)データ種別フィールド
がパーシステント指定のときは、処理種別フィールドの
指定値によらず、更新後ログの出力と2次記憶上のバッ
クアップに対して反映を行い、(2)データ種別フィー
ルドがテンポラリ指定で、処理種別フィールドが全保証
指定のときは、更新後ログの出力と2次記憶上のバック
アップに対して反映を行い、(3)データ種別フィール
ドがテンポラリ指定で、処理種別フィールドが非保証指
定のときは、更新後ログの出力と2次記憶上のバックア
ップに対する反映は行わない。Regarding the result of the update processing based on the UPDATE statement, (1) When the data type field is persistent designation, the output of the updated log and the secondary storage are performed regardless of the designated value of the process type field. When reflected in the backup, (2) When the data type field is temporary specified and the process type field is all guaranteed specified, it is reflected in the output of the updated log and the backup on the secondary storage. 3) When the data type field is temporary designation and the process type field is non-guaranteed designation, the output of the updated log and the reflection on the secondary storage are not reflected.
【0015】このように、本発明では、データ種別がテ
ンポラリ指定であるテーブルに対して、処理種別が非保
証指定であるトランザクションからのUPDATEステ
ートメントによる更新処理についてはI/Oを行わない
ため、トランザクションの処理時間を短縮できる。As described above, according to the present invention, since the update processing by the UPDATE statement from the transaction whose processing type is non-guaranteed is not performed on the table whose data type is temporary, I / O is not performed. Processing time can be shortened.
【0016】[0016]
【実施例】次に、本発明の実施例について図面を参照し
て説明する。Embodiments of the present invention will now be described with reference to the drawings.
【0017】図1は本発明の一実施例で、テーブルを作
成する処理を実現する構成を説明するための図である。FIG. 1 is a diagram for explaining a configuration for realizing a process for creating a table according to an embodiment of the present invention.
【0018】テーブル作成機構102はテーブル作成命
令101により起動されてメモリDB103上にテーブ
ル104とデータ種別フィールド105を作成する。ま
た、テーブル作成機構102は2次記憶106上にテー
ブル104のバックアップ107とデータ種別フィール
ド105のバックアップ108を作成する。The table creation mechanism 102 is activated by the table creation instruction 101 and creates a table 104 and a data type field 105 on the memory DB 103. Further, 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.
【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)。FIG. 2 is a flow chart 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 uses the table creation instruction 1
The table 104 is created on the memory DB 103 with 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 uses the table creation instruction 1
The data type field 105
Either a type for always backing up data (designated as persistent designation) or a type for not performing backup (designated as temporary designation) depending on the type of transaction for which update processing is performed (step 20)
3). (5) The table creation mechanism 102 creates the backup 107 of the table 104 on the secondary storage 106 (step 204). (6) The table creation mechanism 102 creates the backup 108 of the data type field 105 on the secondary storage 106 (step 205).
【0020】以上の手続きにより、データ種別が指定さ
れたテーブル104がメモリDB103上に作成され
る。By the above procedure, the table 104 in which the data type is designated is created in the memory DB 103.
【0021】図3は、本発明に基づいて、トランザクシ
ョンからの2次記憶の更新処理を実現する構成を説明す
るための図である。FIG. 3 is a diagram for explaining a configuration for realizing a secondary storage update process from a transaction according to the present invention.
【0022】トランザクション109は開始命令110
と更新命令111と終了命令112を含む。アクセス機
構113はトランザクションの開始、更新、終了の各処
理を行う。The transaction 109 is a start command 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.
【0023】図4は、図3の構成に基づくトランザクシ
ョンの開始処理のフローチャートである。FIG. 4 is a flowchart of a transaction start process based on the configuration of FIG.
【0024】トランザクションの開始処理は以下の手続
きで行われる。 (1)開始命令110はアクセス機構113にトランザ
クションの開始を指示する(ステップ300)。 (2)アクセス機構113は、メモリDB103上に該
トランザクション109の処理種別フィールド114を
確保する(ステップ301)。 (3)アクセス機構113は、開始命令110のパラメ
ータにしたがい、該トランザクション109から発行さ
れるUPDATEステートメントの処理結果を常に2次
記憶106上に保証する種別(全保証指定とする)と処
理対象テーブルによっては、2次記憶106上で保証し
ない場合がある種別(非保証指定とする)を処理種別フ
ィールド114に設定する(ステップ302)。The transaction start processing is performed by the following procedure. (1) The start instruction 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) The access mechanism 113 always guarantees the processing result of the UPDATE statement issued from the transaction 109 on the secondary storage 106 according to the parameter of the start command 110 (all guarantee specification) and the processing target table. Depending on the case, the type (which is not guaranteed) which may not be guaranteed on the secondary storage 106 is set in the process type field 114 (step 302).
【0025】図5は、図3の構成に基づく、トランザク
ションの更新処理のフローチャートである。FIG. 5 is a flowchart of a transaction update process based on the configuration of FIG.
【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)の処理を行う。非保証
のときはそのまま終る。Transaction update processing is performed by the following procedure. (1) The update instruction 111 instructs the access mechanism 113 to update the database (step 400). (2) According to the UPDATE / INSERT / DELETE statement issued from the update instruction 111, the access mechanism 113 stores the pre-update values in 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 the update statement (step 40
3). (5) When the statement issued from the update instruction 111 is INSERT or DELETE, the access mechanism 1
13 indicates the update result of the table 104 performed in (3) as I
The data 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 command 111 is UPDATE, the data type field 105 of the update table 104 is determined (step 406). (8) When the data type field 105 is persistent, the processes (5) and (6) are performed. (9) When the data type field 105 is temporary, the process type field 114 is determined (step 4
07). (10) Transaction processing type field 114
If is all guaranteed, the processes of (5) and (6) are performed. If it is not guaranteed, it ends as it is.
【0027】図6は、図3の構成に基づく、トランザク
ションの終了処理のフローチャートである。FIG. 6 is a flowchart of the transaction end processing based on the configuration of FIG.
【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)。The transaction termination processing is performed by the following procedure. (1) The end instruction 112 instructs the access mechanism 113 to end the transaction (step 500). (2) The end instruction 112 is determined (step 501). (3) The access mechanism 113 receives the CO from the end instruction 112.
When MMIT is issued, the access mechanism 113 adds the contents of the updated log buffer 116 to the updated log file 118 on the secondary storage 106 (step 50).
2). (4) The access mechanism 113 restores the contents of the I / O buffer 117 to the table backup 10 on the secondary storage 106.
7 is reflected (step 503). (5) When the end command 112 is ROLLBACK, the access mechanism 113 instructs the rollback to update the table 104 based on the pre-update log buffer 115 (step 504).
【0029】以上の手続きにより、データ種別がテンポ
ラリのテーブルに対して、処理種別が非保証のトランザ
クションから発行されるUPDATEステートメントの
更新処理の結果については、2次記憶106に反映され
ず、その分のI/Oを削減できる。By the above procedure, the result of the UPDATE statement update processing issued from the transaction whose processing type is non-guaranteed for the table whose data type is temporary is not reflected in the secondary storage 106, I / O can be reduced.
【0030】図7は、本発明に基づいて、取得した2次
記憶106上のテーブルバックアップ107と更新後ロ
グ情報とデータ種別フィールド105からデータベース
を復元する処理を実現する構成を説明するための図であ
る。FIG. 7 is a diagram for explaining a configuration for implementing a process for restoring the database from the acquired table backup 107 on the secondary storage 106, the updated log information and the data type field 105 according to the present invention. Is.
【0031】復元機構120は復元命令119によりデ
ータベースを復元する処理を行う。The restore mechanism 120 performs a process of restoring the database by the restore instruction 119.
【0032】図8は、図7の構成に基づくデータベース
の復元処理のフローチャートである。FIG. 8 is a flow chart of a database restoration process based on the configuration of FIG.
【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を更新する。The database restoration process is performed by the following procedure. (1) The restore instruction 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 onto 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 processes of (2) and (3) have been completed for all the tables (step 603). If not completed, the processes of (2) and (3) are repeated. (5) When the processes (2) and (3) have been completed for all the tables, the restoration mechanism 120 causes the updated log file 1
18 is read in chronological order, and the table 104 on the memory DB 103 is updated.
【0034】以上の手続きにより、データ種別がパーシ
ステントに指定されたテーブルについては、常に最新値
が保証され、データ種別がテンポラリに指定されたテー
ブルについては、INSERTステートメントか、処理
種別が全保証であるトランザクションのUPDATEス
テートメントのうち、最新の更新値が復元される。By the above procedure, the latest value is always guaranteed for the table whose data type is designated as persistent, and the INSERT statement or the processing type is fully guaranteed for the table whose data type is designated as temporary. The latest updated value of the UPDATE statement of a transaction is restored.
【0035】[0035]
【発明の効果】以上説明したように、本発明は、データ
種別フィールドをデータベース管理情報に設け、処理種
別フィールドをトランザクション管理情報に設け、障害
時にデータベースを復元するのに必要な更新処理の結果
のみ2次記憶へ取得することにより、更新処理内のI/
Oを削減することができ、これにより、従来に比べて高
速なDBアクセスが可能となる効果がある。As described above, according to the present invention, the data type field is provided in the database management information, the process type field is provided in the transaction management information, and only the result of the update process necessary for restoring the database at the time of failure occurs. I / O in the update process
O can be reduced, which has the effect of enabling faster DB access than in the past.
【図1】テーブルを作成する処理を実現する構成を説明
するための図である。FIG. 1 is a diagram for explaining a configuration for realizing a process of creating a table.
【図2】テーブルを作成する処理のフローチャートであ
る。FIG. 2 is a flowchart of a process of creating a table.
【図3】トランザクションからの2次記憶106の更新
処理を実現する構成を説明するための図である。FIG. 3 is a diagram for explaining a configuration for implementing a process of updating secondary storage 106 from a transaction.
【図4】トランザクションの開始処理のフローチャート
である。FIG. 4 is a flowchart of a transaction start process.
【図5】トランザクションの更新処理のフローチャート
である。FIG. 5 is a flowchart of a transaction update process.
【図6】トランザクションの終了処理のフローチャート
である。FIG. 6 is a flowchart of transaction end processing.
【図7】取得した2次記憶106上のテーブルバックア
ップ107と更新後ログ情報とデータ種別フィールド1
05からデータベースを復元する処理を実現する構成を
説明するための図である。FIG. 7 is a table backup 107 on the acquired secondary storage 106, post-update log information, and data type field 1
5 is a diagram for explaining a configuration for realizing a process of restoring a database from 05. FIG.
【図8】データベースの復元処理のフローチャートであ
る。FIG. 8 is a flowchart of a database restoration process.
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 ステップ 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 pre-update log Buffer 116 Post-update log buffer 117 I / O buffer 118 Post-update log file 119 Restore instruction 120 Restore mechanism 200-205 step 300-302 step 400-407 step 500-504 step 600-604 step
Claims (1)
次記憶上にデータベースデータのバックアップとログ情
報を持つメモリデータベースのバックアップ、方法であ
って、 データが格納されるテーブルに対して、処理結果を2次
記憶からのリカバリ処理で常に保証する種別と、特定の
更新処理に対してのみ2次記憶からのリカバリ処理で保
証する種別を指定するフィールドであるデータ種別フィ
ールドをデータベース管理情報に設け、 データベースにアクセスするトランザクションに対し
て、更新ステートメントの処理結果を2次記憶からのリ
カバリ処理で保証する種別と、特定のテーブルに対して
は保証しない種別を指定するフィールドである処理種別
フィールドをトランザクション管理情報に設け、 トランザクションの正常終了時に、挿入ステートメント
と削除ステートメントについては、処理結果の2次記憶
上のバックアップへの反映と更新後の値のログ情報の追
加を行い、更新ステートメントについては、前記データ
種別フィールドが処理結果を2次記憶からのリカバリ処
理で常に保証する種別で、前記処理種別フィールドが更
新ステートメントの処理結果を2次記憶からのリカバリ
処理で保証する種別ならば、2次記憶上のバックアップ
に対する更新結果の反映と更新後の値のログ情報への追
加を行い、前記データ種別フィールドが特定の更新処理
に対してのみ2次記憶からのリカバリ処理で保証する種
別で、前記処理種別フィールドが更新ステートメントの
処理結果を2次記憶からのリカバリ処理で保証する種別
ならば、2次記憶上のバックアップもログ情報も更新し
ないデータベースバックアップ方法。1. All databases are resident in the main memory, and 2
A method of backing up database data on the next storage and a backup of a memory database having log information, in which a processing result for a table storing data is always guaranteed by recovery processing from the second storage, The database management information is provided with a data type field that is a field that specifies the type to be guaranteed in the recovery process from the secondary storage only for a specific update process, and the processing result of the update statement is displayed for the transaction that accesses the database. The transaction management information is provided with a processing type field that is a field for specifying the type guaranteed by the recovery process from the secondary storage and the type not guaranteed for a specific table, and insert statement and delete statement at the normal end of the transaction. about The processing result is reflected in the backup on the secondary storage, the log information of the updated value is added, and in the update statement, the data type field always guarantees the processing result in the recovery processing from the secondary storage. If the processing type field is a type that guarantees the processing result of the update statement by the recovery processing from the secondary storage, the update result is reflected on the backup on the secondary storage and the updated value is added to the log information. The data type field is a type that is guaranteed by the recovery process from the secondary storage only for a specific update process, and the process type field is the type that is guaranteed by the recovery process from the secondary storage for the processing result of the update statement. If so, a database backup method in which neither the backup on the secondary storage nor the log information is updated.
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 true JPH0877047A (en) | 1996-03-22 |
| JP3514332B2 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) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2001281258A (en) * | 2000-03-29 | 2001-10-10 | Toshiba Corp | Analysis equipment |
| CN111459720A (en) * | 2020-04-02 | 2020-07-28 | 上海新炬网络技术有限公司 | Mysql data recovery method based on transaction log |
-
1994
- 1994-09-05 JP JP21098494A patent/JP3514332B2/en not_active Expired - Lifetime
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2001281258A (en) * | 2000-03-29 | 2001-10-10 | Toshiba Corp | Analysis equipment |
| CN111459720A (en) * | 2020-04-02 | 2020-07-28 | 上海新炬网络技术有限公司 | Mysql data recovery method based on transaction log |
| CN111459720B (en) * | 2020-04-02 | 2023-07-07 | 上海新炬网络技术有限公司 | Mysql data recovery method based on transaction log |
Also Published As
| Publication number | Publication date |
|---|---|
| JP3514332B2 (en) | 2004-03-31 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| KR930008684B1 (en) | How to create a database backup copy | |
| JP4324616B2 (en) | Data processing method in storage system | |
| US5590318A (en) | Method and system for tracking files pending processing | |
| US7107294B2 (en) | Method and apparatus for interrupting updates to a database to provide read-only access | |
| US5720026A (en) | Incremental backup system | |
| US5761677A (en) | Computer system method and apparatus providing for various versions of a file without requiring data copy or log operations | |
| US5724581A (en) | Data base management system for recovering from an abnormal condition | |
| CA2163958C (en) | Method of processing input/output request in computer system including a plurality of subsystems | |
| US6732123B1 (en) | Database recovery to any point in time in an online environment utilizing disaster recovery technology | |
| RU2182360C2 (en) | Method for computer system stored data access, method for data filing, and computer system for implementing these methods | |
| US6192376B1 (en) | Method and apparatus for shadowing a hierarchical file system index structure to enable error recovery | |
| US4752910A (en) | Method and apparatus for continuous after-imaging | |
| JPS59195749A (en) | Non-synchronous check pointing system for recovery of errors | |
| CN112463450B (en) | Incremental backup management method, system, electronic equipment and storage medium | |
| WO1995014273A9 (en) | Method and system for tracking changed files | |
| US7281157B2 (en) | Method and apparatus for enabling consistent ancillary disk array storage device operations with respect to a main application | |
| CN116107807A (en) | Method and device for obtaining global consistency point during data backup in database | |
| US12093139B2 (en) | Rolling back a database transaction | |
| US5230075A (en) | Database shadowing system with data tags that select an operation of the save command | |
| JPH09244933A (en) | Database backup method and apparatus | |
| JPH0877047A (en) | Database backup method | |
| JP4390618B2 (en) | Database reorganization program, database reorganization method, and database reorganization apparatus | |
| CN118170726A (en) | File cut-off method, equipment and storage medium of distributed file system | |
| JPH0158533B2 (en) | ||
| CN117472647A (en) | Database transaction rollback method and device |
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 |