JP3674598B2 - Database management method and system - Google Patents
Database management method and system Download PDFInfo
- Publication number
- JP3674598B2 JP3674598B2 JP2002118771A JP2002118771A JP3674598B2 JP 3674598 B2 JP3674598 B2 JP 3674598B2 JP 2002118771 A JP2002118771 A JP 2002118771A JP 2002118771 A JP2002118771 A JP 2002118771A JP 3674598 B2 JP3674598 B2 JP 3674598B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- management unit
- management
- update
- database
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Lifetime
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Description
【0001】
【発明の属する技術分野】
データベースを複数のデータベース管理部で共有する場合のデータベース管理技術である。
【0002】
【従来の技術】
システム間でDBを共用する方式として、例えば特開昭62−204360号公報に記載のように、共用DBの排他制御のため、DB管理元をきめ、このロックマネジャと他システムとの間で排他情報をやりとりして排他の一元管理を行なう方法が知られている。
【0003】
また、この方式では、DB障害時の回復情報であるジャーナルは、各システムで取得されておりDB障害回復時、ジャーナルマージが必要であった。
【0004】
【発明が解決しようとする課題】
従来のシステム間DB共用方式では、性能面、運用面で、下記の問題があった。(1)システム間共用DBに対して、データ検索だけを行う場合でも、当該DBに対する更新処理との排他制御を行うために、DB管理元システムに排他使用連絡を行う必要が有り、システム間でDB共用しない場合に比べて、データ検索のオ一バヘッドが大きくなるため、大量のデータ検索には適していない。
(2)システム間共用DBに対して、複数CPUからデータ更新を行う場合、DB更新ジャーナルは、DB更新要求元システムで取得されるため、DB障害回復時、複数システムのジャーナルをマージする必要が有る。
本発明の目的は、以上の問題を解決するシステム間データベース共用方式を提供することにある。
【0005】
【課題を解決するための手段】
上記目的を達成するために、CPU間のDB共用方式として、
(1)データ検索オ一バヘッドの削減
CPU間共用DBに対して、データ検索しか行わない処理(トランザクション)については、アクセス対象のデータに対して、排他制御を行わず、データ検索要求元CPUから直接データアクセスを行う。
【0006】
これにより、データ検索については、CPU間で共用しないDBへのアクセスと同等の性能を実現できる。
【0007】
データ検索時、他CPUからのデータ更新処理とのタイミングにより、検索データブロックの制御情報に矛盾を検知した場合は、次のいずれかの方法で処理する。(a)一定時間間隔で一定回数、データ検索を再指向し、タイミングによる同期ズレを救済する。(b)当該データベース管理元CPUに検索要求を転送し、矛盾のない状態での検索をデータベース管理元CPUで実行する。
【0008】
(2)DB障害回復用ジャーナルの一元化
DB障害回復には、DBのバックアップ情報と、バックアップ取得時点以降のDB更新ジャーナル情報が必要である。DB更新ジャーナルを1つのCPUの下で一元化して取得するため、DB更新処理については、すべてDB管理元CPUで実施する。即ち、DB管理元以外のCPUから、CPU間共用DBを更新するときは、DB管理元CPUへDB更新要求を送り、DB管理元CPUでDB更新する方式とする。
【作用】
本発明のCPU間DB共用方式では、DB検索だけの処理(トランザクション)については、DB検索要求元CPUから、他CPUとの連絡なしに直接DBアクセスができるので、非共用DBへのアクセスと同等の検索性能が実現できる。
【0009】
また、DB更新は、DB管理元CPUで一元化して行うので、複数のCPUから同一DBに対して更新要求があっても、同一DBの更新ジャーナルは、当該DBの管理元CPUで一元化して取得され、DB障害回復時のジャーナルマージが不要となり、DB障害などに関するDBシステム運用管理者の負担の大幅軽減が実現できる。
【0010】
【発明の実施の形態】
以下、本発明の一実施例を図面により詳細に説明する。
第1図は、本発明の構成を示すブロック図である。
CPUa1が共用DB3の管理元であるとき、CPUb2のユーザプログラム22からのDBアクセス要求があった場合、検索については、CPUb2のDBアクセス部21が直接DBアクセスを行い、更新については、CPUb2のDBアクセス部21からCPUb2のDB分散機能部23、CPUa1のDB分散機能部13を経由して、CPUa1のDBアクセス部11がDBアクセスを行う。
【0011】
CPUa1のユーザプログラム12からのDBアクセス要求があると、検索、更新にかかわらず、CPUa1のDBアクセス部11がDBアクセスを行う。
【0012】
アクセス対象のDBがCPUa1の管理するDBかCPUb2の管理するDBかは、第6図に示すテーブルで管理し、それぞれのDBアクセス部で管理元を判別する。
【0013】
以下、DB検索、更新の具体的な処理手順を説明する。
(1)DB検索の場合(第2図参照)
CPUb2のユーザプログラム22から、CPUa1の管理する共用DB3への検索要求が発行されると(201)、CPUb2のDBアクセス部21で、当該DB3を直接アクセスする。ただし、CPUa1側との排他制御を行わずにアクセスするので、CPUa1側の更新処理とのタイミシグによっては、DBのインデックス部とDBのデータ部の内容に不一致があるように見える場合がある。そこで、この微妙なタイミングを排他制御なしに対処するために、DBのインデックス部とデータ部の内容に不一致がある場合(202)には、所定の時間間隔で所定回数、DBインデックス、DBデータのリードを再試行し(203)、タイミングズレによる不一致がなくなるのを待つ。
所定回数内でも矛盾がなくならない場合、恒久的データ破壊が起きていると判断し、リードエラ一として処理する(204)。
(2)DB更新の場合(第3図〜第5図参照)
CPUb2のユーザプログラム22から、CPUa1の管理する共用DB3を更新する場合について、3つの段階に分けて説明する。(a)更新のための検索要求
第3図に、CPUb2で共用DB3更新のための検索要求が発行された場合を示す。
【0014】
CPUb2のDBアクセス部21では、第6図のDB所在管理テーブルを用いて、要求のあったDBが自CPU管理のDBか否か判別し(301)、CPUa1の管理するDBへの要求ならば、DB分散機能部23を通じて、CPUa1へDBアクセス要求を送信する(302)。CPUa1では、CPUb2から送信され、DB分散機能部13で受信した(303)DBアクセス要求にもとづき、DB排他使用を宣言し(304)、DBアクセスを行ない、DBインデックス部、DBデータ部を読み込む(305,306)。読み込んだ結果はDB分散機能部13を通じてCPUb2ヘ送信する(307)。
【0015】
CPUb2の管理するDBの場合は、CPUb2のアクセス部でDBアクセスを行なう(308〜310)。
【0016】
(b)更新要求
第4図に、CPUb2から共用DB3に対する更新要求が発行された場合を示す。
【0017】
(a)の場合と同様、CPUb2のユーザプログラム22から更新要求があると(401)、DBアクセス部21では、自CPU管理のDBかを判断する(402)。自CPU管理でない場合DB分散機能部を通じてDB管理元CPU、この場合CPUa1ヘ、DBアクセス要求を送信する(403)。CPUa1では、DB分散機能部13で更新要求を受信すると(404)、DBアクセス部で同期点に達するまでDB更新要求を退避し(405)、更新要求処理報告をDB機能分散部を通じてCPUb2に送信する(406)。(c)コミット(COMMlT)あるいはリ夕一ン
第5図に、CPUb2のユーザプログラム22がコミットを発行したか、あるいは、リターンをして処理の同期点に達した場合を示す。
コミット要求の場合を説明する。(a)の場合と同様、CPUb2からCPUa1ヘ、DB分散機能部23を通じて、まずコミット準備要求が送信される(502)。CPUa1ではDBアクセス部でDB更新要求と、DBジャーナル取りだし(504,505)コミット準備完了報告をCPUb2に送信する(506)。CPUb2のDBアクセス部は、コミット準備完了報告を受信すると、コミット要求を送信する(508)(2フェーズコミット)。コミット要求を受けるとCPUa1は、DBアクセス部で共用DBの実更新を行い(509〉、DB排他使用の宣言を解除して(510)、コミット完了報告をCPUb2に行う(511)。この時、DB更新のジャーナルは、CPUalで取得されるため、当該DBが障害になったときの回復処理では、CPUa1のジャーナルのみを用いて回復が実行できる。
【0018】
【発明の効果】
本発明によれば、CPU間でDB共用しても、DB検索性能は、非共用DBへのアクセスと同等の性能を実現できる。
【0019】
また、DB障害回復時、複数CPUのジャーナルをマージせずに簡易に回復運用を実施できる。
【図面の簡単な説明】
【図1】本発明の一実施例の構成図である。
【図2】本発明の一実施例の処理のフローチャートである。
【図3】本発明の一実施例の処理のフローチャートである。
【図4】本発明の一実施例の処理のフローチャートである。
【図5】本発明の一実施例の処理のフローチャートである。
【図6】本発明の一実施例の管理テーブルを示す図である。
【符号の説明】
1,2…CPU、3…共用DB、11,21…DBアクセス部、12,22…ユーザプログラム、13,23…DB分散機能部[0001]
BACKGROUND OF THE INVENTION
This is a database management technique when a database is shared by a plurality of database management units.
[0002]
[Prior art]
As a method of sharing a DB between systems, for example, as described in JP-A-62-204360, a DB management source is determined for exclusive control of a shared DB, and the lock manager and other systems are exclusive. There is known a method for exchanging information and performing unified management of exclusion.
[0003]
In this method, the journal, which is recovery information in the event of a DB failure, is acquired in each system, and journal merging is required when the DB failure is recovered.
[0004]
[Problems to be solved by the invention]
The conventional inter-system DB sharing method has the following problems in terms of performance and operation. (1) Even when only a data search is performed on an inter-system shared DB, in order to perform exclusive control with the update processing for the DB, it is necessary to make an exclusive use notification to the DB management source system. Compared with the case where the database is not shared, the overhead of data search becomes large, so it is not suitable for searching a large amount of data.
(2) When updating data from multiple CPUs to a shared DB between systems, the DB update journal is acquired by the DB update request source system. Yes.
An object of the present invention is to provide an inter-system database sharing method that solves the above problems.
[0005]
[Means for Solving the Problems]
In order to achieve the above object, as a DB sharing method between CPUs,
(1) Reduction of data search overhead For processing (transaction) that only performs data search for the inter-CPU shared DB, exclusive access control is not performed on the data to be accessed, and the data search request source CPU Direct data access.
[0006]
Thereby, the performance equivalent to access to DB which is not shared between CPUs can be realized for data retrieval.
[0007]
If a contradiction is detected in the control information of the search data block due to the timing of data update processing from another CPU at the time of data search, it is processed by one of the following methods. (A) Redirect data search a fixed number of times at fixed time intervals to relieve synchronization shift due to timing. (B) The search request is transferred to the database management source CPU, and the database management source CPU executes the search in a consistent state.
[0008]
(2) Centralized DB failure recovery journal For DB failure recovery, DB backup information and DB update journal information after the backup acquisition time are required. Since the DB update journal is obtained in a unified manner under one CPU, all DB update processing is performed by the DB management source CPU. That is, when updating the inter-CPU shared DB from a CPU other than the DB management source, a DB update request is sent to the DB management source CPU and the DB management source CPU updates the DB.
[Action]
In the inter-CPU DB sharing method according to the present invention, the DB search requesting CPU can directly access the DB (transaction) without contacting the other CPU, and is equivalent to accessing a non-shared DB. Search performance can be realized.
[0009]
Also, since the DB update is performed centrally by the DB management source CPU, even if there is an update request for the same DB from a plurality of CPUs, the update journal of the same DB is centralized by the management source CPU of the DB. Acquired and no journal merging is required when recovering from a DB failure, and the burden on the DB system operation manager regarding DB failure can be greatly reduced.
[0010]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, an embodiment of the present invention will be described in detail with reference to the drawings.
FIG. 1 is a block diagram showing the configuration of the present invention.
When the CPU a1 is the management source of the shared
[0011]
When there is a DB access request from the user program 12 of the CPUa1, the DB access unit 11 of the CPUa1 performs DB access regardless of search and update.
[0012]
Whether the DB to be accessed is the DB managed by the CPU a1 or the DB managed by the CPU b2 is managed by the table shown in FIG. 6, and the management source is determined by each DB access unit.
[0013]
Hereinafter, specific processing procedures for DB search and update will be described.
(1) In the case of DB search (see FIG. 2)
When a search request to the shared
When the contradiction does not disappear even within the predetermined number of times, it is determined that permanent data destruction has occurred, and processing is performed as a read error (204).
(2) In the case of DB update (see FIGS. 3 to 5)
The case of updating the shared
[0014]
The
[0015]
In the case of a DB managed by the CPU b2, DB access is performed by the access unit of the CPU b2 (308 to 310).
[0016]
(B) Update Request FIG. 4 shows a case where an update request for the shared
[0017]
As in the case of (a), when there is an update request from the user program 22 of the CPU b2 (401), the
A case of a commit request will be described. As in the case of (a), a commit preparation request is first transmitted from the CPU b2 to the CPU a1 through the DB distribution function unit 23 (502). In the CPU a1, the DB access unit transmits a DB update request and a DB journal extraction (504, 505) and a commit preparation completion report to the CPU b2 (506). When receiving the commit preparation completion report, the DB access unit of the CPU b2 transmits a commit request (508) (two-phase commit). Upon receiving the commit request, the CPU a1 performs the actual update of the shared DB in the DB access unit (509), cancels the declaration of exclusive use of the DB (510), and sends a commit completion report to the CPU b2 (511). Since the DB update journal is acquired by the CPUal, recovery can be executed using only the journal of the CPUa1 in the recovery process when the DB fails.
[0018]
【The invention's effect】
According to the present invention, even if a DB is shared among CPUs, the DB search performance can be equivalent to that for accessing a non-shared DB.
[0019]
Further, when a DB failure is recovered, recovery operation can be easily performed without merging journals of a plurality of CPUs.
[Brief description of the drawings]
FIG. 1 is a configuration diagram of an embodiment of the present invention.
FIG. 2 is a flowchart of processing according to an embodiment of the present invention.
FIG. 3 is a flowchart of processing according to an embodiment of the present invention.
FIG. 4 is a flowchart of processing according to an embodiment of the present invention.
FIG. 5 is a flowchart of processing according to an embodiment of the present invention.
FIG. 6 is a diagram showing a management table according to an embodiment of the present invention.
[Explanation of symbols]
1, 2 ... CPU, 3 ... shared DB, 11, 21 ... DB access unit, 12, 22 ... user program, 13, 23 ... DB distributed function unit
Claims (13)
前記第1の管理部から前記第2のデータを参照する場合は、前記第1の管理部が前記第2のデータを参照し、前記第1の管理部から前記第2のデータを更新する場合は、前記第1の管理部から第2の管理部へ前記第2のデータを更新する更新要求を送り、前記第2の管理部が前記第2のデータを更新することを特徴とするデータベース管理方法。In the database management method in which the first management unit that manages the first data and the second management unit that manages the second data share the first data and the second data.
When referring to the second data from the first management unit, the first management unit refers to the second data and updates the second data from the first management unit. Sends an update request for updating the second data from the first management unit to the second management unit, and the second management unit updates the second data. Method.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2002118771A JP3674598B2 (en) | 2002-04-22 | 2002-04-22 | Database management method and system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2002118771A JP3674598B2 (en) | 2002-04-22 | 2002-04-22 | Database management method and system |
Related Parent Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP20861799A Division JP3478187B2 (en) | 1999-07-23 | 1999-07-23 | Database management method and system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2003044341A JP2003044341A (en) | 2003-02-14 |
| JP3674598B2 true JP3674598B2 (en) | 2005-07-20 |
Family
ID=19194069
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2002118771A Expired - Lifetime JP3674598B2 (en) | 2002-04-22 | 2002-04-22 | Database management method and system |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3674598B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2006268134A (en) * | 2005-03-22 | 2006-10-05 | Dainippon Printing Co Ltd | Database system, server, program, and recording medium |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS58115567A (en) * | 1981-12-29 | 1983-07-09 | Fujitsu Ltd | Disk volume interchange system |
| JP3478187B2 (en) * | 1999-07-23 | 2003-12-15 | 株式会社日立製作所 | Database management method and system |
-
2002
- 2002-04-22 JP JP2002118771A patent/JP3674598B2/en not_active Expired - Lifetime
Also Published As
| Publication number | Publication date |
|---|---|
| JP2003044341A (en) | 2003-02-14 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP3222125B2 (en) | Database sharing method between systems | |
| US9779128B2 (en) | System and method for massively parallel processing database | |
| US10747745B2 (en) | Transaction execution commitment without updating of data row transaction status | |
| US10116766B2 (en) | Asynchronous and idempotent distributed lock interfaces | |
| JP3504763B2 (en) | Client, server, and storage device used in distributed system and method for restoring resource management server in distributed system | |
| US5065311A (en) | Distributed data base system of composite subsystem type, and method fault recovery for the system | |
| CN100449548C (en) | Database synchronization method and system | |
| EP0567999B1 (en) | Method and apparatus for executing a distributed transaction in a distributed database | |
| CN111506592B (en) | Database upgrading method and device | |
| JP6028850B2 (en) | Data multiplexing system | |
| KR100450400B1 (en) | A High Avaliability Structure of MMDBMS for Diskless Environment and data synchronization control method thereof | |
| JP2006012153A (en) | Concurrent transactions (CONCURRENT TRANSACTIONS) and page synchronization (PAGESYNCHRONIZATION) | |
| US10191959B1 (en) | Versioned read-only snapshots of shared state in distributed computing environments | |
| US6212595B1 (en) | Computer program product for fencing a member of a group of processes in a distributed processing environment | |
| CN110297822B (en) | Block chain-oriented key management method, device, equipment and storage medium | |
| Matri et al. | Týr: blob storage meets built-in transactions | |
| JP3674598B2 (en) | Database management method and system | |
| Liu et al. | Dax: a widely distributed multitenant storage service for dbms hosting | |
| JP3478187B2 (en) | Database management method and system | |
| Sciascia et al. | RAM-DUR: In-memory deferred update replication | |
| US10754710B1 (en) | Transactional watch mechanism | |
| JPH07114495A (en) | Multiplexing file managing system | |
| US6205510B1 (en) | Method for fencing a member of a group of processes in a distributed processing environment | |
| JP2581141B2 (en) | Delayed journal merge method | |
| JP4286857B2 (en) | Internode shared file control method |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20040907 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20041105 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20050405 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20050418 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20080513 Year of fee payment: 3 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090513 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100513 Year of fee payment: 5 |
|
| EXPY | Cancellation because of completion of term | ||
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100513 Year of fee payment: 5 |