JP2007213392A - Sql trace acquisition system and method - Google Patents

Sql trace acquisition system and method Download PDF

Info

Publication number
JP2007213392A
JP2007213392A JP2006033769A JP2006033769A JP2007213392A JP 2007213392 A JP2007213392 A JP 2007213392A JP 2006033769 A JP2006033769 A JP 2006033769A JP 2006033769 A JP2006033769 A JP 2006033769A JP 2007213392 A JP2007213392 A JP 2007213392A
Authority
JP
Japan
Prior art keywords
trace
sql
service providing
computer
statement
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2006033769A
Other languages
Japanese (ja)
Inventor
Kiyoto Sato
清人 佐藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP2006033769A priority Critical patent/JP2007213392A/en
Publication of JP2007213392A publication Critical patent/JP2007213392A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an SQL (structured query language) trace acquisition system and method, capable of acquiring an SQL trace without needing a heavy load. <P>SOLUTION: This system that is a Web system comprises a management computer 400 including an SQL trace acquisition code embedding means 402 for embedding, in a WEB system, an SQL trace acquisition code in a service providing application 401 and generating a service providing application 403 embedded with SQL trace acquisition code, and a service assignment means 404 for assigning the service providing application 403 to a server computer 200 through a network. A service providing application 202 in the server computer 200 acquires a trace mode corresponding to an original application name stored in a trace mode table 203, and issues, when the trace mode is valid, a trace start sentence, an SQL sentence and a trace end sentence in order to the server computer 300. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は、第1のコンピュータからのSQL文実行リクエストを受けSQL文を実行する第2のコンピュータを備えたWebシステムにおけるSQLトレース取得システム、方法、プログラム、及び記録媒体に関する。   The present invention relates to an SQL trace acquisition system, method, program, and recording medium in a Web system including a second computer that receives an SQL statement execution request from a first computer and executes an SQL statement.

SQLトレースとは、データベースで実行したSQL文に関するパフォーマンス情報であり、パフォーマンス・チューニングを行う上での重要な手がかりとなる。   The SQL trace is performance information related to the SQL statement executed in the database, and is an important clue for performance tuning.

SQLトレースを取得するには、通常トレース開始文(トレース出力を有効化する制御用SQL文)を実行してトレース出力を有効化し、続けてトレースを取得したいSQL文を実行、最後にトレース終了文(トレース出力を無効化する制御用SQL文)を実行して元に戻せば良い。ただし、トレース開始文は、あくまでも自セッションのトレース出力を有効化するだけであるため、トレース開始文とトレースを取得したいSQL文は同じセッションで実行する必要がある。   To obtain the SQL trace, execute the normal trace start statement (control SQL statement that enables trace output) to enable the trace output, then execute the SQL statement that you want to obtain the trace, and finally the trace end statement (Control SQL statement for invalidating trace output) may be executed and restored. However, since the trace start statement only validates the trace output of its own session, it is necessary to execute the trace start statement and the SQL statement to obtain the trace in the same session.

なお、関連する技術として以下の特許文献1を参照されたい。   Refer to the following Patent Document 1 as related technology.

特開2001−175633号公報JP 2001-175633 A

しかしながら、親言語にSQL文を組み込んで利用している場合、SQLトレースを取得するためのコードを新たに追加しなければならず、アプリケーションを変更できない場合や、すでに稼動中のアプリケーションに対しては、取得できない問題がある。また、トレースを取得したいSQL文が変更になる毎にアプリケーションをその都度変更しなければならない。   However, when the SQL statement is embedded in the parent language and used, a new code for acquiring the SQL trace must be added. If the application cannot be changed, or if the application is already running There is a problem that can not be obtained. In addition, the application must be changed each time the SQL statement for which a trace is to be acquired is changed.

この場合、別セッションのトレース出力を有効化すれば、アプリケーションを修正せずにSQLトレースを取得することは可能である。   In this case, if the trace output of another session is validated, it is possible to acquire the SQL trace without modifying the application.

しかしながら、別セッションのトレース出力を有効化すれば、アプリケーションを修正せずにSQLトレースを取得するという上記した方法は非現実的である。なぜなら、Webシステムにおいては、通常SQL文の実行に使われる接続(セッション)を事前に予測することは不可能であるので、全セッションのトレース出力を有効化しなければならず、大きな負荷やディスク容量を要求する可能性があるからである。   However, if the trace output of another session is enabled, the above-described method of acquiring the SQL trace without modifying the application is unrealistic. Because, in the Web system, it is impossible to predict in advance the connection (session) that is normally used to execute the SQL statement, so it is necessary to enable the trace output of all the sessions, and the large load and disk capacity. This is because there is a possibility of requesting.

そこで本発明は、大きな負荷やディスク容量を要求することなくSQLトレースを取得することを可能とするSQLトレース取得システム、方法、プログラム、及び記録媒体を提供することを目的とする。   Accordingly, an object of the present invention is to provide an SQL trace acquisition system, method, program, and recording medium that can acquire an SQL trace without requiring a large load or disk capacity.

上記課題を解決するために、本件発明は、以下の特徴を有する課題を解決するための手段を採用している。   In order to solve the above problems, the present invention employs means for solving the problems having the following characteristics.

