Download 6. Compatibility Assessment for Migration to DB2 pureScale

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

DBase wikipedia , lookup

IBM Notes wikipedia , lookup

Microsoft Access wikipedia , lookup

Serializability wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

SQL wikipedia , lookup

Microsoft SQL Server wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

IMDb wikipedia , lookup

Oracle Database wikipedia , lookup

PL/SQL wikipedia , lookup

Open Database Connectivity wikipedia , lookup

Ingres (database) wikipedia , lookup

Functional Database Model wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Concurrency control wikipedia , lookup

Relational model wikipedia , lookup

Versant Object Database wikipedia , lookup

Database wikipedia , lookup

Database model wikipedia , lookup

Clusterpoint wikipedia , lookup

ContactPoint wikipedia , lookup

Transcript
IBM Software
Information Management
IBM Database Conversion Workbench
DB2 to DB2 Migration Guide
IMPE Tools
Version: 1.1.0
Last Updated: March 21st, 2013
IBM Software
Information Management
Table of Contents
1. Introduction .................................................................................................................................................................... 3
2. Prerequisites................................................................................................................................................................... 4
3. Set-up your DCW environment ..................................................................................................................................... 5
3.1.
Create a new DCW Conversion Project ................................................................................................................. 5
3.2.
Create a new connection profile to the source database ....................................................................................... 6
4. Overview of the DB2 to DB2 Conversion Process ..................................................................................................... 7
5. The DCW Task Launcher ............................................................................................................................................... 8
6. Compatibility Assessment for Migration to DB2 pureScale ...................................................................................... 9
6.1.
Overview of the process ......................................................................................................................................... 9
6.2.
DB2 pureScale Compatibility Report ...................................................................................................................... 9
6.2.1. Pre-requisites .......................................................................................................................................... 9
6.2.2. Generate DB2 pureScale Compatibility Report .................................................................................... 9
7. DDL Extraction ............................................................................................................................................................. 10
7.1.
Overview of the process ....................................................................................................................................... 10
7.2.
Extract DDL using a Connection .......................................................................................................................... 11
7.2.1. Pre-requisites ........................................................................................................................................ 11
7.2.2. Extract DDL through a Connection ..................................................................................................... 11
7.3.
Extract DDL by generating a custom extraction script ......................................................................................... 12
7.3.1. Generate a DDL extraction script ........................................................................................................ 12
7.3.2. Run the custom extraction script on your source DB2 database .................................................... 12
7.3.3. Import an existing DDL file ................................................................................................................... 12
8. Create the Target DB2 Database ................................................................................................................................ 13
8.1.
Create and set up the target DB2 database ......................................................................................................... 13
8.2.
Enable Federation on the target DB2 database ................................................................................................... 13
9. Prepare the target DB2 database for data movement .............................................................................................. 14
9.1.
Addressing Incompatible Features ....................................................................................................................... 14
9.2.
Split a DDL file ...................................................................................................................................................... 14
9.2.1. Pre-requisites ........................................................................................................................................ 14
9.2.2. Split a DDL file into more manageable components ......................................................................... 14
9.3.
Deploy Objects for Data Movement ..................................................................................................................... 16
9.3.1. Pre-requisites ........................................................................................................................................ 16
9.3.2. Execute the DDL statements to create buffer pools, table spaces, and tables .............................. 16
10. Data Movement ............................................................................................................................................................. 18
10.1. Overview of the process ....................................................................................................................................... 18
10.2. The Data Movement Engine ................................................................................................................................. 18
10.2.1.
10.2.2.
10.2.3.
Pre-requisites ................................................................................................................................... 18
Migrate data from the source DB2 database to the target DB2 database ................................. 18
Verifying your data movement ....................................................................................................... 18
11. Deploy Remaining Objects.......................................................................................................................................... 19
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 2 of 20
1. Introduction
The IBM® Database Conversion Workbench (DCW) integrates many of the tools used for database conversions into a
single integrated development environment. Whether migrating from one DB2 version to another, or rehosting an
existing DB2 database, 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
Extendable environment as new features can easily be added as plug-ins
Wizards that guide users through all steps of the conversion
The Database Conversion Workbench supports the migration from older DB2 versions to DB2 10.1, and the movement of
database objects and data between DB2 10.1 databases. 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. Assessment Report for Conversion to DB2 pureScale – Identifies features in use at the source database that
are not yet supported in a DB2 10.1 pureScale environment. DCW prepares a report that outlines such cases
along with recommended solutions.
3. DDL Extraction – Extracts database object definitions from the source database. The DDL extract is used by
DCW to re-create the objects on the target database.
4. Split DDL – The Split DDL function converts a single DDL file into multiple files, organized by object types. This
helps stream-line your DB2 to DB2 conversion process by providing a much more intuitive code organization.
These files can then be executed against your target DB2 database to create the required objects.
5. Data Movement – Extracts and loads data from the source database to the target DB2 10.1 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.1.0 Installation Guide, see:
http://www.ibm.com/developerworks/data/ibmdcw
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 4 of 20
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.
iii.
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.
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:




