JPH03147032A - Data base control system - Google Patents

Data base control system

Info

Publication number
JPH03147032A
JPH03147032A JP1283102A JP28310289A JPH03147032A JP H03147032 A JPH03147032 A JP H03147032A JP 1283102 A JP1283102 A JP 1283102A JP 28310289 A JP28310289 A JP 28310289A JP H03147032 A JPH03147032 A JP H03147032A
Authority
JP
Japan
Prior art keywords
record
database
update
backup
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP1283102A
Other languages
Japanese (ja)
Inventor
Suguru Kawakami
川上 英
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Electric Industry Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oki Electric Industry Co Ltd filed Critical Oki Electric Industry Co Ltd
Priority to JP1283102A priority Critical patent/JPH03147032A/en
Publication of JPH03147032A publication Critical patent/JPH03147032A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To update a data base even in the middle of back-up recording an updata transaction number in a record. CONSTITUTION:When a transaction (Tr) gives the request of the update of the data base, a data base updating control part 5 writes the record into the back up value page of the record when the update Tr number of the record is not included in a back up start time completion Tr list (CTRL) 4. When it is included in CTRL and the updating Tr number is not equal to the number of an updating request, the data base updating control part 5 writes the record into the pre-updating value page of the record. Then, the data base updating control part 5 writes the updating value of the record and the number of Tr which gives the updating request into a present value page, and writes a data base table identifier and the value of a record mainbody into a log. Thus, updating during back-up work is terminated.

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明は、データベースの更新動作を停止させることな
く、データベースをバックアップするようにしたデータ
ベース管理システムに関する。
DETAILED DESCRIPTION OF THE INVENTION (Field of Industrial Application) The present invention relates to a database management system that backs up a database without stopping database update operations.

(従来の技術) データベース管理システムでは、データベースを格納し
ているディスク等の不揮発性記憶媒体(以下、2次記憶
媒体という。)に障害が発生した場合でも、データベー
スを現状の状態に回復しなければならない。そのため、
周期的にデータベースの全レコードを、データベースを
格納している2次記憶媒体と異なる2次記憶媒体にコピ
ーし、コピーをとった時点からデータベースに行なわれ
た更新操作のログを取得している。データベースのレコ
ードをコピーする作業をバックアップと呼び、コピーし
たデータをバックアップデ−夕と呼ぶ。
(Prior art) In a database management system, even if a failure occurs in a non-volatile storage medium (hereinafter referred to as a secondary storage medium) such as a disk storing a database, it is necessary to restore the database to its current state. Must be. Therefore,
All records of the database are periodically copied to a secondary storage medium different from the one storing the database, and a log of update operations performed on the database from the time of copying is obtained. The process of copying database records is called backup, and the copied data is called backup data.

バックアップデータとログからデータベースを回復する
ためには、データベースが正しい状態にある時に、バッ
クアップを行ない、その時点からのログを取得しなけれ
ばならない。
To recover a database from backup data and logs, you must perform a backup when the database is in the correct state and retrieve the logs from that point.

データベースは、データベースに対する仕事の論理的な
単位であるトランザクション(Tr)の終了した時に正
しい状態になる。トランザクション実行中は、データベ
ースは過渡的な状態であり、正しい状態とはいえない。
A database is in a correct state when a transaction (Tr), which is a logical unit of work for the database, is completed. While a transaction is being executed, the database is in a transient state and cannot be said to be in a correct state.

しかし、データベース管理システムは、データベースの
効率的アクセスのために、第2図に示す如く複数のトラ
ンザクションが同時に平行的動作をし、データベースを
検索/更新している。従って、データベースをアクセス
する業務プログラムの実行中にデータベースが正しい状
態になることは、はとんどない。
However, in the database management system, in order to access the database efficiently, a plurality of transactions simultaneously operate in parallel to search/update the database, as shown in FIG. Therefore, the database is rarely in the correct state during execution of a business program that accesses the database.

このため、従来、データベースをバックアップする時は
、データベースをアクセスする業務を停止して行なって
いた。
For this reason, conventionally, when backing up a database, operations that access the database have been stopped.

(発明が解決しようとする課題) しかしながら、従来方式では、データベース全体をバッ
クアップするには、かなりの時間がかかり、この間更新
を伴うトランザクションを実行できないという問題があ
った。特に、24時間停止することなく運用するオンラ
イン処理システムでは、オンライン業務実行中にバック
アップデータな取得することが望まれる。
(Problems to be Solved by the Invention) However, in the conventional method, there is a problem in that it takes a considerable amount of time to back up the entire database, and transactions involving updates cannot be executed during this time. Particularly in an online processing system that operates without interruption for 24 hours, it is desirable to obtain backup data while executing online operations.

