JP2009223851A - Method for migrating database system - Google Patents
Method for migrating database system Download PDFInfo
- Publication number
- JP2009223851A JP2009223851A JP2008070668A JP2008070668A JP2009223851A JP 2009223851 A JP2009223851 A JP 2009223851A JP 2008070668 A JP2008070668 A JP 2008070668A JP 2008070668 A JP2008070668 A JP 2008070668A JP 2009223851 A JP2009223851 A JP 2009223851A
- Authority
- JP
- Japan
- Prior art keywords
- execution result
- database
- sql statement
- database system
- file
- 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.)
- Withdrawn
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/21—Design, administration or maintenance of databases
- G06F16/214—Database migration support
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
- G06F16/258—Data format conversion from or to a database
Abstract
Description
本発明は、データベースシステムの移行に伴う処理に関する。 The present invention relates to processing associated with migration of a database system.
事業規模との関係で当初はスタンドアローンを想定したデータベースシステムを使用していた企業が事業規模の拡大に伴ってクライアント/サーバ型のデータベースシステムを導入しようとする場合や、オープンソースのデータベースシステムから商用データベースシステムに変更する場合など、データベースシステムを移行したい場合がある。かかるデータベースシステムの移行要求に応えることを目的とした技術としては、例えば特許文献1に開示されたものがある。 When a company that originally used a stand-alone database system in relation to the business scale intends to introduce a client / server database system as the business scale expands, or from an open source database system You may want to migrate the database system, such as when changing to a commercial database system. As a technique aiming to meet such a database system migration request, for example, there is one disclosed in Patent Document 1.
特許文献1の0006段落に記載されているように、使用可能なSQL文はデータベースシステム毎によって異なっている。従って、移行元のデータベースシステムに含まれていたモジュールやストアードプロシージャのようなSQL文を含むデータベース接続文字列とデータベース制御文字列(以下、「データベース接続・制御文字列」)は、そのままでは移行先のデータベースシステムには適用できないことがある。これに対して、特許文献1のシステムにおいては、GUI技術とSQL文自動変換処理とを連携させることにより、データベースシステムをスムーズに移行させることとしている。 As described in paragraph 0006 of Patent Document 1, usable SQL sentences differ depending on each database system. Therefore, the database connection character string and the database control character string (hereinafter referred to as “database connection / control character string”) including SQL statements such as modules and stored procedures included in the data source database system are left as they are. May not be applicable to other database systems. On the other hand, in the system of Patent Document 1, the database system is smoothly shifted by linking the GUI technology and the SQL sentence automatic conversion process.
特許文献1のシステムを実現するためにはSQL文自動変換処理を可能としなければならないが、例示されているようなSQL文自動変換処理は適切な前処理なくしては現実的には不可能である。しかしながら、特許文献1には上記のような「適切な前処理」についての記載はなく、また、一般的に「適切な前処理」として確立された手法もない。 In order to realize the system of Patent Document 1, it is necessary to enable automatic SQL sentence conversion processing. However, the automatic SQL sentence conversion process as illustrated is practically impossible without appropriate preprocessing. is there. However, Patent Literature 1 does not describe “appropriate preprocessing” as described above, and generally does not have a technique established as “appropriate preprocessing”.
例えば、スタンドアローンを想定したデータベースシステムとクライアント/サーバ型のデータベースシステムの2タイプのデータベースシステムを同一企業が開発・販売し、更には、前者のデータベースシステムから後者のデータベースシステムへの移行もウィザードなどの提供によってサポートされている場合もあるが、その場合であっても、ウィザードによる移行処理を行った後に、移行処理のエラーレポートに従って手動で修正を加えなければ完全な移行処理は成し得ないというのが実情である。これは上記のような「適切な前処理」が確立されていない証左であるが、換言すれば、「適切な前処理」が提供されれば既存のデータベースシステムの自動変換処理も機能することとなる。 For example, the same company develops and sells two types of database systems: a stand-alone database system and a client / server database system. Furthermore, the transition from the former database system to the latter database system is a wizard. However, even after doing so, a complete migration process cannot be achieved without manual correction following the migration process error report after the migration process using the wizard. That is the situation. This is evidence that “appropriate preprocessing” as described above has not been established. In other words, if “appropriate preprocessing” is provided, automatic conversion processing of the existing database system also functions. Become.
そこで、本発明は、データベースシステムの移行のための適切な前処理にかかる方法を提供することを目的とする。 Accordingly, an object of the present invention is to provide a method for appropriate preprocessing for database system migration.
本発明によれば、第1のデータベースシステム移行方法として、複数のレコードを有するユーザデータと、第1データベースエンジンと、該第1データベースエンジン用の第1SQL文を含むデータベース接続文字列とデータベース制御文字列とを有する第1データベース接続・制御文字列とを少なくとも有する第1データベースシステムを、前記ユーザデータと、第2データベースエンジンと、該第2データベースエンジン用の第2SQL文を含むデータベース接続文字列とデータベース制御文字列を有する第2データベース接続・制御文字列とを少なくとも有する第2データベースシステムに移行するデータベースシステム移行方法であって、
前記第1データベースシステムの運用状態を分析して前記第1データベース接続・制御文字列を前記第2データベース接続・制御文字列に変換するための変換用テーブルを作成する変換用テーブル作成ステップと、
前記変換用テーブルを利用して前記第1データベースシステムを前記第2データベースシステムに移行する移行ステップと
を備えるデータベースシステム移行方法が得られる。
According to the present invention, as a first database system migration method, user data having a plurality of records, a first database engine, a database connection character string including a first SQL statement for the first database engine, and a database control character A first database system having at least a first database connection / control string having a column, the user data, a second database engine, and a database connection string including a second SQL statement for the second database engine; A database system migration method for migrating to a second database system having at least a second database connection / control character string having a database control character string,
A conversion table creation step of analyzing an operational state of the first database system and creating a conversion table for converting the first database connection / control character string into the second database connection / control character string;
A database system migration method comprising: a migration step of migrating the first database system to the second database system using the conversion table.
また、本発明によれば、第2のデータベースシステム移行方法として、第1のデータベースシステム移行方法において、
前記変換用テーブル作成ステップは、
前記第1データベースシステムのランタイム時の前記第1SQL文を抽出する抽出ステップと、
SQL文変換テーブルに従い、抽出した前記第1SQL文を変換して変換後SQL文を得るSQL文変換ステップと、
前記第1データベースエンジンによる前記第1SQL文の実行結果を第1実行結果として取得する一方で、前記第2データベースエンジンによる前記変換後SQL文の実行結果を第2実行結果として取得する実行結果取得ステップと、
取得した前記第1実行結果と前記第2実行結果を比較して一致しているか否かを判定する実行結果判定ステップと、
該実行結果判定ステップの結果、前記第1実行結果と前記第2実行結果とが不一致であった場合、当該不一致を解消し得るように前記SQL文変換テーブルを更新して新たな前記SQL文変換テーブルとするテーブル更新ステップと
を備えており、前記実行結果判定ステップの結果、前記第1実行結果と前記第2実行結果とが一致するまで、前記SQL文変換ステップ、前記実行結果判定ステップ及び前記テーブル更新ステップを繰り返し行い、前記実行結果判定ステップの結果、前記第1実行結果と前記第2実行結果とが一致した時点における前記SQL文変換テーブルを前記変換用テーブルとする、データベースシステム移行方法が得られる。
Further, according to the present invention, as the second database system migration method, in the first database system migration method,
The conversion table creation step includes:
An extraction step of extracting the first SQL sentence at runtime of the first database system;
An SQL statement conversion step of converting the extracted first SQL statement according to an SQL statement conversion table to obtain a converted SQL statement;
An execution result acquisition step of acquiring an execution result of the first SQL statement by the first database engine as a first execution result, and acquiring an execution result of the converted SQL statement by the second database engine as a second execution result. When,
An execution result determination step of comparing the acquired first execution result and the second execution result to determine whether or not they match;
If the first execution result and the second execution result do not match as a result of the execution result determination step, the SQL statement conversion table is updated so that the mismatch can be resolved, and the new SQL statement conversion is performed. A table update step for making a table, and as a result of the execution result determination step, the SQL statement conversion step, the execution result determination step, and the step until the first execution result matches the second execution result A database system migration method in which a table update step is repeatedly performed, and the SQL statement conversion table at the time when the first execution result and the second execution result coincide with each other as a result of the execution result determination step is used as the conversion table. can get.
また、本発明によれば、第3のデータベースシステム移行方法として、第2のデータベースシステム移行方法において、
前記抽出ステップは、
前記データベース接続・制御文字列を含むファイルのフォーマットを変換して変換後ファイルを得るフォーマット変換ステップであって、前記フォーマットは、前記データベース接続・制御文字列の内容を確認し且つ変更することを可能とするものであるフォーマット変換ステップと、
前記変換後ファイルの内容を確認して前記第1SQL文の実行に関連のある部分を特定し、実行された際に前記第1SQL文を抽出する抽出用コードを前記特定した部分に対して挿入するように、前記変換後ファイルを変更して変更後ファイルを生成するコード挿入ステップと、
変更後ファイルに対して逆フォーマット変換をして前記ファイルと同一フォーマットを有する中間ファイルを生成する逆フォーマット変換ステップと、
前記中間ファイルを運用して前記第1SQL文を抽出する中間ファイル運用ステップと
を備える、データベースシステム移行方法が得られる。
According to the present invention, as the third database system migration method, in the second database system migration method,
The extraction step includes
A format conversion step for converting the format of the file including the database connection / control character string to obtain a converted file, wherein the format can confirm and change the contents of the database connection / control character string A format conversion step that is
The content of the converted file is confirmed to identify a portion related to the execution of the first SQL statement, and an extraction code for extracting the first SQL statement when executed is inserted into the specified portion. A code insertion step for modifying the converted file to generate a modified file;
A reverse format conversion step for generating an intermediate file having the same format as the file by performing reverse format conversion on the changed file;
There is obtained a database system migration method comprising: an intermediate file operation step of extracting the first SQL sentence by operating the intermediate file.
また、本発明によれば、第4のデータベースシステム移行方法として、第2又は第3のデータベースシステム移行方法において、
前記第1実行結果及び前記第2実行結果は、それぞれレコードセットの形で得られるものであり、
前記実行結果判定ステップは、レコード数、データフィールド数、第1レコードの全フィールドのデータ値、最終レコードの全フィールドのデータ値、及び、前記第1レコードと前記最終レコードの間の特定の一のレコードの全フィールドのデータ値の5点についてのみ、前記第1実行結果と前記第2実行結果の比較を行う
データベースシステム移行方法が得られる。
According to the present invention, as the fourth database system migration method, in the second or third database system migration method,
The first execution result and the second execution result are each obtained in the form of a record set,
The execution result judging step includes the number of records, the number of data fields, the data values of all fields of the first record, the data values of all fields of the last record, and a specific one between the first record and the last record. A database system migration method for comparing the first execution result and the second execution result for only five points of the data values of all the fields of the record is obtained.
また、本発明によれば、第5のデータベースシステム移行方法として、第4のデータベースシステム移行方法において、
前記実行結果判定ステップは、
前記第1実行結果と前記第2実行結果とが不一致であった場合、不一致にかかる前記第1SQL文と不一致となった前記第1実行結果及び前記第2実行結果を不一致結果テーブルとして保存するステップと、
該不一致結果テーブルに基づいて第1実行結果と前記第2実行結果を一致させる手法を特定する特定ステップと、
特定した手法をルール化して得られる情報を前記SQL文変換テーブルに追記して、前記新たなSQL文変換テーブルを作成する新テーブル作成ステップと
を備える、データベースシステム移行方法が得られる。
According to the present invention, as the fifth database system migration method, in the fourth database system migration method,
The execution result determination step includes
If the first execution result and the second execution result do not match, the step of storing the first execution result and the second execution result that do not match the first SQL statement related to the mismatch as a mismatch result table When,
A specifying step for specifying a method for matching the first execution result and the second execution result based on the mismatch result table;
There is obtained a database system migration method comprising: a new table creation step of creating information on the rule obtained from the identified technique and adding the information to the SQL sentence conversion table to create the new SQL sentence conversion table.
更に、本発明によれば、第6のデータベースシステム移行方法として、第1乃至第5のいずれかに記載のデータベースシステム移行方法であって、前記ユーザデータと前記第1データベース接続・制御文字列が一つのファイルに含まれており、当該ファイルを対象とした前記第1データベースシステムの前記第2データベースシステムへの移行を補助するツールが用意されている場合において、
前記移行ステップは、
前記ファイルに含まれるすべてのオブジェクトをテキストファイルにエクスポートするエクスポートステップと、
前記変換用テーブルを用いて、エクスポートされた前記テキストファイルに含まれる前記第1SQL文を前記第2SQL文に変換するテキストファイル変換ステップと、
変換されたテキストファイルを前記ファイルにインポートするインポートステップと、
前記ツールを用いて前記インポート後のファイルからの移行を行うツール使用ステップと
を備えている、データベースシステム移行方法が得られる。
Furthermore, according to the present invention, as a sixth database system migration method, the database system migration method according to any one of the first to fifth aspects, wherein the user data and the first database connection / control character string are In the case where a tool is included that is included in one file and assists the migration of the first database system to the second database system for the file,
The transition step includes:
An export step of exporting all objects contained in said file to a text file;
A text file conversion step of converting the first SQL sentence contained in the exported text file into the second SQL sentence using the conversion table;
An import step of importing the converted text file into the file;
A database system migration method is provided that includes a tool use step of migrating from the file after import using the tool.
また、本発明によれば、変換用テーブル作成方法として、
第1データベースシステムから前記第2データベースシステムへの移行に用いられる変換用テーブルを作成する変換用テーブル作成方法であって、
前記第1データベースシステムは、複数のレコードを有するユーザデータと、第1データベースエンジンと、該第1データベースエンジン用の第1SQL文を含むデータベース接続文字列とデータベース制御文字列とを有する第1データベース接続・制御文字列とを少なくとも有するものであり、
前記第2データベースシステムは、前記ユーザデータと、第2データベースエンジンと、該第2データベースエンジン用の第2SQL文を含むデータベース接続文字列とデータベース制御文字列を有する第2データベース接続・制御文字列とを少なくとも有するものであり、
前記変換用テーブルは、前記第1データベース接続・制御文字列を前記第2データベース接続・制御文字列に変換するためのものである、変換用テーブル作成方法において、
前記第1データベースシステムのランタイム時の前記第1SQL文を抽出する抽出ステップと、
SQL文変換テーブルに従い、抽出した前記第1SQL文を変換して変換後SQL文を得るSQL文変換ステップと、
前記第1データベースエンジンによる前記第1SQL文の実行結果を第1実行結果として取得する一方で、前記第2データベースエンジンによる前記変換後SQL文の実行結果を第2実行結果として取得する実行結果取得ステップと、
取得した前記第1実行結果と前記第2実行結果を比較して一致しているか否かを判定する実行結果判定ステップと、
該実行結果判定ステップの結果、前記第1実行結果と前記第2実行結果とが不一致であった場合、当該不一致を解消し得るように前記SQL文変換テーブルを更新して新たな前記SQL文変換テーブルとするテーブル更新ステップと
を備えており、前記実行結果判定ステップの結果、前記第1実行結果と前記第2実行結果とが一致するまで、前記SQL文変換ステップ、前記実行結果判定ステップ及び前記テーブル更新ステップを繰り返し行い、前記実行結果判定ステップの結果、前記第1実行結果と前記第2実行結果とが一致した時点における前記SQL文変換テーブルを前記変換用テーブルとする、変換用テーブル作成方法が得られる。
Further, according to the present invention, as a conversion table creation method,
A conversion table creation method for creating a conversion table used for migration from a first database system to the second database system,
The first database system includes a first database connection having user data having a plurality of records, a first database engine, a database connection character string including a first SQL statement for the first database engine, and a database control character string. A control string and at least
The second database system includes the user data, a second database engine, a database connection character string including a second SQL statement for the second database engine, and a second database connection / control character string having a database control character string. Having at least
In the conversion table creation method, the conversion table is for converting the first database connection / control character string into the second database connection / control character string.
An extraction step of extracting the first SQL sentence at runtime of the first database system;
An SQL statement conversion step of converting the extracted first SQL statement according to an SQL statement conversion table to obtain a converted SQL statement;
An execution result acquisition step of acquiring an execution result of the first SQL statement by the first database engine as a first execution result, and acquiring an execution result of the converted SQL statement by the second database engine as a second execution result. When,
An execution result determination step of comparing the acquired first execution result and the second execution result to determine whether or not they match;
If the first execution result and the second execution result do not match as a result of the execution result determination step, the SQL statement conversion table is updated so that the mismatch can be resolved, and the new SQL statement conversion is performed. A table update step for making a table, and as a result of the execution result determination step, the SQL statement conversion step, the execution result determination step, and the step until the first execution result matches the second execution result A conversion table creation method in which a table update step is repeatedly performed, and the SQL statement conversion table at the time when the first execution result and the second execution result coincide with each other as a result of the execution result determination step is the conversion table. Is obtained.
本発明によれば、移行元のデータベースシステムにおけるランタイムのSQL文を取得し、事実上、取得したSQL文のすべてに対して検証を行いつつ変換用テーブルを作成していることから、信頼性の高い変換用テーブルを得ることができ、また、その変換用テーブルを用いてデータベースシステムの移行を確実に行うことができる。 According to the present invention, since the runtime SQL statement in the migration source database system is acquired and the conversion table is created while verifying virtually all of the acquired SQL statements, A high conversion table can be obtained, and the database system can be reliably migrated using the conversion table.
なお、上述した本発明によるデータベースシステム移行方法又は変換用テーブル作成方法は、その一部をプログラムに実装することができる。 A part of the above-described database system migration method or conversion table creation method according to the present invention can be implemented in a program.
以下、本発明の実施の形態によるデータベース移行方法として、移行元のデータベースシステムがマイクロソフト社のAccessであり、移行先のデータベースシステムが同じくマイクロソフト社のSQL Serverである場合について図面を参照しながら詳細に説明する。マイクロソフト社のAccessには、Accessで構成されたデータベースシステムをSQL Serverに移行するために、「アップサイジングウィザード」という移行ツールが用意されている。このアップサイジングウィザードでは、Accessデータベースファイル(mdbファイル)をAccessプロジェクトファイル(adpファイル)とSQL Server用のファイルとに分ける。なお、mdbファイルには、ユーザデータに加えて、ストアードプロシージャやモジュール等のデータベース接続・制御文字列も格納されているが、Accessプロジェクトファイルには、mdbファイルがAccessによって実行されていた際のユーザインタフェースを実現するためのモジュール等だけが含まれ、ユーザデータやストアードプロシージャはSQL Server用のファイルに格納されることになる。ここで留意すべきは、Accessのデータベースエンジン(Jetエンジン)とSQL Serverのデータベースエンジンでは、解釈できるSQL文に差異があるという点である。このSQL文の差異のため、アップサイジングウィザードを実行した際に、変換エラーが生じうる。生じてしまった変換エラーは、変換の際に出力されるレポートを参照して手動で修正を加えるしかない。これに対して、以下に説明する実施の形態においては、アップサイジングウィザードにより変換をかける前に、mdbファイルを分析して得られる変換用テーブルを用いて、mdbファイル内に含まれるAccess用のSQL文を含むデータベース接続・制御文字列SQL Server用のSQL文を含むデータベース接続・制御文字列に予め変換しておくことにより、アップサイジングウィザード実行時に変換エラーを生じないようにしている。即ち、本実施の形態によるデータベース移行方法は、図1に示されるように、大きく2つのフェーズにより構成されている。最初のフェーズは、移行元となるデータベースシステムを分析して変換用テーブルを作成する分析フェーズ(変換用テーブル作成フェーズ)であり(S101)、続くフェーズは、作成された変換用テーブルを用いてデータベースシステムの移行を行う移行フェーズである(S102)。 Hereinafter, as a database migration method according to an embodiment of the present invention, a case where the migration source database system is Microsoft Access and the migration destination database system is also Microsoft SQL Server will be described in detail with reference to the drawings. explain. Microsoft Access provides a migration tool called “Upsizing Wizard” for migrating a database system configured with Access to SQL Server. In this upsizing wizard, the Access database file (mdb file) is divided into an Access project file (adp file) and a file for SQL Server. In addition to the user data, database connection / control character strings such as stored procedures and modules are also stored in the mdb file, but the user when the mdb file was executed by Access is stored in the Access project file. Only modules for realizing the interface are included, and user data and stored procedures are stored in a file for SQL Server. It should be noted that there is a difference in interpretable SQL statements between the Access database engine (Jet engine) and the SQL Server database engine. Due to the difference in the SQL sentence, a conversion error may occur when the upsizing wizard is executed. Conversion errors that have occurred can only be corrected manually by referring to the report output during conversion. On the other hand, in the embodiment described below, the SQL for Access included in the mdb file is used by using the conversion table obtained by analyzing the mdb file before performing conversion by the upsizing wizard. By converting the database connection / control character string including the SQL statement for the database connection / control character string SQL Server including the sentence in advance, a conversion error does not occur when the upsizing wizard is executed. That is, the database migration method according to the present embodiment is mainly composed of two phases as shown in FIG. The first phase is an analysis phase (conversion table creation phase) in which the conversion source database system is analyzed to create a conversion table (S101), and the subsequent phase is a database using the created conversion table. This is a transition phase for performing system transition (S102).
分析フェーズでは、図2に示されるように、まず、移行元となるmdbファイルを実際に運用した際にAccessのデータベースエンジンに対して発行されるSQL文の抽出が行われる(S201)。本実施の形態においては、より具体的には、移行元となるmdbファイルを所定のフォーマットに変換して変換後ファイルを得る(S301)。ここで、所定のフォーマットは、データベース接続・制御文字列の内容を確認し且つ変更することを可能とするフォーマットであり、本実施の形態においてはテキストファイル形式である。 In the analysis phase, as shown in FIG. 2, first, an SQL sentence issued to the Access database engine when the mdb file as the migration source is actually used is extracted (S201). In the present embodiment, more specifically, the mdb file as the migration source is converted into a predetermined format to obtain a converted file (S301). Here, the predetermined format is a format that allows the contents of the database connection / control character string to be confirmed and changed, and in the present embodiment, is a text file format.
次いで、変換後ファイルの内容を確認して、Access用のSQL文の実行に関連のある部分を特定し(S302)、その特定した部分に対して抽出用コードを挿入する(S303)。この抽出用コードは、mdbファイルが実際に運用された際に、対応するSQL文を切り出して出力するためのものであり、本実施の形態においてはVBAにより記述されている。 Next, the content of the converted file is confirmed, a portion related to the execution of the SQL statement for Access is specified (S302), and an extraction code is inserted into the specified portion (S303). This extraction code is used to cut out and output a corresponding SQL sentence when the mdb file is actually used, and is described in VBA in the present embodiment.
変換後ファイルに含まれるすべてのSQL文に対して抽出用コードを挿入して、変更後ファイルを生成した後(S302において「なし」)、変更後ファイルに対して、S301のフォーマット変換の逆の作業となる逆フォーマット変換を行って中間ファイルを生成する(S304)。このことから理解されるように、中間ファイルは、移行元となるmdbファイルと同じフォーマットであるが、mdbファイルに含まれるSQL文の実行に関連のある部分には抽出用コードが挿入されてなるものとなっている。 After the extraction code is inserted into all the SQL statements included in the converted file to generate the changed file (“None” in S302), the reverse of the format conversion of S301 is performed on the changed file. An intermediate file is generated by performing reverse format conversion as a work (S304). As understood from this, the intermediate file has the same format as the mdb file that is the migration source, but the extraction code is inserted into the portion related to the execution of the SQL statement included in the mdb file. It has become a thing.
中間ファイルを生成した後、その中間ファイルを運用してmdbファイルの実行時におけるSQL文の抽出を行う(S305)。このようにして抽出された例を図4に示す。図4において一番下の行に記載されているものがmdbファイルのランタイムSQL文である。 After the intermediate file is generated, the SQL file is extracted when the mdb file is executed using the intermediate file (S305). An example extracted in this way is shown in FIG. In FIG. 4, what is described in the bottom line is the runtime SQL statement of the mdb file.
図2に戻り、ランタイムSQL文が抽出されると(S201)、次いで、SQL文変換テーブルに従って、抽出したSQL文の変換を行い、変換後SQL文を得る(S202)。ここで、SQL文変換テーブルは、例えば、図5に示されるようなものであり、変換後SQL文は例えば図6の最下行に記載されたようなものとなる。 Returning to FIG. 2, when the runtime SQL sentence is extracted (S201), the extracted SQL sentence is converted according to the SQL sentence conversion table to obtain the converted SQL sentence (S202). Here, the SQL sentence conversion table is as shown in FIG. 5, for example, and the converted SQL sentence is as shown in the bottom line of FIG. 6, for example.
この時点でのSQL文変換テーブルがmdbファイルに含まれるSQL文のすべてに適切に対応しているのであれば、この変換により、アップサイジングウィザードによる移行処理でも変換エラーのでない状態となる。それを調べるため、まず、ステップS201において抽出したランタイムSQL文をAccessのデータベースエンジンにて実行することにより第1実行結果を得る一方で、ステップS202で得られた変換後SQL文をSQL Serverのデータベースエンジンにて実行することにより第2実行結果を得る(S203)。このようにして得られた第1実行結果及び第2実行結果は、いずれも複数のレコードからなるレコードセットである。 If the SQL statement conversion table at this point appropriately corresponds to all of the SQL statements included in the mdb file, this conversion results in no conversion error even in the migration process by the upsizing wizard. In order to examine it, first, the runtime SQL statement extracted in step S201 is executed by the Access database engine to obtain the first execution result, while the converted SQL statement obtained in step S202 is obtained from the SQL Server database. A second execution result is obtained by executing the engine (S203). The first execution result and the second execution result obtained in this manner are both record sets including a plurality of records.
次いで、ステップS203において得られた第1実行結果及び第2実行結果の対比を行い、両者が一致しているか否かを判定する(S204)。ここで、SQL文の構文は、出力フィールド、対象元テーブル、条件文及びデータ順序の4つの要素で構成されているので、レコード数、データフィールド数、第1レコードの全フィールドのデータ値、最終レコードの全フィールドのデータ値、及び、前記第1レコードと前記最終レコードの間の特定の一のレコードの全フィールドのデータ値の5点についてのみ対比を行い、それらが第1実行結果及び第2実行結果間で一致していることを確認できれば、レコードセットの全データ値について対比せずとも、上述したSQL文の4つの要素が同一であることを確認することができる。 Next, the first execution result and the second execution result obtained in step S203 are compared, and it is determined whether or not they match (S204). Here, the syntax of the SQL statement is composed of four elements: an output field, a target table, a conditional statement, and a data order, so the number of records, the number of data fields, the data values of all fields of the first record, the final A comparison is made only for five points of the data values of all the fields of the record and the data values of all the fields of one specific record between the first record and the last record, and these are compared with the first execution result and the second If it can be confirmed that the execution results match, it is possible to confirm that the four elements of the SQL statement described above are the same without comparing all the data values of the record set.
ステップS204における対比の結果、一致しなかったデータがあった場合には、それを解消するような変換規則を特定し、その内容に応じてSQL文変換テーブルの更新を行い(S205)、更新されたSQL文変換テーブルを用いて、ステップS204における判定結果が一致するまで、ステップS202〜S204を繰り返す。 If there is data that does not match as a result of the comparison in step S204, a conversion rule that eliminates the data is specified, and the SQL statement conversion table is updated according to the content (S205). Using the SQL sentence conversion table, steps S202 to S204 are repeated until the determination results in step S204 match.
ステップS205の処理に関し、より具体的には、図7に示されるように、まず、ステップ204において実行結果の対比を行った結果、一致しなかったデータについて、不一致結果テーブルを保存する(S701)。この不一致結果テーブルは、例えば図8に示されるように、対象となっているSQL文や、それによる実行結果のセットが格納するものである。このような不一致結果テーブルがあると、問題点の特定がし易くなる。この不一致結果テーブルを検討して、不一致を解消する手法を特定し(S702)、特定した手法をルール化して得られる情報をSQL文変換テーブル(図5参照)に追記する。なお、本実施の形態においては、不一致解消の手法の特定は手動で行っている。このようにして問題点の特定と、それを解消するためのSQL文の変換テーブルの更新を繰り返して行うことにより、いずれはステップS204において、すべての実行結果について同一であることを確認できることとなる。このようにして、第1及び第2の実行結果がすべて同一であることを確認できた場合、その時点におけるSQL文変換テーブルを移行フェーズにおいて変換用テーブルとして用いることができる(S102)。 More specifically, as shown in FIG. 7, regarding the processing in step S205, first, a mismatch result table is stored for data that did not match as a result of comparing execution results in step 204 (S701). . For example, as shown in FIG. 8, the mismatch result table stores a target SQL statement and a set of execution results thereby. When there is such a mismatch result table, it becomes easy to identify a problem. By examining this mismatch result table, a technique for eliminating the mismatch is identified (S702), and information obtained by making the identified technique into a rule is added to the SQL sentence conversion table (see FIG. 5). In the present embodiment, the method for resolving the inconsistency is manually performed. In this way, by repeatedly identifying the problem and updating the SQL statement conversion table to solve it, it is possible to confirm that all the execution results are the same in step S204. . In this way, when it can be confirmed that the first and second execution results are all the same, the SQL statement conversion table at that time can be used as a conversion table in the migration phase (S102).
本実施の形態においては、上述したように、移行元のデータベースシステムがAccessであり、移行先のデータベースシステムがSQL Serverであるが、移行フェーズ(S102)においては、mdbファイルに対してアップサイジングツールをかける前に、図9に示されるような前処理を施すことにより、アップサイジングツールによる変換時におけるエラー発生をなくすることができる。 In the present embodiment, as described above, the migration source database system is Access and the migration destination database system is SQL Server. In the migration phase (S102), an upsizing tool is used for the mdb file. 9 is performed, it is possible to eliminate the occurrence of errors during conversion by the upsizing tool.
詳しくは、図9に示されるように、まずは、移行元となるmdbファイル901をテキストファイル902にエクスポートし、エクスポートされたテキストファイル902を変換用テーブル(分析フェーズにおいて作成されたSQL文変換テーブル)903とDAO=>ADO変換テーブルにより変換し、その変換されたテキストファイル904をmdbファイル905にインポートすることにより、外形上はmdbファイルであるが、含まれているSQL文はSQL Serverのものであるといったファイルが作成される。このインポート後のmdbファイル905を対象として、アップサイジングツールをかけると、適切なadpファイル906及びSQL Server用のファイルの作成が適切に行われる。 Specifically, as shown in FIG. 9, first, the migration source mdb file 901 is exported to a text file 902, and the exported text file 902 is converted into a conversion table (SQL sentence conversion table created in the analysis phase). By converting 903 and DAO => ADO conversion table, and importing the converted text file 904 into the mdb file 905, the outline is an mdb file, but the included SQL sentence is that of SQL Server. A file is created. When an upsizing tool is applied to the mdb file 905 after the import, an appropriate adp file 906 and an SQL Server file are appropriately created.
以上、本発明について、具体的なデータベースシステムを例に掲げて説明してきたが、本発明は上述した実施の形態に限定されるものではなく、他のデータベースシステム間の移行にも適用可能である。 As described above, the present invention has been described by taking a specific database system as an example. However, the present invention is not limited to the above-described embodiment, and can be applied to migration between other database systems. .
901 mdbファイル
902 テキストファイル
903 変換用テーブル
904 テキストファイル
905 mdbファイル
906 adpファイル
901 mdb file 902 text file 903 conversion table 904 text file 905 mdb file 906 adp file
Claims (7)
前記第1データベースシステムの運用状態を分析して前記第1データベース接続・制御文字列を前記第2データベース接続・制御文字列に変換するための変換用テーブルを作成する変換用テーブル作成ステップと、
前記変換用テーブルを利用して前記第1データベースシステムを前記第2データベースシステムに移行する移行ステップと
を備えるデータベースシステム移行方法。 User data having a plurality of records, a first database engine, a database connection character string including a first SQL statement for the first database engine, and a first database connection / control character string having a database control character string A first database system comprising: the user data; a second database engine; a database connection character string including a second SQL statement for the second database engine; and a second database connection / control character string having a database control character string A database system migration method for migrating to a second database system having at least
A conversion table creation step of analyzing an operational state of the first database system and creating a conversion table for converting the first database connection / control character string into the second database connection / control character string;
A database system migration method comprising: a migration step of migrating the first database system to the second database system using the conversion table.
前記変換用テーブル作成ステップは、
前記第1データベースシステムのランタイム時の前記第1SQL文を抽出する抽出ステップと、
SQL文変換テーブルに従い、抽出した前記第1SQL文を変換して変換後SQL文を得るSQL文変換ステップと、
前記第1データベースエンジンによる前記第1SQL文の実行結果を第1実行結果として取得する一方で、前記第2データベースエンジンによる前記変換後SQL文の実行結果を第2実行結果として取得する実行結果取得ステップと、
取得した前記第1実行結果と前記第2実行結果を比較して一致しているか否かを判定する実行結果判定ステップと、
該実行結果判定ステップの結果、前記第1実行結果と前記第2実行結果とが不一致であった場合、当該不一致を解消し得るように前記SQL文変換テーブルを更新して新たな前記SQL文変換テーブルとするテーブル更新ステップと
を備えており、前記実行結果判定ステップの結果、前記第1実行結果と前記第2実行結果とが一致するまで、前記SQL文変換ステップ、前記実行結果判定ステップ及び前記テーブル更新ステップを繰り返し行い、前記実行結果判定ステップの結果、前記第1実行結果と前記第2実行結果とが一致した時点における前記SQL文変換テーブルを前記変換用テーブルとする、データベースシステム移行方法。 The database system migration method according to claim 1,
The conversion table creation step includes:
An extraction step of extracting the first SQL sentence at runtime of the first database system;
An SQL statement conversion step of converting the extracted first SQL statement according to an SQL statement conversion table to obtain a converted SQL statement;
An execution result acquisition step of acquiring an execution result of the first SQL statement by the first database engine as a first execution result, and acquiring an execution result of the converted SQL statement by the second database engine as a second execution result. When,
An execution result determination step of comparing the acquired first execution result and the second execution result to determine whether or not they match;
If the first execution result and the second execution result do not match as a result of the execution result determination step, the SQL statement conversion table is updated so that the mismatch can be resolved, and the new SQL statement conversion is performed. A table update step for making a table, and as a result of the execution result determination step, the SQL statement conversion step, the execution result determination step, and the step until the first execution result matches the second execution result A database system migration method in which a table update step is repeatedly performed, and the SQL statement conversion table at the time when the first execution result and the second execution result coincide with each other as a result of the execution result determination step is used as the conversion table.
前記抽出ステップは、
前記データベース接続・制御文字列を含むファイルのフォーマットを変換して変換後ファイルを得るフォーマット変換ステップであって、前記フォーマットは、前記データベース接続・制御文字列の内容を確認し且つ変更することを可能とするものであるフォーマット変換ステップと、
前記変換後ファイルの内容を確認して前記第1SQL文の実行に関連のある部分を特定し、実行された際に前記第1SQL文を抽出する抽出用コードを前記特定した部分に対して挿入するように、前記変換後ファイルを変更して変更後ファイルを生成するコード挿入ステップと、
変更後ファイルに対して逆フォーマット変換をして前記ファイルと同一フォーマットを有する中間ファイルを生成する逆フォーマット変換ステップと、
前記中間ファイルを運用して前記第1SQL文を抽出する中間ファイル運用ステップと
を備える、データベースシステム移行方法。 In the database system migration method according to claim 2,
The extraction step includes
A format conversion step for converting the format of the file including the database connection / control character string to obtain a converted file, wherein the format can confirm and change the contents of the database connection / control character string A format conversion step that is
The content of the converted file is confirmed to identify a portion related to the execution of the first SQL statement, and an extraction code for extracting the first SQL statement when executed is inserted into the specified portion. A code insertion step for modifying the converted file to generate a modified file;
A reverse format conversion step for generating an intermediate file having the same format as the file by performing reverse format conversion on the changed file;
A database system migration method comprising: an intermediate file operation step of extracting the first SQL sentence by operating the intermediate file.
前記第1実行結果及び前記第2実行結果は、それぞれレコードセットの形で得られるものであり、
前記実行結果判定ステップは、レコード数、データフィールド数、第1レコードの全フィールドのデータ値、最終レコードの全フィールドのデータ値、及び、前記第1レコードと前記最終レコードの間の特定の一のレコードの全フィールドのデータ値の5点についてのみ、前記第1実行結果と前記第2実行結果の比較を行う
データベースシステム移行方法。 In the database system migration method according to claim 2 or 3,
The first execution result and the second execution result are each obtained in the form of a record set,
The execution result judging step includes the number of records, the number of data fields, the data values of all fields of the first record, the data values of all fields of the last record, and a specific one between the first record and the last record. A database system migration method for comparing the first execution result and the second execution result for only five points of data values of all fields of a record.
前記実行結果判定ステップは、
前記第1実行結果と前記第2実行結果とが不一致であった場合、不一致にかかる前記第1SQL文と不一致となった前記第1実行結果及び前記第2実行結果を不一致結果テーブルとして保存するステップと、
該不一致結果テーブルに基づいて第1実行結果と前記第2実行結果を一致させる手法を特定する特定ステップと、
特定した手法をルール化して得られる情報を前記SQL文変換テーブルに追記して、前記新たなSQL文変換テーブルを作成する新テーブル作成ステップと
を備える、データベースシステム移行方法。 The database system migration method according to claim 4, wherein
The execution result determination step includes
If the first execution result and the second execution result do not match, the step of storing the first execution result and the second execution result that do not match the first SQL statement related to the mismatch as a mismatch result table When,
A specifying step for specifying a method for matching the first execution result and the second execution result based on the mismatch result table;
A database system migration method comprising: a new table creation step of creating information as a rule for the specified method and adding the information to the SQL statement translation table to create the new SQL statement translation table.
前記移行ステップは、
前記ファイルに含まれるすべてのオブジェクトをテキストファイルにエクスポートするエクスポートステップと、
前記変換用テーブルを用いて、エクスポートされた前記テキストファイルに含まれる前記第1SQL文を前記第2SQL文に変換するテキストファイル変換ステップと、
変換されたテキストファイルを前記ファイルにインポートするインポートステップと、
前記ツールを用いて前記インポート後のファイルからの移行を行うツール使用ステップと
を備えている、データベースシステム移行方法。 6. The database system migration method according to claim 1, wherein the user data and the first database connection / control character string are included in one file, and the file is targeted. In the case where a tool for assisting the migration of the first database system to the second database system is prepared,
The transition step includes:
An export step of exporting all objects contained in said file to a text file;
A text file conversion step of converting the first SQL sentence contained in the exported text file into the second SQL sentence using the conversion table;
An import step of importing the converted text file into the file;
And a tool use step of performing migration from the file after import using the tool.
前記第1データベースシステムは、複数のレコードを有するユーザデータと、第1データベースエンジンと、該第1データベースエンジン用の第1SQL文を含むデータベース接続文字列とデータベース制御文字列とを有する第1データベース接続・制御文字列とを少なくとも有するものであり、
前記第2データベースシステムは、前記ユーザデータと、第2データベースエンジンと、該第2データベースエンジン用の第2SQL文を含むデータベース接続文字列とデータベース制御文字列を有する第2データベース接続・制御文字列とを少なくとも有するものであり、
前記変換用テーブルは、前記第1データベース接続・制御文字列を前記第2データベース接続・制御文字列に変換するためのものである、変換用テーブル作成方法において、
前記第1データベースシステムのランタイム時の前記第1SQL文を抽出する抽出ステップと、
SQL文変換テーブルに従い、抽出した前記第1SQL文を変換して変換後SQL文を得るSQL文変換ステップと、
前記第1データベースエンジンによる前記第1SQL文の実行結果を第1実行結果として取得する一方で、前記第2データベースエンジンによる前記変換後SQL文の実行結果を第2実行結果として取得する実行結果取得ステップと、
取得した前記第1実行結果と前記第2実行結果を比較して一致しているか否かを判定する実行結果判定ステップと、
該実行結果判定ステップの結果、前記第1実行結果と前記第2実行結果とが不一致であった場合、当該不一致を解消し得るように前記SQL文変換テーブルを更新して新たな前記SQL文変換テーブルとするテーブル更新ステップと
を備えており、前記実行結果判定ステップの結果、前記第1実行結果と前記第2実行結果とが一致するまで、前記SQL文変換ステップ、前記実行結果判定ステップ及び前記テーブル更新ステップを繰り返し行い、前記実行結果判定ステップの結果、前記第1実行結果と前記第2実行結果とが一致した時点における前記SQL文変換テーブルを前記変換用テーブルとする、変換用テーブル作成方法。 A conversion table creation method for creating a conversion table used for migration from a first database system to the second database system,
The first database system includes a first database connection having user data having a plurality of records, a first database engine, a database connection character string including a first SQL statement for the first database engine, and a database control character string. A control string and at least
The second database system includes the user data, a second database engine, a database connection character string including a second SQL statement for the second database engine, and a second database connection / control character string having a database control character string. Having at least
In the conversion table creation method, the conversion table is for converting the first database connection / control character string into the second database connection / control character string.
An extraction step of extracting the first SQL sentence at runtime of the first database system;
An SQL statement conversion step of converting the extracted first SQL statement according to an SQL statement conversion table to obtain a converted SQL statement;
An execution result acquisition step of acquiring an execution result of the first SQL statement by the first database engine as a first execution result, and acquiring an execution result of the converted SQL statement by the second database engine as a second execution result. When,
An execution result determination step of comparing the acquired first execution result and the second execution result to determine whether or not they match;
If the first execution result and the second execution result do not match as a result of the execution result determination step, the SQL statement conversion table is updated so that the mismatch can be resolved, and the new SQL statement conversion is performed. A table update step for making a table, and as a result of the execution result determination step, the SQL statement conversion step, the execution result determination step, and the step until the first execution result matches the second execution result A conversion table creation method in which a table update step is repeatedly performed, and the SQL statement conversion table at the time when the first execution result and the second execution result coincide with each other as a result of the execution result determination step is the conversion table. .
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008070668A JP2009223851A (en) | 2008-03-19 | 2008-03-19 | Method for migrating database system |
PCT/JP2009/001217 WO2009116288A1 (en) | 2008-03-19 | 2009-03-18 | Database system transition method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008070668A JP2009223851A (en) | 2008-03-19 | 2008-03-19 | Method for migrating database system |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2009223851A true JP2009223851A (en) | 2009-10-01 |
Family
ID=41090703
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008070668A Withdrawn JP2009223851A (en) | 2008-03-19 | 2008-03-19 | Method for migrating database system |
Country Status (2)
Country | Link |
---|---|
JP (1) | JP2009223851A (en) |
WO (1) | WO2009116288A1 (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8510274B2 (en) | 2011-12-13 | 2013-08-13 | Inforce Co., Ltd. | Method for verifying conversion, apparatus and program of the same |
KR102125010B1 (en) | 2020-03-17 | 2020-06-19 | 김명훈 | System and method for analyzing database migration |
KR20200080073A (en) * | 2018-12-26 | 2020-07-06 | 한남대학교 산학협력단 | Database migration system and database migration method using the same |
JP7346332B2 (en) | 2020-03-04 | 2023-09-19 | Qsol株式会社 | Database migration method, database migration system, and database migration program |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9176773B2 (en) | 2011-06-29 | 2015-11-03 | Microsoft Technology Licensing, Llc | Virtual machine migration tool |
CN109284278B (en) * | 2018-08-13 | 2023-10-31 | 中国平安人寿保险股份有限公司 | Calculation logic migration method based on data analysis technology and terminal equipment |
CN109376142B (en) * | 2018-09-03 | 2023-08-18 | 中国平安人寿保险股份有限公司 | Data migration method and terminal equipment |
-
2008
- 2008-03-19 JP JP2008070668A patent/JP2009223851A/en not_active Withdrawn
-
2009
- 2009-03-18 WO PCT/JP2009/001217 patent/WO2009116288A1/en active Application Filing
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8510274B2 (en) | 2011-12-13 | 2013-08-13 | Inforce Co., Ltd. | Method for verifying conversion, apparatus and program of the same |
KR20200080073A (en) * | 2018-12-26 | 2020-07-06 | 한남대학교 산학협력단 | Database migration system and database migration method using the same |
KR102230821B1 (en) | 2018-12-26 | 2021-03-19 | 한남대학교 산학협력단 | Database migration system and database migration method using the same |
JP7346332B2 (en) | 2020-03-04 | 2023-09-19 | Qsol株式会社 | Database migration method, database migration system, and database migration program |
KR102125010B1 (en) | 2020-03-17 | 2020-06-19 | 김명훈 | System and method for analyzing database migration |
Also Published As
Publication number | Publication date |
---|---|
WO2009116288A1 (en) | 2009-09-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2009223851A (en) | Method for migrating database system | |
US7483757B2 (en) | Control system migration | |
US9619212B2 (en) | Providing code, code generator and software development environment | |
US10248409B1 (en) | Limiting the effects of source code patches on corresponding native-code patches | |
JP5900193B2 (en) | Update determination program and update determination apparatus | |
EP2767900B1 (en) | Method for programming language dependent merging of program codes | |
JP7346332B2 (en) | Database migration method, database migration system, and database migration program | |
JP4888790B2 (en) | Contract definition function verification apparatus, method and program thereof | |
WO2015141723A1 (en) | Source code generation and provision device, and source code generation and provision method | |
JP6006577B2 (en) | Degradation test support system, degradation test support method, and degradation test support program | |
WO2017145357A1 (en) | Information processing device, information processing method, and information processing program | |
Angerer et al. | Modular change impact analysis for configurable software | |
US9792197B2 (en) | Apparatus and program | |
JP2006079484A (en) | Source program conversion program for system migration | |
JP6944838B2 (en) | Conversion device and conversion method | |
JP2009064092A (en) | Software configuration management device, method and program | |
JP2010134487A (en) | Program | |
JP2007219586A (en) | Source code analysis device | |
JPH1185536A (en) | Device and method for automatically correcting error of source program | |
JP6524827B2 (en) | Information processing apparatus, difference association method, and difference association program | |
JP2022028455A (en) | Conversion auxiliary program, conversion auxiliary method, and conversion auxiliary device | |
JP6305356B2 (en) | Specification extraction device, specification extraction method and program | |
JP2015090550A (en) | Data migration method and data migration device | |
JP2012133478A (en) | Database generation device and data base generation method | |
JP2007041996A (en) | Document management system, document management method and document management program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A300 | Application deemed to be withdrawn because no request for examination was validly filed |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20110607 |