JP2008234142A - Batch processing restoration method and system, and program - Google Patents

Batch processing restoration method and system, and program Download PDF

Info

Publication number
JP2008234142A
JP2008234142A JP2007070642A JP2007070642A JP2008234142A JP 2008234142 A JP2008234142 A JP 2008234142A JP 2007070642 A JP2007070642 A JP 2007070642A JP 2007070642 A JP2007070642 A JP 2007070642A JP 2008234142 A JP2008234142 A JP 2008234142A
Authority
JP
Japan
Prior art keywords
database
processing
file
recovery
update
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
JP2007070642A
Other languages
Japanese (ja)
Inventor
Yuji Akune
雄二 阿久根
Shigeji Tasaka
繁慈 田坂
Tomoyoshi Bishu
智喜 備酒
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.)
Hitachi Information Systems Ltd
Original Assignee
Hitachi Information Systems 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 Hitachi Information Systems Ltd filed Critical Hitachi Information Systems Ltd
Priority to JP2007070642A priority Critical patent/JP2008234142A/en
Publication of JP2008234142A publication Critical patent/JP2008234142A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To efficiently carry out data restoration for reprocessing when processing abnormal finish occurs in a batch processing system, of updating a database and a sequential file, with interlocking by one process (program). <P>SOLUTION: The sequential file 60 at a commit time point of the database 50 is automatically saved into a backup file 70, in a business program, so as to secure a content of the sequential file 60 matched with the database 50 after committed, and the automatic data recovery is carried out for the sequential file 60, from the backup file 70 by a recovery processing function of a processing control tool of the batch processing, together with restoration processing by roll-back processing of the database 60 by a DBMS (Data Base Management System) function, in the processing abnormal finish. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、コンピュータシステムを用いた更新系バッチ処理において、データベースとシーケンシャルファイルとを1つの処理(プログラム)で連動させて更新する場合の処理異常終了発生時の再処理のためのデータ復元技術に係り、特に、大量更新のためデータベースのコミット(更新確定)を複数回実施するような処理において異常終了した場合における再処理の準備を、容易に、且つ、正確に実現させるのに好適な技術に関するものである。   The present invention relates to a data restoration technique for reprocessing when an abnormal end of processing occurs when updating a database and a sequential file linked in one process (program) in update batch processing using a computer system. In particular, the present invention relates to a technique suitable for easily and accurately realizing preparation for reprocessing in the case of abnormal termination in a process in which a database commit (update confirmation) is performed a plurality of times for mass update. Is.

バッチ処理では、入力ファイルに格納されているレコードを順次読込み、この読込んだレコードについて処理を行い更新ファイル(データベース)に順次格納するという処理過程をジョブ毎に行う。   In batch processing, a process of sequentially reading records stored in an input file, processing the read records, and sequentially storing them in an update file (database) is performed for each job.

このようなバッチ処理は、更新系バッチ処理プログラムに従って行われるが、ファイルレコードの更新処理途中で障害が発生すると、ファイルレコードの二重更新を防止するために、一旦、更新前の状態に全てのファイルレコードを戻し、再度、ファイルレコードの最初から更新処理をやり直すようになっている。   Such batch processing is performed according to the update system batch processing program. If a failure occurs during the update process of the file record, all the state before the update is temporarily set to prevent double update of the file record. The file record is returned, and the update process is started again from the beginning of the file record.

そのために、復旧時間が長くなると共に、データベース(更新ファイル)を更新前の状態に戻す際に種々のトラブルが発生するという問題がある。   Therefore, there are problems that the recovery time becomes long and various troubles occur when the database (update file) is returned to the state before the update.

このような問題を解決する従来技術として、例えば、特許文献1に記載の技術がある。この技術は、更新系バッチ処理プログラムの障害発生時における更新ファイルの復旧処理をなくして、バッチ処理再開を直ちに行い得るようにしたものである。   As a conventional technique for solving such a problem, for example, there is a technique described in Patent Document 1. This technique eliminates the update file recovery process when a failure occurs in the update batch processing program, so that the batch process can be resumed immediately.

具体的には、入力ファイルから順次レコードを読込んでこの読込みレコードについて処理を行い更新ファイルに順次格納する処理過程をジョブ毎に行うようにしたバッチ処理システムにおいて、ジョブ毎に処理済みのレコード数を記録する処理レコード記録手段と、所定ジョブの開始指令に応答して、処理レコード記録手段に記録されている当該ジョブ対応のレコード数を検索する手段と、この検索された処理レコード数が初期値“0”以外の数値を示しているとき、入力ファイル内の数値の次のレコードから処理を開始する手段とを設けたものである。   Specifically, in a batch processing system that reads a record sequentially from an input file, processes the read record, and sequentially stores it in an update file for each job, the number of records processed for each job is calculated. A processing record recording means for recording; a means for searching for the number of records corresponding to the job recorded in the processing record recording means in response to a start instruction for a predetermined job; and When a numerical value other than “0” is indicated, means for starting processing from the next record of the numerical value in the input file is provided.

また、他の従来技術では、入力ファイルから順次レコードを読み込んで、データベースを更新する処理において、処理が異常終了した場合、以下のように対処している。   In another conventional technique, in the process of reading records sequentially from the input file and updating the database, the following measures are taken when the process ends abnormally.

