Import Script¶
The import
script imports the contents of a VQL file or a Repository
into a Virtual DataPort server or into several Virtual DataPort servers
at the same time.
The following sections explain how to:
Import the metadata from a VQL file, from a VQL file with a properties file or from a zip file containing any of the previous ones. See below Importing the Metadata from a Single File.
Import the metadata from a Repository. See below Importing the Metadata from a Repository.
This script is located in the directory <DENODO_HOME>/bin
.
This script returns one of these exit codes:
0: no errors. All the VQL statements in the file were executed successfully.
126: the execution of one or more VQL statements failed.
1: for other errors. E.g. the script could not open a connection to the Virtual DataPort Server.
Importing the Metadata from a Single File¶
Use the following syntax to import the metadata of a VQL file into one or more Servers:
import --file <input filename>
[ --properties-file <properties file name>]
{ [ --server <server URI>
| --servers-file <servers file>
}
[ --singleuser ] [ --metadata-password <password>]
<server URI> =
host:port/database?user@password[&queryTimeout=value][&chunkTimeout=value][&chunkSize=value]
Parameter Name |
Description |
---|---|
-h --server <server URI> |
URI of the Server. You can specify the
password of the Server
encrypted. To do this,
execute the script
E.g.
If you use this script
to execute queries that
may take a long time,
add the
If you run this script on Windows, do this:
"//localhost:9999/admin?login@pas""s"
If you run this script on Linux, do this:
'//localhost:9999/admin?login@pas'"'"'s'
You can specify more
than one |
-s --servers-file <servers file> |
Instead of using the parameter The file
|
-f --file <input file> |
Path to the file that contains the metadata to be imported. This file can be a plain text file with the metadata (i.e. the VQL statements) or a zip file that contains a VQL file and a properties file. This parameter has a different meaning if the metadata is imported from a repository instead of from a single file. |
-pf --properties-file <properties file> |
Path to the properties file with the values of the parameters that depend on the environment where the Server is running. Use this option when
the metadata was
exported with the
option
|
-su --singleuser |
If present, the import
script will execute the
statement
By doing this, Virtual DataPort switches to single user mode while importing the file. Note: you are strongly advised to import metadata in a Virtual DataPort server in single user mode. |
-mp --metadata-password <password> |
Decrypt the sensitive values using the given password (e.g. passwords of data sources). This parameter is mandatory if the VQL file you are going to import was generated by:
Otherwise, the commands that include sensitive
parameters (the ones marked with You can indicate the password encrypted to avoid
entering it in plain text. To do this, use the
script E.g. |
Examples
Example 1:
import --singleuser --file export.vql
--server "localhost:9999/admin?admin@admin1"
--server "host2:9099/admin?admin@admin2"
In this example, the script imports the metadata of the file
export.vql
into two Servers.
Example 2:
import --singleuser -f export.vql -s servers.conf
In this example, the script imports the metadata of the file
export.vql
and reads the URIs of the target Servers from the file
servers.conf
.
Importing the Metadata from a Repository¶
Use the following syntax to import the metadata of a Repository into one or more Servers.
Besides importing the metadata of the Repository to a Server(s), the
script can instead, create a single file with all VQL statements of
the Repository. To do this, use the option --file
.
Note
If you want to store and import the metadata of the Server in/from a VCS, we recommend using the VCS integration of Virtual DataPort (see section Version Control Systems Integration).
import --repository <path to repository>
[ { --element <path to element>
| --repository-element <identifier path> } ]*
[ --property <property name> = { yes | no } ]*
{ --server <server URI> [--server <server URI>]*
| --servers-file <servers file>
}
[ --file <output file> ] [ --singleuser ]
Parameter Name |
Description |
---|---|
-h --server <host>: <port>/<database> ?<user>@<password> |
URI of the Server. If you want to use an
encrypted password, use
the script
In this case, the value
of this parameter must
be prefixed with
E.g.: //localhost:9999/admin?admin@encrypted:Gr16MjvuXhRzPtPH/yTXHw== |
-s --servers-file |
Instead of using the
parameter Each URI has to be
indicated in a separate
line, with the same
syntax of the parameter
|
-r --repository |
Path to the directory of the Repository. |
-e --element |
Path inside the repository of the element you want to import. Use this option if you only want to import some elements of the Repository. E.g.
If you want to import
an element and its
dependencies, add the
property
E.g.:
|
-re --repository-element |
The identifier path of an element stored in the repository Syntax:
E.g.
The available types are
The value of subtype
can be
|
-su --singleuser |
If present, the import
script will execute the
statement
By doing this, Virtual DataPort switches to single user mode while importing the file. Note: you are strongly advised to import metadata in a Virtual DataPort server in single user mode. |
-d --dependencies |
Add this to import a single element including its dependencies (except jars) when importing from a repository. This parameter is deprecated. |
-P --property |
Set of settings that control the import process. You can specify one or more properties with this syntax: <property name> = {yes | no} Properties than can be passed to the import script (–property parameter): importing from a repository lists the available properties. |
The properties that control the import process (-P
, --property
)
are the following:
Possible Arguments for --property |
Description |
---|---|
includeCreateDatabase |
Only valid when importing an entire database and not when importing an entire repository or just some elements of it. If DROP DATABASE IF EXISTS <exported
db name>;
CREATE DATABASE <exported db
name>
ALTER DATABASE <exported db name>
CACHE OFF;
If you export all the metadata of a Server, the output already includes the statements to create the databases. Default value: |
includeDependencies |
If
For example, if the value of this
parameter is Default value: |
includeJars |
If Default value: |
includeEnvSpecificElements and includeNonEnvSpecificElements |
These options have to be used together to:
With the following options, the script only imports the metadata of elements dependent on the environment: -P includeNonEnvSpecificElements=no -P includeEnvSpecificElements=yes With the following options, the script imports the metadata of the elements that are independent of the environment: -P includeNonEnvSpecificElements=yes -P includeEnvSpecificElements=no The section Exporting Environment-Dependent and Independent Elements to Different Files lists which elements are considered dependent on the environment and which are not. Note: these options are
deprecated and should not be used.
The option |
includeDeployments |
If Default value: |
Example 1
import --singleuser --repository "C:/repository"
--server localhost:9999/admin?admin@admin
--server acme:12999/testing?admin@encrypted:iGTAJvv6CjEd1EvBVZyO4SSkgYCE7Z2C5PMZBLRUYk2YgeibnNZmk4HyTDcecoZuounNgjKxbsh1GO5bXjpRlRIkHOUaaVMj4INs7G3bLa3AE/1MGgSfiv3V4oC/1RVf
In this example, the script imports the content of the Repository
located in the path C:\repository
, into two Virtual DataPort
servers:
A server running in
localhost
, port9999
, using the credentialsadmin/admin
.A server running in the host acme. Note that the password is encrypted.
Example 2:
import --singleuser --repository "C:/repository"
--servers-file servers.conf
In this example, the script reads the URIs of the target Servers from
the file servers.conf
and imports the content of the repository into
these Servers.
Example 3:
import --singleuser --repository "C:/repository" --file output.vql
In this example, the script creates a file output.vql
with all the
VQL statements of the Repository. It does not import anything into any
Server. It just creates the file.