JP4708838B2 - Terminal device and diagnostic program - Google Patents
Terminal device and diagnostic program Download PDFInfo
- Publication number
- JP4708838B2 JP4708838B2 JP2005115969A JP2005115969A JP4708838B2 JP 4708838 B2 JP4708838 B2 JP 4708838B2 JP 2005115969 A JP2005115969 A JP 2005115969A JP 2005115969 A JP2005115969 A JP 2005115969A JP 4708838 B2 JP4708838 B2 JP 4708838B2
- Authority
- JP
- Japan
- Prior art keywords
- sql
- determination
- additional information
- execution
- target server
- 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
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Description
本発明は、SQL実行時のサーバの負荷状況を考慮してデータベースを診断する技術に関する。 The present invention relates to a technique for diagnosing a database in consideration of a load state of a server during SQL execution.
従来、データベースを診断するスクリプトは、当該データベースを有するサーバにおけるスクリプト実行時の負荷状況とは無関係で実行されていた(例えば、特許文献1又は2)。つまり、一度実行してしまうと、スクリプト内のSQL(Structured Query Language)は全て実行されてしまい、スクリプト実行期間中の他のプログラムによるサーバの負荷状況は考慮されていなかった。SQLの実行は、CPUやメモリなどサーバのシステム資源を消費するため、サーバのシステム資源に余裕がある場合は問題ないが、余裕がない場合は当該サーバにとって相当の負荷となってしまう。
Conventionally, a script for diagnosing a database has been executed irrespective of the load status at the time of script execution in the server having the database (for example,
このことから、診断スクリプトは、通常、他のプログラムによるサーバの負荷が低い時間帯を狙って実行される。しかし、診断スクリプトの実行時間は、データ量といったデータベースの状況によって数分乃至数十分と異なるため、当該診断スクリプトの実行期間中に他のプログラムによるサーバの負荷状況が変化してしまうことも多かった。診断スクリプト及び他のプログラムによるサーバの負荷が極端に大きくなると、各プログラムの実行時間の超過や中断、サーバのフリーズといった問題が生じる。 For this reason, the diagnosis script is usually executed aiming at a time zone when the load on the server by another program is low. However, since the execution time of the diagnostic script varies from several minutes to several tens of minutes depending on the database status such as the amount of data, the server load status by other programs often changes during the execution period of the diagnostic script. It was. When the load on the server due to the diagnostic script and other programs becomes extremely large, problems such as excess or interruption of the execution time of each program and freezing of the server occur.
なお、データベースの診断、監視、管理に関する従来技術としては、非特許文献1が挙げられる。
Note that Non-Patent
本発明は、以上の点に鑑みてなされたものであり、実行するスクリプトの各SQL要素に重み付けをすることで、データベースを有するサーバの負荷状況に基づいて所定のSQLを実行するか否かを判定する診断プログラムを提供することを課題とする。 The present invention has been made in view of the above points. By weighting each SQL element of a script to be executed, whether or not to execute a predetermined SQL based on the load status of the server having the database is determined. It is an object to provide a diagnostic program for determination.
本発明の1つの観点では、診断を行うデータベースを有する診断対象サーバと通信可能に接続された端末装置であって、前記診断対象サーバにおいて実行する複数のSQL及び各SQLにそれぞれ設定された付加情報から構成される診断スクリプトに基づいて、前記SQL及び前記付加情報から構成された配列であるSQLリストを作成するSQLリスト作成手段と、前記SQLリストから、前記SQL及び前記付加情報から構成された配列を読み込む読込手段と、前記読込手段が読み込んだ付加情報に基づいて、前記診断対象サーバから動作負荷を表す判定値を取得する判定値取得手段と、前記判定値取得手段が取得した前記判定値及び前記読込手段が読み込んだ付加情報に基づいて、前記読込手段が読み込んだSQLを前記診断対象サーバにおいて実行するか否かを判定する実行判定手段と、前記実行判定手段が実行すると判定した場合に、前記読込手段が読み込んだSQLを前記診断対象サーバへ送信するSQL送信手段と、前記SQL送信手段が送信したSQLの実行結果を、前記診断対象サーバから取得する実行結果受信手段と、を備える。 One aspect of the present invention is a terminal device communicably connected to a diagnosis target server having a database for diagnosis, and a plurality of SQLs executed in the diagnosis target server and additional information set in each SQL An SQL list creating means for creating an SQL list, which is an array composed of the SQL and the additional information, based on a diagnostic script comprising: an array composed of the SQL and the additional information from the SQL list Based on the additional information read by the reading means, a determination value acquisition means for acquiring a determination value representing an operational load from the diagnosis target server, the determination value acquired by the determination value acquisition means, and Based on the additional information read by the reading means, the SQL read by the reading means is changed to the diagnosis target server. An execution determination unit that determines whether or not to execute, an SQL transmission unit that transmits the SQL read by the reading unit to the diagnosis target server when the execution determination unit determines to execute, and the SQL transmission unit Execution result receiving means for acquiring the execution result of the SQL transmitted from the server to be diagnosed.
上記のように構成された端末装置は、ネットワークを介して診断対象サーバとデータの授受が可能なパソコンやPDA(Personal Digital Assistants)などである。端末装置は、まず、外部ファイルである診断スクリプトを読み込むことにより、SQL及び付加情報から構成される1つ以上の配列から成るSQLリストを作成する。即ち、診断スクリプトに記述されたSQL及び付加情報は、初期段階では全てSQLリストに配列として格納されている。そして、端末装置は、SQLリストの中からSQL及び付加情報から構成された配列を読み込む。さらに、端末装置は、読み込んだ付加情報に基づいて、診断対象サーバから動作負荷を表す判定値を取得する。そして、端末装置は、取得した判定値と当該付加情報とに基づいて、読み込んだSQLを診断対象サーバにおいて実行するか否かを判定する。つまり、診断対象サーバの負荷状況に応じて、各SQLを実行するか否かを判定する。また、各SQLにはそれぞれ任意に付加情報を設定することが可能であるため、各SQLに応じた判定が可能である。そして、端末装置は、SQLを実行すると判定した場合にのみ、当該SQLを診断対象サーバに送信し、実行結果を受信する。これによれば、診断対象サーバの負荷状況を確認しながら、その時点で発行可能なSQLのみを実行し、診断スクリプト実行期間中の負荷を常に低い状態に保つことができる。よって、従来のように、診断対象サーバの負荷が極端に増加したことによるフリーズといった問題を解消することができる。 The terminal device configured as described above is a personal computer or PDA (Personal Digital Assistants) that can exchange data with a diagnosis target server via a network. First, the terminal device reads a diagnostic script, which is an external file, to create a SQL list including one or more arrays each including SQL and additional information. That is, the SQL and additional information described in the diagnostic script are all stored in the SQL list as an array in the initial stage. And a terminal device reads the arrangement | sequence comprised from SQL and additional information from a SQL list | wrist. Further, the terminal device acquires a determination value representing the operational load from the diagnosis target server based on the read additional information. Then, the terminal device determines whether or not to execute the read SQL in the diagnosis target server based on the acquired determination value and the additional information. That is, it is determined whether to execute each SQL according to the load status of the diagnosis target server. Further, since it is possible to arbitrarily set additional information for each SQL, it is possible to make a determination according to each SQL. And only when it is determined that the SQL is to be executed, the terminal device transmits the SQL to the diagnosis target server and receives the execution result. According to this, while confirming the load status of the diagnosis target server, only the SQL that can be issued at that time is executed, and the load during the diagnosis script execution period can always be kept low. Therefore, the problem of freezing due to an extreme increase in the load on the diagnosis target server can be solved as in the past.
上記端末装置の一態様では、前記付加情報は、前記判定値を算出するための判定関数及びしきい値を含んでおり、前記判定値取得手段は、前記読込手段が読み込んだ付加情報に含まれる判定関数の結果を前記判定値として取得するものであって、前記端末装置は、前記判定値取得手段が取得した判定値と、前記読込手段が読み込んだ付加情報に含まれるしきい値とを比較する判定値比較手段をさらに備え、前記実行判定手段は、前記判定値比較手段の結果に基づいて、前記読込手段が読み込んだSQLを前記診断対象サーバにおいて実行するか否かを判定する。 In one aspect of the terminal device, the additional information includes a determination function and a threshold value for calculating the determination value, and the determination value acquisition unit is included in the additional information read by the reading unit. A result of a determination function is acquired as the determination value, and the terminal device compares the determination value acquired by the determination value acquisition unit and a threshold value included in the additional information read by the reading unit. A determination value comparing means for determining whether or not the SQL read by the reading means is to be executed in the diagnosis target server based on a result of the determination value comparing means.
上記のように構成された端末装置において、各SQLに設定された付加情報には、判定値及びしきい値が含まれている。つまり、各SQLにはそれぞれ固有の判定値及びしきい値を任意に設定することが可能である。ここで、判定値とは、判定関数の結果であって、SQL実行判定時点での診断対象サーバの動作負荷を表す値である。一方、しきい値とは、SQLの実行を判定するために、判定値の比較対象となる、診断対象サーバの動作負荷の目安となる一定の値である。端末装置は、判定値としきい値の比較結果に基づいて、SQLを実行するか否かを判定する。つまり、予め任意に規定した目安であるしきい値が表す負荷より、判定値が表す負荷の方が小さい場合にのみ、端末装置は、SQLを実行すると判定する。なお、判定関数を実行して判定値を取得する処理は、診断対象サーバにとってほとんど負荷とはならない。これによれば、判定値により、SQL実行判定時点での診断対象サーバの動作負荷を数値として明確に取得することができる。また、予め任意に規定した目安であるしきい値と当該判定値とを比較するため、診断対象サーバの動作負荷を明確に反映して、SQL実行判定を行うことができる。 In the terminal device configured as described above, the additional information set in each SQL includes a determination value and a threshold value. That is, it is possible to arbitrarily set a unique determination value and threshold value for each SQL. Here, the determination value is a result of the determination function, and is a value representing the operation load of the diagnosis target server at the time of SQL execution determination. On the other hand, the threshold value is a constant value that serves as a reference for the operation load of the diagnosis target server, which is a comparison target of the determination value in order to determine execution of SQL. The terminal device determines whether or not to execute SQL based on the comparison result between the determination value and the threshold value. In other words, the terminal apparatus determines to execute SQL only when the load represented by the determination value is smaller than the load represented by the threshold value, which is a guideline arbitrarily defined in advance. Note that the process of executing the determination function and acquiring the determination value is hardly a load on the diagnosis target server. According to this, the operation load of the diagnosis target server at the SQL execution determination time can be clearly acquired as a numerical value by the determination value. In addition, since the threshold value, which is a guideline arbitrarily defined in advance, is compared with the determination value, the SQL execution determination can be performed by clearly reflecting the operation load of the diagnosis target server.
上記端末装置の他の一態様では、前記端末装置は、前記診断対象サーバにおいて実行されたSQL及び当該SQLに設定された付加情報から構成された配列である実行済SQLリストを有しており、前記SQL送信手段が送信したSQL及び当該SQLに設定された付加情報から構成された配列を、前記SQLリストから前記実行済SQLリストへ移動する実行済SQLリスト移動手段をさらに備える。これによれば、既に実行したSQL及び付加情報から構成される配列はSQLリスト内に存在しなくなる。よって、SQL実行判定手段が既に実行したSQLについて実行するか否かを判定することを防止することができる。 In another aspect of the terminal device, the terminal device has an executed SQL list that is an array composed of SQL executed in the diagnosis target server and additional information set in the SQL, It further includes an executed SQL list moving means for moving an array composed of the SQL transmitted by the SQL transmitting means and the additional information set in the SQL from the SQL list to the executed SQL list. According to this, an array composed of already executed SQL and additional information does not exist in the SQL list. Therefore, it can be prevented that the SQL execution determination unit determines whether or not to execute the SQL already executed.
上記端末装置の他の一態様では、前記付加情報は、前記SQLリスト内で移動する位置を示す移動関数を含んでおり、前記実行判定手段が実行しないと判定した場合に、前記読込手段が読み込んだSQL及び当該SQLに設定された付加情報から構成される配列を、当該付加情報に含まれる移動関数に基づいて、前記SQLリスト内で移動するSQLリスト移動手段をさらに備える。これによれば、1度SQL実行判定手段が実行しないと判定したSQLであっても、再びSQLリスト内に移動される。よって、診断処理サーバの負荷状況が軽減した後に、再度SQL実行判定を行い、当該SQLを実行することが可能となる。 In another aspect of the terminal device, the additional information includes a movement function indicating a position to move in the SQL list, and the reading unit reads when the execution determining unit determines not to execute the additional information. SQL list moving means for moving an array composed of the SQL and additional information set in the SQL in the SQL list based on a transfer function included in the additional information is further provided. According to this, even if the SQL is determined not to be executed once by the SQL execution determination means, it is moved again into the SQL list. Therefore, after the load status of the diagnostic processing server is reduced, it is possible to perform the SQL execution determination again and execute the SQL.
上記端末装置の他の一態様では、前記SQLリスト移動手段は、前記配列を、前記移動関数に基づいて、前記SQLリストの最後に移動する。これによれば、1度SQL実行判定手段が実行しないと判定したSQLは、SQLリストの最後の位置に移動する。よって、SQLリストに存在する他のSQLについて実行判定を行っている間に診断処理サーバの負荷状況が軽減した場合には、再度のSQL実行判定により、当該SQLを実行することが可能となる。 In another aspect of the terminal device, the SQL list moving unit moves the array to the end of the SQL list based on the transfer function. According to this, the SQL determined that the SQL execution determination unit does not execute once moves to the last position in the SQL list. Therefore, when the load status of the diagnostic processing server is reduced while execution determination is performed on another SQL existing in the SQL list, the SQL can be executed by re-execution of SQL execution.
上記端末装置の他の一態様では、前記SQLリスト移動手段は、前記配列を、前記移動関数に基づいて、前記SQLリストの最初に移動する。これによれば、1度SQL実行判定手段が実行しないと判定したSQLは、SQLリストの最初に位置に移動する。よって、SQLの順番が意味を持つ場合であっても、予め診断スクリプトに記述された順番でSQLを実行することが可能となる。 In another aspect of the terminal device, the SQL list moving means moves the array to the beginning of the SQL list based on the transfer function. According to this, the SQL determined that the SQL execution determination unit does not execute once moves to the position at the beginning of the SQL list. Therefore, even when the order of SQL is significant, it is possible to execute SQL in the order described in the diagnostic script in advance.
上記端末装置の他の一態様では、前記SQLリスト移動手段は、前記配列を、前記移動関数に基づいて、前記SQLリストにおける予め設定された任意の位置に移動する。これによれば、1度SQL実行判定手段が実行しないと判定したSQLを、SQLリストの任意の位置に移動させることが可能となる。 In another aspect of the terminal device, the SQL list moving unit moves the array to an arbitrary position set in advance in the SQL list based on the transfer function. According to this, it is possible to move the SQL that is determined not to be executed once by the SQL execution determination unit to an arbitrary position in the SQL list.
上記端末装置の他の一態様では、前記付加情報は、前記実行判定手段が判定した回数を示す判定実行数と、判定する最大回数を示す最大判定実行数とを含み、前記端末装置は、前記実行判定手段による判定が行われた場合に、前記読込手段が読み込んだ付加情報に含まれる判定実行数を加算する加算手段と、前記読込手段が読み込んだ付加情報に含まれる判定実行数及び最大判定実行数を比較する実行数比較手段と、をさらに備え、前記実行判定手段は、前記実行数比較手段の結果及び前記判定値に基づいて、前記読込手段が読み込んだSQLを前記診断対象サーバにおいて実行するか否かを判定する。 In another aspect of the terminal device, the additional information includes a determination execution number indicating the number of times determined by the execution determination unit, and a maximum determination execution number indicating the maximum number of determinations. Addition means for adding the number of determination executions included in the additional information read by the reading means when the determination by the execution determination means is performed, and the number of determination executions and the maximum determination included in the additional information read by the reading means An execution number comparison means for comparing the number of executions, wherein the execution determination means executes the SQL read by the reading means in the diagnosis target server based on the result of the execution number comparison means and the determination value It is determined whether or not to do.
上記のように構成された端末装置において、前記付加情報は、判定実行数及び判定最大実行数を含んでいる。端末装置は、付加情報に含まれる判定実行数と判定最大実行数の比較結果を考慮して、SQLを実行するか否かの判定を行う。このように、最大判定実行数を使用して、判定実行数と最大判定実行数の比較結果を考慮することで、診断処理の永久ループを避け、強制的に診断処理を終了させることが可能となる。 In the terminal device configured as described above, the additional information includes a determination execution number and a determination maximum execution number. The terminal device determines whether or not to execute SQL in consideration of a comparison result between the determination execution number and the maximum determination execution number included in the additional information. In this way, by using the maximum number of determination executions and considering the comparison result between the number of determination executions and the maximum number of determination executions, it is possible to avoid a permanent loop of diagnosis processing and forcibly terminate the diagnosis processing Become.
上記端末装置の他の一態様では、前記端末装置は、前記診断対象サーバにおいて実行しないSQL及び当該SQLに設定された付加情報から構成された配列である未実行SQLリストを有しており、前記実行判定手段は、前記実行数比較手段が比較結果として、前記判定実行数が前記最大判定実行数より小さいと判定した場合にのみ、前記SQLを前記診断対象サーバにおいて実行するか否かを判定するものであって、前記実行数比較手段が比較結果として、前記判定実行数が前記最大判定実行数と等しいと判定した場合に、前記読込手段が読み込んだSQL及び付加情報から構成された配列を、前記SQLリストから前記未実行SQLリストへ移動する未実行SQLリスト移動手段をさらに備える。これによれば、実行しないことを決定したSQL及び付加情報から構成される配列はSQLリスト内に存在しなくなる。よって、SQL実行判定手段が既に実行しないことを決定したSQLについて実行するか否かを判定することを防止することができる。 In another aspect of the terminal device, the terminal device has an unexecuted SQL list that is an array composed of SQL that is not executed in the diagnosis target server and additional information set in the SQL, The execution determination unit determines whether or not to execute the SQL in the diagnosis target server only when the execution number comparison unit determines that the determination execution number is smaller than the maximum determination execution number as a comparison result. When the execution number comparison unit determines that the determination execution number is equal to the maximum determination execution number as a comparison result, an array composed of the SQL and additional information read by the reading unit, The system further comprises an unexecuted SQL list moving means for moving from the SQL list to the unexecuted SQL list. According to this, an array composed of SQL and additional information determined not to be executed does not exist in the SQL list. Therefore, it can be prevented that the SQL execution determination unit determines whether or not to execute the SQL that has already been determined not to be executed.
上記端末装置の他の一態様では、1つの前記SQLに対して、複数の前記判定関数の組み合わせを前記付加情報として設定する。これによれば、複数の判定関数の結果、即ち複数の判定値に基づいて、複数の角度から診断対象サーバの負荷状況を認識することができる。 In another aspect of the terminal device, a plurality of combinations of the determination functions are set as the additional information for one SQL. According to this, based on the results of a plurality of determination functions, that is, a plurality of determination values, it is possible to recognize the load status of the diagnosis target server from a plurality of angles.
上記端末装置の他の一態様では、前記しきい値は、予め規定された一定の前記診断対象サーバのCPU使用率であり、前記判定関数は、結果として前記診断対象サーバのCPU使用率を取得する関数であって、前記実行判定手段は、前記判定値比較手段が結果として、前記判定値が前記しきい値より小さいと判定した場合に、前記SQLを前記診断対象サーバにおいて実行すると判定する。これによれば、診断対象サーバの負荷状況を、CPU使用率から認識することができる。CPU使用率は、小さければ診断対象サーバの負荷が小さく、大きければ診断対象サーバの負荷が大きいことを表している。よって、端末装置は、予めしきい値として規定した一定のCPU使用率より判定値として取得したCPU使用率が小さければ、診断対象サーバの負荷が小さいとして、SQLを実行すると判定する。一方、しきい値として規定した一定のCPU使用率より判定値として取得したCPU使用率が大きければ、診断対象サーバの負荷が大きいとして、SQLを実行しないと判定する。 In another aspect of the terminal device, the threshold value is a predetermined CPU usage rate of the diagnostic target server, and the determination function obtains the CPU usage rate of the diagnostic target server as a result. The execution determination unit determines that the SQL is to be executed in the diagnosis target server when the determination value comparison unit determines that the determination value is smaller than the threshold value as a result. According to this, the load status of the diagnosis target server can be recognized from the CPU usage rate. If the CPU usage rate is small, the load on the diagnosis target server is small, and if it is large, the load on the diagnosis target server is large. Therefore, if the CPU usage rate acquired as the determination value is smaller than the predetermined CPU usage rate defined in advance as a threshold value, the terminal device determines that the load on the diagnosis target server is small and executes SQL. On the other hand, if the CPU usage rate acquired as the determination value is larger than the fixed CPU usage rate defined as the threshold value, it is determined that SQL is not executed because the load on the diagnosis target server is large.
上記端末装置の他の一態様では、前記しきい値は、予め規定された一定の前記診断対象サーバの空きメモリ容量であり、前記判定関数は、前記診断対象サーバの空きメモリ容量を取得する関数であって、前記実行判定手段は、前記判定値比較手段が結果として、前記判定値が前記しきい値より大きいと判定した場合に、前記SQLを前記診断対象サーバにおいて実行すると判定する。これによれば、診断対象サーバの負荷状況を空きメモリ容量から認識することができる。空きメモリ容量は、大きければ診断対象サーバの負荷が小さく、小さければ診断対象サーバの負荷が大きいことを表している。よって、端末装置は、予めしきい値として規定した一定の空きメモリ容量より判定値として取得した空きメモリ容量が大きければ、診断対象サーバの負荷が小さいとして、SQLを実行すると判定する。一方、しきい値として規定した一定の空きメモリ容量より判定値として取得した空きメモリ容量が小さければ、診断対象サーバの負荷が大きいとして、SQLを実行しないと判定する。 In another aspect of the terminal device, the threshold value is a predetermined free memory capacity of the diagnosis target server, and the determination function is a function for acquiring the free memory capacity of the diagnosis target server. The execution determination unit determines that the SQL is to be executed in the diagnosis target server when the determination value comparison unit determines that the determination value is larger than the threshold value as a result. According to this, the load status of the diagnosis target server can be recognized from the free memory capacity. If the free memory capacity is large, the load on the diagnosis target server is small, and if it is small, the load on the diagnosis target server is large. Therefore, if the free memory capacity acquired as the determination value is larger than the predetermined free memory capacity defined in advance as the threshold value, the terminal device determines that the load on the diagnosis target server is small and executes SQL. On the other hand, if the free memory capacity acquired as the determination value is smaller than the fixed free memory capacity defined as the threshold value, it is determined that SQL is not executed because the load on the diagnosis target server is large.
上記端末装置の他の一態様では、前記しきい値は、予め規定された一定の時間帯であり、前記判定関数は、現在の時刻を取得する関数であって、前記実行判定手段は、前記判定値比較手段が結果として、前記判定値が前記しきい値に含まれると判定した場合に、前記SQLを前記診断対象サーバにおいて実行すると判定する。これによれば、しきい値として予め診断対象サーバの負荷が小さい時間帯を規定しておく。よって、端末装置は、予めしきい値として規定した負荷が小さい時間帯に、判定値として取得した現在の時刻が含まれていれば、SQLを実行すると判定する。一方、予めしきい値として規定した負荷が小さい時間帯に、判定値として取得した現在の時刻が含まれていなければ、SQLを実行しないと判定する。なお、予めしきい値として負荷が大きい時間帯を規定しておき、判定値がしきい値に含まれない場合にのみSQLを実行すると判定することとしてもよい。 In another aspect of the terminal device, the threshold value is a predetermined time period, the determination function is a function for acquiring a current time, and the execution determination unit includes When the determination value comparison means determines that the determination value is included in the threshold value as a result, it determines that the SQL is to be executed in the diagnosis target server. According to this, a time zone in which the load on the diagnosis target server is small is defined in advance as a threshold value. Therefore, the terminal device determines to execute SQL if the current time acquired as the determination value is included in a time zone in which the load previously defined as the threshold value is small. On the other hand, if the current time acquired as the determination value is not included in the time zone in which the load defined as the threshold value is small, it is determined that SQL is not executed. Note that a time period during which the load is large is defined as a threshold value in advance, and it may be determined that SQL is executed only when the determination value is not included in the threshold value.
上記端末装置のさらに他の一態様では、前記判定関数は、一定の定数を取得する関数であって、前記実行判定手段は、前記判定値比較手段が結果として、前記しきい値に関わらず前記判定値として前記定数を取得したと判定した場合に、前記SQLを前記診断対象サーバにおいて実行すると判定する。これによれば、しきい値に関わらず、SQLを実行すると判定することが可能となる。よって、このような判定関数は、診断処理サーバの負荷状況に関わらず、必ず実行しなければならないSQLに対して特に有効である。 In still another aspect of the terminal device, the determination function is a function for obtaining a constant value, and the execution determination means is the result of the determination value comparison means regardless of the threshold value. When it is determined that the constant is acquired as a determination value, it is determined that the SQL is executed in the diagnosis target server. According to this, it is possible to determine that SQL is executed regardless of the threshold value. Therefore, such a determination function is particularly effective for SQL that must be executed regardless of the load status of the diagnostic processing server.
本発明の別の観点では、診断を行うデータベースを有する診断対象サーバと通信可能に接続されたコンピュータにより実行される診断プログラムであって、前記診断対象サーバにおいて実行する複数のSQL及び各SQLにそれぞれ設定された付加情報から構成される診断スクリプトに基づいて、前記SQL及び前記付加情報から構成された配列であるSQLリストを作成するSQLリスト作成手段、前記SQLリストから、前記SQL及び前記付加情報から構成された配列を読み込む読込手段、前記読込手段が読み込んだ付加情報に基づいて、前記診断対象サーバから動作負荷を表す判定値を取得する判定値取得手段、前記判定値取得手段が取得した前記判定値及び前記読込手段が読み込んだ付加情報に基づいて、前記読込手段が読み込んだSQLを前記診断対象サーバにおいて実行するか否かを判定する実行判定手段、前記実行判定手段が実行すると判定した場合に、前記読込手段が読み込んだSQLを前記診断対象サーバへ送信するSQL送信手段、前記SQL送信手段が送信したSQLの実行結果を、前記診断対象サーバから取得する実行結果受信手段、として前記コンピュータを機能させる。 In another aspect of the present invention, there is provided a diagnostic program that is executed by a computer that is communicably connected to a diagnosis target server having a database for diagnosis, and each of the plurality of SQLs and each SQL executed in the diagnosis target server. Based on a diagnostic script composed of the set additional information, an SQL list creating means for creating an SQL list that is an array composed of the SQL and the additional information, from the SQL list, from the SQL and the additional information Reading means for reading the configured array, determination value acquisition means for acquiring a determination value representing an operational load from the diagnosis target server based on the additional information read by the reading means, and the determination acquired by the determination value acquisition means Based on the value and additional information read by the reading means, the reading means reads An execution determination unit that determines whether or not to execute SQL in the diagnosis target server; an SQL transmission unit that transmits the SQL read by the reading unit to the diagnosis target server when the execution determination unit determines to execute; The computer is caused to function as an execution result receiving unit that acquires the execution result of the SQL transmitted by the SQL transmission unit from the diagnosis target server.
上記診断プログラムをコンピュータにより実行することにより、上述の端末装置を実現することができる。また、上述の端末装置の各態様も同様に実現することができる。 By executing the above diagnostic program by a computer, the above-described terminal device can be realized. Moreover, each aspect of the above-described terminal device can be realized in the same manner.
本発明によれば、実行するスクリプトの各SQL要素に重み付けをすることで、データベースを有するサーバの負荷状況に基づいて所定のSQLを実行するか否かを判定することができる。 According to the present invention, it is possible to determine whether or not to execute a predetermined SQL based on the load status of the server having the database by weighting each SQL element of the script to be executed.
以下、図面を参照して本発明の好適な実施の形態について説明する。 Preferred embodiments of the present invention will be described below with reference to the drawings.
[診断システム]
まず、診断システムについて図1乃至図4を参照して説明する。図1は、診断システム100の概略構成を示す。図2は、従来の診断システムにおける診断プログラム11aの機能を示す図である。図3は、従来の診断システム及び本発明の診断システムそれぞれにおけるCPU使用率の変化を示す図である。図4は、本発明の診断システムにおける診断プログラム11の機能を示す図である。
[Diagnostic system]
First, the diagnostic system will be described with reference to FIGS. FIG. 1 shows a schematic configuration of the
図1に示すように、診断システムにおいて、外部ファイルとして診断スクリプトを有するクライアント端末10と、診断対象となるデータベースを保有する診断対象サーバ12とはネットワーク2を介して通信可能に接続されている。ネットワーク2の1つの好適な例はインターネットである。ここで、クライアント端末10とは、ネットワーク2を介して診断対象サーバ12とデータの送受信が可能なパソコン、PDA(Personal Digital Assistants)等であって、予め診断プログラム11を保有している。この診断プログラム11により、クライアント端末10は、外部ファイルとして診断スクリプトを保持している。ここで、診断スクリプトは、データベースを診断するための複数のSQL(Structured Query Language;データベースの問い合わせ言語)の集合体であって、診断プログラム11は、当該診断スクリプトを操作(ハンドリング)するプログラムである。なお、詳細は後述するが、診断スクリプトに記述されたSQLは、上から順に実行される。
As shown in FIG. 1, in a diagnostic system, a
データベースがうまく動かない等の問題が生じた場合、当該データベースの診断を行う必要がある。このとき、クライアント端末10は、予め診断プログラム11により、診断スクリプトを保持している。そして、クライアント端末10の診断プログラム11は、診断スクリプトに記述されたSQLと、当該SQLの実行命令とを診断対象サーバ12に送信する。即ち、診断プログラム11は、診断対象サーバ12に、診断スクリプト内のSQLを実行するように命令する。一方、診断対象サーバ12は、診断プログラム11から受信した実行命令に従い、受信したSQLを実行する。さらに、診断対象サーバ12は、当該SQLの実行結果をクライアント端末10に送信する。このように、診断スクリプトに記述されたSQLを診断対象サーバ12が実行し、その実行結果をクライアント端末10に送信することでデータベースの診断が行われる。
When a problem such as the database not working properly occurs, it is necessary to diagnose the database. At this time, the
なお、診断対象サーバ12でSQLを実行する際には、当該診断対象サーバ12のCPUやメモリといったシステム資源が消費される。
When SQL is executed on the
従来の診断システムにおいて診断プログラム11aは、図2に示すように、まず、診断スクリプトから1つのSQLを読み込む。なお、診断プログラム11aは、図1と同様にクライアント端末10内で動作しているが、図2及び図4では当該クライアント端末10の図示を便宜上省略する。そして、診断プログラム11aは、読み込んだSQLを実行するように、診断対象サーバ12に命令する。診断対象サーバ12は、診断プログラム11aからの命令として受信したSQLを実行する。さらに、診断対象サーバ12は、当該SQLの実行結果をクライアント端末10に送信する。クライアント端末10が診断結果を受信すると、診断プログラム11aは、診断スクリプトから次のSQLを読み込み、上述の処理を繰り返し行う。この診断処理は、当該診断スクリプトに記述された全てのSQLについて終了するまで繰り返し行われる。
In the conventional diagnostic system, the diagnostic program 11a first reads one SQL from the diagnostic script as shown in FIG. The diagnostic program 11a operates in the
図3(a)は、従来の診断システムにおけるCPU使用率の変化を示す図である。具体的には、縦軸に「診断対象サーバ12のCPU使用率」、横軸に「時間」を取り、診断プログラム11aを実行した際の時間の経過と、診断対象サーバ12のCPU使用率との関係を示すグラフである。グラフ上における実線は、SQL実行を除いた他のプログラムによるCPU使用率、破線は、SQL実行により達するCPU使用率を示している。
FIG. 3A is a diagram showing a change in the CPU usage rate in the conventional diagnostic system. Specifically, the vertical axis indicates “CPU usage rate of the
従来の診断システムにおける診断プログラム11aは、上述のように、一度実行を開始すると、診断スクリプトに記述された最後のSQLの実行が完了するまで、診断処理を終了しない。そのため、図3(a)に示すように、診断プログラム11aを実行中、診断対象サーバ12上の他のプログラムが実行されることにより、診断対象サーバ12の負荷が増大した場合であっても、診断処理を実行し続ける。そのため、診断対象サーバ12の負荷が極端に増大することによる、各プログラムの実行時間の超過や中断、最悪の場合には、診断対象サーバ12のフリーズといった問題が生じる。
As described above, once the diagnosis program 11a in the conventional diagnosis system starts executing, the diagnosis processing does not end until execution of the last SQL described in the diagnosis script is completed. Therefore, as shown in FIG. 3 (a), even when the load on the
これに対し、本発明の診断システム100において診断プログラム11は、図4に示すように、まず、診断スクリプトから1つのSQL及び当該SQLに設定された付加情報、即ち1組のSQL及び付加情報を読み込む。そして、診断プログラム11は、読み込んだ付加情報に基づいて診断対象サーバ12の負荷状況を考慮し、読み込んだSQLを実行するか否かの判定を行う。SQLを実行すると判定した場合、診断プログラム11は、読み込んだSQLを実行するように、診断対象サーバ12に命令する。診断対象サーバ12は、診断プログラム11からの命令として受信したSQLを実行する。さらに、診断対象サーバ12は、当該SQLの実行結果をクライアント端末10に送信する。クライアント端末10が診断結果を受信すると、診断プログラム11は、診断スクリプトから次のSQLを読み込み、上述の処理を繰り返し行う。一方、SQLを実行しないと判定した場合、診断プログラム11は、診断対象サーバ12に実行命令を行うことなく、診断スクリプトから次のSQLを読み込み、上述の処理を繰り返し行う。この診断処理は、後述する所定の条件を完了するまで繰り返し行われる。
On the other hand, in the
図3(b)は、本発明の診断システム100におけるCPU使用率の変化を示す図である。図3(a)と同様に、診断プログラム11を実行した際の時間の経過と、診断対象サーバ12のCPU使用率との関係を示すグラフである。
FIG. 3B is a diagram showing a change in the CPU usage rate in the
本発明の診断システム100における診断プログラム11は、上述のように、各SQLの実行前に、実行するか否かの判定を行うフェーズを設けている。具体的に、詳細は後述するが、診断プログラム11は、付加情報に基づいて診断対象サーバ12の負荷をチェックし、予め規定されたしきい値よりもその負荷が小さい場合にのみSQLを実行する。よって、図3(b)に示すように、診断プログラム11を実行中、診断対象サーバ12上の他のプログラムが実行されることにより、診断対象サーバ12の負荷が増大した場合には、診断処理を中断する。そのため、従来の診断システムにおける問題点を解消することができる。
As described above, the
なお、診断対象サーバ12の負荷をチェックする方法(コマンド)自体は、当該診断対象サーバ12の負荷にはほとんどならないものである。また、SQLを実行するか否かを判定するしきい値は、SQL毎に設定され、付加情報に含まれている。
Note that the method (command) itself for checking the load of the
[SQL]
次に、SQLについて図5を参照して詳しく説明する。図5は、診断スクリプトに記述されたSQLの例を示す。
[SQL]
Next, SQL will be described in detail with reference to FIG. FIG. 5 shows an example of SQL described in the diagnostic script.
SQLとは、データベースへの問い合わせ言語である。SQLを用いることで、表の定義やデータ操作、関係演算など、データベースに関するほとんどの操作を機械可読なテキストとして記述することができる。よって、SQLによりデータベースそのものと、データベース管理システム(以下、「DBMS」と呼ぶ。)との関係を抽象化することが可能となる。 SQL is a query language for a database. By using SQL, most database operations such as table definitions, data operations, and relational operations can be described as machine-readable text. Therefore, the relation between the database itself and the database management system (hereinafter referred to as “DBMS”) can be abstracted by SQL.
図5(a)に示すようなSQLを実行した場合、診断対象サーバ12にとって高負荷となっている列などを抽出することができる。具体的に、図5における「SELECT」とは、列を指定して、特定の条件に合う情報を抽出することを表している。また、図5(a)の「SELECT a, b, c」における「a」、「b」、「c」はそれぞれ任意の列(発行時間、人、SQL文など)を表している。また、「FROM table A」の「table A」は、情報を抽出する任意の表の名称を表している。よって、列「a」、「b」及び「c」が高負荷な列である場合、図5(a)に示すSQLは、「table A」から高負荷となっている列の情報を抽出する操作を示している。
When SQL as shown in FIG. 5A is executed, a column or the like that is highly loaded for the
図5(b)に示すようなSQLを実行した場合、診断対象サーバ12のメモリ使用効率などを抽出することができる。具体的に、図5(b)の「avg(a)」は任意の列の平均値を表している。よって、列「a」が例えばメモリ使用効率を示す列である場合、図5(b)に示すSQLは、「table B」からメモリ使用効率の平均値を抽出する操作を示している。ここで、メモリ使用効率とは、SQL全体に対して診断対象サーバ12のメモリ上にキャッシュされている情報を返した比率である。換言すると、どのくらいの割合(%)でメモリ上の情報を要求元に返しているかを示す数値である。
When SQL as shown in FIG. 5B is executed, the memory usage efficiency of the
図5(c)に示すようなSQLを実行した場合、データベースにおけるパラメータの名前と設定値を全て抽出することができる。具体的に、図5(c)の「name」はパラメータの名前の列を、「value」は設定値の列を表している。よって、図5(c)に示すSQLは、「table C」からパラメータの名前と設定値を全て抽出する操作を示している。 When the SQL as shown in FIG. 5C is executed, all the parameter names and setting values in the database can be extracted. Specifically, “name” in FIG. 5C represents a parameter name column, and “value” represents a set value column. Therefore, SQL shown in FIG. 5C indicates an operation of extracting all parameter names and setting values from “table C”.
図5(d)に示すようなSQLを実行した場合、データベースに含まれる表の情報を全て抽出することができる。具体的に、図5(d)の「*(アスタリスク」)は全ての列を表している。よって、図5(d)に示すSQLは、「table D」の情報を全て抽出する操作を示している。 When SQL as shown in FIG. 5D is executed, it is possible to extract all table information included in the database. Specifically, “* (asterisk”) in FIG. 5D represents all columns. Therefore, SQL shown in FIG. 5D indicates an operation for extracting all information of “table D”.
なお、詳細は後述するが、「table A」〜「table D」はDBMSがディクショナリ領域に管理するテーブルである。また、図5は、上記4つのSQLを例として記載しているが、本発明はこれに限定されるものではなく、任意のSQLを診断スクリプトに記述することが可能である。 Although details will be described later, “table A” to “table D” are tables managed by the DBMS in the dictionary area. FIG. 5 illustrates the above four SQLs as an example, but the present invention is not limited to this, and any SQL can be described in a diagnostic script.
[付加情報]
次に、各SQLに設定された付加情報について、図6乃至図9を参照して詳しく説明する。図6は、付加情報として含まれる情報を説明する図である。図7は、判定関数の例を示す図である。図8は、従来の診断スクリプトの例と、本発明の診断スクリプトの例を示す図である。
[Additional information]
Next, additional information set in each SQL will be described in detail with reference to FIGS. FIG. 6 is a diagram for explaining information included as additional information. FIG. 7 is a diagram illustrating an example of the determination function. FIG. 8 is a diagram illustrating an example of a conventional diagnosis script and an example of a diagnosis script of the present invention.
図6に示すように、付加情報は、判定関数、しきい値、判定実行数、最大判定実行数及び未実行時移動関数(以下、「移動関数」と呼ぶ。)を含んでいる。 As illustrated in FIG. 6, the additional information includes a determination function, a threshold value, a determination execution number, a maximum determination execution number, and an unexecuted movement function (hereinafter referred to as “movement function”).
図6に示す判定関数とは、しきい値との比較を行うための判定値を導く関数である。即ち、判定値とは、診断対象サーバから取得する判定関数の結果であって、SQLを実行しようとする際の診断対象サーバ12の負荷を示す値である。なお、判定関数はSQL毎に任意に設定されるものであり、各SQLでそれぞれ異なるものである。また、複数の判定関数を1つのSQLに設定してもよい。
The determination function shown in FIG. 6 is a function for deriving a determination value for comparison with a threshold value. That is, the determination value is a result of the determination function acquired from the diagnosis target server, and is a value indicating the load on the
ここで、判定関数について図7を参照して詳しく説明する。図7(a)に示すような判定関数によれば、OSコマンドを実行し、診断対象サーバ12のCPU使用率を判定値として取得することができる。CPU使用率が小さければ診断対象サーバ12の負荷も小さくなり、反対にCPU使用率が大きければ診断対象サーバ12の負荷も大きくなる。この場合、後述するしきい値もCPU使用率となり、判定値がしきい値よりも小さい場合にのみ、SQLを実行することになる。
Here, the determination function will be described in detail with reference to FIG. According to the determination function as shown in FIG. 7A, an OS command can be executed and the CPU usage rate of the
なお、判定関数を示す変数表記は「f」である。また、図7に示す変数「t」は、SQL実行判定を行う時点の時間情報であって、判定関数「f(t)」を実行すると、SQL実行判定時点での判定関数「f」の結果を取得することができる。また、図7に各判定関数のコマンド例を示しているが、本発明はこれに限定されるものではなく、OSに応じて任意のコマンドを使用することができる。 The variable notation indicating the determination function is “f”. Also, the variable “t” shown in FIG. 7 is time information at the time of performing SQL execution determination, and when the determination function “f (t)” is executed, the result of the determination function “f” at the time of SQL execution determination Can be obtained. FIG. 7 shows a command example of each determination function, but the present invention is not limited to this, and any command can be used according to the OS.
図7(b)に示すような判定関数によれば、診断対象サーバ12の空きメモリ容量を判定値として取得することができる。空きメモリ容量が小さければ診断対象サーバの負荷は大きくなり、反対に空きメモリ容量が大きければ診断対象サーバの負荷は小さくなる。この場合、後述するしきい値も空きメモリ容量となり、判定値がしきい値よりも大きい場合にのみ、SQLを実行することになる。
According to the determination function as shown in FIG. 7B, the free memory capacity of the
図7(c)に示すような判定関数によれば、SQL実行判定時の時間情報を判定値として取得することができる。この場合、後述するしきい値はSQLの実行を許可する時間帯となり、判定値がしきい値に含まれている場合にのみ、SQLを実行することになる。または、後述するしきい値はSQLの実行を許可しない時間帯となり、判定値がしきい値に含まれていない場合にのみ、SQLを実行することになる。この判定関数及びしきい値は、予め診断対象サーバ12の負荷が増大する時間帯又は軽減する時間帯が明確な場合に有効である。
According to the determination function as shown in FIG. 7C, time information at the time of SQL execution determination can be acquired as a determination value. In this case, a threshold value to be described later is a time zone in which execution of SQL is permitted, and SQL is executed only when the determination value is included in the threshold value. Alternatively, a threshold value to be described later is a time zone in which execution of SQL is not permitted, and SQL is executed only when the determination value is not included in the threshold value. This determination function and threshold value are effective when the time zone during which the load on the
図7(d)に示すような判定関数によれば、いかなる場合においても定数を取得することができる。この場合、後述するしきい値に関わらず、当該定数を取得した場合にはSQLを実行することになる。この判定関数は、診断処理サーバ12の負荷状況に関わらず、必ず実行しなければならないSQLに対して特に有効である。
According to the determination function as shown in FIG. 7D, a constant can be obtained in any case. In this case, SQL is executed when the constant is acquired regardless of a threshold value described later. This determination function is particularly effective for SQL that must be executed regardless of the load status of the
なお、図7は、上記4つの判定関数を例として記載しているが、本発明はこれに限定されるものではなく、任意の判定関数を各SQLに設定することができる。また、判定関数は、1つのSQLに対して1つ設定すると限られるものではなく、1つのSQLに対して複数の判定関数の組み合わせを設定することとしてもよい。 Note that FIG. 7 illustrates the above four determination functions as an example, but the present invention is not limited to this, and an arbitrary determination function can be set for each SQL. In addition, setting one determination function for one SQL is not limited, and a combination of a plurality of determination functions may be set for one SQL.
図6に示すしきい値とは、SQLを実行するか否かを判定するために予め規定された一定の値である。具体的には、しきい値と判定値とを比較し、その大小でSQLを実行するか否かが判定される。 The threshold value shown in FIG. 6 is a constant value defined in advance in order to determine whether or not to execute SQL. Specifically, the threshold value and the determination value are compared, and it is determined whether or not SQL is to be executed based on the magnitude.
図6に示す判定実行数とは、SQLを実行するか否かを判定した回数である。 The number of determination executions shown in FIG. 6 is the number of times it has been determined whether or not to execute SQL.
図6に示す最大判定実行数とは、SQLを実行するか否かを判定する最大回数である。判定実行数が最大判定実行数に達した上で、SQLが実行されない場合、診断プログラム11は、当該SQLは未実行のまま診断処理を終了する。このように、最大判定実行数を使用することで、診断処理の永久ループを避け、強制的に診断処理を終了させることが可能となる。
The maximum number of determination executions shown in FIG. 6 is the maximum number of times for determining whether or not to execute SQL. When the number of determination executions reaches the maximum number of determination executions and SQL is not executed, the
図6に示す移動関数とは、しきい値と判定値を比較することにより、SQLを実行しないと判定した場合に、SQL及び当該SQLに設定された付加情報が後述するSQLリスト内で移動する位置を示す関数である。 In the movement function shown in FIG. 6, when it is determined that SQL is not executed by comparing a threshold value with a determination value, SQL and additional information set in the SQL move in an SQL list described later. This is a function indicating the position.
具体的に、従来の診断スクリプトは、図8(a)に示すように、複数のSQLのみから構成されていた。これに対し、本発明の診断スクリプトは、図8(b)に示すように、複数組のSQL及び付加情報から構成されている。このとき、図示のように、判定関数及びSQLは区切り文字({})で囲むものとする。なお、区切り文字({})は、例えば(“”)や($$)などでも可能である。 Specifically, the conventional diagnostic script is composed of only a plurality of SQLs as shown in FIG. On the other hand, the diagnostic script of the present invention is composed of a plurality of sets of SQL and additional information as shown in FIG. At this time, as shown in the figure, the determination function and SQL are surrounded by delimiters ({}). The delimiter ({}) can be, for example, (“”) or ($$).
[SQLリスト]
次に、診断プログラム11が保有するSQLリストについて図9乃至図13を参照して詳しく説明する。図9は、診断プログラム11が保有するSQLリスト、実行済SQLリスト及び未実行SQLリストを説明する図である。図10は、SQLリスト、実行済SQLリスト及び未実行SQLリストのデータ構成を模式的に示す図である。なお、図10に示すように、判定関数、しきい値、判定実行数、最大判定実行数及び移動関数の変数表記をそれぞれ「f」、「b」、「e」、「c」及び「m」とする。図11は、診断スクリプトに基づくSQLリストの作成を説明する図である。図12は、移動関数の例を示す図である。図13は、診断対象サーバ12が保有するデータベースの構成を模式的に示す図である。
[SQL list]
Next, the SQL list held by the
図9に示すように、診断プログラム11は、SQLリスト、実行済SQLリスト及び未実行SQLリストを保有している。
As shown in FIG. 9, the
図10(a)に示すように、SQLリストとは、実行するか否かを判定するSQL及び当該SQLに設定された付加情報から構成される配列である。外部ファイルである診断スクリプトに記述された全てのSQL及び付加情報は、診断プログラム11が保有するSQLリストに格納される。具体的に、診断プログラム11は、例えば図11(a)に示すような外部ファイルである診断スクリプトを読み込むことにより、図11(b)に示すような複数組のSQL及び付加情報から構成される配列であるSQLリストを作成し、内部ファイルとして保有している。よって、SQLリストは、初期段階では診断スクリプトに記述された1組以上のSQL及び付加情報から構成されており、複数組から構成される場合はリストの1番最初の組がSQL実行判定の対象となる。
As shown in FIG. 10A, the SQL list is an array composed of SQL for determining whether or not to execute and additional information set in the SQL. All the SQL and additional information described in the diagnostic script that is an external file are stored in the SQL list held by the
なお、しきい値と判定値を比較することにより、SQLを実行しないと判定した場合、SQL及び当該SQLに設定された付加情報は、移動関数に基づいてSQLリスト内で移動する。この移動関数に基づくSQLリスト内での移動について、図12を参照して説明する。 If it is determined that SQL is not to be executed by comparing the threshold value with the determination value, the SQL and the additional information set in the SQL move in the SQL list based on the transfer function. The movement in the SQL list based on this movement function will be described with reference to FIG.
図12(a)に示すような移動関数「LAST」によれば、診断プログラム11はSQLを実行しないと判定した場合に、SQLリストの最初に位置する当該SQL及び付加情報から構成される1つの配列を、図示のようにSQLリストの最後に移動する。このような移動関数による方式を、巡回方式と呼ぶ。
According to the transfer function “LAST” as shown in FIG. 12A, when the
図12(b)に示すような移動関数「FIRST」によれば、診断プログラム11はSQLを実行しないと判定した場合に、SQLリストの最初に位置する当該SQL及び付加情報から構成される1つの配列を、図示のように再びSQLリストの最初に移動する。換言すると、SQLを実行しないと判定した場合であっても、当該SQL及び付加情報から構成される1つの配列は同じ位置に留まる。このような移動関数による方式を、固定方式と呼ぶ。これによれば、SQLの順番が意味を持つ場合であっても、予め診断スクリプトに記述された順番でSQLを実行することが可能となる。
According to the transfer function “FIRST” as shown in FIG. 12B, when the
なお、このような移動関数では、診断対象サーバ12の負荷が一瞬だけ高い場合を除いて、診断プログラム11が当該SQLを連続的に実行しないと判定することが考えられる。このような連続的な判定を回避する方法として、判定関数において、診断対象サーバ12の負荷を示す判定値を一定時間待機した後に取得するように設定することなどが考えられる。
In such a transfer function, it is conceivable that the
図12(c)に示すような移動関数「n」によれば、診断プログラム11はSQLを実行しないと判定した場合に、SQLリストの最初に位置する当該SQL及び付加情報から構成される1つの配列を、任意の順番の位置に移動する。また、図12(c)に示すような移動関数「min(n, LAST)」によれば、診断プログラム11はSQLを実行しないと判定した場合に、SQLリストの最初に位置する当該SQL及び付加情報から構成される1つの配列を、SQLリストのn番目、又は、SQLリストがnより短いときはSQLリストの最後に移動する。具体的に、移動関数が配列を2番目の位置に移動することを示している場合には、図示のように、配列は移動する。しかし、移動関数が配列を5番目の位置に移動することを示している場合には、当該5番目の位置が存在しないため、SQLリストの最後に配列は移動する。これによれば、SQL及び付加情報からなる配列の個数が変動するSQLリストであっても、容易に任意の順番の位置に移動するような移動関数を利用することができる。
According to the transfer function “n” as shown in FIG. 12C, when the
図9及び図10(b)に示すように、実行済SQLリストは、診断対象サーバ12により実行されたSQL及び当該SQLに設定された付加情報から構成される配列である。つまり、診断対象サーバ12により実行されたSQL及び付加情報は、SQLリストから実行済SQLリストへ移動する。よって、初期段階では実行済SQLリストには何も格納されていないが、診断処理が進行するにつれて、診断対象サーバ12により実行されたSQL及び付加情報が格納されていく。
As shown in FIGS. 9 and 10B, the executed SQL list is an array composed of SQL executed by the
図9及び図10(c)に示すように、未実行SQLリストは、判定実行数が最大判定実行数に達したため未実行のまま診断処理を終了すると判定されたSQL及び当該SQLに設定された付加情報から構成される配列である。つまり、診断プログラム11により未実行のまま診断処理を終了すると決定されたSQL及び付加情報は、SQLリストから未実行SQLリストへ移動する。よって、診断プログラム11により未実行のまま診断処理を終了すると決定されたSQL及び付加情報がない場合には、未実行SQLリストには何も格納されないこともある。また、未実行SQLリストに格納されたSQLは、診断処理サーバ12により実行されていないため、未実行SQLリストにSQL及び付加情報が格納されている場合には、診断処理は完全に完了したとはいえない。よって、診断プログラムは、診断処理を完全に完了するために、その後、診断スクリプトに記述されたSQLを改めて実行したり、未実行SQLリストに格納されたSQLのみを実行したりといった補完処理を行う必要がある。
As shown in FIG. 9 and FIG. 10C, the unexecuted SQL list is set to the SQL that has been determined to end the diagnostic process without being executed because the determination execution number has reached the maximum determination execution number, and the SQL concerned. It is an array composed of additional information. That is, the SQL and additional information determined to end the diagnostic process without being executed by the
ここで、図13を参照して、診断対象サーバ12が保有するデータベースの構成について説明する。診断対象サーバが保有するデータベースは、図示のように、ユーザ自らが社員表や売上表などを書き込むユーザ領域と、データベースを管理するためにDBMSが自動的に統計情報などを書き込むディクショナリ(「辞書」又は「カタログ」とも呼ぶ。)領域とから構成されている。このように、データベースはユーザ領域とディクショナリ領域に分かれているものの、どちらの領域を使用する場合であっても同一の診断対象サーバ12に負荷がかかる。よって、本発明のように、診断対象サーバ12の負荷に基づいてSQLを実行するか否かを判定する診断処理が有益となる。なお、診断処理において実行時にSQLが読みに行くデータベースの領域は、破線で囲むディクショナリ領域である。
Here, with reference to FIG. 13, the structure of the database which the
[クライアント端末]
次に、クライアント端末10について図14を参照して詳しく説明する。図14は、診断システム100における、特にクライアント端末10の内部構成を示す図である。図示のように、クライアント端末10は、診断プログラム11、SQLリスト作成機能101、読込機能102、SQL実行判定機能103、SQL送信機能104、実行済SQLリスト移動機能105及び実行結果受信機能106から構成されている。また、SQL実行判定機能103は、さらに実行数比較機能131、未実行SQLリスト移動機能132、判定関数実行機能133、判定値比較機能134、判定実行数加算機能135及びSQLリスト移動機能136から構成されている。なお、これら各機能は、診断プログラム11をクライアント端末10内のCPUなどが実行することにより実現される。
[Client terminal]
Next, the
診断プログラム11は、各SQLに設定された付加情報及び診断対象サーバ12の負荷状況に基づいて、当該SQLを実行するか否かを判定した上で、データベースの診断処理を実行するプログラムである。
The
SQLリスト作成機能101は、図11(a)に示すような外部ファイルである診断スクリプトを読み込むことで、図11(b)に示すようなSQLリストを内部ファイルとして作成する機能である。
The SQL
読込機能102は、SQLリスト作成機能101が作成したSQLリストの最初に位置し、SQL及び付加情報から構成される1つの配列を読み込む機能である。
The
SQL実行判定機能103は、読込機能102が読み込んだ付加情報と、診断対象サーバ12の負荷状況とに基づいて、読み込んだSQLを実行するか否かを判定する機能である。
The SQL
実行数比較機能131は、読込機能102が読み込んだ付加情報に含まれる判定実行数と最大判定実行数とを比較する機能である。
The execution
未実行SQLリスト移動機能132は、実行数比較機能131が、判定実行数が最大判定実行数と等しい又は判定実行数が最大判定実行数より大きいと判定した場合に、読込機能102が読み込んだSQLを実行しないことを決定する機能である。また、未実行SQLリスト移動機能132は、実行しないことを決定したSQL及び当該SQLに設定された付加情報から構成される1つの配列を、図10(a)に示すようなSQLリストから、図10(c)に示すような未実行SQLリストへ移動する機能である。このように、未実行SQLリストへ移動することで、既に実行しないことを決定したSQLを、SQL実行判定機能103が再度判定してしまうことを防止することができる。
The unexecuted SQL
判定関数実行機能133は、実行数比較機能131が、判定実行数が最大判定実行数より小さいと判定した場合に、読込機能102が読み込んだ付加情報に含まれる判定関数を実行する機能である。判定関数実行機能133は、判定関数を実行することで、診断対象サーバ12から、当該診断対象サーバ12の負荷を示す判定値を取得する。
The determination
判定値比較機能134は、読込機能102が読み込んだ付加情報に含まれるしきい値と、判定関数実行機能133が取得した判定値とを比較する機能である。なお、SQL実行判定機能103は、この判定値比較機能134による比較結果に基づいて、読込機能102が読み込んだSQLを実行するか否かを判定する。
The determination
判定実行数加算機能135は、判定値比較機能134が比較したしきい値及び判定値に対応する付加情報に含まれる判定実行数に「1」を加算する機能である。
The determination execution
SQLリスト移動機能136は、SQL実行判定機能103が、読込機能102が読み込んだSQLを実行しないと判定した場合に、読込機能102が読み込んだ付加情報に含まれる移動関数に基づいて当該SQL及び付加情報から構成される1つの配列を、図12に示すようにSQLリスト内で移動する機能である。
When the SQL
SQL送信機能104は、SQL実行判定機能103が、読込機能102が読み込んだSQLを実行すると判定した場合に、当該SQLと、当該SQLの実行命令とを診断対象サーバ12へ送信する機能である。
The
実行済SQLリスト移動機能105は、SQL送信機能104が送信したSQL及び当該SQLに設定された付加情報から構成される1つの配列を、図10(a)に示すようなSQLリストから、図10(b)に示すような実行済SQLリストへ移動する機能である。このように、実行済SQLリストへ移動することで、既に実行したSQLを、SQL実行判定機能103が再度判定してしまうことを防止することができる。
The executed SQL
実行結果受信機能106は、診断対象サーバ12から、SQL送信機能104が送信したSQLの実行結果を受信する機能である。このように受信したSQLの実行結果に基づいて、診断プログラム11は、診断対象サーバ12が有するデータベースを診断することができる。
The execution
[診断処理]
次に、図15を参照して、上記診断システム100を構成するクライアント端末10により実行される診断処理について説明する。図15は、診断処理のフローチャートである。
[Diagnostic processing]
Next, with reference to FIG. 15, a diagnosis process executed by the
図示のように、診断処理において、クライアント端末10の診断プログラム11は、まず外部ファイルである診断スクリプトに基づいて、内部ファイルであるSQLリストを作成する。さらに、診断プログラム11は、SQLリストから1組のSQL及び付加情報を読み込む(ステップS1)。そして、診断プログラム11は、読み込んだ付加情報に含まれる判定実行数と最大判定実行数とを比較する(ステップS2)。判定実行数が最大判定実行数と等しいと判定した場合、診断プログラム11は、読み込んだSQL及び付加情報から構成される1つの配列を、SQLリストから未実行SQLリストへ移動する(ステップS11)。
As illustrated, in the diagnostic process, the
一方、判定実行数が最大判定実行数より小さいと判定した場合、診断プログラム11は、読み込んだ付加情報に含まれる判定関数を実行する(ステップS3)。これにより、診断プログラム11は、診断対象サーバ12から、負荷状況を示す判定値を取得することができる。判定値を取得すると、診断プログラム11は、読み込んだ付加情報に含まれるしきい値と、取得した当該判定値とを比較する(ステップS4)。具体的に、判定値及びしきい値がCPU使用率であった場合、診断プログラム11は、判定値がしきい値より大きいと判定すると、診断対象サーバ12の負荷が大きいため、読み込んだSQLを実行しないと判定する。よって、診断プログラム11は、読み込んだ付加情報に含まれる判定実行数に「1」を加算し(ステップS5)、読み込んだSQL及び付加情報から構成される1つの配列を、当該付加情報に含まれる移動関数に基づいて、SQLリスト内で移動する(ステップS6)。
On the other hand, when it is determined that the determination execution number is smaller than the maximum determination execution number, the
一方、判定値がしきい値と等しい又は判定値がしきい値より小さいと判定すると、診断プログラム11は、診断対象サーバ12の負荷が小さいため、読み込んだSQLを実行すると判定する。よって、診断プログラム11は、読み込んだ付加情報に含まれる判定実行数に「1」を加算し(ステップS7)、読み込んだSQL及び当該SQLの実行命令を診断対象サーバ12へ送信する(ステップS8)。さらに、診断プログラムは、読み込んだSQL及び付加情報から構成される1つの配列を、SQLリストから実行済SQLリストへ移動する(ステップS9)。さらに、診断プログラム11は、ステップS8において送信したSQLの実行結果を、診断対象サーバ12から受信する(ステップS10)。
On the other hand, if it is determined that the determination value is equal to the threshold value or the determination value is smaller than the threshold value, the
そして、診断プログラム11は、SQLリストに次のSQL及び付加情報から構成される配列が存在するか否かを判定する(ステップS12)。次のSQL及び付加情報から構成される配列が存在する場合(ステップS12;Yes)、診断プログラム11は、ステップS1乃至10の処理を繰り返し行う。一方、次のSQL及び付加情報から構成される配列が存在しない場合、即ちSQLリストが空の場合(ステップS12;No)、診断プログラム11は、診断処理を終了する。
Then, the
次に、クライアント端末10により実行される診断処理について、図16乃至21を参照して詳細に説明する。
Next, diagnostic processing executed by the
図16乃至図20は、診断処理における配列の変化を説明する図である。図16(a)乃至図20(a)は、診断処理におけるSQLリスト、実行済SQLリスト及び未実行SQLリスト間での配列の移動を特に説明する図である。図16(b)乃至図20(b)は、診断処理の流れを特に説明するフローチャートである。図16(c)乃至図20(c)は、診断処理における配列内での動きを特に説明する図である。また、図21は、縦軸に「値」、横軸に「時間」を取り、診断処理におけるしきい値及び判定値と、時間との関係を説明するグラフである。 FIG. 16 to FIG. 20 are diagrams for explaining a change in arrangement in the diagnostic processing. FIG. 16A to FIG. 20A are diagrams particularly illustrating the movement of the array among the SQL list, the executed SQL list, and the non-executed SQL list in the diagnosis process. FIG. 16B to FIG. 20B are flowcharts specifically explaining the flow of diagnostic processing. FIGS. 16C to 20C are diagrams for specifically explaining the movement in the array in the diagnostic processing. FIG. 21 is a graph for explaining the relationship between threshold values and determination values in diagnosis processing and time, with “value” on the vertical axis and “time” on the horizontal axis.
なお、後述の診断処理においても、図15に示す診断処理と同様に、しきい値及び判定値はCPU使用率であるものとする。 Note that, in the diagnostic process described later, the threshold value and the determination value are assumed to be the CPU usage rate as in the diagnostic process shown in FIG.
診断プログラム11は、まず、診断スクリプトに基づいて、図16(a)上部に示すようなSQLリストを作成する。さらに、図16(b)のフローチャートが示すように、診断プログラム11は、作成したSQLリストの最初に位置するSQL及び付加情報から構成される1つの配列を読み込む(ステップS21)。読み込んだ配列は、図16(c)に示す配列である。そして、診断プログラム11は、読み込んだ配列の付加情報に含まれる判定実行数(e1)「0」と、判定最大実行数(c1)「1」とを比較する(ステップS22)。この場合、判定実行数が判定最大実行数より小さいため、診断プログラム11は、判定関数(f1)を実行する(ステップS23)。診断プログラム11は、判定関数(f1)を実行した結果、図16(c)に示すように、判定値(r1)「30」を取得したとする。一方、判定実行数が判定最大実行数と等しい又は判定実行数が判定最大実行数より大きい場合には、診断プログラム11は、処理Aとして図15に示すステップS11の処理を行う。
The
判定値(r1)を取得した診断プログラム11は、当該判定値(r1)「30」と、読み込んだ配列の付加情報に含まれるしきい値(b1)「80」とを比較する(ステップS24)。この場合、判定値がしきい値より小さいため、診断プログラム11は、読み込んだSQL1を実行すると判定する。一方、判定値がしきい値より大きかった場合には、診断プログラム11は、処理Bとして図15に示すステップS5及びS6の処理を行う。
The
SQL1を実行すると判定した診断プログラム11は、読み込んだ配列の付加情報に含まれる判定実行数(e1)「0」を加算して「1」とする(ステップS25)。そして、診断プログラム11は、SQL1及び当該SQL1の実行命令を診断対象サーバ12へ送信する(ステップS26)。診断対象サーバ12は、受信したSQLを実行する。一方、診断プログラム11は、SQL1及び付加情報から構成される1つの配列を、図16(a)下部に示すように、SQLリストから実行済SQLリストへ移動する(ステップS27)。さらに、診断プログラム11は、診断対象サーバ12からSQL1の実行結果を受信し(ステップS28)、SQLリストに次のSQL及び付加情報から構成される配列が存在するか否かを判定する(ステップS29)。図16(a)下部に示すSQLリストには次の配列が存在するため、診断プログラム11は、図17(b)のフローチャートが示すステップS31へ進む。一方、次の配列が存在しない場合、診断プログラム11は、診断処理を終了する。
The
図17(b)に示すステップS31において、診断プログラム11は、図17(a)上部に示すSQLリストの最初に位置するSQL及び付加情報から構成される1つの配列を読み込む(ステップS31)。読み込んだ配列は、図17(c)に示す配列である。そして、診断プログラム11は、読み込んだ配列の付加情報に含まれる判定実行数(e2)「0」と、判定最大実行数(c2)「1」とを比較する(ステップS32)。この場合、判定実行数が判定最大実行数より小さいため、診断プログラム11は、判定関数(f2)を実行する(ステップS33)。診断プログラム11は、判定関数(f2)を実行した結果、図17(c)に示すように、判定値(r2)「50」を取得したとする。一方、判定実行数が判定最大実行数と等しい又は判定実行数が判定最大実行数より大きい場合には、診断プログラム11は、処理Cとして図15に示すステップS11の処理を行う。
In step S31 shown in FIG. 17B, the
判定値(r2)を取得した診断プログラム11は、当該判定値(r1)「50」と、読み込んだ配列の付加情報に含まれるしきい値(b2)「20」とを比較する(ステップS34)。この場合、判定値がしきい値より大きいため、診断プログラム11は、読み込んだ配列の付加情報に含まれる判定実行数(e2)「0」を加算して「1」とする(ステップS35)。さらに、診断プログラム11は、読み込んだSQL2及び付加情報から構成される1つの配列を、図17(a)の下部に示すように、移動関数(LAST)に基づいて、SQLリスト内の最後の位置に移動する(ステップS36)。そして、診断プログラム11は、図18(b)のフローチャートが示すステップS41へ進む。
The
図18(b)に示すステップS41において、診断プログラム11は、図18(a)上部に示すようなSQLリストの最初に位置するSQL及び付加情報から構成される1つの配列を読み込む(ステップS41)。読み込んだ配列は、図18(c)に示す配列である。そして、診断プログラム11は、読み込んだ配列の付加情報に含まれる判定実行数(e3)「0」と、判定最大実行数(c3)「2」とを比較する(ステップS42)。この場合、判定実行数が判定最大実行数より小さいため、診断プログラム11は、判定関数(f3)を実行する(ステップS43)。診断プログラム11は、判定関数(f3)を実行した結果、図18(c)に示すように、判定値(r3)「80」を取得したとする。なお、判定実行数が判定最大実行数と等しい又は判定実行数が最大判定実行数より大きい場合には、診断プログラム11は、処理Eとして図15に示すステップS11の処理を行う。
In step S41 shown in FIG. 18B, the
判定値(r3)を取得した診断プログラム11は、当該判定値(r3)「80」と、読み込んだ配列の付加情報に含まれるしきい値(b3)「60」とを比較する(ステップS44)。この場合、判定値がしきい値より大きいため、診断プログラム11は、読み込んだ配列の付加情報に含まれる判定実行数(e3)「0」を加算して「1」とする(ステップS45)。さらに、診断プログラム11は、読み込んだSQL3及び付加情報から構成される1つの配列を、図18(a)下部に示すように、移動関数(LAST)に基づいて、SQLリスト内の最後の位置に移動する(ステップS46)。そして、診断プログラム11は、図19(b)のフローチャートが示すステップS51へ進む。なお、ステップS44において判定値がしきい値と等しい又は判定値がしきい値より小さい場合には、診断プログラム11は、処理Fとして図15に示すS7乃至S10の処理を行う。
The
図19(b)に示すステップS51において、診断プログラム11は、図19(a)上部に示すようなSQLリストの最初に位置するSQL及び付加情報から構成される1つの配列を読み込む(ステップS51)。読み込んだ配列は、図19(c)に示す配列である。そして、診断プログラム11は、読み込んだ配列の付加情報に含まれる判定実行数(e2)「1」と、判定最大実行数(c2)「1」とを比較する(ステップS52)。この場合、判定実行数が判定最大実行数と等しいため、診断プログラム11は、読み込んだSQL2及び付加情報から構成される1つの配列を、図19(a)下部に示すように、SQLリストから未実行SQLリストに移動する(ステップS53)。なお、判定実行数が判定最大実行数より小さいと判定された場合には、診断プログラム11は、処理Gとして図15に示すステップS3乃至S10の処理を行う。
In step S51 shown in FIG. 19B, the
そして、診断プログラム11は、SQLリストに次のSQL及び付加情報から構成される配列が存在するか否かを判定する(ステップS54)。図19(a)下部に示すSQLリストには次の配列が存在するため、診断プログラム11は、図20(b)のフローチャートが示すステップS61へ進む。なお、次の配列が存在しなかった場合、診断プログラム11は、診断処理を終了する。
Then, the
図20(b)に示すステップS61において、診断プログラム11は、図20(a)上部に示すようなSQLリストの最初に位置するSQL及び付加情報から構成される1つの配列を読み込む(ステップS61)。読み込んだ配列は、図20(c)に示す配列である。そして、診断プログラム11は、読み込んだ配列の付加情報に含まれる判定実行数(e3)「1」と、判定最大実行数(c3)「2」とを比較する(ステップS62)。この場合、判定実行数が判定最大実行数より小さいため、診断プログラム11は、判定関数(f3)を実行する(ステップS63)。診断プログラム11は、判定関数(f3)を実行した結果、図20(c)に示すように、判定値(r3)「30」を取得したとする。なお、判定実行数が判定最大実行数と等しい又は判定実行数が最大判定実行数より大きい場合には、診断プログラム11は、処理Hとして図15に示すステップS11の処理を行う。
In step S61 shown in FIG. 20B, the
判定値(r3)を取得した診断プログラム11は、当該判定値(r3)「30」と、読み込んだ配列の付加情報に含まれるしきい値(b3)「60」とを比較する(ステップS64)。この場合、判定値がしきい値より小さいため、診断プログラム11は、読み込んだSQL3を実行すると判定する。なお、判定値がしきい値より大きかった場合には、診断プログラム11は、処理Iとして図15にn示すステップS5及びS6を行う。
The
SQL1を実行すると判定した診断プログラム11は、読み込んだ配列の付加情報に含まれる判定実行数(e3)「1」を加算して「2」とする(ステップS65)。そして、診断プログラム11は、SQL3及び当該SQL3の実行命令を診断対象サーバ12へ送信する(ステップS66)。診断対象サーバ12は、受信したSQLを実行する。一方、診断プログラム11は、SQL3及び付加情報から構成される1つの配列を、図20(a)下部に示すように、SQLリストから実行済SQLリストへ移動する(ステップS67)。さらに、診断プログラム11は、診断対象サーバ12からSQL3の実行結果を受信し(ステップS68)、SQLリストに次のSQL及び付加情報から構成される配列が存在するか否かを判定する(ステップS69)。図20(a)下部に示すSQLリストには次の配列が存在しないため、診断プログラム11は、診断処理を終了する。なお、SQLリストに次の配列が存在する場合には、診断プログラム11は、処理Jとして図15に示すステップS1乃至S11の処理を行う。
The
図16乃至図20を参照して説明するように診断処理を実行した場合、当該診断処理における、判定値及びしきい値と、時間との関係は、図21に示すようになる。 When the diagnosis process is executed as described with reference to FIGS. 16 to 20, the relationship between the determination value, the threshold value, and the time in the diagnosis process is as shown in FIG.
本発明によれば、診断処理において、実行する各SQLにそれぞれ設定された付加情報と、診断処理サーバ12の負荷状況とに基づいて、当該SQLを実行するか否かを判定することができる。つまり、診断対象サーバ12の負荷状況を確認しながら、その時点で発行可能なSQLを実行し、診断スクリプトの実行期間中のサーバ負荷を常に低い状態に保つことが可能となる。よって、本発明では、従来生じていた診断処理サーバのフリーズといった問題を解消することが可能となる。
According to the present invention, in the diagnostic process, it is possible to determine whether or not to execute the SQL based on the additional information set for each SQL to be executed and the load status of the
本発明は、データベースの診断を行う際、常に当該データベースを有するサーバの負荷を低い状態に保つことができる診断プログラムとして利用することができる。 The present invention can be used as a diagnostic program that can always maintain a low load on a server having a database when diagnosing the database.
2…ネットワーク
10…クライアント端末
11…診断プログラム
12…診断対象サーバ
100…診断システム
101…SQLリスト作成機能
102…読込機能
103…SQL実行判定機能
104…SQL送信機能
105…実行済SQLリスト移動機能
106…実行結果受信機能
DESCRIPTION OF
Claims (28)
前記診断対象サーバにおいて実行する複数のSQL及び各SQLにそれぞれ設定された付加情報から構成される診断スクリプトに基づいて、前記SQL及び前記付加情報から構成された配列であるSQLリストを作成するSQLリスト作成手段と、
前記SQLリストから、前記SQL及び前記付加情報から構成された配列を読み込む読込手段と、
前記読込手段が読み込んだ付加情報に基づいて、前記診断対象サーバから動作負荷を表す判定値を取得する判定値取得手段と、
前記判定値取得手段が取得した前記判定値及び前記読込手段が読み込んだ付加情報に基づいて、前記読込手段が読み込んだSQLを前記診断対象サーバにおいて実行するか否かを判定する実行判定手段と、
前記実行判定手段が実行すると判定した場合に、前記読込手段が読み込んだSQLを前記診断対象サーバへ送信するSQL送信手段と、
前記SQL送信手段が送信したSQLの実行結果を、前記診断対象サーバから取得する実行結果受信手段と、を備えることを特徴とする端末装置。 A terminal device communicably connected to a diagnosis target server having a database for performing diagnosis,
An SQL list that creates an SQL list that is an array composed of the SQL and the additional information, based on a plurality of SQL executed in the diagnosis target server and a diagnostic script composed of the additional information set for each SQL. Creating means;
Reading means for reading an array composed of the SQL and the additional information from the SQL list;
Based on the additional information read by the reading means, a determination value acquisition means for acquiring a determination value representing an operational load from the diagnosis target server;
Execution determination means for determining whether or not to execute the SQL read by the reading means in the diagnosis target server based on the determination value acquired by the determination value acquisition means and the additional information read by the reading means;
SQL transmission means for transmitting the SQL read by the reading means to the diagnosis target server when the execution determining means determines to execute;
An execution result receiving unit that acquires an execution result of the SQL transmitted by the SQL transmission unit from the diagnosis target server.
前記判定値取得手段は、前記読込手段が読み込んだ付加情報に含まれる判定関数の結果を前記判定値として取得するものであって、
前記端末装置は、
前記判定値取得手段が取得した判定値と、前記読込手段が読み込んだ付加情報に含まれるしきい値とを比較する判定値比較手段をさらに備え、
前記実行判定手段は、前記判定値比較手段の結果に基づいて、前記読込手段が読み込んだSQLを前記診断対象サーバにおいて実行するか否かを判定することを特徴とする請求項1に記載の端末装置。 The additional information includes a determination function and a threshold value for calculating the determination value,
The determination value acquisition unit acquires a determination function result included in the additional information read by the reading unit as the determination value,
The terminal device
A determination value comparison unit that compares the determination value acquired by the determination value acquisition unit with a threshold value included in the additional information read by the reading unit;
The terminal according to claim 1, wherein the execution determination unit determines whether or not to execute the SQL read by the reading unit in the diagnosis target server based on a result of the determination value comparison unit. apparatus.
前記SQL送信手段が送信したSQL及び当該SQLに設定された付加情報から構成された配列を、前記SQLリストから前記実行済SQLリストへ移動する実行済SQLリスト移動手段をさらに備えることを特徴とする請求項1又は2に記載の端末装置。 The terminal device has an executed SQL list that is an array composed of SQL executed in the diagnosis target server and additional information set in the SQL,
The system further comprises an executed SQL list moving means for moving an array composed of the SQL transmitted by the SQL transmitting means and the additional information set in the SQL from the SQL list to the executed SQL list. The terminal device according to claim 1 or 2.
前記実行判定手段が実行しないと判定した場合に、前記読込手段が読み込んだSQL及び当該SQLに設定された付加情報から構成される配列を、当該付加情報に含まれる移動関数に基づいて、前記SQLリスト内で移動するSQLリスト移動手段をさらに備えることを特徴とする請求項1乃至3のいずれか一項に記載の端末装置。 The additional information includes a movement function indicating a position to move in the SQL list,
When the execution determining means determines not to execute, an array composed of the SQL read by the reading means and the additional information set in the SQL is converted into the SQL based on the transfer function included in the additional information. The terminal device according to claim 1, further comprising an SQL list moving unit that moves in the list.
前記端末装置は、
前記実行判定手段による判定が行われた場合に、前記読込手段が読み込んだ付加情報に含まれる判定実行数を加算する加算手段と、
前記読込手段が読み込んだ付加情報に含まれる判定実行数及び最大判定実行数を比較する実行数比較手段と、をさらに備え、
前記実行判定手段は、前記実行数比較手段の結果及び前記判定値に基づいて、前記読込手段が読み込んだSQLを前記診断対象サーバにおいて実行するか否かを判定することを特徴とする請求項1乃至7のいずれか一項に記載の端末装置。 The additional information includes a determination execution number indicating the number of times determined by the execution determination unit, and a maximum determination execution number indicating the maximum number of determinations.
The terminal device
An addition unit for adding the number of determination executions included in the additional information read by the reading unit when the determination by the execution determination unit is performed;
An execution number comparison unit that compares the determination execution number and the maximum determination execution number included in the additional information read by the reading unit;
2. The execution determining unit determines whether or not to execute the SQL read by the reading unit in the diagnosis target server based on a result of the execution number comparing unit and the determination value. The terminal device as described in any one of thru | or 7.
前記実行判定手段は、前記実行数比較手段が比較結果として、前記判定実行数が前記最大判定実行数より小さいと判定した場合にのみ、前記SQLを前記診断対象サーバにおいて実行するか否かを判定するものであって、
前記実行数比較手段が比較結果として、前記判定実行数が前記最大判定実行数と等しいと判定した場合に、前記読込手段が読み込んだSQL及び付加情報から構成された配列を、前記SQLリストから前記未実行SQLリストへ移動する未実行SQLリスト移動手段をさらに備えることを特徴とする請求項8に記載の端末装置。 The terminal device has an unexecuted SQL list that is an array composed of SQL not executed in the diagnosis target server and additional information set in the SQL,
The execution determination unit determines whether or not to execute the SQL in the diagnosis target server only when the execution number comparison unit determines that the determination execution number is smaller than the maximum determination execution number as a comparison result. To do,
When the execution number comparison unit determines that the determination execution number is equal to the maximum determination execution number as a comparison result, an array composed of the SQL read by the reading unit and additional information is extracted from the SQL list. 9. The terminal device according to claim 8, further comprising an unexecuted SQL list moving means for moving to an unexecuted SQL list.
前記判定関数は、結果として前記診断対象サーバのCPU使用率を取得する関数であって、
前記実行判定手段は、前記判定値比較手段が結果として、前記判定値が前記しきい値より小さいと判定した場合に、前記SQLを前記診断対象サーバにおいて実行すると判定することを特徴とする請求項2乃至10のいずれか一項に記載の端末装置。 The threshold value is a predetermined CPU usage rate of the diagnosis target server,
The determination function is a function for obtaining the CPU usage rate of the diagnosis target server as a result,
The execution determination unit determines that the SQL is to be executed in the diagnosis target server when the determination value comparison unit determines that the determination value is smaller than the threshold value as a result. The terminal device according to any one of 2 to 10.
前記判定関数は、前記診断対象サーバの空きメモリ容量を取得する関数であって、
前記実行判定手段は、前記判定値比較手段が結果として、前記判定値が前記しきい値より大きいと判定した場合に、前記SQLを前記診断対象サーバにおいて実行すると判定することを特徴とする請求項2乃至11のいずれか一項に記載の端末装置。 The threshold value is a predetermined free memory capacity of the diagnosis target server,
The determination function is a function for obtaining a free memory capacity of the diagnosis target server,
The execution determination unit determines that the SQL is to be executed in the diagnosis target server when the determination value comparison unit determines that the determination value is larger than the threshold value as a result. The terminal device according to any one of 2 to 11.
前記判定関数は、現在の時刻を取得する関数であって、
前記実行判定手段は、前記判定値比較手段が結果として、前記判定値が前記しきい値に含まれると判定した場合に、前記SQLを前記診断対象サーバにおいて実行すると判定することを特徴とする請求項2乃至12のいずれか一項に記載の端末装置。 The threshold value is a predetermined time period defined in advance,
The determination function is a function for obtaining a current time,
The execution determination unit determines that the SQL is to be executed in the diagnosis target server when the determination value comparison unit determines that the determination value is included in the threshold value as a result. Item 13. The terminal device according to any one of Items 2 to 12.
前記実行判定手段は、前記判定値比較手段が結果として、前記しきい値に関わらず前記判定値として前記定数を取得したと判定した場合に、前記SQLを前記診断対象サーバにおいて実行すると判定することを特徴とする請求項2乃至13のいずれか一項に記載の端末装置。 The determination function is a function for obtaining a constant,
The execution determination unit determines to execute the SQL in the diagnosis target server when the determination value comparison unit determines that the constant is acquired as the determination value regardless of the threshold value. The terminal device according to claim 2, wherein:
前記診断対象サーバにおいて実行する複数のSQL及び各SQLにそれぞれ設定された付加情報から構成される診断スクリプトに基づいて、前記SQL及び前記付加情報から構成された配列であるSQLリストを作成するSQLリスト作成手段、
前記SQLリストから、前記SQL及び前記付加情報から構成された配列を読み込む読込手段、
前記読込手段が読み込んだ付加情報に基づいて、前記診断対象サーバから動作負荷を表す判定値を取得する判定値取得手段、
前記判定値取得手段が取得した前記判定値及び前記読込手段が読み込んだ付加情報に基づいて、前記読込手段が読み込んだSQLを前記診断対象サーバにおいて実行するか否かを判定する実行判定手段、
前記実行判定手段が実行すると判定した場合に、前記読込手段が読み込んだSQLを前記診断対象サーバへ送信するSQL送信手段、
前記SQL送信手段が送信したSQLの実行結果を、前記診断対象サーバから取得する実行結果受信手段、として前記コンピュータを機能させることを特徴とする診断プログラム。 A diagnostic program executed by a computer communicably connected to a diagnosis target server having a database for performing diagnosis,
An SQL list that creates an SQL list that is an array composed of the SQL and the additional information, based on a plurality of SQL executed in the diagnosis target server and a diagnostic script composed of the additional information set for each SQL. Creation means,
Reading means for reading an array composed of the SQL and the additional information from the SQL list,
Determination value acquisition means for acquiring a determination value representing an operational load from the diagnosis target server based on the additional information read by the reading means;
An execution determination unit for determining whether or not to execute the SQL read by the reading unit in the diagnosis target server based on the determination value acquired by the determination value acquiring unit and the additional information read by the reading unit;
SQL transmission means for transmitting the SQL read by the reading means to the diagnosis target server when the execution determining means determines to execute,
A diagnostic program for causing the computer to function as an execution result receiving unit that acquires the execution result of the SQL transmitted by the SQL transmission unit from the diagnosis target server.
前記判定値取得手段は、前記読込手段が読み込んだ付加情報に含まれる判定関数の結果を前記判定値として取得するものであって、
前記プログラムは、
前記判定値取得手段が取得した判定値と、前記読込手段が読み込んだ付加情報に含まれるしきい値とを比較する判定値比較手段としてさらに前記コンピュータを機能させ、
前記実行判定手段は、前記判定値比較手段の結果に基づいて、前記読込手段が読み込んだSQLを前記診断対象サーバにおいて実行するか否かを判定することを特徴とする請求項15に記載の診断プログラム。 The additional information includes a determination function and a threshold value for calculating the determination value,
The determination value acquisition unit acquires a determination function result included in the additional information read by the reading unit as the determination value,
The program is
Causing the computer to further function as a determination value comparison unit that compares the determination value acquired by the determination value acquisition unit with a threshold value included in the additional information read by the reading unit;
The diagnosis according to claim 15, wherein the execution determination unit determines whether or not the SQL read by the reading unit is to be executed in the diagnosis target server based on a result of the determination value comparison unit. program.
前記SQL送信手段が送信したSQL及び当該SQLに設定された付加情報から構成された配列を、前記SQLリストから前記実行済SQLリストへ移動する実行済SQLリスト移動手段としてさらに前記コンピュータを機能させることを特徴とする請求項15又は16に記載の診断プログラム。 The computer has an executed SQL list that is an array composed of SQL executed in the diagnosis target server and additional information set in the SQL,
Further causing the computer to function as an executed SQL list moving means for moving an array composed of the SQL transmitted by the SQL transmitting means and additional information set in the SQL from the SQL list to the executed SQL list. The diagnostic program according to claim 15 or 16, wherein:
前記実行判定手段が実行しないと判定した場合に、前記読込手段が読み込んだSQL及び当該SQLに設定された付加情報から構成される配列を、当該付加情報に含まれる移動関数に基づいて、前記SQLリスト内で移動するSQLリスト移動手段としてさらに前記コンピュータを機能させることを特徴とする請求項15乃至17のいずれか一項に記載の診断プログラム。 The additional information includes a movement function indicating a position to move in the SQL list,
When the execution determining means determines not to execute, an array composed of the SQL read by the reading means and the additional information set in the SQL is converted into the SQL based on the transfer function included in the additional information. The diagnostic program according to claim 15, further causing the computer to function as an SQL list moving unit that moves in a list.
前記プログラムは、
前記実行判定手段による判定が行われた場合に、前記読込手段が読み込んだ付加情報に含まれる判定実行数を加算する加算手段、
前記読込手段が読み込んだ付加情報に含まれる判定実行数及び最大判定実行数を比較する実行数比較手段、としてさらに前記コンピュータを機能させ、
前記実行判定手段は、前記実行数比較手段の結果及び前記判定値に基づいて、前記読込手段が読み込んだSQLを前記診断対象サーバにおいて実行するか否かを判定することを特徴とする請求項15乃至21のいずれか一項に記載の診断プログラム。 The additional information includes a determination execution number indicating the number of times determined by the execution determination unit, and a maximum determination execution number indicating the maximum number of determinations.
The program is
An adding means for adding the number of determination executions included in the additional information read by the reading means when a determination is made by the execution determining means;
The computer is further caused to function as an execution number comparison unit that compares the determination execution number and the maximum determination execution number included in the additional information read by the reading unit,
16. The execution determination unit determines whether or not to execute the SQL read by the reading unit in the diagnosis target server based on a result of the execution number comparison unit and the determination value. The diagnostic program as described in any one of thru | or 21.
前記実行判定手段は、前記実行数比較手段が比較結果として、前記判定実行数が前記最大判定実行数より小さいと判定した場合にのみ、前記SQLを前記診断対象サーバにおいて実行するか否かを判定するものであって、
前記実行数比較手段が比較結果として、前記判定実行数が前記最大判定実行数と等しいと判定した場合に、前記読込手段が読み込んだSQL及び付加情報から構成された配列を、前記SQLリストから前記未実行SQLリストへ移動する未実行SQLリスト移動手段としてさらに前記コンピュータを機能させることを特徴とする請求項22に記載の診断プログラム。 The computer has an unexecuted SQL list that is an array composed of SQL that is not executed in the server to be diagnosed and additional information set in the SQL,
The execution determination unit determines whether or not to execute the SQL in the diagnosis target server only when the execution number comparison unit determines that the determination execution number is smaller than the maximum determination execution number as a comparison result. To do,
When the execution number comparison means determines that the determination execution number is equal to the maximum determination execution number as a comparison result, an array composed of the SQL read by the reading means and additional information is extracted from the SQL list. 23. The diagnostic program according to claim 22, further causing the computer to function as an unexecuted SQL list moving means for moving to an unexecuted SQL list.
前記判定関数は、結果として前記診断対象サーバのCPU使用率を取得する関数であって、
前記実行判定手段は、前記判定値比較手段が結果として、前記判定値が前記しきい値より小さいと判定した場合に、前記SQLを前記診断対象サーバにおいて実行すると判定することを特徴とする請求項16乃至24のいずれか一項に記載の診断プログラム。 The threshold value is a predetermined CPU usage rate of the diagnosis target server,
The determination function is a function for obtaining the CPU usage rate of the diagnosis target server as a result,
The execution determination unit determines that the SQL is to be executed in the diagnosis target server when the determination value comparison unit determines that the determination value is smaller than the threshold value as a result. The diagnostic program according to any one of 16 to 24.
前記判定関数は、前記診断対象サーバの空きメモリ容量を取得する関数であって、
前記実行判定手段は、前記判定値比較手段が結果として、前記判定値が前記しきい値より大きいと判定した場合に、前記SQLを前記診断対象サーバにおいて実行すると判定することを特徴とする請求項16乃至25のいずれか一項に記載の診断プログラム。 The threshold value is a predetermined free memory capacity of the diagnosis target server,
The determination function is a function for obtaining a free memory capacity of the diagnosis target server,
The execution determination unit determines that the SQL is to be executed in the diagnosis target server when the determination value comparison unit determines that the determination value is larger than the threshold value as a result. The diagnostic program according to any one of 16 to 25.
前記判定関数は、現在の時刻を取得する関数であって、
前記実行判定手段は、前記判定値比較手段が結果として、前記判定値が前記しきい値に含まれると判定した場合に、前記SQLを前記診断対象サーバにおいて実行すると判定することを特徴とする請求項16乃至26のいずれか一項に記載の診断プログラム。 The threshold value is a predetermined time period defined in advance,
The determination function is a function for obtaining a current time,
The execution determination unit determines that the SQL is to be executed in the diagnosis target server when the determination value comparison unit determines that the determination value is included in the threshold value as a result. Item 27. The diagnostic program according to any one of Items 16 to 26.
前記実行判定手段は、前記判定値比較手段が結果として、前記しきい値に関わらず前記判定値として前記定数を取得したと判定した場合に、前記SQLを前記診断対象サーバにおいて実行すると判定することを特徴とする請求項16乃至27のいずれか一項に記載の診断プログラム。 The determination function is a function for obtaining a constant,
The execution determination unit determines to execute the SQL in the diagnosis target server when the determination value comparison unit determines that the constant is acquired as the determination value regardless of the threshold value. The diagnostic program according to any one of claims 16 to 27, wherein:
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2005115969A JP4708838B2 (en) | 2005-04-13 | 2005-04-13 | Terminal device and diagnostic program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2005115969A JP4708838B2 (en) | 2005-04-13 | 2005-04-13 | Terminal device and diagnostic program |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2006293838A JP2006293838A (en) | 2006-10-26 |
| JP4708838B2 true JP4708838B2 (en) | 2011-06-22 |
Family
ID=37414325
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2005115969A Expired - Fee Related JP4708838B2 (en) | 2005-04-13 | 2005-04-13 | Terminal device and diagnostic program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP4708838B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110162480B (en) * | 2019-05-31 | 2023-02-24 | 泛升云微电子(苏州)有限公司 | Automatic analysis method for structured diagnosis object |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH08137910A (en) * | 1994-11-15 | 1996-05-31 | Hitachi Ltd | Parallel database processing method and apparatus for implementing the same |
| JP2001331463A (en) * | 2000-05-23 | 2001-11-30 | Nec Corp | Data base construction method and recording medium having the program recorded thereon |
-
2005
- 2005-04-13 JP JP2005115969A patent/JP4708838B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2006293838A (en) | 2006-10-26 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US6938035B2 (en) | Reduce database monitor workload by employing predictive query threshold | |
| US11604782B2 (en) | Systems and methods for scheduling concurrent summarization of indexed data | |
| US9734203B2 (en) | Access path optimization through system statistics | |
| US7447710B2 (en) | Database system providing self-tuned parallel database recovery | |
| US8055686B2 (en) | Method and program of collecting performance data for storage network | |
| JP4598821B2 (en) | System and method for snapshot queries during database recovery | |
| JP4129819B2 (en) | Database search system, search method thereof, and program | |
| US7849072B2 (en) | Local terminal search system, filtering method used for the same, and recording medium storing program for performing the method | |
| JP6342070B2 (en) | Job management apparatus, job management method, and job management program | |
| JP2014081811A (en) | Log management system and log management method | |
| CN111488492B (en) | Method and apparatus for retrieving graph databases | |
| US20130346992A1 (en) | Computing system, method for controlling thereof, and computer-readable recording medium having computer program for controlling thereof | |
| US8595238B2 (en) | Smart index creation and reconciliation in an interconnected network of systems | |
| US8407713B2 (en) | Infrastructure of data summarization including light programs and helper steps | |
| JP2005251048A (en) | System monitoring method | |
| US7756827B1 (en) | Rule-based, event-driven, scalable data collection | |
| US10095737B2 (en) | Information storage system | |
| JP3962417B2 (en) | System and method for controlling access to database | |
| US20120166378A1 (en) | Forward chaining as an orchestration mechanism for analytics | |
| US7979385B2 (en) | Selective exposure to a data consumer | |
| JP4708838B2 (en) | Terminal device and diagnostic program | |
| US10311157B2 (en) | Method for update processing, and apparatus | |
| US7805434B2 (en) | Performing a non-invasive runtime simulation for a database system | |
| JP2005063240A (en) | Hierarchical database retrieving system, method, and program for the system | |
| US20090198813A1 (en) | Server apparatus and computer readable recording medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20080321 |
|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20110222 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20110317 |
|
| LAPS | Cancellation because of no payment of annual fees |