本発明の目的は、このような従来の問題を解決し、デー
タベースのバックアップ作業中でもデータベースを更新
できるようにしたデータベース管理システムを提供する
ことにある。
SUMMARY OF THE INVENTION An object of the present invention is to provide a database management system that solves these conventional problems and allows a database to be updated even during database backup work.

(課題を解決するための手段) 本発明は、2次記憶装置に格納したデータベースのレコ
ードの更新前イメージを保存し、トランザクション障害
回復を行なうデータベース管理システムにおいて、前記
2次記憶装置に格納したデータベースのレコードを更新
するとき、レコードに更新トランザクション番号を記録
し、バックアップ中のレコード更新では、更新要求のト
ランザクション番号がレコードに記録したトランザクシ
ョン番号と異なるとき、レコードの更新前値を更新前値
格納領域とバックアップデータ保存領域に保存した後、
該レコードを更新するデータベース更新制御部と、前記
2次記憶装置に格納したレコードをバックアップすると
きには、レコードに記録した更新トランザクション番号
によってレコードの現在値、更新前値、バックアップ値
の内いずれをバックアップするかを選択するデータベー
スバックアップ制御部とを備えてなるものである。
(Means for Solving the Problems) The present invention provides a database management system that stores pre-update images of database records stored in a secondary storage device and performs transaction failure recovery. When updating a record, an update transaction number is recorded in the record, and when updating a record during backup, if the transaction number of the update request is different from the transaction number recorded in the record, the pre-update value of the record is stored in the pre-update value storage area. and after saving it to the backup data storage area,
A database update control unit that updates the record, and when backing up the record stored in the secondary storage device, backs up any of the current value, pre-update value, and backup value of the record according to the update transaction number recorded in the record. A database backup control section that selects a database backup control section.

(作用) 従って、データベース更新制御部は、2次記憶装置に格
納したデータベースのレコードを更新するとき、レコー
ドに更新トランザクション番号を記録する。バックアッ
プ中のレコード更新では、データベース更新制御部は、
更新要求のトランザクション番号がレコードに記録した
トランザクション番号と異なるとき、レコードの更新前
値を更新前値格納領域とバックアップデータ保存領域に
保存した後、該レコードを更新する。更新要求のトラン
ザクション番号はレコードの更新値とともにレコード記
録される。
(Operation) Therefore, when updating a database record stored in the secondary storage device, the database update control unit records an update transaction number in the record. When updating records during backup, the database update control section:
When the transaction number of the update request is different from the transaction number recorded in the record, the record is updated after storing the pre-update value of the record in the pre-update value storage area and the backup data storage area. The transaction number of the update request is recorded in the record together with the update value of the record.

よって、更新業務を停止することなくバックアップ作業
をすることができる。
Therefore, backup work can be performed without stopping update work.

また、データベースバックアップ制御部は、レコードを
バックアップするとき、レコードに記録された更新トラ
ンザクション番号によってレコードの現在値、更新前値
、バックアップ値の内、いずれをバックアップするかを
、バックアップ取得開始時点で、トランザクションの完
了、未完了により選択する。データベースを格納した媒
体に障害が発生した場合、バックアップデータを用いて
データベースを回復させることができる。
Furthermore, when backing up a record, the database backup control unit determines which of the record's current value, pre-update value, and backup value is to be backed up, based on the update transaction number recorded in the record, at the time of starting backup acquisition. Select depending on whether the transaction is completed or not. If a failure occurs in the medium on which the database is stored, the database can be recovered using backup data.

(実施例) 次に本発明の実施例について図面を用いて説明する。(Example) Next, embodiments of the present invention will be described using the drawings.

第1図は、本発明のデータベース管理システムの一実施
例を示すブロック図である。
FIG. 1 is a block diagram showing an embodiment of the database management system of the present invention.

