Copying data using SQL code

The sqldbcopy utility executes SQL code that upgrades one database file from one data area to another. The utility converts data for columns with different data types between source and destination, minimum and maximum date and time values, and variant subset index switch column values.

The SQL code can enhance the performance of database copy tasks under the conditions described in this guide.

The utility is designed to determine as much of the required database connection information as it can, based on the source and target data areas. The generated SQL code implements a single INSERT INTO/SELECT FROM statement. This engages the database engine to perform the complete copy of the data within the engine itself without sending data across DB Connections.

The generated SQL code is sent to the database engine using JDBC to upgrade a database file from one data area to another. These data areas must exist within the same database type.

Infor Lawson files are categorized based on their data locations or tablespaces, as defined in the destination data area's dbspaces in dbdef. Infor Lawson files in a data location will be handled by one thread. If files are categorized into 10 data locations, for example, 10 threads process 10 sets of files, that is, one thread handle per set. The number of simultaneous threads that can be run depends on the DEGREEOFPARALLELISM setting in the properties file. Moreover, indexes are created in parallel for each processed Lawson file.

Before you start, set the environment variable IBMJDBC to the directory path where the DB2 JDBC driver is located.

%IBMJDBC%\db2jcc4.jar

To copy data using a generated SQL code, at a command prompt, specify:

sqldbcopy [-H] -P propertiesFile [-D directivesFile]

Consider these options:

Program Option Description
-H Print detailed usage.
-P Input file name and path for setting properties.
-D Directives file defining which Lawson files or data locations to include or exclude in the data copy