本発明の一態様によるSQLトレース取得システムは、
第1のコンピュータ(200)及び第1のコンピュータからのSQL文実行リクエストを受けSQL文を実行する第2のコンピュータ(300)を備えたWebシステムにおいて、
サービス提供アプリケーション(401)に、ソースコード無修正でSQLトレース取得用のコードを埋め込み、SQLトレース取得コード埋め込み済みサービス提供アプリケーション(403)を生成するSQLトレース取得コード埋め込み手段(402)と、
SQLトレース取得コード埋め込み済みサービス提供アプリケーション(403)を、ネットワークを介してSQLトレース取得機能付きサービス提供アプリケーション(202)として第1のコンピュータ(200)へ配備するサービス配備手段(404)とからなる管理サーバ(400)を有し、
第1のコンピュータ(200)は、
SQL文発行元アプリケーション名に対応するトレースモードをあらかじめ格納しているトレースモードテーブル(203)と、
前記対応するトレースモードをトレースモードテーブル(203)から取得し、トレースモードが有効であった場合トレース開始文、SQL文、トレース終了文の順に第2のコンピュータ(300)へ発行し、トレースモードが無効であった場合SQL文のみを発行するSQLトレース取得機能付きサービス提供アプリケーション(202)を有することを特徴とする。
An SQL trace acquisition system according to an aspect of the present invention includes:
In a Web system including a first computer (200) and a second computer (300) that executes an SQL statement in response to an SQL statement execution request from the first computer,
SQL trace acquisition code embedding means (402) for embedding the SQL trace acquisition code without modification in the source code in the service providing application (401) and generating the service providing application (403) with the embedded SQL trace acquisition code;
Management comprising service deployment means (404) for deploying the SQL trace acquisition code embedded service providing application (403) to the first computer (200) as a service providing application (202) with an SQL trace acquisition function via the network A server (400),
The first computer (200)
A trace mode table (203) that stores in advance the trace mode corresponding to the SQL statement issuer application name;
The corresponding trace mode is acquired from the trace mode table (203), and when the trace mode is valid, the trace start statement, the SQL statement, and the trace end statement are issued to the second computer (300) in this order. It is characterized by having a service providing application (202) with an SQL trace acquisition function that issues only an SQL sentence when it is invalid.

さらに、管理サーバ(400)が、前記トレースモードテーブル(203)へ、SQL文実行関数の呼び出し元アプリケーション名とトレースモードのマッピング情報を記録するトレースモード更新手段(405)を有することを特徴とする。   Furthermore, the management server (400) has a trace mode update means (405) for recording mapping information of the call source application name of the SQL statement execution function and the trace mode in the trace mode table (203). .

さらに、前記第2のコンピュータ(300)が、SQL文を実行し、実行結果を前記第1のコンピュータ(200)に送信する際、トレース出力が有効になっていた場合前記トレースリポジトリ(303)へSQLトレースを格納するデータベース管理システム(302)を有することを特徴とする。   Further, when the second computer (300) executes the SQL statement and sends the execution result to the first computer (200), if the trace output is valid, the second computer (300) goes to the trace repository (303). It has a database management system (302) for storing SQL traces.

さらに、前記SQLトレース取得コードが、前記トレースモードテーブル(203)から取得されたSQL文実行関数の呼び出し元アプリケーション名に対応するトレースモードに基づいて現行セッションのトレース出力を有効化するコードであってSQL文実行後に元に戻すコードであり、サービス提供アプリケーション401内に存在するSQL文実行関数の前後に埋め込まれることを特徴とする。   Furthermore, the SQL trace acquisition code is a code for enabling the trace output of the current session based on the trace mode corresponding to the caller application name of the SQL statement execution function acquired from the trace mode table (203). This is a code to be restored after executing the SQL statement, and is characterized by being embedded before and after the SQL statement execution function existing in the service providing application 401.

また、本発明の一態様によるSQLトレース取得方法は、
第1のコンピュータ(200)とネットワークを介して接続されている管理サーバ(400)内で前記サービス提供アプリケーション(401)に、ソースコード無修正でSQLトレース取得用のコードを埋め込むステップと、
SQLトレース取得コード埋め込み済みサービス提供アプリケーション(403)を生成するステップと、
前記SQLトレース取得コード埋め込み済みサービス提供アプリケーション(403)を、ネットワークを介してSQLトレース取得機能付きサービス提供アプリケーション(202)として前記第1のコンピュータ(200)へ配備するステップと、
SQL文発行元アプリケーション名に対応するトレースモードをあらかじめトレースモードテーブル(203)に格納するステップと、
前記第1のコンピュータ内で、前記対応するトレースモードを前記トレースモードテーブル(203)から取得するステップと、
当該トレースモードが有効であった場合トレース開始文、SQL文、トレース終了文の順に第2のコンピュータ(300)へ発行し、トレースモードが無効であった場合SQL文のみを発行するステップ
を有することを特徴とする。
In addition, an SQL trace acquisition method according to an aspect of the present invention includes:
Embedding SQL trace acquisition code without modification in the service providing application (401) in the management server (400) connected to the first computer (200) via the network;
Generating an SQL trace acquisition code embedded service providing application (403);
Deploying the SQL trace acquisition code embedded service providing application (403) to the first computer (200) as a service providing application (202) with an SQL trace acquisition function via a network;
Storing the trace mode corresponding to the SQL statement issuer application name in the trace mode table (203) in advance;
Obtaining the corresponding trace mode from the trace mode table (203) in the first computer;
When the trace mode is valid, a trace start statement, an SQL statement, and a trace end statement are issued to the second computer (300) in this order, and when the trace mode is invalid, only a SQL statement is issued. It is characterized by.

さらに、前記トレースモードテーブル(203)へ、SQL文実行関数の呼び出し元アプリケーション名とトレースモードのマッピング情報を記録更新するステップを有することを特徴とする。   The trace mode table (203) further includes a step of recording and updating the mapping information of the caller application name of the SQL statement execution function and the trace mode.

さらに、前記第2のコンピュータ(300)内で、SQL文を実行し、その実行結果を前記第1のコンピュータ(200)に送信する際、トレース出力が有効になっていた場合前記トレースリポジトリ(303)へSQLトレースを格納するステップを有することを特徴とする。   Furthermore, when the SQL statement is executed in the second computer (300) and the execution result is transmitted to the first computer (200), if the trace output is enabled, the trace repository (303 ) To store the SQL trace.