Project Explorer view – lists all projects and relevant files.
Data Source Explorer view – lists all existing DB2 connection profiles.
Administration Explorer view – lists all existing DB2 connection profiles and
provides access to DB2 administration functions.
DCW DB2 to DB2 Task Launcher – launches the various wizards and help topics.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 5 of 20
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
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 6 of 20
IBM Software
Information Management
4. Overview of the DB2 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 has the following steps:
The Database Conversion Workbench provides an integrated environment to help facilitate the DB2 to DB2 migration
process. It includes many functions that will take the user through the migration steps.
It is highly recommended for novice users to follow the process from beginning to end. DCW can support the use of the
various migration functions separately, however, that is beyond the scope of this guide.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 7 of 20
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 migration 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.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 8 of 20
IBM Software
Information Management
6. Compatibility Assessment for Migration to DB2 pureScale
6.1.
Overview of the process
Before starting a database conversion, a compatibility assessment is recommended to accurately determine the work
that is required to migrate your DB2 database into the DB2 10.1 pureScale environment. Most of this assessment
comes with experience, and an intimate knowledge of DB2 10.1 is highly recommended.
For novice users, the Database Conversion Workbench comes with a simple assessment tool that can give a general
idea of compatibility between your source DB2 database and the target DB2 10.1 pureScale environment.
This is done by inspecting your source database for features that are not supported in a DB2 pureScale environment
and presenting the findings in a report. This report also contains some recommended fixes to commonly known issues.
Note that addressing incompatibility issues are covered in section 9.1 – Addressing incompatible features.
6.2.
DB2 pureScale Compatibility Report
6.2.1.
Pre-requisites
 Ensure that you have a connection profile of the source database as outlined in section 3.2 Create a
new connection profile to the source database.
 Source database must be a DB2 (version 9.5 and higher) database
6.2.2.
Generate DB2 pureScale Compatibility Report
i. Right-click on your conversion project folder and navigate to Database Conversion > Create DB2
pureScale Assessment Report. The wizard opens.
ii. In the wizard, select the connection profile for your source DB2 database. Click Next.
iii. On the second page of the wizard, specify the Project Folder to save to.
iv. Specify the name for the report and click Finish.
v. The report opens automatically in Data Studio. If not, it can be found in your conversion project folder.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 9 of 20
IBM Software
Information Management
7. DDL Extraction
7.1.
Overview of the process
The Database Conversion Workbench can extract the DDL for the source database objects through an online
connection, or by generating 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 > Extract DDL. The DDL Extraction Wizard opens.
The various processes are listed in the following sections.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 10 of 20
IBM Software
Information Management
7.2.
Extract DDL using a Connection
This is the recommended method if it is possible to directly connect to the source database through Data Studio.
7.2.1.
Pre-requisites
 Ensure that you have a connection profile of the source database as outlined in section 3.2 Create a
