Oracle to DB2 UDB Conversion Guide2003

 < Day Day Up > 


4.6 The Generate Data Transfer Scripts task

The next task in our conversion is the Generate Data Transfer Scripts tab. From this tab it is possible to:

This tab is separated into three panes: left, middle, and right. When first opened, the left pane shows all the tables in the Oracle schema that are being converted; the right pane shows the file that contains all of the converted DB2 code; the middle pane contains options that may be specified when data import or load is selected (Figure 4-22).

Figure 4-22: The Generate Data Transfer Scripts tab

Choosing Data Import or Load

The choice of whether to import or load data into DB2 UDB is usually dictated by the amount of data.

For small amounts of data, Import is usually sufficient. This method inserts data into a database table from an external file, inserting one row at a time. During the import of data, the table remains accessible to other applications. All applicable constraints and triggers remain in effect, and are activated in the usual way as rows are inserted.

For large amounts of data, LOAD is usually preferable. The LOAD utility constructs page images containing many rows and inserts them into the database one page at a time. It requires exclusive access to the tablespace being loaded. During the loading of data, the tablespace that contains the table is not accessible to other applications. Applicable constraints and triggers are deactivated for the duration of the load. Applicable check constraints and foreign key constraints are enforced at the end of the load process. The enforcement of business rules that are implemented by triggers are not guaranteed after the load completes.

During load and import, MTK will disable the referential integrity. MTK deletes the foreign keys before load and import, and re-create them after.

Import or Load options

The following options are available for Import or Load:

Advanced Import or Load options

When the Advanced Options button is clicked, a screen opens that displays the options for the data movement that you have selected (Import or Load). Figure 4-23 shows the screen opened with the options available for Load. One parameter which we would like to bring to your attention is the message file. DB2 writes the output of Import and Load to the message file specified here. The default is message.txt in /tmp directory on UNIX and c:/temp on Windows.

Figure 4-23: Advanced Options screen for LOAD

4.6.1 Creating unload and load scripts

For our conversion we chose to load the data into DB2; all the defaults will be taken:

Figure 4-24 shows the screen after the Create Scripts button is clicked, and scripts have been generated.

Figure 4-24: The Generate Data Transfer Scripts screen after scripts generated

4.6.2 Files generated by the Generate Data Transfer Script task

After the Create script button is clicked on the Generate Data Transfer Scripts task, the following files are created:

For our example, the following scripts were created:

Note 

In addition to generating data movement files, MTK also generates the online data movement functionality "on the fly" from within the tool itself so that if you choose to move the data on-line within the GUI within the Deploy tab, the MTK tool knows how. That is why if you skip from the Refine tab to the Deploy tab, you will not have an online option of extracting and loading data; these options will remain in a "grayed out" state.


 < Day Day Up > 

Категории