第1の従来技術では、入力ファイルから順次レコードを読み込んで、データベースを更新する処理では、処理が異常終了した場合、コミット(更新確定)を行う前の状態の時は、データベースのロールバック機能により、データベースを更新前の状態に自動回復する。この技術では、再処理時は、異常終了の原因を除去後、再度入力ファイルの先頭レコードからデータベース更新処理を実行させる。   In the first conventional technique, in the process of sequentially reading records from the input file and updating the database, if the process ends abnormally, the state before the commit (update confirmation) is performed by the database rollback function. Automatically restore the database to its pre-update state. In this technique, at the time of reprocessing, after the cause of abnormal termination is removed, database update processing is executed again from the first record of the input file.

第2の従来技術では、大量のデータをデータベースに更新する処理において、データベースのロールバック用のエリアが膨大にならないように、適切なレコード数分の処理が終了した段階でコミット(更新確定)を実施させる。この場合、更新処理が異常終了したときは、直前のコミット(更新確定)前までデータベースを自動回復させる。この技術では、再処理時は、異常終了の原因を除去後、最終コミット(更新確定)時点までの入力ファイルのレコードを読み飛ばし、最終コミット(更新確定)時点以降のレコードからデータベース更新処理を実行させる。これにより二重更新を防止させる。   In the second prior art, in the process of updating a large amount of data to the database, commit (update confirmation) is performed at the stage when the process for the appropriate number of records is completed so that the area for rollback of the database does not become enormous. Let it be implemented. In this case, when the update process ends abnormally, the database is automatically recovered until before the last commit (update confirmation). With this technology, at the time of reprocessing, after removing the cause of abnormal termination, the records of the input file up to the time of the last commit (update confirmation) are skipped, and the database update processing is executed from the records after the last commit (update confirmation) Let This prevents double updates.

第3の従来技術では、入力ファイルから順次レコードを読み込んで、出力ファイルであるシーケンシャルファイルを更新する処理において、処理が異常終了した場合、処理前に取得した出力ファイルのバックアップを基にファイルを回復させるか、もしくは、再処理実施時、更新したレコード件数分の入力レコードを読み飛ばすことで、二重更新を起こさせないようにする。   In the third conventional technique, in the process of sequentially reading records from the input file and updating the sequential file that is the output file, if the process ends abnormally, the file is recovered based on the backup of the output file obtained before the process. Or, when reprocessing is performed, double update is prevented from occurring by skipping the input records for the number of updated records.

しかし、データベースとシーケンシャルファイルを1つの処理(プログラム)で同時に更新を行い、且つ、大量更新のためデータベースのコミット(更新確定)を複数回実施するような処理を行うシステムにおいては、異常終了した場合、ロールバック後のデータベースと更新後のシーケンシャルファイルでは、処理済み時点が異なってしまうため、同期が取れていない。このような場合、上述の特許文献1の技術を含めむ従来技術では対処できない。   However, if the system and the sequential file are updated in one process (program) at the same time, and the system that performs the process of committing the database (update confirmation) multiple times for mass update, the process ends abnormally. The database after the rollback and the sequential file after the update are not synchronized because the processed time points are different. Such a case cannot be dealt with by the conventional technique including the technique of Patent Document 1 described above.

例えば、業務プログラムにて入力ファイから順次レコードを読み込み、レコード項目のチェック処理を行った後、チェック処理(データベースの更新判定)でOKとなったレコードをデータベースへ更新し、NGとなったレコードをエラー情報としてシーケンシャルファイルに出力するような処理において、大量のデータを入力させる場合、データベースのロールバック用エリアが膨大且つ、不足しないよう、適切なレコード数分処理した場合に、コミットさせる場合である。   For example, after reading records sequentially from the input file with a business program and performing a check process for record items, the record that was OK in the check process (database update determination) is updated to the database, and the record that is NG In the process of outputting to the sequential file as error information, when a large amount of data is input, when the appropriate number of records are processed so that the database rollback area is not too large and insufficient, the commit is performed. .

このような場合、異常終了後の再処理を行うためには、処理実行前のデータベースとシーケンシャルファイルのバックアップをそれぞれ取得しておき、異常終了時には、バックアップからデータベースとシーケンシャルファイルを処理実行前の状態に回復した後、再度1件目のレコードから処理を行う必要がある。   In such a case, in order to perform reprocessing after abnormal termination, a backup of the database and sequential file before execution of the process is acquired, and at the time of abnormal termination, the database and sequential file are processed from the backup before execution. After recovering, it is necessary to perform processing from the first record again.

これにより、再処理で途中の件数までは、1回目と同じ処理を繰り返さなければならないため、時間、および、労力に無駄が発生することになる。   As a result, the same processing as the first time must be repeated up to the number of cases in the middle of reprocessing, resulting in wasted time and labor.

特開平06−012267号公報Japanese Patent Laid-Open No. 06-012267

解決しようとする問題点は、従来の技術では、データベースの更新を単一プログラムで複数回コミットし、且つ、シーケンシャルファイルを更新する処理を行うシステムにおいては、処理が途中で異常終了した場合、データベースはロールバック機能にて直前コミット時点まで自動回復するが、シーケンシャルファイルは異常終了時点となり、データベースとシーケンシャルファイルのデータが不整合となる点である。   The problem to be solved is that, in the conventional technique, in a system that performs processing of updating a sequential file with a single program and updating a sequential file, the database is Is automatically recovered to the point of the last commit with the rollback function, but the sequential file becomes the abnormal end point and the data in the database and the sequential file become inconsistent.

本発明の目的は、これら従来技術の課題を解決し、データベースのコミット時点と連動したシーケンシャルファイルの退避と処理異常時の回復を自動的に行うことで処理異常時の対処(再実行など)を簡易的および正確に実施することを可能とすることである。   The object of the present invention is to solve the problems of the prior art, and to deal with a processing error (such as re-execution) by automatically saving a sequential file linked with the commit time of the database and automatically recovering from the processing error. It is possible to carry out simply and accurately.

