Skip to main content

Running the MS SQL Server collector

Note

The latest version of the Collector is 2.158. To view the release notes for this version and all previous versions, please go here.

Generating the command or YAML file

This section walks you through the process of generating the command or YAML file for running the collector from Windows or Linux or MAC OS.

  1. On the Organization profile page, go to the Settings tab > Metadata collectors section.

  2. Click the Help me set up a collector button.

  3. On the On-prem collector setup prerequisites screen, read the pre-requisites and click Next.

  4. On the On which platform will this collector execute? screen, select if you will be running the collector on Windows or Mac OS or Linux. This will determine the format of the YAML and CLI that is generated in the end. Click Next.

    general_01.png
  5. On the Choose metadata collector type you would like to setup screen, select SQL Server. Click Next.

  6. On the Configure a new on premises Microsoft SQLServer Collector screen, set the following properties and click Next.

  7. On the next screen, set the following properties and click Next.

    Table 2.

    Field name

    Corresponding parameter name

    Description

    Required

    Server

    -s= <server>

    --server= <server> 

    The host name of the database server to connect to. For Azure Synapse, provide the server information you obtained here.

    Yes

    Server port

    -p= <port>

    --port= <port> 

    The port of the database server (if not the default).

    No

    Database

    -d= <database>

    --database= <database>

    The name of the database to connect to.

    Yes

    Schemas to collect

    Select from one of the following options: Collect all schema, Specify which schema to collect

    Yes

    Collect all schema

    -A, --all-schemas

    Catalog all schemas to which the user has access.

    Yes

    (if --schema is not set)

    Specify which schema to collect

    -S= <databaseSchema>

    --schema= <databaseSchema>

    Select this option and then specify the names of the database schema to be catalog.

    Yes

    (if --all-schemas is not set)

    Include information schema

    --include-information-schema

    when --all-schemas is specified, include the database's Information Schema in catalog collection (ignored if --all-schemas is not specified).

    No

    Username

    -u= <user>

    --user= <user> 

    The username to use to make the JDBC connection.

    Yes

    Password

    -P= <password>

    --password=<password> 

    Specify this option to provide the password for the database on the command line.

    Yes



  8. On the next screen, set the following optional properties and click Next.

    Table 3.

    Field name

    Corresponding parameter name

    Description

    Required?

    Disable lineage collection

    --disable-lineage-collection

    Skip harvesting of intra-database lineage metadata.

    No

    SQL Server extended properties collection flag

    --collect-extended-properties

    Harvest information about extended properties from SQL Server.

    No

    Enable sample string values collection

    --sample-string-values

    Enable sampling and storage of sample values for columns with string values.

    No

    Enable column statistics collection

    --enable-column-statistics                            

    Enable harvesting of column statistics (this is optional, and may greatly increase collector run time)

    No

    Server environment

    -e= <environment>

    --environment= <environment>

    if your provided server name is localhost, use this to give a friendly name to the environment in which your database server runs. it helps differentiate it from other environments.

    No

    Database ID

    -D= <databseid>

    --database-id= <databaseId>

    A unique identifier for this database - will be used to generate the ID for the database (this is optional, you only need to provide this if the database name used for the connection is not sufficiently unique to completely identify the database)

    No

    Target sample size for Profiling

    --target-sample-size=<targetSampleSize>                            

    Target for number of rows to sample from tables.

    No

    JDBC Properties

    --jdbc-property=<driverProperties>

    JDBC driver properties to pass through to driver connection, as name=value. Separate the name=value pairs with a semicolon (;). For example, property1=value1;property2=value2 

    No



  9. On the next screen, provide the Collector configuration name. This is the name used to save the configuration details. The configuration is saved and made available on the Metadata collectors summary page from where you can edit or delete the configuration at a later point. Click Save and Continue.

  10. On the Finalize your Microsoft SQLServer Collector configuration screen, you are notified about the environment variables and directories you need to setup for running the collector. Select if you want to generate Configuration file ( YAML) or Command line arguments (CLI). Click Next..

    Important

    You must ensure that you have set up these environment variables and directories before you run the collector.

  11. The next screen gives you an option to download the YAML configuration file or copy the CLI command. Click Done. If you are generating a YAML file, click Next.

  12. The Microsoft SQLServer Collector command screen gives you the command to use for running the collector using the YAML file.

  13. You will notice that the YAML/CLI has following additional parameters that are automatically set for you.

    Important

    Except for the collector version, you should not change the values of any of the parameter listed here.

    Table 4.

    Parameter name

    Details

    Required?

    -a= <agent>

    --agent= <agent>

    --account= <agent>

    The ID for the data.world account into which you will load this catalog - this is used to generate the namespace for any URIs generated.

    Yes

    --site= <site>

    This parameter should be set only for Private instances. Do not set it for public instances and single-tenant installations. Required for private instance installations.

    Yes (required for private instance installations)

    -U

    --upload

    Whether to upload the generated catalog to the  organization account's catalogs dataset.

    Yes

    -L

    --no-log-upload

    Do not upload the log of the Collector run to the organization account's catalogs dataset.

    Yes

    dwcc: <CollectorVersion>

    The version of the collector you want to use (For example, datadotworld/dwcc:2.113)

    Yes



  14. Add the following additional parameter to test run the collector.

    • --dry-run If specified, the collector does not actually harvest any metadata, but just checks the database connection parameters provided by the user and reports success or failure at connecting.