さらに、前記SQLトレース取得コードは、前記トレースモードテーブル(203)から取得されたSQL文実行関数の呼び出し元アプリケーション名に対応するトレースモードに基づいて現行セッションのトレース出力を有効化するコードであってSQL文実行後に元に戻すコードであり、サービス提供アプリケーション401内に存在するSQL文実行関数の前後に埋め込まれることを特徴とする。   Furthermore, the SQL trace acquisition code is a code for enabling the trace output of the current session based on the trace mode corresponding to the caller application name of the SQL statement execution function acquired from the trace mode table (203). This is a code to be restored after executing the SQL statement, and is characterized by being embedded before and after the SQL statement execution function existing in the service providing application 401.

また、本発明によれば、コンピュータに、
第1のサーバ(200)とネットワークを介して接続されている管理サーバ(400)内で前記サービス提供アプリケーション(401)に、ソースコード無修正でSQLトレース取得用のコードを埋め込むステップと、
SQLトレース取得コード埋め込み済みサービス提供アプリケーション(403)を生成するステップと、
前記SQLトレース取得コード埋め込み済みサービス提供アプリケーション(403)を、ネットワークを介してSQLトレース取得機能付きサービス提供アプリケーション(202)として前記第1のサーバ(200)へ配備するステップを有し、
SQL文発行元アプリケーション名に対応するトレースモードをあらかじめトレースモードテーブル(203)に格納するステップと、
前記第1のサーバ(200)内で、前記対応するトレースモードを前記トレースモードテーブル(203)から取得するステップと、
当該トレースモードが有効であった場合トレース開始文、SQL文、トレース終了文の順に第2のサーバ(300)へ発行し、トレースモードが無効であった場合SQL文のみを発行するステップを実行させることを特徴とするプログラムが得られる。
In addition, according to the present invention, a computer
Embedding the SQL trace acquisition code without modification in the service providing application (401) in the service providing application (401) in the management server (400) connected to the first server (200) via the network;
Generating an SQL trace acquisition code embedded service providing application (403);
Deploying the SQL trace acquisition code embedded service providing application (403) to the first server (200) as a service providing application (202) with an SQL trace acquisition function via a network;
Storing the trace mode corresponding to the SQL statement issuer application name in the trace mode table (203) in advance;
Obtaining the corresponding trace mode from the trace mode table (203) in the first server (200);
When the trace mode is valid, a trace start statement, an SQL statement, and a trace end statement are issued to the second server (300) in this order, and when the trace mode is invalid, only the SQL statement is issued. A program characterized by this can be obtained.

また、本発明によれば、前記プログラムを記録したことを特徴とするコンピュータ読取可能な情報記録媒体(コンパクトディスク、フレキシブルディスク、ハードディスク、光磁気ディスク、ディジタルビデオディスク、磁気テープ、または、半導体メモリを含む。)が得られる。   According to the present invention, there is provided a computer-readable information recording medium (compact disk, flexible disk, hard disk, magneto-optical disk, digital video disk, magnetic tape, or semiconductor memory) characterized by recording the program. Including) is obtained.

本発明によれば、第1に、ソースコード無修正でサービス提供アプリケーションにSQLトレース取得用のコードを機械的に埋め込むため、アプリケーションの修正が不要であり、アプリケーション開発者がまったく意識しなくても良い。このため、アプリケーションから発行されるSQL文のトレースを現実的な方法で取得することができる。   According to the present invention, first, since the SQL trace acquisition code is mechanically embedded in the service providing application without correcting the source code, there is no need to modify the application, and the application developer is not conscious at all. good. For this reason, the trace of the SQL sentence issued from an application can be acquired by a realistic method.

また、本発明によれば、第2に、アプリケーション単位にトレースモードを管理し、ある特定のアプリケーションから発行されたSQL文のみ、トレースを取得することができるため、サーバ計算機に大きな負荷やディスク容量を要求することがなくなる。   In addition, according to the present invention, secondly, since the trace mode is managed for each application and only the SQL statement issued from a specific application can be acquired, a large load or disk capacity is imposed on the server computer. Is no longer required.

次に、本発明の実施の形態について図面を参照して詳細に説明する。以下、図1を参照して、本発明の第1の実施の形態に係るSQLトレース取得システムについて説明する。   Next, embodiments of the present invention will be described in detail with reference to the drawings. The SQL trace acquisition system according to the first embodiment of the present invention will be described below with reference to FIG.

本システムは、プログラム制御により動作するクライアント計算機100と、プログラム制御により動作するサーバ計算機200と、プログラム制御により動作するサーバ計算機300と、プログラム制御により動作する管理計算機400と、サーバ計算機200上で動作するサービス処理手段201と、サーバ計算機200上の補助記憶装置または記憶媒体に格納された、SQLトレース取得機能付きサービス提供アプリケーション202と、サーバ計算機200上の主記憶装置または記憶媒体に格納されたトレースモードテーブル203と、サーバ計算機300上で動作するSQL文処理手段301と、サーバ計算機300上の補助記憶装置または記憶媒体に格納されたデータベース管理システム302と、サーバ計算機300上の補助記憶装置または記憶媒体に格納されたトレースリポジトリ303と、管理計算機400上で動作するSQLトレース取得コード埋め込み手段402、およびサービス配備手段404、およびトレースモードテーブル更新手段405と、管理計算機400上の補助記憶装置または記憶媒体に格納されるサービス提供アプリケーション401、およびSQLトレース取得コード埋め込み済みサービス提供アプリケーション403、から構成されている。   This system operates on a client computer 100 operating under program control, a server computer 200 operating under program control, a server computer 300 operating under program control, a management computer 400 operating under program control, and a server computer 200. Service processing means 201 to perform, a service providing application 202 with an SQL trace acquisition function stored in an auxiliary storage device or storage medium on the server computer 200, and a trace stored in a main storage device or storage medium on the server computer 200 Mode table 203, SQL statement processing means 301 operating on server computer 300, database management system 302 stored in an auxiliary storage device or storage medium on server computer 300, and auxiliary on server computer 300 Trace repository 303 stored in storage device or storage medium, SQL trace acquisition code embedding unit 402 operating on management computer 400, service deployment unit 404, trace mode table updating unit 405, and auxiliary on management computer 400 The service providing application 401 is stored in a storage device or a storage medium, and the service providing application 403 has an SQL trace acquisition code embedded therein.

