NuoDB Migrator Schema Command
The schema
command generates a DDL SQL statement script to create database objects that have been defined in a schema of a source NuoDB or third-party database.
The types of command line options that are available to the schema
command include:
-
Source database options
Specify the details for the source NuoDB or third-party database, such as database connection, login credentials and transaction properties. -
Target database options
Specify the details for the target NuoDB database, such as database connection, login credentials and schema information. If target database options are provided then the DDL SQL script is executed in the target NuoDB database and it creates the database objects. -
Output script definition and formatting
Specify filters for which objects to generate DDL SQL object create statements. You can also specify which objects to not include in DDL SQL statement creation. For example, specify the type of DDL commands generated for each object, such asDROP
and/orCREATE
statements and define syntax such as qualifying schema name and using quotes. -
Data type mapping options
Override the default data types that will be generated.
The output from running the schema
command includes a data types mapping summary. For each source type, the summary shows the NuoDB type it was mapped to.
Syntax
nuodb-migrator schema
--source.driver=source_driver_class_name
--source.url=jdbc:source_jdbc_url
--source.schema=my_schema
--source.username=userid
--source.password=passwd
--output.path=path_and_filename_for_ddl_sql_file [option]...
The following is a list of schema
command line options (option
).
Some of these NuoDB Migrator schema
command line options are also available to be used with the NuoDB Migrator dump
and/or load
commands.
Options related to the source database connection | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Option |
Required? |
|
Description |
||||||||||||||||
--source.driver= |
Yes |
dump only |
JDBC driver class name |
||||||||||||||||
--source.url= |
Yes |
dump only |
Source database connection URL in the standard syntax: Optionally, include the source database username and password in the
It is allowed to specify the database username and password in both the
|
||||||||||||||||
--source.username=
|
Yes |
dump only |
Source database username. Alternatively you can specify the user name in the |
||||||||||||||||
--source.password=
|
No |
dump only |
Source database password. Alternatively you can specify the password in the |
||||||||||||||||
--source.properties=
|
No |
dump only |
Additional connection properties encoded as URL query string, e.g. “ |
||||||||||||||||
--source.catalog= |
No |
dump only |
Default database catalog name to use |
||||||||||||||||
--source.schema= |
No |
dump only |
Default database schema name to use |
||||||||||||||||
--source.auto.commit= { true | false } |
No |
dump only |
If set to |
||||||||||||||||
--source.transaction.
isolation= |
No |
dump only |
Sets the transaction isolation level for the migration execution.
A valid value can be either a symbolic name or an integer constant representing transaction isolation levels as defined in the JDBC
NuoDB does not support all of the levels, only |
Options related to the target database connection. If provided, the DDL commands will be executed in the target database. The target parameters can also define specifics regarding data mapping definitions. | |||
---|---|---|---|
Option |
Required? |
|
Description |
--target.url= |
No |
load only |
Target database connection URL in the format, |
--target.username=
|
No |
load only |
Target database user name |
--target.password=
|
No |
load only |
Target database password |
--target.properties=
|
No |
load only |
Additional connection properties encoded as URL query string, e.g. “ |
--target.schema= |
No |
load only |
Database schema name to use. If not provided, objects will be generated in the same schema as the source database schema. |
Options related to DDL SQL script file output | |||
---|---|---|---|
Option |
Required? |
|
Description |
--output.path= |
No |
- |
Saves DDL SQL script to a file specified by |
--table.type= |
No |
|
Comma separated types of table objects ( |
--meta.data. |
No |
|
Includes or excludes specific metadata types from the generated output. Valid values are:
By default, all objects are generated.
If you have tables with a sequence auto-generated column, you cannot use the |
--script.type={drop | create} |
No |
|
Type of DDL statement to be generated for each object. Default is both |
--group.scripts.by={table | meta.data} |
No |
|
Group generated DDL scripts. Group by table is the default. |
--identifier.quoting={
minimal |
always |
|
No |
|
Identifier quoting policy name, implementing
|
--identifier.normalizer={
noop |
standard |
lowercase |
uppercase |
|
No |
|
Identifier transform to use, implementing
|
--naming.strategy={ auto | hash | qualify} |
No |
|
Naming strategy to define how some object names are generated. This relates to objects of type index, foreign key, sequence, trigger. Valid options are:
|
Options related to Custom Data Type Mappings | |||
---|---|---|---|
Option |
Required? |
|
Description |
--type.code= |
No |
|
This parameter identifies a type in the source database for which we want to specify a customized mapping.
See |
--type.size= |
No |
|
Defines the size of a source data type.
This parameter will allow you to map source types of different sizes to different target types.
See also |
--type.precision= |
No |
|
The maximum total number of decimal digits that can be stored, both to the left and to the right of the decimal point.
This parameter will allow you to map source types of different precision to different target types.
See also |
--type.scale= |
No |
|
The number of fractional digits (digits after the decimal point) for numeric data types.
This parameter will allow you to map source types of different scale to different target types.
See also |
--type.name= |
No |
|
SQL type name , i.e., |
--config= |
No |
|
Specifies a custom type mapping configuration file, where |
--use.nuodb.types={ true | false } |
No |
|
Instructs the migrator to transform source database types to the best matching NuoDB types, where |
--use.explicit.defaults={ true | false } |
No |
|
Affects only MySQL implicit default values.
This option allows MySQL implicit defaults to be moved over to the NuoDB schema explicitly.
The option is |