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:
- Creating the database:
DTP
- Creating the user:
dtp
- Creating a schema in the database
Prerequisites
- The database server should be installed and running.
Preparing the Database via Command Line
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:
- Create the database:
DTP
- Create the user:
dtp
- Create a schema in the database
Preparing Oracle DB via Command Line
- 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
. - 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
. - Run the create.sql script found in the
<INSTALL_DIR>/grs/db/dtp/oracle/
directory as the userdtp
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
- 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
. - Run the create.sql script found in the
<INSTALL_DIR>/grs/db/dtp/postgresql/
directory as the userdtp
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:
- Click Configure Database Settings and select Create new DTP database, user, and schema in the window that appears.
- Click Next.
- Select a database type: MySQL, Oracle, or PostgreSQL.
- Enter the database URL and root credentials, then click Test Connection to confirm that it is correct.
- Click Next.
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:
- Click Configure Database Settings and select Connect to existing DTP database in the window that appears.
- Click Next.
- Select a database type: MySQL, Oracle, or PostgreSQL.
Enter the database URL and user credentials, then click Test Connection to confirm that it is correct.
- 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:
- Click Configure Database Settings and select Create DTP database schema in the window that appears.
- Click Next.
- Select a database type: MySQL, Oracle, or PostgreSQL.
- Enter the database URL and user credentials, then click Test Connection to confirm that it is correct.
- 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.