サーバ計算機200は、サービス処理手段201を含む。サーバ計算機300は、SQL文処理手段301を含む。管理計算機400は、SQLトレース取得コード埋め込み手段402と、サービス配備手段404と、トレースモードテーブル更新手段405を含む。   The server computer 200 includes service processing means 201. The server computer 300 includes SQL statement processing means 301. The management computer 400 includes an SQL trace acquisition code embedding unit 402, a service deployment unit 404, and a trace mode table update unit 405.

これらの手段はそれぞれ概略で次のように動作する。SQLトレース取得コード埋め込み手段402は、サービス提供アプリケーション401に、ソースコード無修正でSQLトレース取得用のコードを埋め込み、SQLトレース取得コード埋め込み済みサービス提供アプリケーション403を生成する。   Each of these means generally operates as follows. The SQL trace acquisition code embedding unit 402 embeds an SQL trace acquisition code without modification of the source code in the service providing application 401 to generate the SQL trace acquisition code embedded service providing application 403.

サービス配備手段404は、SQLトレース取得コード埋め込み済みサービス提供アプリケーション403を、SQLトレース取得機能付きサービス提供アプリケーション202としてサーバ計算機200へ配備する。   The service deployment means 404 deploys the SQL trace acquisition code embedded service providing application 403 to the server computer 200 as the service providing application 202 with the SQL trace acquisition function.

トレースモード更新手段405は、トレースモードテーブル203へ、SQL文実行関数の呼び出し元アプリケーション名とトレースモードのマッピング情報を記録する。   The trace mode update means 405 records the call source application name of the SQL statement execution function and the trace mode mapping information in the trace mode table 203.

サービス処理手段201は、クライアント計算機100から実行リクエストを受け取ると、SQLトレース取得機能付きサービス提供アプリケーション202へリクエストを転送し、アプリケーションの実行結果をクライアントへ返す。   Upon receiving an execution request from the client computer 100, the service processing unit 201 transfers the request to the service providing application 202 with the SQL trace acquisition function, and returns the execution result of the application to the client.

SQLトレース取得機能付きサービス提供アプリケーション202は、SQL文の実行リクエストをSQL文処理手段301へ転送する。SQL文処理手段301は、SQLトレース取得機能付きサービス提供アプリケーション202からSQL文の実行リクエストを受け取ると、データベース管理システム302にSQL文を転送し、SQL文の実行結果をクライアントへ返す。   The service providing application 202 with the SQL trace acquisition function transfers the SQL statement execution request to the SQL statement processing unit 301. When receiving the SQL statement execution request from the service providing application 202 with the SQL trace acquisition function, the SQL statement processing unit 301 transfers the SQL statement to the database management system 302 and returns the execution result of the SQL statement to the client.

データベース管理システム302は、SQL文を実行し、実行結果をクライアントに返す。その際、トレース出力が有効になっていた場合は、トレースリポジトリ303へSQLトレースが格納される。   The database management system 302 executes the SQL statement and returns the execution result to the client. At this time, if the trace output is enabled, the SQL trace is stored in the trace repository 303.

次に、本発明に係るSQLトレース取得方法、すなわちSQLトレース取得システムの動作について詳細に説明する。   Next, the operation of the SQL trace acquisition method, that is, the SQL trace acquisition system according to the present invention will be described in detail.

最初に、サービス提供アプリケーションを配備する場合の処理について説明する。管理計算機400のSQLトレース取得コード埋め込み手段402は、サービス提供アプリケーション401に、ソースコード無修正で機械的にSQLトレース取得用のコードを埋め込み、SQLトレース取得コード埋め込み済みサービス提供アプリケーション403を生成する。このSQLトレース取得コード埋め込み済みサービス提供アプリケーションは、例えば図3に示すようにSQL文実行関数の前後にSQLトレース取得コードが埋め込まれる。   First, processing when a service providing application is deployed will be described. The SQL trace acquisition code embedding unit 402 of the management computer 400 mechanically embeds the SQL trace acquisition code without modification of the source code in the service providing application 401, and generates the SQL trace acquisition code embedded service providing application 403. In the service providing application in which the SQL trace acquisition code is embedded, for example, as shown in FIG. 3, the SQL trace acquisition code is embedded before and after the SQL statement execution function.

サービス配備手段404は、SQLトレース取得コード埋め込み済みサービス提供アプリケーション403を、SQLトレース取得機能付きサービス提供アプリケーション202としてサーバ計算機200へ配備する。   The service deployment means 404 deploys the SQL trace acquisition code embedded service providing application 403 to the server computer 200 as the service providing application 202 with the SQL trace acquisition function.

以下、SQLトレース取得機能付きサービス提供アプリケーション202が実行する処理について図4を参照して説明する。SQLトレース取得コード埋め込み済みサービス提供アプリケーション403におけるSQL文発行箇所では、SQLトレース取得機能付きサービス提供アプリケーション202は先ず、SQL文発行元アプリケーション名に対応するトレースモードをトレースモードテーブル203から取得する(ステップA1)。ここで、トレースモードテーブル203には例えば図2に示すようにSQL文発行元アプリケーション名とそれに対応するトレースモードがあらかじめ格納されている。   Hereinafter, processing executed by the service providing application 202 with the SQL trace acquisition function will be described with reference to FIG. In the SQL statement issue location in the service providing application 403 with the embedded SQL trace acquisition code, the service providing application 202 with the SQL trace acquisition function first acquires the trace mode corresponding to the SQL statement issuing source application name from the trace mode table 203 (step A1). Here, for example, as shown in FIG. 2, the SQL statement issuer application name and the corresponding trace mode are stored in the trace mode table 203 in advance.

