In this section:

Overview

Before connecting DTP to the database, you must first prepare the database. This can be done via the command line and/or the DTP UI. Preparing the database involves three steps:

  1. Creating the database: DTP
  2. Creating the user: dtp
  3. Creating a schema in the database

Prerequisites

  • The database server should be installed and running.

Preparing the Database via Command Line

Follow the directions below that are appropriate for your database. Once you have prepared your database, see Connect to an Existing DTP Database below for information about connecting DTP to your database.

Preparing MySQL DB via Command Line

Run the create.sql script found in the <DTP_INSTALL>/dtp/grs/db/dtp/mysql/ directory as root. This script will:

  1. Create the database: DTP
  2. Create the user: dtp
  3. Create a schema in the database

Preparing Oracle DB via Command Line

  1. Run the create_tablespaces.sql script found in the <DTP_INSTALL>/grs/db/dtp/oracle/ directory as an admin. This script will create the database: DTP.
  2. Run the create_user.sql script found in the <DTP_INSTALL>/grs/db/dtp/oracle/ directory as an admin. This script will create the user: dtp.
  3. Run the create.sql script found in the <DTP_INSTALL>/grs/db/dtp/oracle/ directory as the user dtp created in the previous step (do not run this script as an admin). This script will create the schema in the database.

Preparing PostgreSQL DB via Command Line

  1. Run the create_db_and_user.sql script found in the <DTP_INSTALL>/grs/db/dtp/postgresql/ directory as an admin. This script will create the database: DTP and the user: dtp.
  2. Run the create.sql script found in the <DTP_INSTALL>/grs/db/dtp/postgresql/ directory as the user dtp created in the previous step (do not run this script as an admin). This script will create the schema in the database.

Preparing the Database via UI

First, start DTP Server by following the directions in Starting DTP Application. Then open and license DTP by following the directions in Opening and Licensing DTP. Once you have licensed DTP, you will be redirected the database creation page where you can create a new DTP database and schema as well as new user credentials by doing the following:

  1. Click Configure Database Settings and select Create new DTP database, user, and schema in the window that appears.
  2. Click Next.

  3. Select a database type: MySQLOracle, or PostgreSQL.
  4. Enter the database URL and root credentials, then click Test Connection to confirm that it is correct.

    For MySQL databases, the root user must have the GRANT OPTION privilege.


  5. Click Next.

  6. Enter new user and credentials and click Create Database.

    Existing Parasoft Users

    The processes will fail if the Parasoft default "dtp" user already exists. In this rare scenario, you can manually create the database and users, then go through the Create a DTP schema for an existing database described below. Alternatively, you can drop the "dtp" user before running this process.

Other UI Options

Connect to an Existing DTP Database

To connect to an existing DTP database using existing user credentials:

  1. Click Configure Database Settings and select Connect to existing DTP database in the window that appears.
  2. Click Next.

  3. Select a database type: MySQLOracle, or PostgreSQL.
  4. Enter the database URL and user credentials, then click Test Connection to confirm that it is correct.

  5. Click Save & Connect to connect to the database.

Create a DTP Schema for an Existing Database

To create a DTP schema for an existing database with existing user credentials:

  1. Click Configure Database Settings and select Create DTP database schema in the window that appears.
  2. Click Next.

  3. Select a database type: MySQLOracle, or PostgreSQL.
  4. Enter the database URL and user credentials, then click Test Connection to confirm that it is correct.
  5. Click Create Schema.

Integration with Azure Key Vault

DTP does not ship with the JAR files necessary to fully integrate with Azure Key Vault. To integrate with Azure Key Vault, contact Parasoft support to obtain the JAR files necessary to enable the integration. Copy the files into the <DTP_DATA>/lib/thirdparty directory and restart DTP (see Stopping DTP Services and Starting DTP Applications).

DTP Database settings are saved inside the <dtp-db-connection> element of the PSTRootConfig.xml file located in <DTP_DATA_DIR>/conf/. If your organization stores the DTP Database password in Azure Key Vault, you can configure DTP to retrieve the password by adding an <azure-key-vault> element. The example below is for MySQL but will work for all the supported databases.

    <dtp-db-connection>
        <db-type>MySQL</db-type>
        <user>dtp</user>
        <url>jdbc:mysql://localhost:3306/DTP</url>
        <azure-key-vault>
            <url>https://dtp-dev.vault.azure.net/</url>
            <secret>default-db-password</secret>
        </azure-key-vault>
    </dtp-db-connection>

The value of the <url> element is the Azure Key Vault URI. The value of the <secret> element is the name of the secret in Azure Key Vault. Note that in the example above, there is no need for the <password> element inside <dtp-db-connection> element since DTP is configured to retrieve the database password from Azure Key Vault.

This functionality assumes that you have you have configured Access Control and Managed Identity so that DTP deployed in an Azure VM has access to the secret on Azure Key Vault.

Troubleshooting

A defect in the MySQL 8.x JDBC connector may cause the database creation process may fail

Check the dtpconsole-db.log log for the following error (the log may include additional messages):  

The server time zone value 'PDT' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.

The error message will specify your timezone. If you see this error after a database creation script failure, set the serverTimezone property in MySQL to your timezone and re-run the script.

  • No labels