Verifying environment variables and directories

  1. Verify that you have set up all the required environment variables that were identified by the Collector Wizard before running the collector. Alternatively, you can set these credentials in a credential vault and use a script to retrieve those credentials.

  2. Verify that you have set up all the required directories that were identified by the Collector Wizard.

Running the collector

Important

Before you begin running the collector make sure you have the correct version of collectors downloaded and available.

Running collector using YAML file

  1. Go to the server where you have setup docker to run the collector.

  2. Make sure you have download the correct version of collectors. This version should match the version of the collector specified in the command you are using to run the collector.

  3. Place the YAML file generated from the Collector wizard to the correct directory.

  4. From the command line, run the command generated from the application for executing the YAML file.

    Caution

    Note that is just a sample command for showing the syntax. You must generate the command specific to your setup from the application UI.

    docker run -it --rm --mount type=bind,source=${HOME}/dwcc,target=/dwcc-output \
      --mount type=bind,source=${HOME}/dwcc,target=${HOME}/dwcc --mount type=bind,source=${HOME}/dwcc-drivers,target=/usr/src/dwcc-config/lib \
      -e DW_AUTH_TOKEN=${DW_AUTH_TOKEN} -e DW_SQLSERVER_PASSWORD=${DW_SQLSERVER_PASSWORD} \
      datadotworld/dwcc:2.124 --config-file=/dwcc-output/config-sqlserver.yml
  5. The collector automatically uploads the file to the specified dataset and you can also find the output at the location you specified while running the collector.

  6. At a later point, if you download a newer version of the collector from docker, you can edit the collector version in the generated command to run the collector with the newer version.

Running collector without the YAML file

  1. Go to the server where you have setup docker to run the collector.

  2. Make sure you have download the version of collectors from here. This version should match the version of the collector specified in the command you are using to run the collector.

  3. From the command line, run the command generated from the application. Here is a sample command.

    Caution

    Note that is just a sample command for showing the syntax. You must generate the command specific to your setup from the application UI.

    docker run -it --rm --mount type=bind,source=${HOME}/dwcc,target=/dwcc-output \
      --mount type=bind,source=${HOME}/dwcc,target=${HOME}/dwcc --mount type=bind,source=${HOME}/dwcc-drivers,target=/usr/src/dwcc-config/lib \
      datadotworld/dwcc:2.124 catalog-sqlserver --agent=8bank-catalog-sources \
      --site=solutions --no-log-upload=false --upload=true --api-token=${DW_AUTH_TOKEN} \
      --output=/dwcc-output --name=8bank-catalog-sources-collection \
      --upload-location=ddw-catalogs --server=8bank_server --database=8bank_database \
      --all-schemas=true --include-information-schema=false --user=8bank_user \
      --password=${DW_SQLSERVER_PASSWORD} --disable-lineage-collection=true \
      --collect-extended-properties=true --enable-column-statistics=false \
      --sample-string-values=true --target-sample-size=10
  4. The collector automatically uploads the file to the specified dataset and you can also find the output at the location you specified while running the collector.

  5. At a later point, if you download a newer version of collector from docker, you can edit the collector version in the generated command to run the collector with the newer version.

Automating updates to your metadata catalog

Keep your metadata catalog up to date using cron, your Docker container, or your automation tool of choice to run the catalog collector on a regular basis. Considerations for how often to schedule include:

  • Frequency of changes to the schema

  • Business criticality of up-to-date data