上記目的を達成するため、本発明においては、業務プログラム内でデータベースのコミット時点のシーケンシャルファイルを自動的にバックアップファイルに退避して、コミット後のデータベースと整合性のとれたシーケンシャルファイルの内容を確保しておき、処理異常終了時には、DBMS機能によるデータベースのロールバック処理による回復処理と共に、シーケンシャルファイルに対しても、バッチ処理の処理制御ツールのリカバリ処理機能により、バックアップファイルからのデータ自動回復を行う。このように、コミット時点でのシーケンシャルファイル自動バックアップと、従来技術であるバッチ処理の処理制御ツールのリカバリ機能にて行うシーケンシャルファイル回復とを組み合わることにより、単一プログラムで複数回コミットする場合のデータベースおよびシーケンシャルファイルを整合性のとれた状態とすることができる。   In order to achieve the above object, in the present invention, the sequential file at the time of committing the database is automatically saved in the backup file in the business program, and the contents of the sequential file consistent with the database after committing are secured. In addition, when processing ends abnormally, automatic recovery of data from backup files is performed for sequential files as well as recovery processing by database rollback processing using the DBMS function, using the recovery processing function of the processing control tool for batch processing. . In this way, by combining sequential file automatic backup at the time of commit and sequential file recovery performed by the recovery function of the batch processing process control tool, which is a conventional technology, when committing multiple times in a single program Databases and sequential files can be kept in a consistent state.

本発明によれば、データベースの更新を単一業務プログラムで複数回コミットし、且つ、シーケンシャルファイルを更新する処理を行うバッチ処理システムにおいて、例え、業務プログラムの処理が途中で異常終了した場合にも、シーケンシャルファイルを、ロールバックされたデータベースと整合性のとれた直近のコミット完了時点の内容に自動的に回復することができ、大量データの更新を行うときに処理異常終了が発生した場合にも、処理異常終了発生時にも、データベースのコミットとシーケンシャルファイルの更新の整合性を意識することなく、異常終了時の再実行を簡易に且つ正確に行うことが可能である。   According to the present invention, in a batch processing system that performs processing for updating a database multiple times with a single business program and updating a sequential file, for example, even when the processing of a business program ends abnormally. The sequential file can be automatically recovered to the content at the time of the most recent commit completion that is consistent with the rolled back database, and even if a processing abnormal termination occurs when updating a large amount of data Even when processing abnormal termination occurs, re-execution upon abnormal termination can be performed easily and accurately without being aware of the consistency between the commit of the database and the update of the sequential file.

以下、図を用いて本発明を実施するための最良の形態例を説明する。図1は、本発明に係るバッチ処理システムの構成例を示すブロック図であり、図2は、図1におけるバッチ処理システムの本発明に係る処理動作例を示すフローチャート、図3は、図1におけるバッチ処理システムによる更新処理異常終了時のデータベースの回復処理およびシーケンシャルファイルの回復処理動作例を示す説明図、図4は、図1におけるバッチ処理システムによる更新処理異常終了までのデータベースおよびシーケンシャルファイルの更新処理動作例を示す説明図、図5は、図1におけるバッチ処理システムによる更新処理異常終了時のデータベースの回復処理動作例を示す説明図、図6は、図1におけるバッチ処理システムによる更新処理異常終了時のシーケンシャルファイルの回復処理動作例を示す説明図である。   The best mode for carrying out the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing a configuration example of a batch processing system according to the present invention, FIG. 2 is a flowchart showing an example of processing operation according to the present invention of the batch processing system in FIG. 1, and FIG. FIG. 4 is an explanatory diagram showing an example of database recovery processing and sequential file recovery processing when the update processing is abnormally terminated by the batch processing system. FIG. 4 is a diagram of updating the database and sequential file until the batch processing system in FIG. FIG. 5 is an explanatory diagram showing an example of processing operation, FIG. 5 is an explanatory diagram showing an example of database recovery processing operation at the time of abnormal termination of update processing by the batch processing system in FIG. 1, and FIG. It is explanatory drawing which shows the recovery processing operation example of the sequential file at the time of completion | finish.

図1におけるバッチ処理システムは、プログラムされたコンピュータ処理により、データベース50とシーケンシャルファイル(図中「出力ファイル」と記載)60とを1つの処理(プログラム)で連動させて更新すると共に、処理異常終了発生時の再処理のためのデータ復元を行うものであり、CPU(Central Processing Unit)や主メモリ、表示装置、入力装置、外部記憶装置等からなり、光ディスク駆動装置等を介してCD−ROM等の記憶媒体に記録されたプログラムやデータを外部記憶装置内にインストールした後、この外部記憶装置から主メモリに読み込みCPUで処理することにより、各処理部の機能を実行することで、特に、大量更新のためデータベース50のコミット(更新確定)を複数回実施するような処理において異常終了した場合における再処理の準備を、容易に、且つ、正確に行う。   The batch processing system in FIG. 1 updates the database 50 and the sequential file (described as “output file” in the figure) 60 in a single process (program) by programmed computer processing and terminates abnormally. Data recovery for reprocessing at the time of occurrence, consisting of a CPU (Central Processing Unit), main memory, display device, input device, external storage device, etc., CD-ROM etc. via an optical disk drive device etc. After installing the program or data recorded in the storage medium in the external storage device, the program is read from the external storage device into the main memory and processed by the CPU, thereby executing the functions of each processing unit. Commit (update confirmation) of database 50 multiple times for update Preparation for reprocessing when the process ends abnormally is easily and accurately performed.

