IBM Migration Toolkit (MTK) FAQ

Abstract

This document answers many common IBM Migration Toolkit (MTK) questions.

 

Here are some MTK frequently asked questions.

http://publib.boulder.ibm.com/infocenter/db2luw/v8//index.jsp
DB2 Database for Linux, UNIX, and Windows JDBC Driver not found
Make sure SQLLIB\java\db2java.zip is needed in the class path.
MTK fails to load LOB data into the DB2 database product table
You have run into a DB2 database product limitation that afflicts remote deployment. Remote deployment does not work with LOB data, because DB2 database product requires a path on the server for the LOBSPATH parameter.

If the DB2 database product server can connect to the source database server, either MTK can be installed on the DB2 database product server to run the migration there, or the scripts that MTK creates for moving data manually can be executed on the DB2 database product server, which gets around the LOBSPATH problem. There are detailed instructions for doing this in the MTK topic "Manually transferring data by using files."

If the DB2 database product server cannot connect to the source database server, things get more complicated:
1. You can use the Directory for data extraction field on the Generate Data Transfer Scripts page to put the extracted data into a directory on the DB2 database product server.
2. After deploying the objects and extracting the data on the Deploy to target panel, you can move the DataMove_*_db2.bat or DataMove_*_db2.sh file to the DB2 database product server.
3. Edit DataMove_*_db2.bat or DataMove_*_db2.sh to correct the path.
4. Run DataMove_*_db2.bat or DataMove_*_db2.sh to load the data into the DB2 database product.
When I selected from my table I saw references (such as "D161/C20_807113.out") instead of the actual LOB data
The LOAD statement used should have two parameters to instruct the DB2 database product on where to get the LOB data. For example:

LOBS FROM C:\MTK\projects\SQL2000\DataOutScripts\dbo_Categories\ MODIFIED BY LOBSINFILE

If either is missing, then references are written instead of LOB data.
I want to distribute MTK UDF's with my migrated application
Given that IBM provides you the UDFs "as-is" without warranty or indemnification, you can redistribute them with your application.
I have encountered "transaction log full" problem when deploying data to a DB2 database product by selecting the "import" function
To fix this:
1. In the Generate Data Transfer Script panel, select Import and then select the Advanced options button.
2. In the dialog box that appears, enter a number of rows in the commit count field. If the DB2 database product is configured with "Log retain for recovery status" set to no (the default), the log space will be recovered at each commit.
I have some stored procedures in MSSQL with default values. It looks like this functionality is not supported in the DB2 database product - is that correct?
MTK stripped off the default values without issuing a message. The default parameter values are not supported by the DB2 database product. However, the converter does not lose the default value when it removes it from the procedure statement, instead it adds the default value in the calling statement.
Problem with moving Unicode data from SQL Server to a DB2 database product
The load or import statement for a unicode file needs the "no check lengths" option selected on the advanced options page before creating the data transfer scripts. The codepage may also need to be set on that page.
Codepage issues into DB2 database product
In the Advanced Options for Generate Data Transfer Scripts panel there is a field labeled "code page." This field needs to be filled in with the appropriate value so that the generated LOAD command contains the "codepage=xxx" modifier that tells DB2 database product to interpret the special characters in the transfer file correctly.

See this article for more information: http://www.ibm.com/developerworks/db2/library/techarticle/0

I am getting this error when I try to run the SQL Translator: --* [200040] "C:\MTK\projects\testsql\SQLTranslator.input"(24:1)-(24:14) Input Error: card_trans_vue is not a valid table, view, or table function name.
The SQL Translator does not have a definition of card_trans_vue available. You can include the definition of card_trans_vue in the script window. If you have run a script containing the definition of card_trans_vue through the Convert step, you can select "Use all files" in the drop-down list next to the Paste button. Then the SQL Translator will have the definition of card_trans_vue available and will not issue the error.
Whenever I try to migrate the objects from Sybase to the DB2 database product, by default it is moving all of the UDT data types also. How can I avoid this?
MTK always extracts the UDT data types. The only way to avoid migrating those to the DB2 database product is to edit the source file after extraction and delete the unneeded UDT data types in the file before conversion.
How do we specify a specific table space name for DB2 database product tables?
The MTK team recommends that customers use the DB2 Control Center wizard to create their table spaces.

MTK provides an initial CREATE TABLESPACE statement at the beginning of the DB2 database product file when you chooses that option in the converter advanced options. Providing this CREATE TABLESPACE statement causes the CREATE TABLE statements to keep the IN table space parameter and put the tables into table spaces of the correct names.

You need to add index and long table space clauses to the DB2 database product file after the column list:
Read syntax diagramSkip visual syntax diagram
>>-IN--tablespace-name1--+----------------------------+--+---------------------------+-><
'-INDEX IN--tablespace-name2-' '-LONG IN--tablespace-name3-'