同図において、1はデータベース管理システムであって
、このデータベース管理システム1は、トランザクショ
ン(Tr)番号割当テーブル2とバックアップ中表示フ
ラグ3とバックアップ開始時完了トランザクション(T
r)4とデータベース更新制御部5とデータベースバッ
クアップ制御部6とデータベース回復制御部7と要求受
は付は部14とトランザクション(Tr)制御部15を
有している。ここに、Tr番号割当テーブル2は、各ト
ランザクションに対し唯一識別するトランザクション番
号(Tr番号)を夫々割当て、そのTr番号の最大値(
Tr番号は順番に割当てるので、最後に割当てられたT
r番号の値をいう。)を格納しているものである。バッ
クアップ中表示フラグ3は、バックアップ作業中か否か
を示すものである。バックアップ開始時完了Trリスト
(CTRL) 4は、バックアップを開始した時点で完
了していたトランザクションを識別するためのものであ
る。バックアップ開始時点で完了していたトランザクシ
ョンは、例えば、バックアップ開始時のトランザクショ
ン番号の最後の値(Tr番号は順番に割当てるので、最
後に割当てられたTr番号の値をいう。)と未完了のT
r番号の値とから求まる。また、データベース更新制御
部5は、データベースのレコードの更新を制御するもの
である。また、データベースバックアップ制御部6は、
データベース9のレコードのコピーを他の2次記憶装置
8bに格納するものである。また、データベース回復制
御部7は、バ・ンクアップデータとログから、データベ
ースを回復させるものである。また、要求受は付は部1
4は、データベース管理システムlを利用する外部の要
求元からの要求を受は付けるものである。また、Tr制
御部15は、トランザクションの完了を制御したり、ト
ランザクションに唯一のTr番号を該トランザクション
に割当て、かつTrの状態を管理したりするものである
In the figure, 1 is a database management system, and this database management system 1 includes a transaction (Tr) number assignment table 2, a backup display flag 3, and a transaction completed at the start of backup (T
r) 4, a database update control section 5, a database backup control section 6, a database recovery control section 7, a request reception section 14, and a transaction (Tr) control section 15. Here, the Tr number assignment table 2 assigns a uniquely identifying transaction number (Tr number) to each transaction, and calculates the maximum value of the Tr number (
Since Tr numbers are assigned in order, the last assigned T
Refers to the value of r number. ) is stored. The backup in progress display flag 3 indicates whether or not a backup operation is in progress. The completed Tr list (CTRL) 4 at backup start is used to identify transactions that were completed at the time backup was started. Transactions that were completed at the time of backup start are, for example, the last value of the transaction number at the time of backup start (Tr numbers are assigned in order, so this refers to the value of the last assigned Tr number) and uncompleted T
It is determined from the value of r number. Further, the database update control unit 5 controls updating of records in the database. Further, the database backup control unit 6
A copy of the record of the database 9 is stored in another secondary storage device 8b. Further, the database recovery control unit 7 recovers the database from backup data and logs. Also, request reception is in Part 1.
4 accepts requests from external request sources that utilize the database management system 1. The Tr control unit 15 also controls the completion of transactions, assigns a unique Tr number to a transaction, and manages the state of the Tr.

また、8aは、データベース9を格納するディスク等の
不揮発性記憶媒体を用いた2次記憶装置、8bはデータ
ベース9のバックアップデータ11とデータベース9に
対する更新のログデータ13を格納するディスク等の不
揮発性記憶媒体を用いた2次記憶装置である。1oはデ
ータベース表10′の集まりである。12は、データベ
ース表10′の集まり10のバックアップデータである
Further, 8a is a secondary storage device using a non-volatile storage medium such as a disk for storing the database 9, and 8b is a non-volatile storage device such as a disk for storing backup data 11 of the database 9 and log data 13 of updates to the database 9. It is a secondary storage device using a storage medium. 1o is a collection of database tables 10'. 12 is backup data of the collection 10 of database tables 10'.

第3図は、データベース表10′の内部構成図である。FIG. 3 is an internal configuration diagram of the database table 10'.

同図において、データベース表10’はレコード31の
集まりである。このレコード31は、レコードを唯一識
別するレコード識別子32と、このレコードを最後に更
新したトランザクション番号(これを更新Tr番号とい
う。)33と、レコード本体(レコード内容)34から
なる。ここで、レコード内容34は、例えばユーザデー
タなどとして利用される。
In the figure, a database table 10' is a collection of records 31. This record 31 consists of a record identifier 32 that uniquely identifies the record, a transaction number (this is referred to as an update Tr number) 33 that last updated this record, and a record body (record content) 34. Here, the record content 34 is used, for example, as user data.

第4図は、データベース表の格納形式を示す図である。FIG. 4 is a diagram showing the storage format of the database table.

41a、41bは、レコードを格納するページを指すポ
インタを格納するページである。
41a and 41b are pages that store pointers pointing to pages that store records.

これらの、レコードを格納するページを指すポインタは
、レコードを格納するページの増減に応じて増減する。
These pointers pointing to pages that store records increase or decrease depending on the increase or decrease in the number of pages that store records.

42a、42bは、レコードの現在値を格納するページ
を指すポインタである。
42a and 42b are pointers pointing to pages that store the current values of records.