new connection profile to the source database.
7.2.2. Extract DDL through a Connection
The Database Conversion Workbench can extract the objects from an entire database or of select schemas.
i.
ii.
iii.
iv.
v.
vi.
vii.
viii.
From the DDL Extraction Wizard, select Extract DDL using a connection. Click Finish. The
Extract DDL through a connection Wizard opens.
On the first page, select the connection profile of your source DB2 database. Click Next.
On the second page, select the schemas that you want to extract. Click Next.
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.
On the fifth page, select your project folder 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 project folder in the Project Explorer View.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 11 of 20
IBM Software
Information Management
7.3.
Extract DDL by generating a custom extraction script
7.3.1. Generate a DDL extraction script
If a connection to the source database is unavailable, DCW can still help you extract the DDL from the source
DB2 database. This is done by using DCW to generate a custom DDL extraction script, which can then be
manually run on your source DB2 database. Note that the Generate DDL extraction script Wizard can also be
accessed through the DB2 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. Specify the name of the source DB2 database.
b. Specify the name of the script file to be created.
c. Select the options that you want the script to do. For the purposes of this guide, it is
recommended that you keep the default options.
d. Click Finish.
The custom script can be found in the directory that you specified.
iii.
7.3.2. Run the custom extraction script on your source DB2 database
You can execute the custom extraction script by using the DB2 Command Line Processor from a machine that
has access to the source DB2 database server. Manually running the script is outside of the scope of this guide.
7.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. In the Project Explorer view, right-click on your DCW Project and navigate to Database
Conversion > Import a DDL file. The Import Wizard opens.
ii. 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.
iii. The DDL file will be imported into your DCW Project, and automatically converted to a .sql extension.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 12 of 20
IBM Software
Information Management
8. 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.
8.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 on
this command, see: http://www.ibm.com/support/publications/us/library/
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 details, see: http://pic.dhe.ibm.com/infocenter/db2luw/v10r1/index.jsp
8.2.
Enable Federation on the target DB2 database
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 DB2 database on the target DB2 database.
*Note: Your database may have Federation enabled by default. You can use the following command in your DB2 CLP
to verify this: db2 get database manager configuration
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 13 of 20
IBM Software
Information Management
9. Prepare the target DB2 database for data movement
This step involves executing the extracted DDL statements against the target database to re-create the database objects.
9.1.
Addressing Incompatible Features
Before you can create the objects on the target database, you might need to address some compatibility issues
between the two DB2 versions. For instance, discontinued features must be converted to their equivalent in the target
DB2 version. If the target is a DB2 10.1 pureScale database, unsupported features need to be addressed.
DCW does not provide support to automatically address these situations. On the other hand, when the target
environment is a DB2 10.1 pureScale database, DCW can help identify such incompatibilities. Review section 6 for
details about how to generate a compatibility report for conversions to a DB2 10.1 pureScale environment.
9.2.
Split a DDL file
The Database Conversion Workbench can split a single DDL file into multiple files that are much more manageable.
The resulting files are created by splitting the DDL statements according to the object types. Note that the Split DDL
wizard is accessible from the DCW DB2 Task Launcher.
9.2.1.
Pre-requisites
 Ensure that you have a DDL file of the source DB2 database in your DCW Project.
9.2.2.
Split a DDL file into more manageable components
i.
ii.
Right-click on the DDL file and navigate to Database Conversion > Split SQL files. The Split File(s)
wizard opens.
Complete the steps of the wizard.
a. The first page of the wizard is an introductory page. Click Next.
b. On the second page of the wizard, select the statement delimiter and the project folder into
which you want to save the files. Click Next.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 14 of 20
IBM Software
Information Management
c.
On the third page of the wizard, you are able to see how the various object types are arranged.
You can expand the trees and double click on the object types, which opens an example of the
SQL file to be created. Verify the split organization and scripts. Click Next.
d. The fourth page of the wizard displays the summary. Verify that it is correct. Click Finish.
iii.
The new folder, with the same name as the original DDL file, is found in the SQL Scripts directory in
your DCW Project. The files are arranged by object type.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 15 of 20
IBM Software
Information Management
9.3.
Deploy Objects for Data Movement
Before transferring data from the source DB2 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.
9.3.1.
Pre-requisites
 Ensure that you have extracted the DDL statements from the source 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 Conversion to
DB2 pureScale Assessment Report.
 Ensure that the target DB2 database has been created and it is set up properly.
9.3.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 16 of 20
IBM Software
Information Management

Alternatively, you can use DCW’s Run SQL Files… command to execute multiple files at
once.
1. Select the SQL file(s) you wish to run. You can also select the folder to run all 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 will 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 17 of 20
IBM Software
Information Management
10.
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 DB2
database to the target DB2 database.
10.1. Overview of the process
The Database Conversion Workbench leverages Federation capabilities of the DB2 database manager 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 data for entire schemas.
10.2. The Data Movement Engine
10.2.1. Pre-requisites
 Ensure that a connection to the source DB2 database exists
 Ensure that the target database is created and properly set up
 Ensure that Federation has been enabled on the target DB2 server
 Ensure that the source database is cataloged locally in the target DB2 server
 Ensure that the tables receiving the data have been created on the target DB2 database
10.2.2. Migrate data from the source DB2 database to the target DB2 database
Note that this wizard is accessible from the DB2 Task Launcher.
i.
ii.
Right-click on the DCW Project and navigate to Database Conversion > DB2 Data Movement. The
DB2 Data Movement wizard opens.
Complete the steps of the 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 DB2 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 DB2 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) you want to move. Click Next.
g. The Data movement engine creates wrappers for your objects, and provides a summary.
h. Click Finish to start the data movement.
10.2.3. Verifying your data movement
You can check the log and message files located in the Data Movement folder in your DCW project,
respectively. 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 18 of 20
IBM Software
Information Management
11.
Deploy Remaining Objects
After moving data from the source DB2 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 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 dependencies between the database
objects, you might have to execute the DDL statements more than once until all dependencies are satisfied.
Database Conversion Workbench
© Copyright IBM Corp. 2013. All rights reserved
Page 19 of 20
© 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.