4. Overview of the Oracle to DB2 Conversion Process

IBM Software
Information Management
IBM Database Conversion Workbench
Oracle to DB2 Conversion Guide
IMPE Tools
Version: 1.1.0
Last Updated: March 21, 2013
IBM Software
Information Management
Table of Contents
1. Introduction .................................................................................................................................................................... 4
2. Prerequisites................................................................................................................................................................... 5
3. Set-up your DCW environment ..................................................................................................................................... 6
3.1.
Create a new DCW Conversion Project ................................................................................................................. 6
3.2.
Create a new connection profile to the source database ....................................................................................... 8
4. Overview of the Oracle to DB2 Conversion Process ................................................................................................. 9
5. The DCW Task Launcher ............................................................................................................................................. 10
6. DDL Extraction ............................................................................................................................................................. 11
6.1.
Overview of the process ....................................................................................................................................... 11
6.2.
Extract DDL using a Connection .......................................................................................................................... 11
6.2.1. Pre-requisites ........................................................................................................................................ 11
6.2.2. Extract DDL through a Connection ..................................................................................................... 11
6.3.
Extract DDL by generating a custom extraction script ......................................................................................... 14
6.3.1. Generate a custom DDL extraction script .......................................................................................... 14
6.3.2. Run the custom extraction script on your source Oracle database ................................................ 14
6.3.3. Import an existing DDL file ................................................................................................................... 14
7. Compatibility Evaluation ............................................................................................................................................. 15
7.1.
Running the Compatibility Evaluation .................................................................................................................. 15
7.1.1. Pre-requisites ........................................................................................................................................ 15
7.1.2. Run the compatibility evaluation ......................................................................................................... 15
7.2.
Submitting your Evaluation Report to IBM ........................................................................................................... 16
7.3.
Using the Evaluation Report................................................................................................................................. 16
7.3.1. Pre-requisites ........................................................................................................................................ 16
7.3.2. View through your web browser .......................................................................................................... 16
7.3.3. Executive Summary .............................................................................................................................. 16
7.3.4. Technical Summary of PL/SQL and DDL Statements ....................................................................... 17
7.3.5. Detailed Technical Report .................................................................................................................... 17
7.3.6. Unrecognized lines of code.................................................................................................................. 18
8. Code Conversion ......................................................................................................................................................... 19
8.1.
Auto-convert Oracle syntax to DB2 compatible syntax ........................................................................................ 19
8.1.1. Pre-requisites ........................................................................................................................................ 19
8.1.2. Run the auto-conversion ...................................................................................................................... 19
8.2.
Split DDL Function ............................................................................................................................................... 20
8.2.1. Pre-requisites ........................................................................................................................................ 20
8.2.2. Run the Split DDL Function .................................................................................................................. 20
8.3.
Reviewing the converted code ............................................................................................................................. 21
9. Create the Target DB2 Database ................................................................................................................................ 23
9.1.
Create and set up the target DB2 database ......................................................................................................... 23
10. Prepare the target DB2 database for data movement .............................................................................................. 24
10.1. Deploy Objects for Data Movement ..................................................................................................................... 24
10.1.1.
10.1.2.
Pre-requisites ................................................................................................................................... 24
Execute the DDL statements to create buffer pools, table spaces, and tables ........................ 24
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 2 of 34
IBM Software
Information Management
11. Data Movement ............................................................................................................................................................. 26
11.1. Overview of the process ....................................................................................................................................... 26
11.2. Extract and Load Data from Files ......................................................................................................................... 26
11.2.1.
11.2.2.
11.2.3.
11.2.4.
Pre-requisites ................................................................................................................................... 26
Extract data to flat files ................................................................................................................... 26
Load data from flat files .................................................................................................................. 27
Verifying your data extraction ........................................................................................................ 27
11.3. Data movement using pipes ................................................................................................................................. 28
11.3.1.
11.3.2.
11.3.3.
Pre-requisites ................................................................................................................................... 28
Starting the data movement using pipes ...................................................................................... 28
Verifying your data extraction ........................................................................................................ 30
11.4. Data movement using federation ......................................................................................................................... 31
11.4.1.
11.4.2.
11.4.3.
11.4.4.
11.4.5.
Pre-requisites ................................................................................................................................... 31
Set-up the target DB2 database for federation ............................................................................. 31
Configure Oracle client software ................................................................................................... 31
Data movement using Federation .................................................................................................. 32
Verifying your data extraction ........................................................................................................ 32
12. Deploy Remaining Objects.......................................................................................................................................... 33
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 3 of 34
1. Introduction
The IBM® Database Conversion Workbench (DCW) integrates many of the tools used for database conversions into a
single integrated development environment. Whether converting to DB2 from another relational database management
system (RDBMS), or migrating from one version of DB2 to another, DCW provides an easy to use framework to take
you through the migration process.
DCW is provided as a plug-in to IBM Data Studio, a no-charge graphical tool based on an Eclipse® platform. IBM Data
Studio helps database developers and administrators manage, administer, and develop heterogeneous database
environments for increased productivity and collaboration. For more information, visit:
http://www.ibm.com/software/data/optim/data-studio/
As an integrated workbench, DCW provides the following benefits to the user:
-
Common graphical interface with uniform look and feel for all phases of the conversion
A consolidated process with well defined steps based on best practices
Faster enablement for client and partner teams in conversion methodology
Wizards that guide users through all steps of the conversion
DCW offers a variety of tools for Oracle® conversion or DB2 migration is comprised of several tools that
can be used together to take a user through all the steps of a database conversion. Conversely, each tool
can also be used separately based on user preference and need.
DCW offers the following step-by-step functions to facilitate the process.
1. DCW Task Launcher - An integrated help guide, which provides step by step instructions through the conversion
process.
2. DDL Extraction - Extracts objects in the source database, used by DCW to analyze the source database and
provide compatibility assessment and work effort.
3. Compatibility Evaluation – Provides a report of the estimated % compatibility of Oracle SQL and PL/SQL
statements with DB2 10.1, outlining the major issues of the conversion, code that was auto-converted, as well as
code that must be fixed manually.
4. Code Conversion - Auto-converts Oracle syntax to DB2 compatible syntax. This streamlines a time consuming
process.
5. Split DDL – splits a single DDL file into multiple files, organized by object types, which can then be executed
against the target DB2 database to create the required objects.
6. Package Visualizer - Generates a dependency graph of objects in the source database.
7. Data Movement - Extracts and loads data from the source Oracle database to the target DB2 database.
IBM Software
Information Management
2. Prerequisites
The IBM Database Conversion Workbench is a plug-in for Data Studio 3.2. Data Studio must first be installed on your
machine to access DCW. Data Studio is based on an Eclipse platform, which must also be installed on your machine.