43a、43bは、レコードの更新前値を格納するペー
ジを指すポインタである。44a、44bは、レコード
のバックアップ値を格納するページを指すポインタであ
る。45a、45bは、レコードの現在値を格納するペ
ージである。このページに格納される値が、レコードの
最新の値である。46a、46bは、レコードの更新前
値を格納するページである。このページに格納される値
は、トランザクションのアボート時に、レコードをトラ
ンザクション開始時の状態に戻すために使用される。4
7a、47bは、レコードのバックアップ値を格納する
ページである。このページは、オンライン中にバックア
ップを取得するために使用する。
43a and 43b are pointers pointing to pages that store pre-update values of records. 44a and 44b are pointers pointing to pages that store backup values of records. 45a and 45b are pages that store the current values of records. The value stored on this page is the latest value for the record. 46a and 46b are pages that store pre-update values of records. The values stored in this page are used when a transaction is aborted to return the records to the state they were in when the transaction began. 4
7a and 47b are pages that store backup values of records. Use this page to take backups while online.

このように、レコードの値は、3つのバージョンがデー
タベース9上に格納されることになる。
In this way, three versions of the record value will be stored on the database 9.

次に本発明の実施例の動作について以下、場合を分けて
説明する。
Next, the operation of the embodiment of the present invention will be explained in different cases.

先ず、データベース9のレコードを更新する前に、外部
の要求元からトランザクション開始の要求が、データベ
ース管理システム1の要求受は付は部14に送られてく
ると、要求受は付は部14は、トランザクション(T 
r )制御部15にその要求を渡す。Tr制御部15は
、Tr番号割当テーブル2の内容に1を加え、これをト
ランザクションを唯一識別できるTr番号とし、そのT
r番号を要求受は付は部14を介して外部の要求元に応
答する。
First, before updating records in the database 9, a request to start a transaction is sent from an external request source to the request receiving section 14 of the database management system 1. , transaction (T
r) Pass the request to the control unit 15. The Tr control unit 15 adds 1 to the contents of the Tr number assignment table 2, sets this as a Tr number that can uniquely identify the transaction, and assigns the transaction as a Tr number.
The request receiving section 14 responds to the external requestor for the r number.

(イ)通常の更新 外部の要求元は、Tr番号を取得した後は、データベー
ス管理システム1への要求には、該Tr番号を必ず付加
する。
(b) After the request source outside the normal update obtains the Tr number, it always adds the Tr number to the request to the database management system 1.

バックアップ中表示フラグが”偽”で、バックアップ作
業中でない状態の時に、外部の要求元からのトランザク
ションがデータベースの更新要求をした場合、要求受は
付は部14は、その要求をデータベース更新制御部5に
渡す。データベース更新制御部5は、第5図(a)に示
す手順によって、データベースを更新し、ログを書込む
When the backup display flag is "false" and a backup operation is not in progress, if a transaction from an external request source makes a database update request, the request reception section 14 handles the request to the database update control section. Pass it to 5. The database update control unit 5 updates the database and writes a log according to the procedure shown in FIG. 5(a).

例えば、更新するレコードの現在の値が第4図に示すレ
コードの現在値ページ45aに格納されていて、この現
在値ページから更新するレコードを読出し、そのレコー
ドの更新Tr番号が、更新要求をしたTr番号と異なる
場合(第5図(a)のステップSL、S2)、レコード
の現在値ページ45a上のレコードの値を、第4図の更
新前ページ46aの対応する部分に書込んだ後、レコー
ドの現在値ベージ45a上のレコードを更新する、即ち
レコードの現在値ページにレコードの更新値と更新を要
求したTrの番号を書込む(第5図(a)のステップS
3.S4)、更に、データベース表識別子とレコード識
別子と更新を要求したTr番号と更新後のレコード本体
の値をログに書込む(第5図(a)のステップS5)。
For example, if the current value of the record to be updated is stored in the record current value page 45a shown in FIG. 4, and the record to be updated is read from this current value page, the update Tr number of the record is If it is different from the Tr number (steps SL and S2 in FIG. 5(a)), after writing the value of the record on the current record value page 45a to the corresponding part of the pre-update page 46a in FIG. Update the record on the current record value page 45a, that is, write the updated value of the record and the number of the Tr that requested the update on the current value page of the record (step S in FIG. 5(a)
3. S4), and further writes the database table identifier, the record identifier, the Tr number that requested the update, and the value of the updated record body to the log (step S5 in FIG. 5(a)).

