Executing DSC

Precautions

  • Before starting DSC programs, specify the path of the output folder. Separate the input folder path, output folder path, and log path with spaces. The path of the input folder cannot contain spaces. Spaces in a path will cause an error in DSC execution. For details, see Troubleshooting.
  • If the output folder contains subfolders or files, DSC deletes the subfolders and files or overwrites them based on parameter settings in the application.properties configuration file in the config folder before the migration. Deleted or overwritten subfolders and files cannot be restored by DSC.
  • If migration is performed concurrently on the same server (executed by the same or different DSCs), different migration tasks must use different output folder paths and log paths.
  • You can configure an optional parameter to specify a log path. If the path is not specified, DSC automatically creates a log folder under TOOL_HOME. For details, see Log Reference.

Migration Methods

You can execute runDSC.sh in Linux or runDSC.bat in Windows to perform schema conversion. For details, see Table 1.

Table 1 Schema Conversion Method

Scenario

Command-Line Parameter

Teradata SQL Migration

> ./runDSC.sh
 --source-db Teradata
[--application-lang SQL]
[ --input-folder <input-script-path> ]
[--output-folder <output-script-path> ]
[--log-folder <log-path>]
[--target-db/-T][Optional]
> runDSC.bat
--source-db Teradata
[--application-lang SQL]
[ --input-folder <input-script-path> ]
[--output-folder <output-script-path> ]
[--log-folder <log-path>]
[--target-db/-T][Optional]

Oracle SQL Migration

./runDSC.sh
--source-db Oracle
[--application-lang SQL]
[--input-folder <input-script-path>]
[--output-folder <output-script-path>]
[--log-folder <log-path>]
[--conversion-type <Conversion-Type-BulkOrBlogic>]
[--target-db/-T]
runDSC.bat
--source-db Oracle
[--application-lang SQL]
[--input-folder <input-script-path>]
[--output-folder <output-script-path>]
[--log-folder <log-path>]
[--conversion-type <Conversion-Type-BulkOrBlogic>]
[--target-db/-T]

Teradata Perl Migration

> ./runDSC.sh
--source-db Teradata
[--application-lang Perl]
[--input-folder <input-script-path> ]
[--output-folder <output-script-path> ]
[--log-folder <log-path>]
[--target-db/-T][Optional]
> runDSC.bat
  --source-db Teradata
[--application-lang Perl]
[--input-folder <input-script-path> ]
[--output-folder <output-script-path> ]
[--log-folder <log-path>]
[--target-db/-T][Optional]

MySQL SQL Migration

> ./runDSC.sh
--source-db MySql
[--application-lang SQL]
[--input-folder <input-script-path>]
[--output-folder <output-script-path>]
[--log-folder <log-path>]
[--conversion-type <conversion-Type-BulkOrBlogic>]
[--target-db/-T]
> runDSC.bat
--source-db MySql
[--application-lang SQL]
[--input-folder <input-script-path>]
[--output-folder <output-script-path>]
[--log-folder <log-path>]
[--conversion-type <conversion-Type-BulkOrBlogic>]
[--target-db/-T]

Netezza Migration

> ./runDSC.sh
--source-db Netezza
[--application-lang SQL]
[--input-folder <input-script-path>]
[--output-folder <output-script-path>]
[--log-folder <log-path>]
[--target-db/-T][Optional]
> runDSC.bat
--source-db Netezza
[--application-lang SQL]
[--input-folder <input-script-path>]
[--output-folder <output-script-path>]
[--log-folder <log-path>]
[--target-db/-T][Optional]

DB2 Syntax Migration

> ./runDSC.sh
--source-db db2
[--application-lang SQL]
[--input-folder <input-script-path>]
[--output-folder <output-script-path>]
[--log-folder <log-path>]
[--conversion-type <Conversion-Type-BulkOrBlogic>]
[--target-db/-T]
> runDSC.bat
--source-db db2
[--application-lang SQL]
[--input-folder <input-script-path>]
[--output-folder <output-script-path>]
[--log-folder <log-path>]
[--conversion-type <Conversion-Type-BulkOrBlogic>]
[--target-db/-T]
  • Command parameter description:
    • source-db specifies the source database. The value can be Teradata, Oracle which is case-insensitive.
    • conversion-type specifies the migration type. This parameter is optional. DSC supports the following migration types:

      Bulk: Migrate DML and DDL scripts.

      BLogic: Migrate service logic, such as procedures and functions. BLogic is used for Oracle PL/SQL, Netezza.

    • target-db specifies the target database. The value can be GaussDB A or GaussDB T.
  • Command output description:

    Migration process start time indicates the migration start time and Migration process end time indicates the migration end time. Total process time indicates the total migration duration, in milliseconds. In addition, the total number of migrated files, total number of processors, number of used processors, log file path, and error log file path are also displayed on the console.

  • For details, see Database Schema Conversion.

Task Examples

  • Example: Run the following command to migrate the SQL files of the Oracle database to the SQL scripts applicable to GaussDB A in Linux:
    ./runDSC.sh --source-db Oracle --input-folder D:\test\conversion\input --output-folder D:\test\conversion\output --log-folder D:\test\conversion\log --conversion-type bulk --targetdb gaussdbA
  • Example: Run the following command to migrate the SQL files of the Oracle database to the SQL scripts applicable to GaussDB T in Windows:
    runDSC.bat --source-db Oracle --input-folder D:\test\conversion\input --output-folder D:\test\conversion\output --log-folder D:\test\conversion\log --conversion-type bulk --targetdb gaussdbA

Migration details are displayed on the console (including the progress and completion status):

********************** Schema Conversion Started *************************
DSC process start time : Mon Jan 20 17:24:49 IST 2020
Statement count progress 100% completed [FILE(1/1)]

Schema Conversion Progress 100% completed
************************************************************************** 
Total number of files in input folder : 1
************************************************************************** 
Log file path :....../DSC/DSC/log/dsc.log
DSC process end time : Mon Jan 20 17:24:49 IST 2020
DSC total process time : 0 seconds
********************* Schema Conversion Completed ************************