図1において、バッチ処理システムは、業務プログラムにて、記憶装置に格納された入力ファイル30から順次レコードを読み込み、記憶装置に格納されたデータベース50とシーケンシャルファイル60の更新を行う処理を実行するものであり、プログラムを用いてコンピュータで実現する機能として、通常実行処理部10と異常終了処理部20が設けられている。   In FIG. 1, the batch processing system executes a process of sequentially reading records from an input file 30 stored in a storage device and updating a database 50 and a sequential file 60 stored in the storage device by a business program. As a function realized by a computer using a program, a normal execution processing unit 10 and an abnormal end processing unit 20 are provided.

通常実行処理部10は、入力ファイル読み込み部11、ファイル出力部12aとデータベース更新部12bからなるデータベース更新部12、コミット部13aと出力ファイルバックアップ部13bからなるデータベース更新確定部13、コミット件数情報記録部14からなり、入力ファイル30の読み込みと、データベース50への書き込み・更新、および、データベース50のコミット(確定更新)と、当該データベース50のコミット時のコミット件数情報の記録ならびにシーケンシャルファイル60の退避(バックアップ処理)を行う。   The normal execution processing unit 10 includes an input file reading unit 11, a database update unit 12 including a file output unit 12a and a database update unit 12b, a database update confirmation unit 13 including a commit unit 13a and an output file backup unit 13b, and a commit number information record. Unit 14, reads the input file 30, writes / updates to the database 50, commits the database 50 (confirmed update), records the commit number information at the time of committing the database 50, and saves the sequential file 60. (Backup process).

すなわち、入力ファイル読み込み部11は、プログラム機動指令に対応して入力ファイル30から当該ジョブ対応のレコードを順次に読み込みデータベース更新部12に渡す。   That is, the input file reading unit 11 sequentially reads records corresponding to the job from the input file 30 in response to the program operation command and passes them to the database update unit 12.

データベース更新部12は、入力ファイル読み込み部11から渡されたレコードに対して、データチェック処理機能によりデータ項目のチェックを行い、データ項目が正しければデータベース更新部12bにより、データ編集・加工を行った後にデータベース50への書き込み・更新を行う。   The database update unit 12 checks the data item with the data check processing function for the record passed from the input file reading unit 11, and if the data item is correct, the database update unit 12b performs data editing / processing. The database 50 is written / updated later.

データチェック処理機能によるデータ項目のチェックで、データ項目に誤りがあることを検出した場合には、データベース更新部12は、ファイル出力部12aにより、エラー情報として当該レコードをシーケンシャルファイル60へ出力する。   When the data check by the data check processing function detects that there is an error in the data item, the database update unit 12 outputs the record as error information to the sequential file 60 by the file output unit 12a.

その際、外部パラメータであるコミット間隔パラメータ40から指定されたコミットカウンタ値と業務プログラムで記録しているレコードカウント値とが一致した場合、データベース更新確定部13が起動する。   At this time, if the commit counter value designated from the commit interval parameter 40, which is an external parameter, matches the record count value recorded by the business program, the database update confirming unit 13 is activated.

データベース更新確定部13は、コミット部13aにより、データベース50に対するコミット(更新確定)を実施すると共に、出力ファイルバックアップ部13bにより、シーケンシャルファイル60のレコード内容をバックアップファイル(図中「出力ファイルバックアップ」と記載)70に複製して退避させる。これにより、データベース50のコミット(確定更新)時点のシーケンシャルファイル60の同期を行う。   The database update confirmation unit 13 commits (update confirmation) to the database 50 by the commit unit 13a, and records the record contents of the sequential file 60 by the output file backup unit 13b as “output file backup” in the figure. Description) Duplicated in 70 and saved. As a result, the sequential file 60 at the time of commit (definite update) of the database 50 is synchronized.

コミット件数情報記録部14は、データベース更新確定部13のコミット部13aおよび出力ファイルバックアップ部13bによる、データベース50に対するコミット(更新確定)とシーケンシャルファイル60のレコード内容のバックアップファイル70への退避処理毎に、当該処理情報を記憶装置に記録する。   The commit number information recording unit 14 performs commit (update confirmation) on the database 50 and saves the record contents of the sequential file 60 to the backup file 70 by the commit unit 13a and the output file backup unit 13b of the database update confirmation unit 13. The processing information is recorded in the storage device.

このように、本例のジョブ処理システムでは、データベース50のコミット時点のシーケンシャルファイル60のレコード内容を自動的にバックアップファイル70へ退避しておくことで、ロールバック後のデータベース50と整合性のとれたバックアップファイル70を確保している。   Thus, in the job processing system of this example, the record contents of the sequential file 60 at the time of committing the database 50 are automatically saved in the backup file 70, so that consistency with the database 50 after the rollback can be obtained. The backup file 70 is secured.

そして、処理異常終了時には、異常終了処理部20におけるリカバリ処理部21による処理により、データベース50の回復処理と共に、確保したバックアップファイル70からシーケンシャルファイル60のレコード内容を回復する処理を行い、データベース50との同期をとる。   When the process ends abnormally, the recovery process unit 21 in the abnormal end process unit 20 performs the process of recovering the record contents of the sequential file 60 from the secured backup file 70 together with the recovery process of the database 50. Synchronize.