なお、ステップS2において、レコードの更新Tr番号
と更新要求をしたTr番号とが等しいときは、ステップ
S4へ移行する。
In addition, in step S2, when the update Tr number of the record and the Tr number that requested the update are equal, the process moves to step S4.

(ロ)バックアップデータ取得 外部の要求元からデータベースのバックアップの要求が
要求受は付は部14に供給された場合、要求受は付は部
14はその要求をデータベースバックアップ制御部6は
、第5図(b)に示す手順に従ってデータベース9をバ
ックアップする。
(b) Backup Data Acquisition When a request for database backup is supplied to the request receiving section 14 from an external request source, the request receiving section 14 receives the request from the database backup control section 6. The database 9 is backed up according to the procedure shown in Figure (b).

第5図(b)のバックアップデータ取得手順について説
明する。
The backup data acquisition procedure shown in FIG. 5(b) will be explained.

データベースバックアップ制御部6は、バックアップ中
表示フラグ3を“真”にする(ステップ511)。次に
、データベースバックアップ制御部6は、完了している
TrをCTRL 4に書込み(ステップ512)、バッ
クアップ作業の開始とCTRL4の内容をログに書込む
(ステップ513)。
The database backup control unit 6 sets the backup in progress display flag 3 to "true" (step 511). Next, the database backup control unit 6 writes the completed Tr to CTRL 4 (step 512), and writes the start of the backup work and the contents of CTRL 4 to the log (step 513).

データベースバックアップ制御部6は、全データペース
表をバックアップしたか否かをチエツクし、全データペ
ース表をバックアップしていない場合には、次のデータ
ベース表のバックアップを開始する(ステップS14,
515)。そして全レコードをバックアップした場合に
は、ステップS16からステップS14へ移行する。デ
ータベースバックアップ制御部6は、全レコードをバッ
クアップしていない場合、次のレコードのバックアップ
を開始する(ステップ816゜517)、次にデータベ
ースバックアップ制御部6は、現在値ページからレコー
ドを読出し、そのレコードの更新Tr番号がCTRL4
に含まれるか否かをチエツクし、CTRL4に含まれな
い場合は、レコードの更新前値ページからレコードをM
 出し、そのレコードの更新Tr番号がCTRL4に含
まれるか否かをチエツクする(ステップS18〜521
) データベースバックアップ制御部6は、そのレコー
ドの更新Tr番号がCTRL4に含まれていない場合は
、レコードのバックアップ値ページからレコードを読出
し、そのレコードをデータベース表のバックアップに書
込む(ステップS21〜523)。この後、ステップS
23からステップS14へ移行する。また、ステップS
19において、当該レコードの更新Tr番号がCTRL
4に含まれる場合やステップS21において当該レコー
ドの更新Tr番号がCTRL4に含まれる場合は、夫々
ステップS19.S21からステッブS23へと移行す
る。
The database backup control unit 6 checks whether all database tables have been backed up, and if all database tables have not been backed up, starts backing up the next database table (step S14,
515). If all records have been backed up, the process moves from step S16 to step S14. If not all records have been backed up, the database backup control unit 6 starts backing up the next record (steps 816 and 517). Next, the database backup control unit 6 reads the record from the current value page and saves that record. The update Tr number is CTRL4
If it is not included in CTRL4, select the record from the record's pre-update value page.
and checks whether the updated Tr number of the record is included in CTRL4 (steps S18 to S521).
) If the update Tr number of the record is not included in CTRL4, the database backup control unit 6 reads the record from the backup value page of the record and writes the record to the backup of the database table (steps S21 to 523). . After this, step S
23, the process moves to step S14. Also, step S
19, the update Tr number of the record is CTRL
4, or if the update Tr number of the record is included in CTRL4 in step S21, the process proceeds to step S19. The process moves from S21 to step S23.

以上のような動作を繰返して全データペース表をバック
アップした場合にはステップS14からステップS24
へ移行し、バックアップ作業の完了をログに書込む。そ
して、データベースバックアップ制御部6はバックアッ
プ中表示フラグ3を“偽”にする。
If all the database tables are backed up by repeating the above operations, steps S14 to S24 are performed.
, and writes the completion of the backup operation to the log. Then, the database backup control unit 6 sets the backup in progress display flag 3 to "false".