IBM Data Studio 3.2 full client
o Available for download at: http://www.ibm.com/developerworks/downloads/im/data/

Eclipse Platform Software Development Kit
o Available for download through Data Studio using: http://download.eclipse.org/eclipse/updates/3.6/
For installation requirements and instructions, consult the IBM DCW 1.0.0 Plug-In Installation Guide, see:
http://www.ibm.com/developerworks/data/ibmdcw
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 5 of 34
IBM Software
Information Management
3. Set-up your DCW environment
3.1.
Create a new DCW Conversion Project
In order to access the functions of the Database Conversion Workbench, you need to create a new DCW project.
i.
ii.
From Data Studio, navigate to menu File > New > New DCW Project, to open the New DCW
Project wizard.
Enter the Project Name, type of Source Database, and the type of Target Database. For an
Oracle to DB2 conversion, please select “Oracle” as the Source Database and the appropriate
DB2 database as the Target Database.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 6 of 34
IBM Software
Information Management
iii.
Click Finish. You might be asked to switch to the Database Conversion perspective. Click Yes
to confirm the switch, and note that the following views are available:




Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Project Explorer view – lists all projects and relevant files.
Data Source Explorer view – lists all existing database connection profiles.
Administration Explorer view – lists all existing database connection profiles and
provides access to DB2 administration functions.
DCW Oracle to DB2 Task Launcher – launches the various wizards and help topics.
Page 7 of 34
IBM Software
Information Management
3.2.
Create a new connection profile to the source database
If you can directly connect to the source database from your local machine, you can set up a connection profile for the
source database. This information is stored by Data Studio and provides quick and easy access to the source
database.
i.
ii.
In the Data Source Explorer view, right click on Database Connections and select New. The
New Connection wizard opens.
Enter the connection information for your source database
 Select “Oracle” as the database manager and choose the correct JDBC driver