トレースモードが有効であった場合は、トレース開始文、SQL文、トレース終了文の順にSQL処理手段301へ発行する(ステップA2)。トレースモードが無効であった場合は、SQLトレース取得機能付きサービス提供アプリケーション202はSQL文のみを発行する(ステップA3)。   When the trace mode is valid, the trace start sentence, the SQL sentence, and the trace end sentence are issued to the SQL processing unit 301 in this order (step A2). If the trace mode is invalid, the service providing application 202 with the SQL trace acquisition function issues only an SQL statement (step A3).

ここで、トレースモードテーブル203にあらかじめ格納されているSQL文発行元アプリケーション名および当該アプリケーション名に対応するトレースモードは例えば図2に示すような形式で格納されている。   Here, the SQL statement issuer application name stored in advance in the trace mode table 203 and the trace mode corresponding to the application name are stored in a format as shown in FIG. 2, for example.

次に、トレースモードを変更する場合の処理について説明する。   Next, processing when changing the trace mode will be described.

トレースモードテーブル更新手段405は、トレースモードテーブル203へ、トレースを取得したいSQL文を発行するアプリケーション名を記録する。   The trace mode table update unit 405 records, in the trace mode table 203, the name of an application that issues an SQL statement for which a trace is to be acquired.

最後に、アプリケーションを実行する場合の処理について図5を参照して説明する。なお、図5における処理1、処理2、処理3はデータベースへアクセスする処理、すなわちSQL文の実行以外の処理であるいわゆるビジネスロジックの実行処理を指す。   Finally, processing when an application is executed will be described with reference to FIG. Note that processing 1, processing 2, and processing 3 in FIG. 5 indicate processing for accessing a database, that is, execution processing of so-called business logic that is processing other than execution of an SQL statement.

クライアント計算機100は、サービス処理手段201へ、実行リクエストを送信する。サービス処理手段201は、SQLトレース取得機能付きサービス提供アプリケーション202へ前記実行リクエストを転送する。   The client computer 100 transmits an execution request to the service processing unit 201. The service processing unit 201 transfers the execution request to the service providing application 202 with the SQL trace acquisition function.

前記実行リクエストを受けたSQLトレース取得機能付きサービス提供アプリケーション202は、図4に示すような上記したSQL文発行処理をした上でSQL文処理手段301へ、SQL文実行リクエストを送信する(図5のSQL文発行処理1,2)。SQL文処理手段301は、データベース管理システム302へ、前記実行リクエストの対象となるSQL文を転送する。データベース管理システム302は、当該SQL文を実行する。その際、トレース出力が有効になっていた場合は、トレースリポジトリ303へトレース出力が有効となっている当該トレースが格納される。SQLトレース取得機能付きサービス提供アプリケーション202は、アプリケーションの実行結果をクライアント計算機100へ送信する。   The service providing application 202 with the SQL trace acquisition function that has received the execution request transmits the SQL statement execution request to the SQL statement processing means 301 after performing the above-described SQL statement issuing processing as shown in FIG. 4 (FIG. 5). SQL statement issue processing 1, 2). The SQL statement processing unit 301 transfers the SQL statement that is the target of the execution request to the database management system 302. The database management system 302 executes the SQL statement. At that time, if the trace output is enabled, the trace for which the trace output is enabled is stored in the trace repository 303. The service providing application 202 with the SQL trace acquisition function transmits the execution result of the application to the client computer 100.

また、発明対象としては、上記SQLトレース取得方法における各ステップをコンピュータに実行させるプログラムも含み、このプログラムはプログラムそのものであってもよいし、このプログラムがコンピュータで読み取り可能な記録媒体に格納されているものであってもよい。   The invention also includes a program for causing a computer to execute each step in the above SQL trace acquisition method. This program may be the program itself, or the program is stored in a computer-readable recording medium. It may be.

本発明では、この記録媒体として、マイクロコンピュータで処理が行なわれるために必要なメモリ、例えばROMのようなものそのものがプログラムメディアであってもよいし、また、図示していない外部記憶装置としてプログラム読み取り装置が設けられ、そこに記録媒体を挿入することで読み取り可能なプログラムメディアであってもよい。いずれの場合においても、格納されているプログラムはマイクロコンピュータがアクセスして実行させる構成であってもよいし、あるいはいずれの場合もプログラムを読み出し、読み出されたプログラムは、マイクロコンピュータのプログラム記憶エリアにロードされて、そのプログラムが実行される方式であってもよい。このロード用のプログラムは予め本体装置に格納されているものとする。   In the present invention, as the recording medium, a memory necessary for processing by the microcomputer, such as a ROM itself, may be a program medium, or a program as an external storage device (not shown). It may be a program medium provided with a reading device and readable by inserting a recording medium therein. In any case, the stored program may be configured to be accessed and executed by the microcomputer, or in any case, the program is read out, and the read program is stored in the program storage area of the microcomputer. The program may be loaded and executed by the program. It is assumed that this loading program is stored in the main device in advance.