なお、ステップS12において、データベースバックア
ップ制御部6は、完了しているTrをCTRL4に書込
んでいるが、この場合、完了しているTrは、バックア
ップ取得開始(T back)時点のTr番号割当テー
ブルに格納されたTr番号の最後の値とバックアップ取
得開始時点の未完了なTr番号とから求まるので、完了
しているTrの代わりに、バックアップ取得開始時点の
、Tr番号の最後の値と未完了なTr番号とをCTRL
4に書込んでもよい。
In addition, in step S12, the database backup control unit 6 writes the completed Tr to CTRL4, but in this case, the completed Tr is written in the Tr number assignment table at the time of backup acquisition start (T back). Since it is determined from the last value of the Tr number stored in the Tr number and the uncompleted Tr number at the time of starting backup acquisition, instead of the completed Tr, the last value of the Tr number and the uncompleted Tr number at the time of starting backup acquisition are calculated. CTRL the Tr number
You can also write in 4.

また、例えば、第6図(a)のT back時点tlに
てバックアップが要求されたとする。このT back
時点t、においては、トランザクション(Tr、)1.
  トランザクション(Tr、)2は既に完了している
が、Tr、2.Tr、4は未完了の状態にある。しかし
、本発明では、第6図(b)で示す状態のデータベース
が、バックアップされる。
Further, for example, assume that a backup is requested at time T back tl in FIG. 6(a). This T back
At time t, transaction (Tr,)1.
Transaction (Tr,)2 has already been completed, but Tr,2. Tr, 4 is in an incomplete state. However, in the present invention, the database in the state shown in FIG. 6(b) is backed up.

即ち、データベースの各レコード毎に見れば、T ba
ck時点t、にて完了しているT「、1とTr、3の更
新後で、T back時に完了していないTr、2とT
r、4の更新前の値が、バックアップされる。
That is, if we look at each record in the database, T ba
Tr,2 and T, which have not been completed at Tback, after updating T',1 and Tr,3 which have been completed at time t,
The value of r,4 before the update is backed up.

(ハ)バックアップ作業中の更新 バックアップ中表示フラグが“真”で、バックアップ作
業中状態の時に、外部の要求元からのトランザクション
がデータベースの更新要求をした場合、データベース更
新制御部5は、第5図(C)に示す手順に従って、デー
タベースを更新し、ログを書込む。
(c) Update during backup operation If the backup operation display flag is “true” and a transaction from an external request source requests a database update while the backup operation is in progress, the database update control unit 5 Update the database and write the log according to the procedure shown in Figure (C).

第5図(c)のバックアップ作業中の更新手順について
説明する。
The update procedure during the backup operation shown in FIG. 5(c) will be explained.

先ず、データベース更新制御部5は、レコードの現在値
ページから更新するレコードを読出し、そのレコードの
更新Tr番号がCTRL4に含まれるか否かチエツクし
、CTRL4に含まれない場合、そのレコードをレコー
ドのバックアップ値ページに書込む(ステップ326〜
828) なお、ステップS27でレコードの更新Tr
番号がCTRL4に含まれるとき、ステップS29へ移
行する。次に、データベース更新制御部5は、前記レコ
ードの更新Tr番号が、更新要求した番号と等しいとき
は、ステップS31へ移行し、更新要求した番号と等し
くないときは、レコードをレコードの更新前値ページに
書込む(ステップS29゜530)。次に、データベー
ス更新制御部5は、レコードの更新値と更新を要求した
Trの番号を、現在値ページに書込み(ステップ531
)、更にデータベース表識別子とレコード識別子と更新
を要求したTrの番号と更新後のレコード本体の値をロ
グに書込む(ステップ532)ことで、バックアップ作
業中の更新を終了する。
First, the database update control unit 5 reads the record to be updated from the current value page of the record, checks whether the update Tr number of the record is included in CTRL4, and if it is not included in CTRL4, the record is updated. Write to backup value page (step 326~
828) Note that in step S27, the record update Tr
When the number is included in CTRL4, the process moves to step S29. Next, when the update Tr number of the record is equal to the update requested number, the database update control unit 5 moves to step S31, and when the update Tr number of the record is not equal to the update requested number, the database update control unit 5 updates the record to the pre-update value of the record. Write on the page (step S29゜530). Next, the database update control unit 5 writes the update value of the record and the number of the Tr that requested the update to the current value page (step 531
), and further writes the database table identifier, the record identifier, the number of the Tr that requested the update, and the value of the updated record body into the log (step 532), thereby terminating the update during the backup operation.