本例のリカバリ処理部21は、DBMS(Data Base Managing System)の既存の機能であるロールバック処理を行うロールバック部21aと、従来技術であるバッチ処理の処理制御ツールのリカバリ機能としてのリカバリ処理を行う出力ファイル戻し部21bを具備し、ロールバック部21aにより、データベース50に対するロールバック処理を行い、出力ファイル戻し部21bにより、出力ファイルバックアップ70を用いたシーケンシャルファイル60に対するリカバリ処理を行う。   The recovery processing unit 21 of this example includes a rollback unit 21a that performs rollback processing, which is an existing function of DBMS (Data Base Managing System), and recovery processing as a recovery function of a processing control tool for batch processing that is a conventional technology The output file return unit 21b is configured to perform rollback processing on the database 50 by the rollback unit 21a, and recovery processing is performed on the sequential file 60 using the output file backup 70 by the output file return unit 21b.

これにより、データベース50の更新を複数回コミットする業務プログラムが異常終了した場合に、ロールバックされたデータベース50と整合性のとれたシーケンシャルファイル60を、直近のコミット完了時点のシーケンシャルファイル70と同じ内容で自動的に回復することができる。   As a result, when the business program that commits the update of the database 50 multiple times ends abnormally, the sequential file 60 that is consistent with the rolled back database 50 has the same contents as the sequential file 70 at the time of the most recent commit completion. Can be recovered automatically.

このように、本例のバッチ処理システムでは、コミット時点でのシーケンシャルファイル自動バックアップとバッチ処理の処理制御ツールのリカバリ機能を組み合わることにより、単一プログラムで複数回コミットする場合のデータベース50およびシーケンシャルファイル60が整合性のとれた状態となる。   In this way, in the batch processing system of this example, by combining the sequential file automatic backup at the time of committing and the recovery function of the processing control tool for batch processing, the database 50 and sequential when committing multiple times with a single program are performed. The file 60 is in a consistent state.

以下、図2を用いて、通常実行処理部10による、データベース50とシーケンシャルファイル60の更新処理の詳細を説明する。   Hereinafter, the details of the update process of the database 50 and the sequential file 60 by the normal execution processing unit 10 will be described with reference to FIG.

上述したように、ここでは、業務プログラムにて入力ファイル30のレコードを順次読み込み、データチェック処理にてデータ項目をチェックし、データ項目が正しければデータ編集・加工した後にデータベース50の更新を行い、データ項目に誤りがあれば、シーケンシャルファイル60にエラー情報としてレコードを出力する処理を行い、その際、外部パラメータで指定したコミットカウンタ値(コミット間隔パラメータ40)と業務プログラムで記録しているレコードカウント値が一致した場合、データベース50のコミット(確定更新)とシーケンシャルファイル60の退避を行い、データベース50のコミット(確定更新)時点のシーケンシャルファイル60の同期を行う例を用いる。   As described above, here, the records of the input file 30 are sequentially read by the business program, the data items are checked by the data check process, and if the data items are correct, the database 50 is updated after the data is edited and processed, If there is an error in the data item, a record is output as error information to the sequential file 60. At this time, the commit counter value (commit interval parameter 40) specified by the external parameter and the record count recorded by the business program are processed. When the values match, an example is used in which the commit (definite update) of the database 50 and the sequential file 60 are saved, and the sequential file 60 at the time of commit (definite update) of the database 50 is synchronized.

処理の実行に当たり、最初に、データベース50のコミット実行判定の基となるコミットカウンタ値を読み込む(ステップS201)。   In executing the process, first, a commit counter value that is a basis for the commit execution determination of the database 50 is read (step S201).

次に、入力ファイル30から1レコードを読み込み(ステップS202)、コミット判定値となる入力ファイル30のレコード入力件数をカウントするレコードカウンタ値に1を設定する(ステップS203)。   Next, one record is read from the input file 30 (step S202), and 1 is set to the record counter value for counting the number of record inputs of the input file 30 that is the commit determination value (step S203).

続いて、入力ファイル30のレコード読み込みが終了(EOF)となるまで繰り返す処理部分(ステップS204〜S214)について説明する。   Next, the processing part (steps S204 to S214) that is repeated until the record reading of the input file 30 is completed (EOF) will be described.

まず、入力したレコードの項目チェックを行い、データベース50への更新判定を実施する(ステップS205)。   First, an item check is performed on the input record to determine whether to update the database 50 (step S205).

判定の結果、データベース50への更新対象レコードであれば、データ項目の編集・加工を行い、データベース50への仮書き込みを行い(ステップS206)、また、判定結果がデータベース50の更新対象外レコードであれば、入力レコードをシーケンシャルファイル60(出力ファイル)へ出力する(ステップS207)。   As a result of the determination, if the record is an update target record in the database 50, the data item is edited / processed, temporarily written in the database 50 (step S206), and the determination result is a non-update target record in the database 50. If there is, the input record is output to the sequential file 60 (output file) (step S207).

次に、コミットカウンタ値とレコードカウンタ値を比較し(ステップS208)、カウンタ値が同じ場合、データベース50へのコミット(更新確定)を行う(ステップS209)と共に、シーケンシャルファイル60(出力ファイル)の全レコードをバックアップ用のシーケンシャルファイル(バックアップファイル70)へ出力する(ステップS210)。   Next, the commit counter value and the record counter value are compared (step S208). If the counter values are the same, commit (update confirmation) to the database 50 is performed (step S209) and all the sequential files 60 (output files) The record is output to a sequential file for backup (backup file 70) (step S210).