ここで、上記プログラムメディアは、本体と分離可能に構成される記録媒体であり、磁気テープやカセットテープ等のテープ系、FD(フレキシブルディスク)やHD(ハードディスク)等の磁気ディスクやCD−ROM/MO/MD/DVD等の光ディスク系、ICカード(メモリカードを含む)/光カード等のカード系、あるいはマスクROM、EPROM、EEPROM、フラッシュROM等による半導体メモリを含めた固定的にプログラムを担持する媒体であってもよい。   Here, the program medium is a recording medium configured to be separable from the main body, such as a tape system such as a magnetic tape or a cassette tape, a magnetic disk such as an FD (flexible disk) or HD (hard disk), or a CD-ROM / Supports fixed programs including optical disks such as MO / MD / DVD, card systems such as IC cards (including memory cards) / optical cards, and semiconductor memories such as mask ROM, EPROM, EEPROM, flash ROM, etc. It may be a medium.

また、本発明においては、インターネットを含む通信ネットワークと接続可能なシステム構成であることから、通信ネットワークからプログラムをダウンロードするように流動的にプログラムを担持する媒体であってもよい。なお、このように通信ネットワークからプログラムをダウンロードする場合には、そのダウンロード用プログラムは予め装置本体に格納しておくか、あるいは別の記録媒体からインストールされるものであってもよい。   Further, in the present invention, since the system configuration is connectable to a communication network including the Internet, the medium may be a medium that dynamically carries the program so as to download the program from the communication network. When the program is downloaded from the communication network in this way, the download program may be stored in the apparatus main body in advance or may be installed from another recording medium.

さらに、本発明では、プログラム自体として、マイクロコンピュータで実行される処理そのものであってもよいし、あるいはインターネットを含む通信ネットワークとアクセスすることで取り込める、あるいは取り込めたものであってもよいし、こちらから送り出すものであってもよい。   Furthermore, in the present invention, the program itself may be a process executed by a microcomputer, or may be acquired by accessing a communication network including the Internet, or may be acquired. You may send out from.

また、上記した各実施の形態は、本発明を好適に実施した形態の一例に過ぎず、本発明は、その主旨を逸脱しない限り、種々変形して実施することが可能なものである。   Further, each of the above-described embodiments is merely an example of a preferred embodiment of the present invention, and the present invention can be implemented with various modifications without departing from the gist thereof.

本発明によれば、アプリケーションを修正せずに、かつサーバ計算機に大きな負荷をかけずに、SQLトレースを取得するといった用途において本発明に係るSQLトレース取得システムが適用される。   According to the present invention, the SQL trace acquisition system according to the present invention is applied for the purpose of acquiring an SQL trace without modifying an application and without imposing a heavy load on the server computer.

本発明によれば、SQLトレースを取得するSQLトレース取得システムや、SQLトレースを取得するシステムをコンピュータに実現するためのプログラムといった用途に適用できる。また、コンピュータ上で動作する各種プログラムにSQLトレースを取得するSQLトレース取得機能を提供するといった用途にも適用可能である。   The present invention can be applied to uses such as a SQL trace acquisition system for acquiring an SQL trace and a program for realizing a system for acquiring an SQL trace in a computer. Further, the present invention can be applied to an application such as providing an SQL trace acquisition function for acquiring an SQL trace to various programs operating on a computer.

本発明に係るSQLトレース取得システムの構成を示したブロック図である。It is the block diagram which showed the structure of the SQL trace acquisition system which concerns on this invention. トレースモードテーブル(203)に格納されたSQL文発行元アプリケーション名及びそれに対応するトレースモードの一例を示した図である。It is the figure which showed an example of the SQL mode issuer application name stored in the trace mode table (203) and the trace mode corresponding to it. SQLトレース取得コード埋め込み前のアプリケーションとSQLトレース取得コード埋め込み後のアプリケーションを示した図である。It is the figure which showed the application before embedding SQL trace acquisition code, and the application after SQL trace acquisition code embedding. SQLトレース取得機能付きサービス提供アプリケーションが実行する処理を示したフローチャートである。It is the flowchart which showed the process which the service provision application with a SQL trace acquisition function performs. 本発明の処理全体の中におけるSQL文発行処理の位置づけを示した図である。It is the figure which showed the positioning of the SQL sentence issue process in the whole process of this invention.

符号の説明Explanation of symbols

100 クライアント計算機
200 サーバ計算機
201 サービス処理手段
202 SQLトレース取得機能付きサービス提供アプリケーション
203 トレースモードテーブル
300 サーバ計算機
301 SQL文処理手段
302 データベース管理システム
303 トレースリポジトリ
400 管理計算機
401 サービス提供アプリケーション
402 SQLトレース取得コード埋め込み手段
403 SQLトレース取得コード埋め込み済みサービス提供アプリケーション
404 サービス配備手段
405 トレースモードテーブル更新手段
DESCRIPTION OF SYMBOLS 100 Client computer 200 Server computer 201 Service processing means 202 Service providing application with SQL trace acquisition function 203 Trace mode table 300 Server computer 301 SQL statement processing means 302 Database management system 303 Trace repository 400 Management computer 401 Service providing application 402 SQL trace acquisition code Embedding means 403 SQL trace acquisition code embedded service providing application 404 service deployment means 405 trace mode table updating means

Claims (10)