例えば、第4図を用いていえば、更新するレコードの現
在の値がレコードの現在値ページ45aに格納されてい
て、このレコードの更新Tr番号が、バックアップ取得
開始時に完了しておらず、かつ更新要求をしたTrと異
なる場合、前記レコードの現在値ページ45a上のレコ
ードの値を、レコードのバックアップ値ベージ47aの
対応する部分とレコードの更新前ページ46aの対応す
る部分に書込んだ後、レコードの現在の値45a上のレ
コードを更新する(第5図(C)のステップ326〜5
31)。
For example, using FIG. 4, if the current value of the record to be updated is stored in the record's current value page 45a, and the updated Tr number of this record has not been completed when backup acquisition starts, and the updated If it is different from the Tr that made the request, the value of the record on the current value page 45a of the record is written to the corresponding part of the record backup value page 47a and the corresponding part of the record before update page 46a, and then the record value is update the record on the current value 45a (steps 326-5 of FIG. 5(C)
31).

(ニ)データベース回復 データベースを格納する媒体に障害が発生すると、第5
図(d)に示す手順に従って、前記(ロ)で取得したバ
ックアップデータ11を2次記憶装置8bから2次記憶
装置8aのデータベース9にコピーすることにより、デ
ータベース9をT back時点まで回復しくステップ
533)、このデータベース9とT back時点で未
完了だったTrの更新ログにより、データベース9を更
新し、ログが取得されて最後のトランザクション実行状
態までデータベースを回復する(ステップ534)。
(d) Database recovery If a failure occurs in the medium that stores the database, the
By copying the backup data 11 obtained in step (b) from the secondary storage device 8b to the database 9 of the secondary storage device 8a according to the procedure shown in FIG. 533), the database 9 is updated using this database 9 and the update log of the Tr that was incomplete at the time of T back, and the log is acquired to restore the database to the last transaction execution state (step 534).

以上の説明から判かるように、本発明ではバックアップ
中は、レコードを更新するとき、更新要求をしたトラン
ザクション番号をレコードに更新値と共に記録し、更新
前のレコードの値をレコードのバックアップ値ページに
保存するようにしたので、更新業務を停止することなく
、バックアップ作業をすることができる。
As can be seen from the above explanation, in the present invention, when updating a record during backup, the transaction number that requested the update is recorded in the record along with the updated value, and the value of the record before the update is recorded on the backup value page of the record. Since it is saved, you can perform backup work without stopping update work.

本発明は本実施例に限定されることなく、本発明の要旨
を逸脱しない範囲で種々の応用及び変形が考えられる。
The present invention is not limited to this embodiment, and various applications and modifications can be made without departing from the gist of the present invention.

(発明の効果) 上述したように本発明を用いれば、バックアップ中のレ
コードの更新に当たり、更新要求のトランザクション番
号がレコードに記録したトランザクション番号と異なる
とき、レコードの更新前値を更新前値格納領域とバック
アップデータ保存領域に保存した後、該レコードを更新
するので、更新業務を停止することなくバックアップ作
業を行なうことができる。また、本発明によれば、デー
タベースを格納した媒体に障害が発生した場合、バック
アップデータを用いてデータベースを回復させることが
できる。
(Effects of the Invention) As described above, by using the present invention, when updating a record that is being backed up, when the transaction number of the update request is different from the transaction number recorded in the record, the pre-update value of the record is stored in the pre-update value storage area. Since the record is updated after being saved in the backup data storage area, backup work can be performed without stopping the update work. Further, according to the present invention, if a failure occurs in the medium on which the database is stored, the database can be recovered using backup data.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の一実施例を示すブロック図、第2図は
データベース内でのトランザクションの動作状況を示す
図、第3図はデータベース表10’の内部構成図、第4
図はデータベース表10′の格納形式の説明図、第5図
は第1図の動作フローチャート、第6図はデータベース
の状態を示す説明図である。 1・・・データベース管理システム、 2・・・Tr番号割当テーブル、 4・・・バックアップ開始時完了リスト(CTRL)、
5・・・データベース更新制御部、 6・・・データベースバックアップ制御部、7・・・デ
ータベース回復制御部、 8a、8b・・・2次記憶装置、9・・・データベース
、10′・・・データベース表、 11・・・バックアップデータ、 12′・・・データベース表のバックアップデータ。 データベース表1o′の格納形式の説明国策  4  
図 通常の更新手順のフローチャート 第  5  図(a) バックアップ作業中の更新手順フローチ?−)第 15
 図(c) データベース回復手履フローチ↑−ト 第5図(d)
