JP4090226B2 - Display method of stored procedure call relation diagram and database management system - Google Patents
Display method of stored procedure call relation diagram and database management system Download PDFInfo
- Publication number
- JP4090226B2 JP4090226B2 JP2001273224A JP2001273224A JP4090226B2 JP 4090226 B2 JP4090226 B2 JP 4090226B2 JP 2001273224 A JP2001273224 A JP 2001273224A JP 2001273224 A JP2001273224 A JP 2001273224A JP 4090226 B2 JP4090226 B2 JP 4090226B2
- Authority
- JP
- Japan
- Prior art keywords
- procedure
- stored
- storage means
- trigger
- call
- 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 - Fee Related
Links
- 238000000034 method Methods 0.000 title claims description 202
- 238000010586 diagram Methods 0.000 title description 30
- 230000001419 dependent effect Effects 0.000 claims description 16
- 238000007726 management method Methods 0.000 description 28
- 238000012545 processing Methods 0.000 description 23
- 230000008569 process Effects 0.000 description 21
- 230000008859 change Effects 0.000 description 7
- 238000012217 deletion Methods 0.000 description 5
- 230000037430 deletion Effects 0.000 description 5
- 230000006870 function Effects 0.000 description 4
- 238000003780 insertion Methods 0.000 description 3
- 230000037431 insertion Effects 0.000 description 3
- 101100328884 Caenorhabditis elegans sqt-3 gene Proteins 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 238000007796 conventional method Methods 0.000 description 1
- 230000006866 deterioration Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000000644 propagated effect Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
- 238000012559 user support system Methods 0.000 description 1
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Stored Programmes (AREA)
Description
【0001】
【産業上の利用分野】
本発明は、データベースに保存されたストアドプロシージャの呼出関係図の表示方法及び該表示方法を実行するデータベース管理システムに関り、特に、更新、削除、挿入のデータ変更操作によって自動的に実行される特殊なストアドプロシージャであるトリガをも含んだ、データベース内のストアドプロシージャの呼出関係図の表示方法及びデータベース管理システムに関する。
【0002】
【従来技術】
一般にストアドプロシージャは、データベースに対する一連の処理手順を一つのプログラムにまとめ、データベース管理システムに保存したデータベースオブジェクトの1つである。このストアドプロシージャは、クライアントから引数を渡してそれに基づいた処理を実行したり、クライアントに処理劣化を返す機能を持つ。
【0003】
この作成されたストアドプロシージャは、すぐに実行できる形式に変換されてデータベースに保存されており、通常のようにSQL(Structured Query Language)文を1つずつ送るのに比べて、ネットワークのトラフイックを低減できると共に、サーバ上で構文解析や機械語への変換を前もって終了させておくため、処理時間も短縮することができる。従って、当該ストアドプロシージャは、クライアントから呼び出し命令を送信するだけで実行することができる。
【0004】
一方、トリガは、ユーザが直接呼び出さない特殊なストアドプロシージャであり、データの更新、削除、挿入などの変更操作を1つまたは複数使用し、特定テーブルのデータを変更する際に実行されるように定義され、ユーザがデータの更新、削除、挿入等の変更支持を行うたびに、トリガの定義内容に応じて自動的に変更を実行するものである。このトリガは、1つのデータ繰作により関連するデータへの変更処理を自動的に波及させる、或いはそのデータの変更内容をチェックするような場合に用いられる。
【0005】
この様にトリガを含めたストアドプロシージャは、処理時間の軽減やデータ整合性を保つ上での機能として、多くのデータベースシーステムに標準的に備えられている。
【0006】
前記ストアドプロシージャを使用したデータベースアプリケーションの開発においては、ストアドプロシージャの数が数十個から数百個、ものによっては千個を超える場合もある。この場合、機能拡張の向上のために改良が繰り返し加えられるが、その拡張や改良を効率良くしかも間違いなく行うためには、オペレータに対して複雑なプログラムの構造を分かりやすく正確に表現(表示)することが重要である。
【0007】
このブログラム構造(データベース上のストアドプロシージャの呼び出し関係)を分かりやすく正確に表示する従来技術による手法としては、図3に示すデータベース管理システムの管理テーブルの1つである従属関係テーブルを使用したものが知られている。
【0008】
図3は、従来技術によるブログラム構造の表示方法を説明するための図であり、サーバコンピュータ1におけるストアドプロシージャ(Proc)、トリガー(Trigger)、各種テーブル(Table)を示している。
【0009】
前記サーバコンピュータ1は、データベース管理システムプログラム(DBMS)11と、DBMS(データベース管理システム)管理領域13、ストアドプロシージャ14、ユーザテーブル15、管理テーブル16等を格納したハードディスク12を含み、前記データベース管理システムプログラム11がハードディスク12をアクセスし、ストアドプロシージャ14に定義された内容に従ってユーザテーブル15他をアクセスして所定の命令を実行する様に構成され、利用者が行った前記データベース管理システムプログラム11を介したハードディスク12に格納されたデータファイル中のレコードに対する更新情報、削除情報、DBMS(データベース管理システムソフト)が記録されており、利用者は前記DBMSを介してデータファイル中のレコードに対して更新、削除、検索等の各種のレコード操作を行うことができる。
【0010】
前記DMS管理領域13には、ユーザの作成したテーブルやDBMSが管理用に使用するテーブル、ストアドジャなどのデータベースオブジェクトが格納されている。ストアドプロシージャのDBMS管理の登録は、DBMSへコマンド(CREATEプロシージャ文)の実行を要求することで行われる。別のオブジェクトを参照するオブジェクトは、そのオブジェクトに従属していると見なされ、データベースオブジェクトは、それ自身が作成されるとき、参照している別のオブジェクトとの間の従属関係を管理用のテーブルである従属関係テーブルに格納するようになっている。
【0011】
具体的に説明すると、図3に示したプロシージャは、Proc1を実行することにより、(1)Proc2の実行によりTableAの全て(*)の行を取得(SELECT)し、次いで(2)TableAの内容である行1に変数10をセットするように更新(UPDATE)し、更に(3)Proc3によりTableAの内容を削除(DELETE)し、次いでTableBを取得(SELECT)する一連の処理を実行する様に定義されている。尚、図中のTriggerA_UPDは、TableAへの更新操作(UPDATE)で起動されるトリガであり、TableBに新たな行を追加する処理を示し、TriggerA_DELは、TableAへの削除操作(DELETE)で起動されるトリガであり、TableBから行を削除する処理を示している。
【0012】
本例におけるストアドプロシージャの呼び出し関係は、この従属関係テーブルの内容を木構造に展開することによって得ることができる。
【0013】
【発明が解決しようとする課題】
前記のように従属関係テーブルの内容を解析することによって、ストアドプロシージャの呼び出し関係図を得ることができ、図3のデータベースオブジェクトが存在するデータベースのProc1を頂点とした呼び出し関係を示すと図8のようになる。この関係図は、Proc1を頂点とし、TableAからTriggerA_UPDとTriggerA_DELに分岐する枝と、Proc2からTableAを介してTriggerA_UPDとTriggerA_DELに分岐する枝と、Proc2からTableAを介してTriggerA_UPDとTriggerA_DELに分岐する枝と、Proc3からTableAを介してTriggerA_UPDとTriggerA_DELに分岐する枝と、前記Proc3からTableBに分岐する枝とに表すことができる。
【0014】
この従来技術によるストアドプロシージャの呼び出し関係図は、ユーザからの直接呼び出しでないストアドプロシージャであるトリガに対してもテーブルに関連付けられて表示される。このため従来の関係図の表示方法は、直接呼び出しの明示的な記述がテーブルが呼びだし元となるストアドプロシージャ定義内にはないため、トリガとトリガを起動するテーブルの変換繰作を実行するストアドプロシージャとの間に直接的な従属関係はなく、あくまでもトリガ付けられているテーブルを介した間接的な従属関係を全て表示してしまう。
【0015】
また、従来の関係図の表示方法は、2つのデータベースオブジェクト間の従属関係を単純に展開しただけなので、Proc1からは決して実行されることのないTableに関連付けられているTriggerA_DELトリガが呼び出し関係図上に展開されてしまう。
【0016】
従って従来技術によるストアドプロシージャの呼出関係図の表示方法は、利用者に直接的に不要な従属関係まで複雑に表示してしまい、各プロシージャの関係をユーザが把握するのが困難であると言う不具合があった。
【0017】
本発明の目的は、前述の従来技術による不具合を除去することであり、トリガとトリガの呼び出し元ストアドプロシージャとの間の従属関係を直接的な関係で表示すると共にユーザのテーブルへの変更繰作によって実際に呼び出されるトリガを織別し、ドプロシージャの呼出し関係を正確に表現することができるストアドプロシージャ呼出関係図の表示方法及びデータベース管理システムを提供することである。
【0018】
【課題を解決するための手段】
前記目的を達成するために本発明によるデータベース管理システムのストアドプロシージャ呼出関係図の表示方法は、複数のプロシージャに対して従属する他のプロシージャ又はテーブル又はトリガとの従属関係と、複数のテーブルに対して従属するトリガとの従属関係と、複数のトリガに対して従属するテーブルとの従属関係とを格納する従属関係テーブルを用い、該従属関係テーブルに格納されたプロシージャとテーブルとトリガとの従属関係を解析し、特定のプロシージャに従属して実行される他のプロシージャ及びトリガとの関係を木構造で表示することを特徴とする。
【0019】
更に本発明によるデータベース管理システムは、複数のプロシージャに対して従属する他のプロシージャ又はテーブル又はトリガとの従属関係と、複数のテーブルに対して従属するトリガとの従属関係と、複数のトリガに対して従属するテーブルとの従属関係とを格納する従属関係テーブルと、該従属関係テーブルに格納されたプロシージャとテーブルとトリガとの従属関係を参照し、特定のプロシージャに従属して実行される他のプロシージャ及びトリガとの関係を出力するストアドプロシージャ解析手段と、該ストアドプロシージャ解析手段から出力された特定のプロシージャに従属して実行される他のプロシージャ及びトリガとの関係を木構造で表示する呼出関係図表示手段とを備えることを特徴とする。
【0020】
【発明の実施の形態】
以下、本発明によるストアドプロシージャ呼び出し関係図表示方法及びこれを実行するデータベース管理システムの一実施形態を図面を参照して詳細に説明する。
【0021】
図1は、本発明によるストアドプロシージャ呼び出し関係図表示方法が適用されるデータベース管理システムの全体構成を説明するための図、図2は本実施形態による表示方法によって表示されるストアドプロシージャ呼び出し関係図及び呼出関係テーブルの一例を示す図、図4〜図7は本実施形態による処理フローを説明するための図である。
【0022】
本実施形態によるストアドプロシージャ呼び出し関係図表示方法が適用されるデータベース管理システムは、図1に示す如く、サーバコンピュータ1とクライアントコンピュータ2とによって構成され、前記サーバコンピュータ1は、データベース管理システム11を介してユーザがアクセス可能であり、ストアドプロシージャ14、ユーザテーブル15、管理用テーブル16などのデータベースオブジェクトを格納するDBMS管理領域13を持つハードディスク12と、データベース全体の管理を行い、且つクライアントコンピュータ2と接続する機能も持つデータベース管理システムプログラム11とを備え、クライアントコンピュータ2は、サーバコンピュータ1のストアドプロシージャ解析手段21と、該ストアドプロシージャ解析手段21によって出力されたストアドプロシージャ呼び出し関係情報を木構造で表示するストアドプロシージャ呼出関係図表示手段22を備える。尚、実際のシステムにおいてはCPU,メモリ,入出力装置その他の回路機構を備えるものであるが、本明細書においては周知な技術であるため省略して説明する。
【0023】
次に前記データベース管理システムによるストアドプロシージャ解析手段21がストアドプロシージャの呼び出し関係を解析する処理手順を図4〜図7を参照して説明する。尚、各プロシージャの内容は図3に示したものと同一の場合を説明する。
<Proc1の第1回目処理手順>
この処理手順は、図4に示す如く、まず調べるべきプロシージャ名(ブロシージャ=Proc1)が与えられると、そのプロシージャが従属しているオブジェクトがあるかどうかを調べるために、従属関係テーブル160から従属するオブジェクトが指定されたプロシージャであるレコード(図3では行▲1▼のProc1:Proc2)を取得する(ステップ201)。ここでレコードが存在しなければ終了し、存在する場合は、そのオブジェクトを調べる次のステップ202にフローA1の如く進み、従属されるオブジェクトがプロシージャであるか否かを判定し(ステップ203)し、当該プロシージャ(Proc2)が存在するため、取得した従属関係のレコードを呼出関係テーブル32に追加し(ステップ204:図2の呼出関係32の行aにProc1:Proc2を追加)、更に今度は従属されるオブジェクトであるプロシージャ(Proc2)について、このアルゴリズムを実行する再帰呼出に入る(ステップ205)。
【0024】
以上がProc1における1回目の処理であり、この1回目の処理においては、ステップ201においてProc1の定義内容(Proc1:Proc2)を取得し、ステップ203においてブロシージャ(Proc2)を検出し、ステップ204により取得した従属関係のレコード(行aのProc1:Proc2)を呼出関係テーブル32に追加する様に動作する。この呼出関係テーブル32は、特定のプロシージャを親ノードとし、当該のプロシージャに対して実行される他のプロシージャ又はトリガを対応付けて格納するものである。
<Proc2の第1回目処理手順>
さて、前記ステップ205における再帰呼出は、図5に示す如く、まず調べるべきプロシージャ名(ブロシージャ=Proc2)が与えられると、そのプロシージャが従属しているオブジェクトがあるかどうかを調べるために、従属関係テーブル160から従属するオブジェクトが指定されたプロシージャであるレコードを取得する(ステップ201:図3では行▲2▼のProc2:TableA)。ここでレコードが存在しなければ終了するが、ここでは存在するため、そのオブジェクトを調べる次のステップ202にフローC1の如く進み、従属されるオブジェクトがプロシージャであるか否かを判定し(ステップ203)、プロシージャが存在しないため、次のステップ206に進む。
【0025】
このステップ206においては、テーブルであるかどうかの判定を行い、テーブル(TableA)があるため、従属するオブジェクト(現在調べているプロシージャ)の定義内容(:図3のProc2の内容であるSELECT * FROM TableA)を取得し(ステップ207)、全てのテーブルへのチェックを行ったか判定(ステップ208)した後に、これがSELECT文か否かの判定を行い(ステップ209)、SELECT文のためフローC2の如くステップ201に戻り、ステップ201及び202を経て図4のステップ205の次のステップに戻る。
<Proc1の第2回目処理手順>
この処理手順は、図4に戻り、まず調べるべきプロシージャ名(ブロシージャ=Proc1)が与えられると、そのプロシージャが従属しているオブジェクトがあるかどうかを調べるために、従属関係テーブルから従属するオブジェクトが指定されたプロシージャであるレコード(図3のでは行▲2▼のProc1:TableA)を取得する(ステップ201)。ここでレコードが存在しなければ終了し、存在する場合は、そのオブジェクトを調べる次のステップ202にフローB1の如く進み、従属されるオブジェクトがプロシージャであるか否かを判定し(ステップ203)、当該プロシージャが存在しないため次のステップ206に進む。
【0026】
このステップ206においては、テーブルであるかどうかの判定を行い、テーブル(TableA)であるため、従属するオブジェクト(現在調べているプロシージャ)の定義内容(:図3のProc1の内容であるEXECUTE Proc2 / UPDATE TableA SET col1=10 /EXECUTE Proc3)を取得し(ステップ207)、テーブルへの操作を全てチェックしたか判定(ステップ208)と、更にSELECT文ではないことの判定(ステップ209)と、テーブルへの操作がSELECTの場合はトリガが起動されることはないため、操作に対するトリガがあるかの判定(ステップ210)と、従属されているオブジェクトをトリガに置き換えて関係テーブルに追加(ステップ211)とを行う。この流れはフローB1〜B〜B2の如くである。また前記ステップ211の具体的処理は、図3の呼出関係テーブル32の行b(Proc2:TriggerA_UPD)の追加である。
<Proc1の第3回目処理手順>
この処理手順は、図6に示す如く、まず調べるべきプロシージャ名(ブロシージャ=Proc1)が与えられると、そのプロシージャが従属しているオブジェクトがあるかどうかを調べるために、従属関係テーブルから従属するオブジェクトが指定されたプロシージャであるレコード(図3のでは行▲3▼のProc1:Proc3)を取得する(ステップ201)。
【0027】
ここでレコードが存在しなければ終了し、存在するためにオブジェクトを調べる次のステップ202にフローE1の如く進み、従属されるオブジェクトがプロシージャであるか否かを判定し(ステップ203)し、当該プロシージャ(Proc3)が存在するため、取得した従属関係のレコードを呼出関係テーブルに追加し(ステップ204:図3の呼出関係テーブル32の行cであるProc1:Proc3を追加)、更に今度は従属されるオブジェクトであるプロシージャ(Proc3)について、このアルゴリズムを実行する再帰呼出に入る(ステップ205)。
<Proc3の第1回目処理手順>
前記ステップ205における再帰動作は、図7に示す如く、まず調べるべきプロシージャ名(ブロシージャ=Proc3)が与えられると、そのプロシージャが従属しているオブジェクトがあるかどうかを調べるために、従属関係テーブルから従属するオブジェクトが指定されたプロシージャであるレコード(図3のでは行▲4▼のProc2:TableA)を取得する(ステップ201)。
【0028】
ここでレコードが存在しなければ終了し、存在するため、そのオブジェクトを調べる次のステップ202にフローGの如く進み、従属されるオブジェクトがプロシージャであるか否かを判定し(ステップ203)し、当該プロシージャが存在しないため次のステップ206に進む。
【0029】
このステップ206においては、テーブルであるかどうかの判定を行い、テーブル(TableA)があるため、従属するオブジェクト(現在調べているプロシージャ)の定義内容(:図3のProc3の内容であるEDLETE FROM TableA / WHREE col1=30 / SELECT * FROM TableB)を取得し(ステップ207)、テーブルへの操作を全てチェックしたか判定(ステップ208)と、更にSELECT文ではないことの判定(ステップ209)と、テーブルへの操作がSELECTの場合はトリガが起動されることはないため、操作に対するトリガがあるかの判定(ステップ210)と、従属されているオブジェクトをトリガに置き換えて関係テーブルに追加(ステップ211)とを行う。この流れはフローG1〜G〜G2の如くである。また前記ップ211の具体的処理は、図3の呼出関係テーブル32の行d(Proc3:TableA_DEL)の追加である。
【0030】
尚、本実施形態においてはProc3の第2回及び第3回目の処理手順として、図7において処理フローH1〜H〜H2、I1〜I〜I2の経緯に従って前述と同様の動作を行うものであるが、ここでは前述の動作と同様であるため説明を省略する。
<表示処理>
本実施形態によるストアドプロシージャ呼出関係図の表示方法が適用されるデータベース管理システムは、ストアドプロシージャ解析手段21が前述の図4〜図7に示した処理フローを実行することにより、前記呼出関係テーブル32を作成し、この呼出関係テーブル32を元に図2左側又は図1の如きストアドプロシージャ呼び出し関係図を表示する。
【0031】
即ち、本実施形態においては、図3のデータベースオブジェクトが存在するデータベースのProc1プロシージャを頂点とした呼び出し関係を、図4〜図7に示した手順で解析すると、図2に示す符号32に示した呼出関係テーブルが出力され、この呼出関係テーブル32を木構造に展開すると、符号31に示すトリガを含んだストアドプロシージャ間の呼出関係を表現することが可能となる。
【0032】
【発明の効果】
以上述べた如く本発明によれば、トリガを含むストアドプロシージャを用いたデータベースアプリケーションにおけるストアドプロシージャの呼出関係の図表示方法において、特にトリガとトリガの呼び出しもとストアドプロシージャとの間の従属関係を直接的な関係で表現すると共に、ユーザのテーブルへの再操作によって呼び出される実際のトリガを識別してストアドプロシージャの呼出関係を正確に表示することができるため、プログラムの構造を見やすく且つ正確に把握することが可能となる。
【図面の簡単な説明】
【図1】本発明によるストアドプロシージャ呼出関係図の表示方法が適用されるデータベース管理システムの全体構成を説明するための図。
【図2】本実施形態による表示方法によって表示されるストアドプロシージャ呼び出し関係図及び呼出関係テーブルの一例を示す図。
【図3】従来技術によるブログラム構造を表示するデータデース管理システムを説明するための図。
【図4】本実施形態による従属関係テーブルに格納されたプロシージャとテーブルとトリガとの従属関係を解析する処理フローを示す図。
【図5】本実施形態による同従属関係を解析する処理フローを示す図。
【図6】本実施形態による同従属関係を解析する処理フローを示す図。
【図7】本実施形態による同従属関係を解析する処理フローを示す図。
【図8】 従来技術によるブログラム構造の表示方法を説明するための図。[0001]
[Industrial application fields]
The present invention relates to a display method of a stored procedure call relation diagram stored in a database and a database management system for executing the display method, and in particular, automatically executed by data change operations such as update, deletion, and insertion. The present invention relates to a method for displaying a call relation diagram of a stored procedure in a database, including a trigger which is a special stored procedure, and a database management system.
[0002]
[Prior art]
In general, a stored procedure is one of database objects in which a series of processing procedures for a database are combined into one program and stored in a database management system. This stored procedure has a function of passing an argument from the client and executing a process based on the argument or returning a process deterioration to the client.
[0003]
This created stored procedure is converted into a ready-to-execute format and stored in the database, reducing network traffic compared to sending SQL (Structured Query Language) statements one at a time as usual. At the same time, since parsing and conversion to machine language are terminated in advance on the server, the processing time can be shortened. Therefore, the stored procedure can be executed simply by sending a call command from the client.
[0004]
On the other hand, a trigger is a special stored procedure that is not called directly by the user, and is executed when changing data in a specific table by using one or more change operations such as data update, deletion, and insertion. It is defined, and whenever the user supports change such as update, deletion, insertion, etc., the change is automatically executed according to the definition content of the trigger. This trigger is used when a change process to related data is automatically propagated by one data operation, or a change content of the data is checked.
[0005]
In this way, stored procedures including triggers are provided as standard in many database systems as functions for reducing processing time and maintaining data integrity.
[0006]
In the development of a database application using the stored procedure, the number of stored procedures may be several tens to several hundreds, and in some cases, more than a thousand. In this case, improvements are repeatedly added to improve the function expansion, but in order to perform the expansion and improvement efficiently and definitely, the structure of a complicated program is expressed (displayed) in an easy-to-understand manner for the operator. It is important to.
[0007]
As a conventional technique for displaying the program structure (calling procedure of stored procedure on the database) in an easy-to-understand and accurate manner, a dependency table, which is one of the management tables of the database management system shown in FIG. 3, is used. It has been known.
[0008]
FIG. 3 is a diagram for explaining a program structure display method according to the prior art, and shows stored procedures (Proc), triggers (Triggers), and various tables (Tables) in the
[0009]
The
[0010]
The DMS management area 13 stores user-created tables, tables used by the DBMS for management, and database objects such as stored jars. Registration of stored procedure DBMS management is performed by requesting the DBMS to execute a command (CREATE procedure statement). An object that references another object is considered to be subordinate to that object, and when a database object is created, it is a table that manages the dependency with another object that references it. Are stored in the dependency table.
[0011]
More specifically, the procedure shown in FIG. 3 executes (1) acquires all (*) rows of TableA by executing Proc1, and then (2) the contents of TableA. Update (UPDATE) so as to set the
[0012]
The stored procedure call relationship in this example can be obtained by expanding the contents of the dependency table into a tree structure.
[0013]
[Problems to be solved by the invention]
By analyzing the contents of the dependency table as described above, a stored procedure call relationship diagram can be obtained, and the call relationship with the database object Proc1 in FIG. It becomes like this. This relationship diagram shows Proc1 as a vertex, a branch branching from Table A to TriggerA_UPD and TriggerA_DEL, a branch branching from Proc2 to TriggerA_UPD and TriggerA_DEL, and a branch branching from Proc2 to TriggerTigAG_A , Branching from Proc3 to TriggerA_UPD and TriggerA_DEL via TableA, and branching from Proc3 to TableB.
[0014]
This stored procedure call relationship diagram according to the prior art is displayed in association with a table for a trigger that is a stored procedure that is not a direct call from a user. For this reason, the conventional relationship diagram display method is that there is no explicit description of the direct call in the stored procedure definition from which the table is called, so the stored procedure that executes the conversion of the table that triggers the trigger and the trigger is executed. There is no direct dependency relationship between and, and all indirect dependency relationships via the triggered table are displayed.
[0015]
In addition, since the conventional relationship diagram display method simply expands the dependency between two database objects, the TriggerA_DEL trigger associated with the table that is never executed from Proc1 is displayed on the call relationship diagram. Will be expanded.
[0016]
Therefore, the stored method call relationship diagram display method according to the prior art displays complicated dependencies directly to the user, and it is difficult for the user to grasp the relationship of each procedure. was there.
[0017]
An object of the present invention is to eliminate the above-mentioned problems caused by the prior art, and display the dependency relationship between the trigger and the caller stored procedure as a direct relationship, and change the user table. It is intended to provide a display method and a database management system for a stored procedure call relation diagram that can categorize triggers that are actually called and can accurately represent a call relation of a procedure.
[0018]
[Means for Solving the Problems]
In order to achieve the above object, a method for displaying a stored procedure call relationship diagram of a database management system according to the present invention includes a dependency relationship with other procedures or tables or triggers dependent on a plurality of procedures, and a plurality of tables. Dependency relationship between a trigger stored in the dependency relationship table and a trigger is stored using a dependency relationship table that stores dependency relationships between triggers dependent on each other and dependency relationships between tables dependent on a plurality of triggers. And the relationship with other procedures and triggers executed depending on a specific procedure is displayed in a tree structure.
[0019]
Furthermore, the database management system according to the present invention provides a dependency relationship with other procedures or tables or triggers subordinate to a plurality of procedures, a dependency relationship with a trigger subordinate to a plurality of tables, and a plurality of triggers. Referring to the dependency table storing the dependency relationship with the dependent table, and the dependency relationship between the procedure, the table and the trigger stored in the dependency table, and executing the other depending on the specific procedure Stored procedure analysis means for outputting the relationship between a procedure and a trigger, and a call relationship for displaying in a tree structure the relationship between other procedures and triggers executed depending on a specific procedure output from the stored procedure analysis means And a figure display means.
[0020]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, a stored procedure call relation diagram display method and a database management system for executing the method according to the present invention will be described in detail with reference to the drawings.
[0021]
FIG. 1 is a diagram for explaining the overall configuration of a database management system to which a stored procedure call relationship diagram display method according to the present invention is applied, and FIG. 2 is a stored procedure call relationship diagram displayed by the display method according to the present embodiment. FIGS. 4 to 7 are diagrams illustrating an example of a call relationship table. FIGS. 4 to 7 are diagrams for explaining a processing flow according to the present embodiment.
[0022]
As shown in FIG. 1, the database management system to which the stored procedure call relation diagram display method according to the present embodiment is applied comprises a
[0023]
Next, a processing procedure in which the stored procedure analysis means 21 by the database management system analyzes the stored procedure call relationship will be described with reference to FIGS. The case where the contents of each procedure are the same as those shown in FIG. 3 will be described.
<Proc1 first processing procedure>
As shown in FIG. 4, when a procedure name (procedure = Proc1) to be checked is given, this processing procedure depends from the dependency table 160 in order to check whether there is an object on which the procedure depends. A record (Proc1: Proc2 in row (1) in FIG. 3) which is a procedure in which an object is designated is acquired (step 201). If the record does not exist, the process ends. If it exists, the process proceeds to the
[0024]
The above is the first process in Proc1, and in this first process, the definition contents of Proc1 (Proc1: Proc2) are acquired in
<First Proc2 Processing Procedure>
Now, as shown in FIG. 5, the recursive call in the
[0025]
In this
<Second Proc1 Processing Procedure>
This processing procedure returns to FIG. 4. When a procedure name to be checked (procedure = Proc1) is given, in order to check whether or not there is an object on which the procedure is dependent, an object dependent from the dependency table is determined. A record that is a designated procedure (Proc1: TableA in row (2) in FIG. 3) is acquired (step 201). If the record does not exist, the process ends. If it exists, the process proceeds to the
[0026]
In this
<Proc1 Third Processing Procedure>
In this processing procedure, as shown in FIG. 6, when a procedure name (procedure = Proc1) to be checked is given, in order to check whether there is an object on which the procedure is dependent, an object subordinate to the dependency table is checked. Is acquired (Proc1: Proc3 in row (3) in FIG. 3) (step 201).
[0027]
If the record does not exist, the process ends, and since the object exists, the process proceeds to the
<Proc3 first processing procedure>
As shown in FIG. 7, when the procedure name to be checked (procedure = Proc3) is given, the recursive operation in
[0028]
If the record does not exist, the process ends. Since the record exists, the process proceeds to the
[0029]
In this
[0030]
In this embodiment, as the second and third processing procedures of Proc3, the same operation as described above is performed according to the process flow H1 to H2 and I1 to I2 in FIG. However, since it is the same as that of the above-mentioned operation | movement here, description is abbreviate | omitted.
<Display processing>
In the database management system to which the stored procedure call relationship diagram display method according to the present embodiment is applied, the stored
[0031]
That is, in the present embodiment, when the call relationship having the Proc1 procedure of the database in which the database object of FIG. 3 exists as a vertex is analyzed by the procedure shown in FIGS. When a call relation table is output and this call relation table 32 is expanded into a tree structure, it is possible to express a call relation between stored procedures including a trigger indicated by
[0032]
【The invention's effect】
As described above, according to the present invention, in the method for displaying a stored procedure call relationship in a database application using a stored procedure including a trigger, in particular, the dependency relationship between the trigger and the trigger call source is stored directly. It is possible to express the relationship of the stored procedure and accurately display the stored procedure call relation by identifying the actual trigger that is called by re-operation on the user's table. It becomes possible.
[Brief description of the drawings]
FIG. 1 is a diagram for explaining an overall configuration of a database management system to which a stored procedure call relation diagram display method according to the present invention is applied;
FIG. 2 is a diagram illustrating an example of a stored procedure call relation diagram and a call relation table displayed by the display method according to the present embodiment.
FIG. 3 is a diagram for explaining a data database management system for displaying a program structure according to the prior art.
FIG. 4 is a diagram showing a processing flow for analyzing a dependency relationship between a procedure, a table, and a trigger stored in a dependency relationship table according to the embodiment;
FIG. 5 is a view showing a processing flow for analyzing the dependency relationship according to the embodiment;
FIG. 6 is a diagram showing a processing flow for analyzing the dependency relationship according to the embodiment.
FIG. 7 is a view showing a processing flow for analyzing the dependency relationship according to the embodiment;
FIG. 8 is a view for explaining a program structure display method according to the prior art.
Claims (2)
各プロシージャに対して従属する他のプロシージャ、テーブル又はトリガとの従属関係と、各テーブルに対して従属するトリガとの従属関係と、各トリガに対して従属するテーブルとの従属関係とを格納する従属関係記憶手段と、Stores dependencies with other procedures, tables, or triggers that are dependent on each procedure, dependencies with triggers that are dependent on each table, and dependencies on tables that are dependent on each trigger Dependency storage means;
前記ストアドプロシージャ記憶手段に記憶された任意のプロシージャについて、前記従属関係記憶手段の記憶内容に基づき、当該プロシージャ、テーブル及びトリガ間の従属関係を解析する解析手段と、Analyzing means for analyzing a dependency relationship between the procedure, table and trigger based on the stored contents of the dependency relationship storing means for any procedure stored in the stored procedure storage means;
前記解析手段により解析されたプロシージャ、テーブル及びトリガ間の呼び出し関係を記憶する呼出関係記憶手段と、Call relation storage means for storing the call relation between the procedure, table and trigger analyzed by the analysis means;
前記呼出関係記憶手段により記憶された当該プロシージャ、テーブル及びトリガ間の呼び出し関係を木構造で表示する表示手段と備えたストアドプロシージャのデータベース管理システムにおいて、In a stored procedure database management system comprising display means for displaying a call relation between the procedure, table and trigger stored in the call relation storage means in a tree structure,
前記解析手段は、当該プロシージャに従属するプロシージャについて、当該プロシージャを親ノード、当該従属するプロシージャを子ノードとした呼び出し関係を呼出関係記憶手段に記憶する第1ステップを実行し、かつ、当該従属するプロシージャに対して前記第1ステップを再帰的に実行し、The analysis means executes a first step of storing, in the call relation storage means, a call relationship in which the procedure is a parent node and the subordinate procedure is a child node for the procedure subordinate to the procedure. Recursively performing the first step on the procedure;
当該プロシージャに従属するテーブルについて、前記ストアドプロシージャ記憶手段に記憶された当該テーブルの定義内容を参照し、当該テーブルへの操作に対応するトリガがある場合には、当該プロシージャを親ノード、当該トリガを子ノードとした呼び出し関係を呼出関係記憶手段に記憶する第2ステップを実行することを特徴とするストアドプロシージャのデータベース管理システム。For a table subordinate to the procedure, refer to the definition contents of the table stored in the stored procedure storage means, and if there is a trigger corresponding to the operation on the table, the procedure is set as a parent node and the trigger is set. A database management system for stored procedures, wherein a second step of storing a calling relationship as a child node in a calling relationship storage means is executed.
複数のプロシージャ、テーブル及びトリガの定義内容を格納するストアドプロシージャ記憶手段と、Stored procedure storage means for storing definitions of a plurality of procedures, tables and triggers;
各プロシージャに対して従属する他のプロシージャ、テーブル又はトリガとの従属関係と、各テーブルに対して従属するトリガとの従属関係と、各トリガに対して従属するテーブルとの従属関係とを格納する従属関係記憶手段と、Stores dependencies with other procedures, tables, or triggers that are dependent on each procedure, dependencies with triggers that are dependent on each table, and dependencies on tables that are dependent on each trigger Dependency storage means;
前記従属関係記憶手段の記憶内容に基づき、プロシージャ、テーブル及びトリガ間の従属関係を解析する解析手段と、Analysis means for analyzing a dependency relationship between a procedure, a table and a trigger based on the stored contents of the dependency relationship storage means;
前記解析手段により解析されたプロシージャ、テーブル及びトリガ間の呼び出し関係を記憶する呼出関係記憶手段と、Call relation storage means for storing the call relation between the procedure, table and trigger analyzed by the analysis means;
プロシージャ、テーブル及びトリガ間の呼び出し関係を木構造で表示する表示手段と備えたストアドプロシージャのデータベース管理システムにおいて、In a stored procedure database management system comprising display means for displaying a call relationship among procedures, tables and triggers in a tree structure,
前記ストアドプロシージャ記憶手段に記憶された任意のプロシージャについて、For any procedure stored in the stored procedure storage means,
前記解析手段により、当該プロシージャに従属するプロシージャについて、当該プロシージャを親ノード、当該従属するプロシージャを子ノードとした呼び出し関係を呼出関係記憶手段に記憶する第1ステップを実行し、かつ、当該従属するプロシージャに対して前記第1ステップを再帰的に実行し、The analysis means executes a first step of storing, in the call relation storage means, a call relationship having the procedure as a parent node and the dependent procedure as a child node, for the procedure subordinate to the procedure. Recursively performing the first step on the procedure;
前記解析手段により、当該プロシージャに従属するテーブルについて、前記ストアドプロシージャ記憶手段に記憶された当該テーブルの定義内容を参照し、当該テーブルへの操作に対応するトリガがある場合には、当該プロシージャを親ノード、当該トリガを子ノードとした呼び出し関係を呼出関係記憶手段に記憶する第2ステップを実行し、For the table subordinate to the procedure, the analysis means refers to the definition content of the table stored in the stored procedure storage means, and if there is a trigger corresponding to the operation on the table, the procedure is regarded as a parent. Executing a second step of storing the call relationship in the call relationship storage means with the node as a child node,
前記表示手段により、前記呼出関係記憶手段に記憶された当該プロシージャ、テーブル及びトリガ間の呼び出し関係を木構造で表示する第3ステップを実行する方法。A method of executing a third step of displaying, by the display means, a call relation between the procedure, table and trigger stored in the call relation storage means in a tree structure.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2001273224A JP4090226B2 (en) | 2001-09-10 | 2001-09-10 | Display method of stored procedure call relation diagram and database management system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2001273224A JP4090226B2 (en) | 2001-09-10 | 2001-09-10 | Display method of stored procedure call relation diagram and database management system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2003085012A JP2003085012A (en) | 2003-03-20 |
| JP4090226B2 true JP4090226B2 (en) | 2008-05-28 |
Family
ID=19098465
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2001273224A Expired - Fee Related JP4090226B2 (en) | 2001-09-10 | 2001-09-10 | Display method of stored procedure call relation diagram and database management system |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP4090226B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP5046715B2 (en) * | 2007-04-06 | 2012-10-10 | 株式会社エヌ・ティ・ティ・データ | Database system and program thereof |
-
2001
- 2001-09-10 JP JP2001273224A patent/JP4090226B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2003085012A (en) | 2003-03-20 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Simitsis et al. | State-space optimization of ETL workflows | |
| US7401064B1 (en) | Method and apparatus for obtaining metadata from multiple information sources within an organization in real time | |
| US7370270B2 (en) | XML schema evolution | |
| US7076778B2 (en) | Method and apparatus for upgrading a software application in the presence of user modifications | |
| JP3851493B2 (en) | Database search method, database search system, and computer-readable recording medium recording database search program | |
| US9177021B2 (en) | Relational query planning for non-relational data sources | |
| JP3742177B2 (en) | Parallel database system routine execution method | |
| US8010499B2 (en) | Database staging area read-through or forced flush with dirty notification | |
| US9626368B2 (en) | Document merge based on knowledge of document schema | |
| CN100565521C (en) | Dynamic method for generating XML documents from a database | |
| KR20010012305A (en) | System and method for storing and manipulating data in an information handling system | |
| US8667010B2 (en) | Database table partitioning allowing overlaps used in full text query | |
| CA2378582A1 (en) | Real-time database object statistics collection | |
| US12130814B2 (en) | Late materialization of queried data in database cache | |
| JP2016509281A (en) | Active database query maintenance | |
| CN109885585A (en) | Support the distributed data base system and method for storing process, trigger and view | |
| US8370375B2 (en) | Method for presenting database query result sets using polymorphic output formats | |
| KR101213798B1 (en) | Complex data access | |
| CN114490646A (en) | Data blood relationship analysis method and system based on metadata | |
| US20040193567A1 (en) | Apparatus and method for using a predefined database operation as a data source for a different database operation | |
| US8290922B2 (en) | Data framework to enable rich processing of data from any arbitrary data source | |
| CN110399378B (en) | Database system lock operation analysis method and device | |
| US7885927B2 (en) | Transfer of table instances between databases | |
| JP4090226B2 (en) | Display method of stored procedure call relation diagram and database management system | |
| US20080133461A1 (en) | Optimization of left and right outer join operations in database management systems |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20070918 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20071113 |
|
| 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: 20080129 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20080226 |
|
| R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110307 Year of fee payment: 3 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110307 Year of fee payment: 3 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120307 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130307 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130307 Year of fee payment: 5 |
|
| S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313111 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130307 Year of fee payment: 5 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140307 Year of fee payment: 6 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| LAPS | Cancellation because of no payment of annual fees |