そして、レコードカウンタ値を「0」とし(ステップS211)、入力ファイル30から次の1レコードを読み込み(ステップS212)、レコードカウンタ値に1を加算(ステップS213)した後、繰り返し部分の先頭(ステップS204)へ戻る。   Then, the record counter value is set to “0” (step S211), the next one record is read from the input file 30 (step S212), and 1 is added to the record counter value (step S213). Return to S204).

尚、ステップS208での比較において、カウンタ値が異なる場合、入力ファイル30から1レコードを読み込み(ステップS212)、レコードカウンタ値に1を加算(ステップS213)した後、繰り返し部分の先頭(ステップS204)へ戻る。   In the comparison in step S208, if the counter values are different, one record is read from the input file 30 (step S212), 1 is added to the record counter value (step S213), and the beginning of the repeated portion (step S204). Return to.

入力ファイル30が最終レコードの場合には、繰り返し部分(ステップS204〜214)の処理の終了後、コミット(更新確定)を実行し(ステップS215)、処理を終了させる。尚、ステップS209およびステップS215におけるコミット実行時には、コミット件数情報記録部14において、その際の、入力レコード件数等の情報を記憶装置に記録する。   If the input file 30 is the last record, commit (update confirmation) is executed (step S215) after the process of the repeated portion (steps S204 to 214) is completed, and the process is terminated. At the time of commit execution in steps S209 and S215, the commit number information recording unit 14 records information such as the number of input records at that time in the storage device.

次に、図3〜図6を用いて、異常終了処理部20による、更新処理異常終了時のシーケンシャルファイル60の自動回復を行う業務処理の実行例を説明する。   Next, an execution example of business processing for automatically recovering the sequential file 60 at the time of abnormal termination of update processing by the abnormal termination processing unit 20 will be described with reference to FIGS.

本例の説明では、業務プログラムにて入力ファイル30のレコードを順次読み込み、入力ファイル30のレコード読み込みが45万件目で例外データ(データチェック処理でエラーとならないデータ)やデータベース50のエリア不足などにより処理が異常終了した場合の、回復したデータベース50に同期しているシーケンシャルファイル60の自動回復機能を例とする。   In the explanation of this example, the records of the input file 30 are sequentially read by the business program, the record reading of the input file 30 is 450,000th, the exception data (data that does not cause an error in the data check process), the shortage of the database 50 area, etc. As an example, the automatic recovery function of the sequential file 60 synchronized with the recovered database 50 when the process ends abnormally as described above.

図4に示すように、入力ファイル30からのレコードの読み込みが10万件に達する度に、データベース50におけるコミット(更新確定)とシーケンシャルファイル60(出力ファイル)に対するバックアップファイル70(退避ファイル)への退避処理が実行され、入力ファイル30のレコード読み込みが45万件目で処理が異常終了した場合(ステップ301)、データベース30は、リカバリ処理部21のロールバック部21aにより、図5に示すように、DBMSのロールバック機能により最終コミット時点である40万件目処理終了時点まで自動的に回復する(ステップ302〜303)。   As shown in FIG. 4, every time the number of records read from the input file 30 reaches 100,000, the commit (update confirmation) in the database 50 and the backup file 70 (evacuation file) for the sequential file 60 (output file) are stored. When the save process is executed and the record reading of the input file 30 is 450,000th and the process ends abnormally (step 301), the database 30 is processed by the rollback unit 21a of the recovery processing unit 21 as shown in FIG. The DBMS rollback function automatically recovers to the end of the 400,000th processing, which is the final commit time (steps 302 to 303).

シーケンスファイル60に関しては、データベース50の最終コミット時点である40万件目処理終了時点のバックアップファイル70が自動取得されており、リカバリ処理部21の出力ファイル戻し部21b、すなわち、バッチ処理の処理制御ツールのリカバリ機能により、図6に示すように、バックアップファイル70からシーケンシャルファイル60を自動的に回復する(ステップ305〜307)。   Regarding the sequence file 60, the backup file 70 at the end of the 400,000th processing, which is the final commit time of the database 50, is automatically acquired, and the output file return unit 21b of the recovery processing unit 21, that is, the process control of batch processing As shown in FIG. 6, the sequential file 60 is automatically recovered from the backup file 70 by the tool recovery function (steps 305 to 307).

これにより、データベース50とシーケンシャルファイル60はきちんと同期が取れた状況になり、異常終了の原因を除去後、再処理を行う際には、最終コミット(更新確定)時点までの入力ファイルの件数を読み飛ばす従来技術により、無駄な入力処理も無くすことが可能となる。   As a result, the database 50 and the sequential file 60 are properly synchronized. When reprocessing is performed after the cause of the abnormal termination is removed, the number of input files up to the time of the final commit (update confirmation) is read. It is possible to eliminate useless input processing by the conventional technique of skipping.

以上、図1〜図6を用いて説明したように、本例では、業務プログラム内でデータベース50のコミット時点のシーケンシャルファイル60を自動的にバックアップファイル70に退避して、コミット後のデータベース50と整合性のとれたシーケンシャルファイル60の内容を確保しておき、処理異常終了時には、DBMS機能によるデータベース50のロールバック処理による回復処理と共に、シーケンシャルファイル60に対しても、バッチ処理の処理制御ツールのリカバリ処理機能により、バックアップファイル70からのデータ自動回復を行う。   As described above with reference to FIGS. 1 to 6, in this example, in the business program, the sequential file 60 at the time of committing the database 50 is automatically saved in the backup file 70, and the committed database 50 and The contents of the sequential file 60 with consistency are secured, and when the process ends abnormally, the recovery process by the rollback process of the database 50 by the DBMS function is performed, and the process control tool of the batch process is also applied to the sequential file 60. Automatic data recovery from the backup file 70 is performed by the recovery processing function.