FIG. 1 is a block diagram showing an embodiment of the present invention, FIG. 2 is a diagram showing the operational status of transactions within a database, FIG. 3 is an internal configuration diagram of a database table 10', and FIG.
FIG. 5 is an explanatory diagram of the storage format of the database table 10', FIG. 5 is an operation flowchart of FIG. 1, and FIG. 6 is an explanatory diagram showing the state of the database. 1... Database management system, 2... Tr number assignment table, 4... Completion list at backup start (CTRL),
5... Database update control unit, 6... Database backup control unit, 7... Database recovery control unit, 8a, 8b... Secondary storage device, 9... Database, 10'... Database Table, 11... Backup data, 12'... Backup data of database table. Explanation of storage format of database table 1o' National policy 4
Figure 5: Flowchart of normal update procedure Figure 5 (a) Flowchart of update procedure during backup work? -) No. 15
Figure (c) Database recovery manual flowchart ↑-Figure 5 (d)

Claims (1)

【特許請求の範囲】 2次記憶装置に格納したデータベースのレコードの更新
前イメージを保存し、トランザクション障害回復を行な
うデータベース管理システムにおいて、 前記2次記憶装置に格納したデータベースのレコードを
更新するとき、レコードに更新トランザクション番号を
記録し、バックアップ中のレコード更新では、更新要求
のトランザクション番号がレコードに記録したトランザ
クション番号と異なるとき、レコードの更新前値を更新
前値格納領域とバックアップデータ保存領域に保存した
後、該レコードを更新するデータベース更新制御部と、
前記2次記憶装置に格納したレコードをバックアップす
るときには、レコードに記録した更新トランザクション
番号によってレコードの現在値、更新前値、バックアッ
プ値の内いずれをバックアップするかを選択するデータ
ベースバックアップ制御部とを備えたことを特徴とする
データベース管理システム。
[Scope of Claims] In a database management system that stores pre-update images of database records stored in a secondary storage device and performs transaction failure recovery, when updating database records stored in the secondary storage device, An update transaction number is recorded in the record, and when a record is updated during backup, if the transaction number of the update request is different from the transaction number recorded in the record, the pre-update value of the record is saved in the pre-update value storage area and the backup data storage area. After that, a database update control unit updates the record;
When backing up the record stored in the secondary storage device, the database backup control unit selects which of the current value, pre-update value, and backup value of the record to back up based on the update transaction number recorded in the record. A database management system characterized by:
JP1283102A 1989-11-01 1989-11-01 Data base control system Pending JPH03147032A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1283102A JPH03147032A (en) 1989-11-01 1989-11-01 Data base control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1283102A JPH03147032A (en) 1989-11-01 1989-11-01 Data base control system

Publications (1)

Publication Number Publication Date
JPH03147032A true JPH03147032A (en) 1991-06-24

Family

ID=17661246

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1283102A Pending JPH03147032A (en) 1989-11-01 1989-11-01 Data base control system

Country Status (1)

Country Link
JP (1) JPH03147032A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110018408A1 (en) * 2008-03-19 2011-01-27 Cheon-Soo Cho Washing machine

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110018408A1 (en) * 2008-03-19 2011-01-27 Cheon-Soo Cho Washing machine
US8459754B2 (en) * 2008-03-19 2013-06-11 Lg Electronics Inc. Washing machine

Similar Documents

Publication Publication Date Title
US6959369B1 (en) Method, system, and program for data backup
JP2531894B2 (en) Data processing device
CA2933790C (en) Apparatus and method for creating a real time database replica
US7783848B2 (en) Method and apparatus for backup and recovery using storage based journaling
US7444485B1 (en) Method and apparatus for duplicating computer backup data
US6061769A (en) Data set backup in a shared environment
US8868507B2 (en) Method and apparatus for data recovery using storage based journaling
EP0351387B1 (en) Minimizing locking and reading in a segmented storage space
EP1461700B1 (en) Appliance for management of data replication
US5991772A (en) Method and apparatus for restoring a portion of a database
US7472139B2 (en) Database recovery method applying update journal and database log
US6745304B2 (en) Method and device for storing computer data with back-up operations
US20040260726A1 (en) DBMS backup without suspending updates and corresponding recovery using separately stored log and data files
JPH0823841B2 (en) Data processing system and method
US20070101063A1 (en) System recovery method and computer system using the same
US20050273474A1 (en) Method and system for data processing with data replication for the same
JP2002149454A (en) Transaction support on logical disk
EP0295424A2 (en) Method for managing subpage concurrency control and partial transaction rollback in a transaction-oriented system of the write-ahead logging type
US7523204B2 (en) Coordinated quiesce of a distributed file system
JP3991760B2 (en) Database management method and apparatus and processing program therefor
JP2002318717A (en) Database system
US20060026459A1 (en) Method and apparatus for storing data
JP3290182B2 (en) Data set backup method and apparatus in shared environment
JPH0287242A (en) Database backup and recovery method
JP2610972B2 (en) Database data integrity method