For organizations with schemas that change often and where surfacing the latest data is business critical, daily may be appropriate. For those with schemas that do not change often and which are less critical, weekly or even monthly may make sense. Consult your data.world representative for more tailored recommendations on how best to optimize your catalog collector processes.

Managing collector runs and configuration details

Overview

Some enterprise systems support the use of Secure Sockets Layer (SSL) encrypted communications on all external traffic. If you are harvesting metadata from a source system that requires SSL, you will need to add a CA certificate or self-signed certificate.

Obtaining the Custom SSL Certificate

  • Obtain the root certificate for your source system issued by your company. Typically your system administrator should be able to provide you with this.

Extending Docker to use custom SSL certificates

If the collector is run via Docker, extend the Docker image and install the custom certificate.

STEP 1: Prepare the Docker File

First, prepare a Dockerfile with the instructions for Docker to install the custom certificate and extend the Docker image.

  1. Ensure you are on the machine where you have downloaded the Docker Image and plan to execute the Collector.

  2. In a directory create the new Dockerfile with the following parameters for your custom SSL Certificate:

    FROM datadotworld/dwcc:<collector_version>
    ADD ./<custom_certificate_file_path> <custom_certificate_file_name>
    RUN keytool -importcert -alias startssl -cacerts -storepass changeit 
    -noprompt -file <custom_certificate_file_name>
    • Replace <collector_version> with the version of the Collector you want to use (For example, datadotworld/dwcc:2.120)

    • Replace <custom_certificate_file_path> with the path to the custom SSL Certificate.

    • Replace <custom_certificate_file_name> with the name of your custom SSL Certificate file.

    For example, the command will look like:

    FROM datadotworld/dwcc:2.120
    ADD ./ ca.der certificate
    RUN keytool -importcert -alias startssl -cacerts -storepass changeit 
    -noprompt -file certificate

STEP 2: Install the certificate and extend the docker image

Next, execute the the Dockerfile to install the certificate and extend the data.world Collector Docker Image.

  1. Using your terminal of choice, ensure you are in the directory containing the Dockerfile created in step 1.

  2. Next, create the new extended Docker image, called dwcc-cert in this example, by executing the following command:

    docker build -t dwcc-cert .

    Important things to note:

    • The command must be all lowercase.

    • The command must include the period (.) at the end, which directs Docker to use the local directory for the Dockerfile created above.

    • For the new image, the command uses the name dwcc-cert You can change the name if you want.

STEP 3: Run collector using the custom certificate

Finally, run the collector using the custom Certificate.

  1. Get the standard docker run command for the Data Source you are collecting from.

  2. Change the docker run command to use dwcc-cert image instead of dwcc image.

    Sample command for Tableau.

    docker run -it --rm --mount type=bind,source=/tmp,target=/dwcc-output \
    --mount type=bind,source=/tmp,target=/app/log dwcc-cert \
    catalog-tableau --tableau-api-base-url <baseUrl> \
    --tableau-password <password> --tableau-username <username> \
    -a <account> -n <catalogName> -o "/dwcc-output"

    If you are using YAML file for running the collector, edit the command to use dwcc-cert image instead of dwcc image.

    docker run -it --rm --mount type=bind,source=${HOME}/dwcc,target=/dwcc-output \ 
     --mount type=bind,source=${HOME}/dwcc,target=${HOME}/dwcc -e DW_AUTH_TOKEN=${DW_AUTH_TOKEN} \
      -e DW_TABLEAU_PASSWORD=${DW_TABLEAU_PASSWORD} dwcc-cert \ 
     --config-file=/dwcc-output/config-tableau.yml

Adding custom SSL certificates when using jar

If the collector is run via jar, add the certificate to the JVM truststore.

  1. From the terminal, navigate to the directory containing the certificate.

  2. Run the following command to add the SSL certificate to the truststore:

    keytool -importcert -alias startssl -cacerts -storepass changeit -noprompt -file <custom_certificate_file_path>

    Replace <custom_certificate_file_path> with the path to the custom SSL Certificate.

    For example, the command will look like:

    keytool -importcert -alias startssl -cacerts -storepass changeit -noprompt -file ca.der
  3. Finally, run the collector using the original jar file command. Note that this command does not need any modifications.

Troubleshooting SSL certificate issues

Issue

  • The following error occurs while running the collector:

Caused by: javax.ws.rs.ProcessingException: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Description

  • There was an issue connecting to the source system using the SSL certificate.

Solution

  1. Check to make sure the SSL certificate has not expired.

  2. Ensure you have the correct SSL certificate for the source system.