This article describes how to migrate an application from an Oracle database to a DB2 V9.7 database. This article mainly provides a simple and powerful practical application tool, migrate applications from Oracle to IBM®DB2®Version 9.7 for Linux®, UNIX®, And Windows®.
You can also use this tool to migrate data from other database management systems to DB2 for Linux, UNIX, and Windows and DB2 for z/OS.®.
Introduction
Starting from DB2 V9.7 for Linux, UNIX, and Windows, you no longer need to use Oracle Applications on DB2 products through Migration Toolkit (MTK. The Data Movement Tool replaces the MTK function and significantly simplifies the workflow.
For all other scenarios, such as transferring data from a database to DB2 for z/OS, this tool is particularly outstanding in high-speed data transfer. We used this tool to transfer 4 TB of data within three days.
GUI provides easy-to-use interfaces for beginners, while advanced users prefer command line APIs.
Preparation
Download
First, download the tool to your target DB2 server. An additional step is required to transfer data to DB2 for z/OS.
Install
Download the IBMDataMovementTool.zip file and decompress it to the IBMDataMovementTool directory on the target DB2 server. To achieve the best data transfer performance, it is strongly recommended to install the server on DB2 ).
Prerequisites
To run Oracle Applications on DB2 for Linux, UNIX, and Windows, install DB2 V9.7 on the target server.
Java must be installed on the target server™Version 1.5 or later. You can run the java-version command to check the current Java version. By default, Java is installed in <install_dir> \ SQLLIB \ java \ jdk (Windows) of DB2 for Linux, UNIX, and Windows) or/opt/ibm/db2/V9.7/java/jdk (Linux.
Find the location of the JDBC driver for the source database and DB2.
Database JDBC driver
- Oracle ojdbc14.jar, xdb. jar, xmlparserv2.jar, or classes12.jar is classes111.jar for Oracle 7 or 8i)
- SQL Server sqljdbc. jar
- Sybase jconn3.jar
- MySQL mysql-connector-java-5.0.8-bin.jar
- PostgreSQL postgresql-8.1-405.jdbc3.jar.
- Ingres iijdbc. jar
- DB2 for Linux, UNIX, and Windows db2jcc. jar, db2jcc_license_cu.jar
- DB2 for z db2jcc. jar and db2jcc_license_cisuz.jar
- Optional Access_JDBC30.jar for MS Access
Environment Settings
UNIX: log on to the server as the DB2 instance owner.
Windows: Start the DB2 command window.
Switch to the IBMDataMovementTool directory. This tool includes a JAR file and two Driver scripts.
IBMDataMovementTool. cmd-run the Command Script of this tool on Windows.
IBMDataMovementTool. sh-run the Command Script of this tool on UNIX.
IBMDataMovementTool. jar-JAR file of this tool.
Create a DB2 target database
To run this tool, you need to connect to the target database. Therefore, you must first create this database. On DB2 V9.7, we recommend that you use the default Automatic Storage and select a 32 KB page size. When you enable an application on DB2 V9.7, the instance and database must be in compatible mode. We also recommend that you adjust the rounding behavior to match Oracle. By setting the re-verification semantic revalidation semantics to deferred_force, you can deploy objects in no dependent order.
On UNIX systems, $ db2set DB2_COMPATIBILITY_VECTOR = ORA
- $ Db2set DB2_DEFERRED_PREPARE_SEMANTICS = YES
- $ Db2stop force
- $ Db2start
- $ Db2 "create db testdb automatic storage yes on/db2data1,
- /Db2data2,/db2data3 dbpath on/db2system PAGESIZE 32 K"
- $ Db2 update db cfg for testdb using auto_reval deferred_enforce
- $ Db2 update db cfg for testdb using decflt_rounding round_half_up
- On Windows, C: \> db2set DB2_COMPATIBILITY_VECTOR = ORA
- C: \> db2set DB2_DEFERRED_PREPARE_SEMANTICS = YES
- C: \> db2stop force
- C: \> db2start
- C: \> db2 "create db testdb automatic storage yes on C:, D: dbpath on e: PAGESIZE 32 K"
- C: \> db2 update db cfg for testdb using auto_reval deferred_enforce
- C: \> db2 update db cfg for testdb using decflt_rounding round_half_up
Extract objects and Data
Before running this tool, prepare the following information for the source database and DB2 Server:
IP address or host name of the source database and DB2 Server
Port number to be connected
Required database name, SID, subsystem name, etc.
User ID with DBA privilege on the source database
Password of this user
Location of the source database and DB2 JDBC driver
Information about the storage space or volume/mount point
Run IBMDataMovementTool. cmd on Windows or./IBMDataMovementTool. sh on UNIX. If the server displays images, this tool starts a GUI. Otherwise, it switches to interactive command line mode.
On Windows:
- IBMDataMovementTool.cmd
On UNIX:
- ./IBMDataMovementTool.sh
A gui window is displayed. Some messages should also appear in the shell window. Before you start using the GUI, check the messages to confirm that there are no errors.
If DB2_COMPATIBILITY_VECTOR is not set, this tool reports a warning. Follow these steps to set the compatibility vector ).
- [2009-05-15 12.48.59.218] INPUT Directory = .
- [2009-05-15 12.48.59.218] Configuration file loaded: 'jdbcdriver.properties'
- [2009-05-15 12.48.59.218] Configuration file loaded: 'IBMExtract.properties'
- [2009-05-15 12.48.59.218] appJar : 'C:\Vikram\Prospects\DB2Cobra\IBMDataMovementTool.jar'
- [2009-05-15 12.49.01.000] * WARNING *. I did not detect DB2_COMPATIBILITY_VECTOR set for
- compatibility mode.
- [2009-05-15 12.49.01.000] To set compatibility mode, discontinue this program and
- run the following commands
- [2009-05-15 12.49.01.000] db2set DB2_COMPATIBILITY_VECTOR=ORA
- [2009-05-15 12.49.01.000] db2stop force
The above content is an introduction to migrating applications from Oracle to DB2 V9.7 easily.