このように、コミット時点でのシーケンシャルファイル60のバックアップファイル70への自動バックアップと、従来技術であるバッチ処理の処理制御ツールのリカバリ機能にて行うシーケンシャルファイル回復とを組み合わることにより、単一プログラムで複数回コミットする場合のデータベース50およびシーケンシャルファイル60を整合性のとれた状態とすることができる。   In this way, a single program is obtained by combining automatic backup of the sequential file 60 to the backup file 70 at the time of committing and sequential file recovery performed by the recovery function of the processing control tool for batch processing, which is a conventional technique. Thus, the database 50 and the sequential file 60 in the case of committing a plurality of times can be brought into a consistent state.

これにより、データベース50の更新を単一業務プログラムで複数回コミットし、且つ、シーケンシャルファイル60を更新する処理を行うバッチ処理システムにおいて、例え、業務プログラムの処理が途中で異常終了した場合にも、シーケンシャルファイル60を、ロールバックされたデータベース50と整合性のとれた直近のコミット完了時点の内容に自動的に回復することができる。   Thus, in a batch processing system that commits the update of the database 50 a plurality of times with a single business program and updates the sequential file 60, for example, even when the processing of the business program ends abnormally, The sequential file 60 can be automatically recovered to the content at the time of the latest commit completion that is consistent with the rolled back database 50.

このように、データベース50のコミット時点と連動したシーケンシャルファイル60の退避と処理異常時の回復を自動的に行うことで、大量データの更新を行うときに処理異常終了が発生した場合にも、データベース50のコミットとシーケンシャルファイル60の更新の整合性を意識することなく、異常終了時の再実行を簡易に且つ正確に行うことが可能となる。   As described above, even when processing abnormal termination occurs when updating a large amount of data by automatically saving the sequential file 60 linked with the commit time of the database 50 and recovering when processing is abnormal, the database Re-execution at the time of abnormal termination can be performed easily and accurately without being aware of the consistency between 50 commits and sequential file 60 update.

すなわち、大量データの更新を行うとき、処理が異常終了した段階でデータベース50のロールバックによる回復時点に合わせて、シーケンシャルファイル60も自動的に回復させることができ、再処理のための準備を効率よく行うことが可能となる。   That is, when a large amount of data is updated, the sequential file 60 can also be automatically recovered in accordance with the recovery point by the rollback of the database 50 when the processing ends abnormally. It can be done well.

尚、本発明は、図1〜図6を用いて説明した例に限定されるものではなく、その要旨を逸脱しない範囲において種々変更可能である。例えば、本例では、1つのコンピュータ装置内に、バッチ処理システムとデータベース・システム等を設けた構成としているが、バッチ処理システムとデータベース・システム等を、それぞれネットワークを介して接続された個別のコンピュータ装置に設けた構成としても良い。   In addition, this invention is not limited to the example demonstrated using FIGS. 1-6, In the range which does not deviate from the summary, various changes are possible. For example, in this example, a batch processing system and a database system are provided in one computer device, but the batch processing system and the database system are connected to each other via a network. It is good also as a structure provided in the apparatus.

また、本例のコンピュータ構成に関しても、キーボードや光ディスクの駆動装置の無いコンピュータ構成としても良い。また、本例では、光ディスクを記録媒体として用いているが、FD(Flexible Disk)等を記録媒体として用いることでも良い。また、プログラムのインストールに関しても、通信装置を介してネットワーク経由でプログラムをダウンロードしてインストールすることでも良い。   The computer configuration of this example may be a computer configuration without a keyboard or optical disk drive. In this example, an optical disk is used as a recording medium. However, an FD (Flexible Disk) or the like may be used as a recording medium. As for the program installation, the program may be downloaded and installed via a network via a communication device.

本発明に係るバッチ処理システムの構成例を示すブロック図である。It is a block diagram which shows the structural example of the batch processing system which concerns on this invention. 図1におけるバッチ処理システムの本発明に係る処理動作例を示すフローチャートである。It is a flowchart which shows the processing operation example which concerns on this invention of the batch processing system in FIG. 図1におけるバッチ処理システムによる更新処理異常終了時のデータベースの回復処理およびシーケンシャルファイルの回復処理動作例を示す説明図である。It is explanatory drawing which shows the example of recovery processing of the database at the time of the update process abnormal end by the batch processing system in FIG. 1, and recovery processing of a sequential file. 図1におけるバッチ処理システムによる更新処理異常終了までのデータベースおよびシーケンシャルファイルの更新処理動作例を示す説明図である。It is explanatory drawing which shows the update process operation example of the database and sequential file until update process abnormal end by the batch processing system in FIG. 図1におけるバッチ処理システムによる更新処理異常終了時のデータベースの回復処理動作例を示す説明図である。It is explanatory drawing which shows the recovery processing operation example of the database at the time of the update process abnormal end by the batch processing system in FIG. 図1におけるバッチ処理システムによる更新処理異常終了時のシーケンシャルファイルの回復処理動作例を示す説明図である。It is explanatory drawing which shows the recovery processing operation example of the sequential file at the time of the update process abnormal end by the batch processing system in FIG.

符号の説明Explanation of symbols