o *NOTE*: You may need to download the required driver, and specify the path
iii.
Select Finish. You can now see the source database listed in the Data Source Explorer view.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 8 of 34
IBM Software
Information Management
4. Overview of the Oracle to DB2 Conversion Process
This guide assumes that the reader has fundamental knowledge of DB2 databases. For references and training, see:
http://www.software.ibm.com/data/db2
A standard conversion follows these steps:
DDL Extract
(.SQL File)
Assessment
Questionnaire
Conversion Assessment
(CAQ File)
DDL Extract
(.SQL File)
Compatibility Evaluation
Evaluation Report
(.HTML and .XMLE File)
Conversion Assessment
(CAQ File)
Automatic Conversion of
Incompatible Code
Converted Code
(.SQL file)
Evaluation Report
(.HTML and .XMLE File)
Conversion Effort
Estimate
Conversion Estimate
Report (.CSV File)
Converted Code
(.SQL file)
Split DDL Files
Multiple Converted
Code (.SQL file)
DBAnalysis Output
(Dependency Files)
Visualize Relationships
Package Dependency
Graphs
Multiple Converted
Code (.SQL file)
Manual Code Fix
DB2 Compatible Code
(.SQL file)
Create Target DB
Target DB2 DB
DB2 Compatible Code
(.sql File)
Prepare the Target DB
Source Oracle DB
Extract Data
Extracted Data
Deploy Data
DB2 Compatible Code
(.sql File)
Finalize Target DB
Extracted Data
Data Movement
Extract DDL
Source Oracle DB
Assessment and Conversion
DCW Conversion Process Overview
Verification
The Database Conversion Workbench provides an integrated environment to help facilitate the Oracle to DB2 conversion
process. It includes many functions that take the user through the conversion steps.
It is highly recommended for novice users to follow the process from beginning to end. DCW can support the use of the
various conversion functions separately, however, that is beyond the scope of this guide.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 9 of 34
IBM Software
Information Management
5. The DCW Task Launcher
The Database Conversion Workbench comes with a built in “Task Launcher”, which acts as an assistant to launch the
various steps of the conversion process.
The DCW Task Launcher is available after a conversion project has been created, and can be accessed through the
‘Help’ menu found in Data Studio. Included with the task launcher are the DCW Help Topics which offer directions on
how to access the various functions through your Project Explorer View, as well as helpful hints and step-by-step
guidelines to follow for your conversion project. These help topics are automatically displayed when a process step is
selected in the DCW Task Launcher.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 10 of 34
IBM Software
Information Management
6. DDL Extraction
6.1.
Overview of the process
The Database Conversion Workbench can extract the DDL for the source Oracle database objects through an online
connection, or by generating a custom DDL extraction script that can be manually executed by the user.
The DDL extraction process can be accessed using the DDL Extraction wizard.
To navigate to the wizard:
i.
In the Project Explorer view, right-click on your DCW Project and navigate to Database
Conversion > DDL Extraction. The DDL Extraction wizard opens.
The options are also available from the DCW Task Launcher, under the DDL Extraction Tab.
The various processes are listed in the following sections.
6.2.
Extract DDL using a Connection
This is the recommended method if it is possible to directly connect to the source Oracle database through Data
Studio.
6.2.1.
Pre-requisites
 Ensure that you have a connection profile of the source Oracle database as outlined in section 3.2