第1のコンピュータ及び当該第1のコンピュータからのSQL文実行リクエストを受けSQL文を実行する第2のコンピュータを備えたWebシステムにおいて、
サービス提供アプリケーションに、ソースコード無修正でSQLトレース取得用のコードを埋め込み、SQLトレース取得コード埋め込み済みサービス提供アプリケーションを生成するSQLトレース取得コード埋め込み手段と、
SQLトレース取得コード埋め込み済みサービス提供アプリケーションを、ネットワークを介してSQLトレース取得機能付きサービス提供アプリケーションとして前記第1のコンピュータへ配備するサービス配備手段とからなる管理サーバを有し、
前記第1のコンピュータは、
SQL文発行元アプリケーション名に対応するトレースモードをあらかじめ格納しているトレースモードテーブルと、
前記対応するトレースモードを前記トレースモードテーブルから取得し、トレースモードが有効であった場合トレース開始文、SQL文、トレース終了文の順に前記第2のコンピュータへ発行し、トレースモードが無効であった場合SQL文のみを発行するSQLトレース取得機能付きサービス提供アプリケーション
を有することを特徴とするSQLトレース取得システム。
In a Web system including a first computer and a second computer that executes an SQL statement in response to an SQL statement execution request from the first computer,
SQL trace acquisition code embedding means for generating an SQL trace acquisition code embedded service providing application by embedding a SQL trace acquisition code without modifying the source code in the service providing application;
A management server comprising service deployment means for deploying an SQL trace acquisition code embedded service providing application to the first computer as a service providing application with an SQL trace acquisition function via a network;
The first computer is
A trace mode table storing in advance a trace mode corresponding to the application name of the SQL statement issuer;
When the corresponding trace mode is acquired from the trace mode table and the trace mode is valid, the trace start statement, the SQL statement, and the trace end statement are issued to the second computer in this order, and the trace mode is invalid. An SQL trace acquisition system comprising a service providing application with an SQL trace acquisition function that issues only an SQL statement.
前記管理サーバは、前記トレースモードテーブルへ、SQL文実行関数の呼び出し元アプリケーション名とトレースモードのマッピング情報を記録するトレースモード更新手段を有することを特徴とする請求項1記載のSQLトレース取得システム。   2. The SQL trace acquisition system according to claim 1, wherein the management server has trace mode update means for recording mapping information of the call source application name of the SQL statement execution function and the trace mode in the trace mode table. 前記第2のコンピュータは、SQL文を実行し、実行結果を前記第1のコンピュータに送信する際、トレース出力が有効になっていた場合前記トレースリポジトリへSQLトレースを格納するデータベース管理システムを有することを特徴とする請求項2記載のSQLトレース取得システム。   The second computer has a database management system that stores an SQL trace in the trace repository when trace output is enabled when an SQL statement is executed and an execution result is transmitted to the first computer. The SQL trace acquisition system according to claim 2. 前記SQLトレース取得コードは、前記トレースモードテーブルから取得されたSQL文実行関数の呼び出し元アプリケーション名に対応するトレースモードに基づいて現行セッションのトレース出力を有効化するコードであってSQL文実行後に元に戻すコードであり、サービス提供アプリケーション内に存在するSQL文実行関数の前後に埋め込まれることを特徴とする請求項1記載のSQLトレース取得システム。   The SQL trace acquisition code is a code that validates the trace output of the current session based on the trace mode corresponding to the call source application name of the SQL statement execution function acquired from the trace mode table. The SQL trace acquisition system according to claim 1, wherein the SQL trace acquisition system is embedded before and after an SQL statement execution function existing in the service providing application. 第1のコンピュータからのSQL文実行リクエストを受けSQL文を実行する第2のコンピュータを備えたWebシステムにおけるSQLトレース取得方法において、
前記第1のコンピュータとネットワークを介して接続されている管理サーバ内で前記サービス提供アプリケーションに、ソースコード無修正でSQLトレース取得用のコードを埋め込むステップと、
SQLトレース取得コード埋め込み済みサービス提供アプリケーションを生成するステップと、
前記SQLトレース取得コード埋め込み済みサービス提供アプリケーションを、ネットワークを介してSQLトレース取得機能付きサービス提供アプリケーションとして前記第1のコンピュータへ配備するステップと、
SQL文発行元アプリケーション名に対応するトレースモードをあらかじめトレースモードテーブルに格納するステップと、
前記第1のコンピュータ内で、前記対応するトレースモードを前記トレースモードテーブルから取得するステップと、
当該トレースモードが有効であった場合トレース開始文、SQL文、トレース終了文の順に前記第2のコンピュータへ発行し、トレースモードが無効であった場合SQL文のみを発行するステップ
を有することを特徴とするSQLトレース取得方法。
In a method for acquiring an SQL trace in a Web system including a second computer that receives an SQL statement execution request from a first computer and executes an SQL statement,
Embedding SQL trace acquisition code without modification in the service providing application in the service providing application in the management server connected to the first computer via a network;
Generating an SQL trace acquisition code embedded service providing application;
Deploying the SQL trace acquisition code embedded service providing application to the first computer as a service providing application with an SQL trace acquisition function via a network;
Storing a trace mode corresponding to the SQL statement issuer application name in the trace mode table in advance;
Obtaining the corresponding trace mode from the trace mode table in the first computer;
When the trace mode is valid, a trace start statement, an SQL statement, and a trace end statement are issued to the second computer in this order, and when the trace mode is invalid, only a SQL statement is issued. SQL trace acquisition method.
さらに、前記トレースモードテーブルへ、SQL文実行関数の呼び出し元アプリケーション名とトレースモードのマッピング情報を記録更新するステップを有することを特徴とする請求項5記載のSQLトレース取得方法。   6. The SQL trace acquisition method according to claim 5, further comprising the step of recording and updating the mapping information of the call source application name of the SQL statement execution function and the trace mode in the trace mode table. 前記第2のコンピュータ内で、SQL文を実行し、実行結果を前記第1のコンピュータに送信する際、トレース出力が有効になっていた場合前記トレースリポジトリへSQLトレースを格納するステップを有することを特徴とする請求項6記載のSQLトレース取得方法。   When executing a SQL statement in the second computer and transmitting the execution result to the first computer, the method includes a step of storing an SQL trace in the trace repository when trace output is enabled. The SQL trace acquisition method according to claim 6, wherein: 前記SQLトレース取得コードは、前記トレースモードテーブルから取得されたSQL文実行関数の呼び出し元アプリケーション名に対応するトレースモードに基づいて現行セッションのトレース出力を有効化するコードであってSQL文実行後に元に戻すコードであり、サービス提供アプリケーション内に存在するSQL文実行関数の前後に埋め込まれることを特徴とする請求項5記載のSQLトレース取得方法。   The SQL trace acquisition code is a code that validates the trace output of the current session based on the trace mode corresponding to the call source application name of the SQL statement execution function acquired from the trace mode table. The SQL trace acquisition method according to claim 5, wherein the SQL trace acquisition method is embedded before and after an SQL statement execution function existing in the service providing application. コンピュータに、
第1のサーバとネットワークを介して接続されている管理サーバ内で前記サービス提供アプリケーションに、ソースコード無修正でSQLトレース取得用のコードを埋め込むステップと、
SQLトレース取得コード埋め込み済みサービス提供アプリケーションを生成するステップと、
前記SQLトレース取得コード埋め込み済みサービス提供アプリケーションを、ネットワークを介してSQLトレース取得機能付きサービス提供アプリケーションとして前記第1のサーバへ配備するステップを有し、
SQL文発行元アプリケーション名に対応するトレースモードをあらかじめトレースモードテーブルに格納するステップと、
前記第1のサーバ内で、前記対応するトレースモードを前記トレースモードテーブルから取得するステップと、
当該トレースモードが有効であった場合トレース開始文、SQL文、トレース終了文の順に第2のサーバへ発行し、トレースモードが無効であった場合SQL文のみを発行するステップ
を実行させることを特徴とするプログラム。
On the computer,
Embedding the SQL trace acquisition code without modification in the service providing application in the service providing application in the management server connected to the first server via the network;
Generating an SQL trace acquisition code embedded service providing application;
Deploying the SQL trace acquisition code embedded service providing application to the first server as a service providing application with an SQL trace acquisition function via a network;
Storing a trace mode corresponding to the SQL statement issuer application name in the trace mode table in advance;
Obtaining the corresponding trace mode from the trace mode table in the first server;
When the trace mode is valid, a trace start statement, an SQL statement, and a trace end statement are issued to the second server in this order, and when the trace mode is invalid, only the SQL statement is issued. Program.
請求項9記載のプログラムを記録したことを特徴とするコンピュータ読取可能な情報記録媒体(コンパクトディスク、フレキシブルディスク、ハードディスク、光磁気ディスク、ディジタルビデオディスク、磁気テープ、または、半導体メモリを含む。)。
A computer-readable information recording medium (including a compact disk, a flexible disk, a hard disk, a magneto-optical disk, a digital video disk, a magnetic tape, or a semiconductor memory), wherein the program according to claim 9 is recorded.
JP2006033769A 2006-02-10 2006-02-10 Sql trace acquisition system and method Pending JP2007213392A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006033769A JP2007213392A (en) 2006-02-10 2006-02-10 Sql trace acquisition system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006033769A JP2007213392A (en) 2006-02-10 2006-02-10 Sql trace acquisition system and method

