Differences

This shows you the differences between two versions of the page.

sqldata_cmd [September 08, 2017 5:57 am]
sqlines
sqldata_cmd [May 22, 2021 6:39 am] (current)
Line 1: Line 1:
====== SQLines Data Tool - Command Line Reference ====== ====== SQLines Data Tool - Command Line Reference ======
-SQLines Data is a scalable, parallel high performance data transfer, schema conversion and validation tool.  +You can run SQLines Data tool from a command line, and this article describes the command line parameters. Additionally, you can specify options in [[//sqldata_cfg|Configuration File]].
- +
-You can run the tool from a command line, and this article describes the command line parameters. Additionally, you can specify options in [[//sqldata_cfg|Configuration File]].+
To run SQLines Data from command line, run //.sqldata// on Linux and ///sqldata.exe// on Windows. To run SQLines Data from command line, run //.sqldata// on Linux and ///sqldata.exe// on Windows.
Line 14: Line 12:
| **-sd** | Source database connection string | Option must be specified, no default value | | **-sd** | Source database connection string | Option must be specified, no default value |
| **-td** | Target database connection string | Option must be specified, no default value | | **-td** | Target database connection string | Option must be specified, no default value |
-| **-t** | List of tables (wildcards *.* are allowed) | Option must be specified, no default value |+| [[/sqldata_cmd#t-option|-t]] | List of tables (wildcards *.* are allowed) | No default value |
| **-tf** | A file with list of tables | No file used | | **-tf** | A file with list of tables | No file used |
| **-texcl** | Tables to exclude (wildcards *.* are allowed) | No tables excluded | | **-texcl** | Tables to exclude (wildcards *.* are allowed) | No tables excluded |
| **-qf** | A file with SQL SELECT queries | No file used | | **-qf** | A file with SQL SELECT queries | No file used |
| **-cmd** | Command to perform | Perform //transfer// command | | **-cmd** | Command to perform | Perform //transfer// command |
-| **-topt** | Transfer options | //recreate// tables in the target database |+| [[/sqldata_cmd#topt-option|-topt]] | Transfer options | //recreate// tables in the target database |
| **-vopt** | Validation options | //rowcount// to compare row count for tables | | **-vopt** | Validation options | //rowcount// to compare row count for tables |
-| **-smap** | Schema name mapping | No any schema mapping is performed |    +| [[/sqldata_cmd#smap-option|-smap]] | Schema name mapping | No any schema mapping is performed |    
| **-cmapf** | Column name and data type mapping file | //sqlines_cmap.txt// file |     | **-cmapf** | Column name and data type mapping file | //sqlines_cmap.txt// file |    
-| **-dtmapf** | Global data type mapping file | //sqlines_dtmap.txt// file |    +| [[/sqldata_cmd#dtmapf-option|-dtmapf]] | Global data type mapping file | //sqlines_dtmap.txt// file |    
| **-out** | Output directory for logs and reports (created if not exists) | The current directory | | **-out** | Output directory for logs and reports (created if not exists) | The current directory |
| **-ss** | Number of concurrent sessions | 4 concurrent sessions | | **-ss** | Number of concurrent sessions | 4 concurrent sessions |
Line 76: Line 74:
For example, //-t = * -texcl = temp*// specifies to migrate all tables excluding tables those name starts with //temp//. For example, //-t = * -texcl = temp*// specifies to migrate all tables excluding tables those name starts with //temp//.
 +
 +===== -qf Option =====
 +
 +**-qf** option allows you to specify one or more queries to extract data from the source database. If multiple queries are defined, they will be executed in parallel (the number of concurrent sessions is defined by -ss option).
 +
 +<code sql>
 +  -- Syntax:
 +  -- target_table1, query1;  (use ; to terminate the query, you can use newlines and tabs)
 +  -- target_table2, query2; ... ;
 +
 +  ORDERS, SELECT * FROM orders WHERE created_dt >= CURRENT_DATE;
 +</code>
 +
 +For an example, see //sqlines_qf.txt// located in the tool directory.
===== -cmd Option ===== ===== -cmd Option =====
Line 92: Line 104:
| //truncate// | Truncate tables (perform TRUNCATE TABLE command) to remove data in the existing tables before data transfer. | | //truncate// | Truncate tables (perform TRUNCATE TABLE command) to remove data in the existing tables before data transfer. |
| //none//  | Just start data transfer into existing tables | | //none//  | Just start data transfer into existing tables |
 +
 +Please note that when //truncate// or //none// is set the tool **does not** create tables, table constraints and indexes in the target database.
You can set multiple values separating them by a comma, for example, to create tables if they do not exist in the target database, You can set multiple values separating them by a comma, for example, to create tables if they do not exist in the target database,
Line 158: Line 172:
Note that if you specify both directory and file name in **-log** option, the directory must exist. If you want to automatically create the directory use **-out** option to specify the directory and **-log** option to specify the file name only.   Note that if you specify both directory and file name in **-log** option, the directory must exist. If you want to automatically create the directory use **-out** option to specify the directory and **-log** option to specify the file name only.  
 +