Create a new connection profile to the source database.
6.2.2. Extract DDL through a Connection
The Database Conversion Workbench can extract the objects from an entire database or of select schemas.
i.
From the DDL Extraction wizard, select Extract DDL using a connection. Click Finish. The
Extract DDL through a connection wizard opens.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 11 of 34
IBM Software
Information Management
ii.
On the first page, select the connection profile of your source Oracle database. Click Next.
iii.
On the second page, select the schemas that you want to extract. Click Next.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 12 of 34
IBM Software
Information Management
iv.
v.
On the third page, select the elements that you want to include in the DDL script. Click Next.
On the fourth page, select the objects types that you want to extract. Click Next.
vi.
On the fifth page, select your DCW Project and specify the name of the script file. Verify the
preview of the DDL script and specify the terminator you want to use. It is recommended that you
change the terminator character to “/”. Click Next.
On the sixth page, verify the summary of the wizard. Click Finish.
The DDL file is available under the selected DCW Project in the Project Explorer View.
vii.
viii.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 13 of 34
IBM Software
Information Management
6.3.
Extract DDL by generating a custom extraction script
6.3.1. Generate a custom DDL extraction script
If a connection to the source Oracle database is unavailable, DCW can still help you extract the DDL from the
source Oracle database. This is done by using DCW to generate a custom DDL extraction script, which can then
be manually run on your source Oracle database. Note that the Generate Custom DDL Extraction Script wizard
can also be accessed through the Oracle Task Launcher.
i.
From the DDL Extraction wizard, select Generate DDL extraction script. Click Finish. The
Generate Custom DDL Extraction Script wizard opens.
ii.
Complete the steps of the wizard.
a. On the first page, specify the name of the files that are to be generated as a result of the
extraction script. Specify the name of the script and the directory to which you want to save. It is
recommended that you select Exclude all system schemas, so that the script extracts all of
the schemas except for the Oracle default system schemas. Click Next.
b. Click Finish.
The custom script can be found in the directory that you specified.
iii.
6.3.2. Run the custom extraction script on your source Oracle database
You can execute the custom extraction script through Oracle SQL*Plus from a machine that has access to the
source Oracle database server. Manually running the script is outside of the scope of this guide.
6.3.3. Import an existing DDL file
If you already have a DDL file of your source Oracle database (from the custom script or other sources), you can
import the file into your database conversion project.
i.
ii.
iii.
In the Project Explorer view, right-click on your DCW Project and navigate to Database
Conversion > Import a DDL file. The Import wizard opens.
Specify the directory of the DDL file and select the DDL file you want to import. Select the folder
(DCW project) into which you want to import the DDL file. Click Finish.
The DDL file is imported into your DCW Project, and automatically converted to a .sql extension.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 14 of 34
IBM Software
Information Management
7. Compatibility Evaluation
With a simple click of a button, the IBM Database Conversion Workbench provides an assessment report which outlines
the compatibility of a source Oracle database with the target DB2 database. A part of the evaluation report is a detailed
DDL and PL/SQL issues list, as well as some suggested workarounds to fix incompatible code.
7.1.
Running the Compatibility Evaluation
The Compatibility Evaluation is done by analyzing the DDL file of the source Oracle database.
7.1.1.
7.1.2.
Pre-requisites
 Ensure that you have a DDL file of the source Oracle database as outlined in section 6 - DDL
Extraction.
Run the compatibility evaluation
Right-click on the source Oracle DDL that you extracted. Navigate to Database Conversion >
Evaluate Compatibility. The Compatibility Evaluation wizard opens.
ii.
Select the source SQL dialect as Oracle and the Target SQL dialect as the DB2 version you are
converting to.
iii.
Click Finish.
iv.
The Evaluation Report (.xmle) is generated in your project folder.
i.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 15 of 34
IBM Software
Information Management
7.2.
Submitting your Evaluation Report to IBM
The Compatibility Evaluation generates an encrypted .xmle report as < file_name>-<timestamp>_report.xmle. This
report needs to be sent to IBM, and the decrypted report is emailed back to you.
*NOTE: The .xmle file does not contain any source code. It just contains the information shown in the report.
Using your desired email platform, submit the .xmle file to [email protected]
An email response is sent containing the HTML version of the Evaluation Report, which can be viewed through your
web browser.
7.3.
Using the Evaluation Report
The Evaluation Report is a key part of the conversion process, and outlines the various compatibility issues in the
syntax between Oracle and DB2. This section outlines how to use the Evaluation Report to correctly address any
issues that are reported.
7.3.1.
Pre-requisites
 Ensure that you have the HTML version of the Evaluation Report. Please see section 7.2 – Running