Publications (1)

Publication Number Publication Date
JP2007213392A true JP2007213392A (en) 2007-08-23

Family

ID=38491756

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006033769A Pending JP2007213392A (en) 2006-02-10 2006-02-10 Sql trace acquisition system and method

Country Status (1)

Country Link
JP (1) JP2007213392A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011039774A (en) * 2009-08-11 2011-02-24 Nippon Telegr & Teleph Corp <Ntt> Logger library mounting device, and control method of the same
JP2012190346A (en) * 2011-03-11 2012-10-04 Nec Corp Portal system and arrangement method for portlets with dependency
US10310958B2 (en) 2016-09-16 2019-06-04 Fujitsu Limited Recording medium recording analysis program, analysis method, and analysis apparatus

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011039774A (en) * 2009-08-11 2011-02-24 Nippon Telegr & Teleph Corp <Ntt> Logger library mounting device, and control method of the same
JP2012190346A (en) * 2011-03-11 2012-10-04 Nec Corp Portal system and arrangement method for portlets with dependency
US10310958B2 (en) 2016-09-16 2019-06-04 Fujitsu Limited Recording medium recording analysis program, analysis method, and analysis apparatus

Similar Documents

Publication Publication Date Title
CN108958796B (en) Service request processing method and device and service request processing system
CN107506221B (en) Application program upgrading method, device and equipment
KR101177971B1 (en) Methods, systems, and apparatus for object invocation across protection domain boundaries
CN111399840B (en) Module development method and device
US10817284B2 (en) Melding of mediation flow service component architecture (SCA) components
KR101238374B1 (en) Method and appratus for supplying mashup service
US10810025B2 (en) Operation control method, and apparatus for operation control, and non-transitory computer-readable storage medium for storing program
CN109634591B (en) File processing method and device
JP2005533294A (en) Service acquisition method and service acquisition system
CN112597013A (en) Online development and debugging method and device
JP5011927B2 (en) Application execution system, computer, application execution method and program for application execution system
JP2007213392A (en) Sql trace acquisition system and method
CN116107623A (en) Software development method and device and electronic equipment
CN109918059B (en) Application function expansion method and device, terminal equipment and storage medium
US9088463B1 (en) Container contract for data dependencies
JP2008152400A (en) Application management system and control method therefor
JP2007133601A (en) Software package, system management device, and onboard information equipment
CN114153480A (en) Code synchronization method, component publishing method, device thereof and computer storage medium
JP2016062311A (en) Update device and information processing method
KR20150080310A (en) Server and method for updating application
CN108958795A (en) BootLoader code huge profit method and development board in a kind of embedded system
JP6648567B2 (en) Data update control device, data update control method, and data update control program
KR20110103888A (en) System for accessing and sharing user defined contents and method of the same
CN117873550A (en) Expansion method, equipment and medium of callback interface
CN115705226A (en) Method, device and equipment for executing voice scene task and storage medium

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090423

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090430

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20090909