10:通常実行処理部、11:入力ファイル読み込み部、12:データベース更新部、12a:ファイ出力部、12b:データベース更新部、13:データベース更新確定部、13a:コミット部、13b:出力ファイルバックアップ部、14:コミット件数情報記憶部、20:異常終了処理部、21:リカバリ処理部、21a:ロールバック部、21b:出力ファイル戻し部、30:入力ファイル、40:コミット間隔パラメータ、50:データベース、60:シーケンシャルファイル(「出力ファイル」)、70:バックアップファイル(「出力ファイルバックアップ」)。   10: Normal execution processing unit, 11: Input file reading unit, 12: Database update unit, 12a: File output unit, 12b: Database update unit, 13: Database update confirmation unit, 13a: Commit unit, 13b: Output file backup unit , 14: commit number information storage unit, 20: abnormal end processing unit, 21: recovery processing unit, 21a: rollback unit, 21b: output file return unit, 30: input file, 40: commit interval parameter, 50: database, 60: Sequential file (“output file”), 70: Backup file (“output file backup”).

Claims (4)

プログラムされたコンピュータによって、バッチ処理システムにおけるデータベースおよびシーケンシャルファイルのデータ更新処理異常終了からの回復処理を行う方法であって、
上記データベースのコミット時点の上記シーケンシャルファイルのデータをバックアップ装置に格納する第1のステップと、
上記データベースの回復処理と共に、上記シーケンシャルファイルに対する上記バックアップ装置からのデータ回復を行う第2のステップと
を有することを特徴とするバッチ処理回復方法。
A method of performing recovery processing from abnormal termination of data update processing of a database and a sequential file in a batch processing system by a programmed computer,
A first step of storing data of the sequential file at the time of committing the database in a backup device;
And a second step of recovering data from the backup device for the sequential file together with the recovery processing of the database.
請求項1に記載のバッチ処理回復方法であって、
上記第2のステップは、
上記データベースの回復処理をDBMSのロールバック機能を用いて行い、
上記シーケンシャルファイルに対する上記バックアップ装置からのデータ回復をバッチ処理制御ツールのリカバリ機能を用いて行うことを特徴とするバッチ処理回復方法。
The batch processing recovery method according to claim 1,
The second step is
Perform the database recovery process using the rollback function of the DBMS,
A batch processing recovery method characterized in that data recovery from the backup device for the sequential file is performed using a recovery function of a batch processing control tool.
プログラムされたコンピュータによって、バッチ処理装置におけるデータベースおよびシーケンシャルファイルのデータ更新処理異常終了からの回復処理を行うシステムであって、
請求項1もしくは請求項2のいずれかに記載のバッチ処理回復方法における各ステップでの処理を実行する手段を具備したことを特徴とするバッチ処理システム。
A system for performing recovery processing from abnormal termination of data update processing of a database and a sequential file in a batch processing device by a programmed computer,
A batch processing system comprising means for executing processing at each step in the batch processing recovery method according to claim 1.
コンピュータに、請求項1もしくは請求項2のいずれかに記載のバッチ処理回復方法における各ステップでの処理を実行させるためのプログラム。   The program for making a computer perform the process in each step in the batch process recovery method in any one of Claim 1 or Claim 2.
JP2007070642A 2007-03-19 2007-03-19 Batch processing restoration method and system, and program Pending JP2008234142A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007070642A JP2008234142A (en) 2007-03-19 2007-03-19 Batch processing restoration method and system, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007070642A JP2008234142A (en) 2007-03-19 2007-03-19 Batch processing restoration method and system, and program

Publications (1)

Publication Number Publication Date
JP2008234142A true JP2008234142A (en) 2008-10-02

Family

ID=39906860

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007070642A Pending JP2008234142A (en) 2007-03-19 2007-03-19 Batch processing restoration method and system, and program

Country Status (1)

Country Link
JP (1) JP2008234142A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114625576A (en) * 2022-05-17 2022-06-14 广州万协通信息技术有限公司 Power failure prevention data processing method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114625576A (en) * 2022-05-17 2022-06-14 广州万协通信息技术有限公司 Power failure prevention data processing method and device
CN114625576B (en) * 2022-05-17 2022-10-18 广州万协通信息技术有限公司 Power failure prevention data processing method and device

Similar Documents

Publication Publication Date Title
US9218377B2 (en) Failure recovery and error correction techniques for data loading in information warehouses
US8015430B1 (en) Using asset dependencies to identify the recovery set and optionally automate and/or optimize the recovery
JP2008009809A (en) Database synchronous processing program
JPH04139544A (en) Data restoring method
JPH11134235A (en) Method for supporting recovery from fault of external storage device
CN101196839A (en) Data renovation and synchronization process of double-flash read-only memory
CN115145697A (en) Database transaction processing method and device and electronic equipment
CN109359093B (en) Rule file updating method and system
JP2008234142A (en) Batch processing restoration method and system, and program
CN110543485A (en) Block chain reservation filing method based on snapshot
JP2003280963A (en) Document management system, restoration method, program for performing restoration, and recording medium with program recorded thereon
CN113704277A (en) Database-based breakpoint continuous transmission method and related device
JP2016115223A (en) Database management system, database management method, and program
JP3613077B2 (en) Database recovery method and program recording medium
JPH09274581A (en) Data backup method
CN113448978B (en) Method and device for guaranteeing data consistency in same-name image file replacement operation
JP2008217367A (en) Fault restoration method and system for batch processing
JP6891533B2 (en) Database device
JPH05143422A (en) Updated journal managing system
JP2000315190A (en) Job recovery system
JPH01214947A (en) Data preserving system
JPH04175830A (en) Rerun control system
JPH01140353A (en) System for maintaining data in data base
CN115454725A (en) Database backup method and device, electronic equipment and storage medium
JP3189804B2 (en) Data backup method and device