the Compatibility Evaluation for more details.
7.3.2. View through your web browser
You can open the Evaluation Report using your preferred browser by double clicking on the file. You can also
import the Evaluation Report into Data Studio, and use the native browser in Data Studio.
i.
ii.
iii.
iv.
v.
Right-click on your DCW Project and select Import. The Import wizard opens.
Expand the General folder and select File System. Click Next.
Select Browse, and navigate to the directory in which the HTML Evaluation Report is located. Once
the folder is open, select the HTML Evaluation Report. Click Finish.
The report is now in your DCW Project.
In your DCW Project, right-click on the HTML Evaluation Report and select Open With > Web
Browser. The Evaluation Report opens.
7.3.3. Executive Summary
This section of the report shows the compatibility percentage of all PL/SQL statements that can run natively on a
DB2 database, which has been enabled for Oracle compatibility.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 16 of 34
IBM Software
Information Management
7.3.4. Technical Summary of PL/SQL and DDL Statements
Under Technical Summary, the PL/SQL and DDL summary provides statistics on the number of statements that
the Compatibility Evaluation has detected, and identifies the number of statements that require attention.
The Total Number is the count of statements/objects that the Compatibility Evaluation has detected.
The Number that Require Attention is the count of Oracle statements/objects that are not immediately
transferrable to DB2 and require attention.
*NOTE: Statements and objects that can be auto-converted by DCW are not included in the count of “Number
that Require Attention”
7.3.5. Detailed Technical Report
Near the bottom of the report is a link to expand the Evaluation Report to show a detailed analysis of the
statements. The unsupported Oracle statements that require attention are listed here. These statements must be
altered or removed since DB2 does not recognize these statements.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 17 of 34
IBM Software
Information Management
You can expand or collapse each statement by clicking on the statement. The evaluation report provides the line
number of the statement in the original DDL code, the entire statement that contains the error as well as a
recommended solution.
7.3.6. Unrecognized lines of code
The very last section of the report contains lines of code that the Compatibility Evaluation was not able to
recognize. These statements might or might not be compatible with DB2.
You can check double check the code by referring to the line number that is listed.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 18 of 34
IBM Software
Information Management
8. Code Conversion
The IBM Database Conversion Workbench offers a powerful tool that can auto-convert well known Oracle syntax to
DB2 compatible syntax.
8.1.
Auto-convert Oracle syntax to DB2 compatible syntax
8.1.1.
8.1.2.
Pre-requisites
 Ensure that you have a DDL file of the source Oracle database as outlined in section 6 - DDL
Extraction.
Run the auto-conversion
Right-click on the DDL File of your source Oracle database in your DCW Project. Navigate to
Database Conversion > Convert Code… The Code Conversion wizard opens.
ii.
Select the Source SQL dialect and Target SQL dialect. Click Finish.
iii.
The converted DDL file is located in your DCW Project folder, named “<originalfilename><timestamp>_converted.sql”
i.
Note: The code conversion automatically changes all statement terminators to ‘@’
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 19 of 34
IBM Software
Information Management
8.2.
Split DDL Function
After the Code Conversion has been run, DCW has an optional, yet useful, function to convert a single DDL file into
multiple files organized by object type. This function helps to stream-line your Oracle to DB2 conversion process by
providing a much more intuitive code organization. Furthermore, it breaks down a large DDL file into smaller and more
manageable components, which allows multiple team members to work on various files.
*NOTE: Subsequent sections of this guide assumes that the Split DDL function has been run.
8.2.1.
8.2.2.
Pre-requisites
 Ensure that you have a DDL file of the source Oracle database as outlined in section 6 - DDL
Extraction.
 Ensure that you have run the Code Conversion as outlined in section 8.2.2 – Run the code
conversion.
Run the Split DDL Function
Right-click on the converted DDL File of your source Oracle database in your DCW Project.
Navigate to Database Conversion > Split DDL Files… The Split SQL Files wizard opens.
ii.
Select the appropriate Statement terminator. It is recommended that you use “@” since the code
conversion has automatically changed all terminators to ‘@’. Click Next.
iii.
View the list of objects. Click Next.
iv.
View the summary. Click Finish.
v.
A new folder is created in your DCW Project that contains the split code.
i.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 20 of 34
IBM Software
Information Management
8.3.
Reviewing the converted code
You can review the converted code in Data Studio by double clicking on the SQL file.
DCW does one of the following four things:
 Remove code fragment – DCW comments out fragments of code that are not required on DB2. These
are tagged in the converted code with “Code Fragment”.
 Auto-convert code – DCW automatically makes updates to code to make it compatible with DB2 while
maintaining the semantics of the original code. These statements are not tagged.
 Requires Attention – Code is marked as “requires attention” and is converted to DB2 compatible syntax
so that the statement can compile and execute successfully. Although due to differences in behavior
between DB2 and Oracle, it might raise issues during runtime in very specific scenarios. For instance,
DCW converts any NUMBER(N) where N is greater than 31 (max precision in DB2) to NUMBER(31)
which works for a great majority of scenarios.
 Evaluation Issue – DCW highlights statements that were identified in the Evaluation Report as being a