MTK creates a lot of functions with SYB, MS7, ORA, or INFX schema. How do I migrate those from one DB2 database product to another?
The functions with the SYB schema are being created by mtksyb.udf during the deployment. If you look in the Deploy_conversion.bat file, you will see a block of lines like this (with cmp replaced by your database name):
@ECHO Installing JAVA UDFs file under name syb.cmp...
DB2 -v -td! -f "C:\MTK\mtksybdrop.udf" >null
DB2 CALL SQLJ.REMOVE_JAR('syb.cmp') >null
DEL null
DB2 -v CALL SQLJ.INSTALL_JAR('file:C:\MTK\sybUDFs.jar','syb.cmp') >>%UDFLOGFILE%
DB2 -v -td! -f "mtksyb.udf" >>%UDFLOGFILE%
@ECHO Creation of MTK UDFs done.

Here is a guide for repeating the deployment of the UDFs into another database:

The installation of the JAR file completed successfully, but creation of each JAVA UDF fails with DB21034E
The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned:

SQL20204N The user defined function or procedure "PROCID" was unable to map to a single Java method. LINE NUMBER=3. SQLSTATE=46008

The JAR file is installed under a different name than is used in the external name of the procedure. In other words, CALL SQLJ.INSTALL_JAR('file:/db2home/db2inst2/worksp/scripts/sybUDFs.jar','syb.cmp'):
CREATE FUNCTION SYB.procid()
RETURNS INTEGER
EXTERNAL NAME 'syb.udfjar:com.ibm.db2.tools.mtksybudf.sybUDFs.procid'
LANGUAGE JAVA
PARAMETER STYLE DB2GENERAL
DETERMINISTIC
NOT FENCED
NULL CALL
NO SQL NO EXTERNAL ACTION
DBINFO

When MTK prepares to deploy the UDF file to DB2 database product, it changes the instances of udfjar in the external name to match the DB2 database product name.
I want to keep the original comments on the translation of my stored procedures
MTK only preserves all comments (both those created by MTK and original sp comments) or removes all comments. Most of the comments produced by MTK are the original source statements. Because the translation to DB2 database product cannot be a one-for-one mapping of statements, there is no way to copy only the source comments into the DB2 database product with any assurance that the comments would be placed somewhere that makes sense. Therefore, MTK keeps source comments only with the original source statements.
I have my tables in one file and my procedures in another. When I translate the procedures with the tables file set as the context file, the translator says it cannot find the tables.
The translator maps each database or schema combination into a schema for DB2 database product, because all the objects go into a single DB2 database product:

The referenced tables are not found in schema dbo1, only in schema dbo, so it is not recognized as the same name.

You can either remove the use or setuser statement from the procedures file, or add the same statement to the tables file to tell the translator to treat all of the objects as being in the same database or schema combination. The translator will then successfully find the tables.

Why is a NULLABLE CHAR translated to NULLABLE VARCHAR?

Except for the special case of character types of length one (CHAR(1)), nullable character types are converted to variable length character types. This is because in Sybase the behavior of VARCHAR is the same as a nullable CHAR. Meaning extra space padding is truncated and NULL values are allowed. However, in a DB2 database product even if a CHAR column is nullable, it remains fixed length for all values except NULL. Also, in a DB2 database product the default is that columns are nullable rather than non-nullable as is the default for Sybase.

I cannot connect to the Oracle database
The machine running MTK needs either an ODBC connection to the Oracle server or an Oracle client and ojdbc14.jar or classes12.zip in the class path in order for MTK to be able to access the Oracle server. The Oracle native driver connection uses a service name and relies on the Oracle client to use the information in the tnsnames.ora file to translate that into the details of the connection string.
The entry in the tnsnames.ora file on that machine supplies the host and port information. For example:
oracle =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = machine.at.ibm.com)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = oracle)
)
)

I do not have an ODBC connection and the native driver option is grayed out
Oracle
MTK needs either ojdbc14.jar or classes12.zip to be found in the class path.
MS SQLServer 2000
MTK needs three MS jar files to be found in the class path. The jar files needed are:

You can either add them to the system class path, or edit MTKMain.bat to add them. It will be easier to add them to the class path if you first copy them to your c:\MTK directory.
MS SQLServer 7
There is no native driver option. There is a Microsoft® document titled “HOW TO: Get Started with Microsoft JDBC” at .
Sybase
MTK needs jconn2.jar to be found in the class path. This can be downloaded as the JConnect tool from Sybase.
Informix
MTK needs ifxjdbc.jar, which is included in the MTK installation and in the MTKMain.bat class path.
How do I resolve the Java warning: WARNING: Could not create system preferences directory. System preferences are unusable.
Follow these steps and provide necessary permissions:
1. Create /etc/.java/.systemPrefs and enter chmod 777 to the change the mode to 777.
2. Create $HOME/.java/.userPrefs and enter chmod 777 to the change the mode to 777.
3. Provide the executable permissions to JDBC driver (for example: chmod 777 jconn3.jar).
For more information, see http://publib.boulder.ibm.com/infocenter/cmgmt/v8r3m0/index.jsp?topic=/com.ibm.cmgmtreadmefp.doc/d96445.htm.
 

转载于:https://blog.51cto.com/cheneyyu/985660


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部