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 <INSTALL_DIR>/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 <INSTALL_DIR>/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 <INSTALL_DIR>/grs/db/dtp/oracle/ directory as an admin. This script will create the user: dtp.
  3. Run the create.sql script found in the <INSTALL_DIR>/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 <INSTALL_DIR>/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 <INSTALL_DIR>/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.
  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.

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.

"Cannot connect to the DB" error

Check the rs.log for more information about the error, especially toward the end of the file; search for terms like "database", "jdbc", "mysql", "oracle", or "postgres". See Viewing Log Files for more information about DTP logs.

  • No labels