potential issue. These are tagged in the converted code as “DCW Evaluation Issue”
At this point, you must manually edit the converted code to be fully compatible with DB2.
1. Review code that requires attention.
a. You can search the string “requires attention” by using CTRL+F.
b. In the following example, the MAXVALUE statement was auto-converted from 28 digits to 27 digits,
since DB2 only accepts up to 27 digits. In most cases, this is not a problem. However, DCW has
identified it as requiring attention so that the user is aware that this change has been made, and
might become an issue if 28 digits are required.
c.
You can search the remaining converted code for the next statement that “requires attention” and
review it appropriately.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 21 of 34
IBM Software
Information Management
2. Review code with Evaluation Issue
a. You can search the string “DCW Evaluation Issue” by using CTRL+F.
b. In the following example, the BEFORE trigger must be invoked with a FOR EACH ROW statement.
This was also outlined in the Evaluation Report.
You can add the FOR EACH ROW statement to the converted code, so that it can run on DB2.
c.
You can search the remaining converted code for other statements with “DCW Evaluation Issue”
and review it appropriately.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 22 of 34
IBM Software
Information Management
9. Create the Target DB2 Database
Creation and set up of the target DB2 database require manual steps that are not supported by DCW. Complete the
following steps to create and set up the target database.
9.1.
Create and set up the target DB2 database
Run the CREATE DATABASE command at the target server to create your target database. For more information
about this command, see:
http://pic.dhe.ibm.com/infocenter/db2luw/v10r1/index.jsp?topic=%2Fcom.ibm.db2.luw.admin.cmd.doc%2Fdoc%2Fr00
01941.html
Alternatively, you can use Data Studio to create the database. These topics can be accessed by selecting Help
Contents from the Data Studio Help menu.
After the database is created, you can adjust the database configuration parameters according to your needs using
the UPDATE DATABASE CONFIGURATION command. For more information about this command, see:
http://pic.dhe.ibm.com/infocenter/db2luw/v10r1/topic/com.ibm.db2.luw.admin.cmd.doc/doc/r0001987.html
For more details about DB2 Version 10.1, see: http://pic.dhe.ibm.com/infocenter/db2luw/v10r1/index.jsp
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 23 of 34
IBM Software
Information Management
10.
Prepare the target DB2 database for data movement
This step involves executing the extracted DDL statements against the target DB2 database to re-create the Oracle
database objects.
10.1. Deploy Objects for Data Movement
Before transferring data from the source Oracle database to the target DB2 database, the target tables and other
required objects must first be created.
In this step, you use the DDL files from the Split DDL function to create buffer pools, table spaces, and tables on the
target DB2 database.
10.1.1. Pre-requisites
 Ensure that you have extracted the DDL statements from the source Oracle database.
 Ensure that the Split DDL function has been executed on the extracted DDL file.
 If applicable, ensure that you reviewed and fixed any incompatibilities highlighted in the Evaluation
Report and Code Conversion.
 Ensure that the target DB2 database has been created and it is set up properly.
10.1.2. Execute the DDL statements to create buffer pools, table spaces, and tables
i.
ii.
Using the Project Explorer view, navigate to [DCW_project] > [folder_with_split_DDL_files] >
Base Objects.
Execute the DDL statements in DDL_bufferpool.sql, DDL_tablespace.sql, and DDL_table.sql.
 This can be done by using the SQL Editor in Data Studio, accessible by double clicking
on any SQL file to open it.
1. Select the target DB2 database in the Connection field.
2. Select RUN, by selecting the green play button on the top right corner.
3. The results and status are displayed in the SQL Results tab.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 24 of 34
IBM Software
Information Management

Alternatively, you can use the DCW Run SQL Files… command to execute multiple files
at once.
1. Select the SQL file(s) that you want to run. You can also select the folder to run
all of the SQL files in a folder.
2. Right-click and navigate to Database Conversion > Run SQL Files…
3. Set your Statement delimiter to ‘@’. Click Finish.
4. Select the Connection profile of your target database. Click Finish.
5. The scripts execute.
Note: Some of these files might not be present in your project because the objects were not
extracted, or they do not exist in the source database.
Note: You might also need to execute DDL statements to create objects required by your table
definitions, such as user-defined types.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 25 of 34
IBM Software
Information Management
11.
Data Movement
After the target DB2 database has been created and properly set up, you are now ready to move your data from the source
Oracle database to the target DB2 database.
11.1. Overview of the process
The Database Conversion Workbench provides multiple methods to easily transfer data from one database to another.
The Data Movement wizard provides an easy to use method that takes the user step-by-step to transfer the data for
entire schemas.
11.2. Extract and Load Data from Files
11.2.1. Pre-requisites
 Ensure that a connection to the source Oracle database exists
 Ensure that the target DB2 database is created and properly set up
 Ensure that the tables receiving the data have been created on the target DB2 database
11.2.2. Extract data to flat files
Note that this wizard is accessible from the Oracle Task Launcher.
i.
ii.
Right-click on the DCW Project and navigate to Database Conversion > Extract Data... The
Extract Data to Flat Files wizard opens.
Complete the steps of the wizard.
a. Select the source Oracle database. Click Next.
b. Select the schema that you want to move. Enter the output directory for the flat files and logs.
Click Next.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 26 of 34
IBM Software
Information Management
c.
Select the tables you want to move. Click Next.
d. Specify the data movement configuration parameters. For novice users, this can be left as
default. Click Next.
e. View the summary. Click Finish.
f. The extraction log is automatically displayed in Data Studio. The data is extracted to the
directory specified in step c with the file extension “.tables”.
g. You can copy the specified directory to a desired storage medium and transfer it to a different
computer.
11.2.3. Load data from flat files
Note that this wizard is also accessible from the Oracle Task Launcher.
i.
ii.
Right-click on the DCW Project and navigate to Database Conversion > Load Data... The Load
Data wizard opens.
Complete the steps of the wizard.
a. Select the target DB2 database. Click Next.
b. Select the directory in which the files from section 11.2.2 – Extract data to flat files are located.
Click Next.
c. View the summary. Click Finish.
d. The wizard runs the deployment process and shows a progress dialog until the process is
complete.
11.2.4. Verifying your data extraction
You can check the log and message files located in the Data Movement folder in your DCW project,. If
the data transfer was successful, these files provide a row count of each table, which can be used to
ensure that all of the data has been moved correctly. In case of failure, the log files contain detailed
information about the errors that occurred.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 27 of 34
IBM Software
Information Management
11.3. Data movement using pipes
When a simultaneous connection with the source Oracle database and target DB2 database is available, DCW can
move data through a connection, without the need to save to a separate storage media.
11.3.1. Pre-requisites
 Ensure that a connection to the source Oracle database exists
 Ensure that the target DB2 database is created and properly set up
 Ensure that the tables receiving the data have been created on the target DB2 database
11.3.2. Starting the data movement using pipes
Note that this wizard is accessible from the Oracle Task Launcher.
i.
ii.
iii.
Right-click on the DCW Project and navigate to Database Conversion > Move Data... The Move
Data wizard opens.
Select Data movement using pipes. The Data Movement Using Pipes wizard opens.
Complete the steps of the wizard.
a. On the first page, either select an existing Oracle database connection or create a new
connection by clicking New.... Continue to the next page.
b. On the second page, select an existing target DB2 database connection or create a new
connection by clicking New.... Continue to the next page.
c.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 28 of 34
IBM Software
Information Management
d. On the third page, select the Schema that you want to extract. Click Next.
e. On the fourth page, select the Tables that you want to extract. Click Next.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 29 of 34
IBM Software
Information Management
f.
On the fifth page, specify the data movement configuration parameters. For novice users, this
can be left as default. Click Next.
g. View the summary. Click Finish.
h. The extraction starts and the progress is displayed. A log is automatically displayed in Data
Studio after the process is finished. These logs are also created in your DCW Project under the
Data Movement Folder.
11.3.3. Verifying your data extraction
You can check the log and message files located in the Data Movement folder in your DCW project. If
the data transfer was successful, these files provide a row count of each table, which can be used to
ensure that all of the data has been moved correctly. In case of failure, the log files contain detailed
information about the errors that occurred.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 30 of 34
IBM Software
Information Management
11.4. Data movement using federation
DCW also supports the movement of data by leveraging DB2 federation capabilities.
11.4.1. Pre-requisites
 Ensure that a connection to the source Oracle database exists
 Ensure that the target DB2 database is created and properly set up
 Ensure that the tables receiving the data have been created on the target DB2 database
 Oracle client software must be installed on the system hosting the target DB2 database.
11.4.2. Set-up the target DB2 database for federation
The FEDERATED parameter needs to be enabled on the target DB2 instance before you can move objects into
the target DB2 database. This is done by updating the database manager configuration.
i.
ii.
iii.
iv.
From the DB2 CLP, ensure that the instance has been started
Type the following command to enable federation: db2 update dbm cfg using federated yes
Restart the instance.
Catalog the source Oracle database on the target DB2 database.
*Note: Your database might have federation enabled by default. You can use the following command in your DB2
CLP to verify this: db2 get database manager configuration
11.4.3. Configure Oracle client software




In the case of a Linux or UNIX operating system, set the ORACLE_HOME environment variable on
your target environment. In the case of a Windows environment, this is automatically done.
Insert the ORACLE_HOME variable into \$DB2PATH$\cfg\db2dj.ini file.
Set up the Oracle client configuration file "tnsnames.ora" located in
"\$ORACLE_HOME$\NETWORK\ADMIN".
Add the following lines and change the specified values:
alias_name =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP)
(HOST = oracle_host)
(PORT = host_port)
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = oracle_sid)
)
)
Test the Oracle connection:
Run the command "tnsping alias_name" on the command line prompt.
Connect to the Oracle database through SQL Plus: sqlplus user/password@alias_name
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 31 of 34
IBM Software
Information Management
11.4.4. Data movement using Federation
i.
Using the Project Explorer view, right-click on your DCW project and navigate to Database
Conversion > Move Data... Select Data movement using federation. Click Finish.
ii.
Complete the steps of the Move Data Using Federation wizard.
a. Review the requirements on the first page of the wizard. Click Next.
b. On the second page of the wizard, select the source Oracle database. Click Next.
c. On the third page of the wizard, select the target DB2 database. Click Next.
d. On the fourth page of the wizard, specify the name of the source Oracle database as cataloged
in the target DB2 server.
e. Provide the user ID and password that is to be used to run the data load. The wizard
automatically populates these fields with the same values from the source database connection
profile, but you can change them as appropriate.
f. Select the schema(s) that you want to move. Click Next.
g. DCW creates wrappers for your objects, and provides a summary.
h. Click Finish to start the data movement.
11.4.5. Verifying your data extraction
You can check the log and message files located in the Data Movement folder in your DCW project. If
the data transfer was successful, these files provide a row count of each table, which can be used to
ensure that all data has been moved correctly. In case of failure, the log files contain detailed
information about the errors that occurred.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 32 of 34
IBM Software
Information Management
12.
Deploy Remaining Objects
After moving data from the source Oracle database to the target DB2 database, execute the remaining DDL scripts
against the target DB2 database to complete the creation of database objects.
Note: Ensure that you have completed the data transfer from all tables in the scope of your project.
1. Using the Project Explorer view, navigate to [DCW_project] > [folder_with_split_DDL_files] > Base Objects
and execute all of the DDL files.


You can open each individual file using the SQL Editor then press the Run SQL button to execute the
DDL statements.
Alternatively, right-click on the .sql file and select Database Conversion > Run SQL files...
2. Repeat the previous steps for all folders inside [DCW_project] > [folder_with_split_DDL_files].
Note: Depending on the order that DDL statements are executed and the dependencies between the database
objects, you might have to execute the DDL statements more than once until all of the dependencies are satisfied.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 33 of 34
© Copyright IBM Corporation 2013
All Rights Reserved.
IBM Canada
8200 Warden Avenue
Markham, ON
L6G 1C7
Canada
IBM, the IBM logo, ibm.com and Tivoli are trademarks or registered
trademarks of International Business Machines Corporation in the
United States, other countries, or both. If these and other
IBM trademarked terms are marked on their first occurrence in this
information with a trademark symbol (® or ™), these symbols indicate
U.S. registered or common law trademarks owned by IBM at the time
this information was published. Such trademarks may also be
registered or common law trademarks in other countries. A current list
of IBM trademarks is available on the Web at “Copyright and
trademark information” at ibm.com/legal/copytrade.shtml
Other company, product and service names may be trademarks or
service marks of others.
References in this publication to IBM products and services do not
imply that IBM intends to make them available in all countries in which
IBM operates.
No part of this document may be reproduced or transmitted in any form
without written permission from IBM Corporation.
Product data has been reviewed for accuracy as of the date of initial
publication. Product data is subject to change without notice. Any
statements regarding IBM’s future direction and intent are subject to
change or withdrawal without notice, and represent goals and
objectives only.
THE INFORMATION PROVIDED IN THIS DOCUMENT IS
DISTRIBUTED “AS IS” WITHOUT ANY WARRANTY, EITHER
EXPRESS OR IMPLIED. IBM EXPRESSLY DISCLAIMS ANY
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE OR NON-INFRINGEMENT.
IBM products are warranted according to the terms and conditions of
the agreements (e.g. IBM Customer Agreement, Statement of Limited
Warranty, International Program License Agreement, etc.) under which
they are provided.