Database configuration

This section explains how to set the database configuration for Service Virtualization.

Database configuration overview

Each Designer and Server installation requires its own dedicated database that is not shared with any other Designer or Server. If multiple Service Virtualization instances use the same database, data loss and unexpected behavior may occur.

For currently supported databases, see Support Matrix.

Back to top

Set database configuration from the Windows installer UI

This section describes how to setup the database when installing Service Virtualization Designer and the Service Virtualization Server.

In the installation wizard, select the Database configuration option and enter the required values. If the database does not exist, the installation wizard creates it with the name you specify.

Name Description
Database Type

Select the MS SQL Server, Oracle, or PostgreSQL database for SV Server installation. For SV Designer, you have also an option to use Embedded database.

If you are upgrading: Custom functions are executed directly on the database layer. If your existing virtual services contain custom functions, changing the database provider can render them non-functional.

For more information, see Define Custom Functions.

Data Source

The data source part of the connection string.

Basic syntax:

MSSQL: server\instance,port
Oracle:

host/servicename, host:port/servicename, or host/servicename:port

This works for SERVICE_NAME and not for SID. If you want to connect using SID, see Configuration examples.

PostgreSQL: server
Default: localhost\SQLExpress_SV

Note:

  • If you are working with the full SQL Server version, you can exclude the instance name to use the default instance.

  • If you are working with SQL Server Express, you must specify the exact database instance name.

  • If you are working with Oracle and have problems connecting, you can use SQLPlus to verify if you are able to connect to the Oracle database by opening a command window and typing: sqlplus user/pwd@server:port/serviceName

  • If you are working with PostgreSQL and have problems connecting, use the psql utility or the pgAdmin GUI tool to verify your credentials.

Database Name

The database name.

For MS SQL Server or PostgreSQL only.

Properties

Optional: Additional database connection properties. The properties you specify are appended to the connection string after the server and instance parameters.

For example:

  • Use Encrypt='true' to use an SSL connection to the database server for MS SQL Server only. For other database types, check the respective documentation.

  • Use Proxy User Id=pUserId;Proxy Password=pPassword to specify proxy authentication for connection to an Oracle server.

Create

For MS SQL Server or PostgreSQL only.

If the Create option is selected:

  • Creates the database during product installation.
  • Recreates the database if it already exists.
  • Removes the database when the product is uninstalled.

If you clear the Create checkbox:

  • Uses the existing database.
  • Drops all user objects in the specified database to prepare a clean database for the application.

Note:

  • For Service Virtualization Server: To maintain your data, make sure to run the Backup and Restore options provided by Service Virtualization.

    • During Server upgrade: The Backup and Restore options are provided later in this installation wizard.
    • During Server reinstall: Manually run the Backup and Restore options described in Backup and restore the SV Server.
  • To install the product, the database user must have the proper privileges.

    • Microsoft® SQL Server®:
      • If you select the option to create the database automatically during installation, the database user must have sufficient privileges to create the database; the SQL server roles dbcreator and public, and the database role db_owner.
      • If you are using an existing database, the database user must have sufficient privileges to create the database schema; the SQL server role public and the database role db_owner.
    • PostgreSQL database: the CREATEDB role is required.
Authentication The database server authentication type.
User

The database server authentication user.

For SQL authentication only.

Password

The database server authentication password.

For SQL authentication only.

Test Connection Tests the database connection.
Connection String View or modify the complete database connection string.

Back to top

Set Linux database configuration

For details, see Set database configuration from the command line below.

Back to top

Set database configuration from the command line

You can change the values for all database properties that were specified while installing Server or Designer. For example, you can change the data source and authentication.

Note: The following section is relevant for both Windows and Linux installations.

To modify database configuration properties:

Run ConfigTool.exe db-setProperties command, followed by the properties to modify.

Copy code
ConfigTool.exe db-setProperties ["server"|"designer"] [dbType] [datasource] [properties] [dbName] ["WinAuth"|"SqlAuth"] ?[username] ?[password]

where: ["server"|"designer"] specifies the configuration to change (select one). The remaining items are described in Installation Wizard Options.

Examples

Example 1. The following example updates the Server database properties to an Oracle database that uses SQL authentication with the specified user name and password.

Copy code
ConfigTool.exe db-setProperties server oracle myoracle.mycompany.net/db1 "" "" SqlAuth MyName MyPassword

 

Example 2. The following example updates the SV Designer database properties to a local MS SQL database instance named my_designer that uses Windows authentication.

Copy code
ConfigTool.exe db-setProperties designer mssql localhost\SQLExpress_SV "" "my_designer" WinAuth

 

Example 3. This example sets SV Designer database to an embedded type.

Copy code
ConfigTool.exe db-setProperties designer embedded

 

Example 4. This example sets SV Server database to an Azure SQL database.

Copy code
ConfigTool.exe db-setProperties server mssql db-server.database.windows.net "" MyDbName SqlAuth MyUser MyPassword

 

Example 5. This example sets SV Server database to a PostgreSQL database running on localhost.

Copy code
ConfigTool.exe db-setProperties server postgresql ";Host=localhost;Database=postgres" "" postgres SqlAuth postgres password

Back to top

Configuration examples

This section provides examples of connection strings for connecting to a database.

Oracle using SID

To connect to an Oracle database using SID, use the following connection string:

(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=hpswvm234088)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SID=orcl)))

Oracle over SSL

To connect to an Oracle database over SSL, use the following connection string:

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=oracleserver.example.com)(PORT=1628))(CONNECT_DATA=(SERVICE_NAME=db.hostname.net)))

Prerequisites:

  1. Make a note of the location of your wallet file. You can create an empty wallet file with the command:

    mkstore.bat -wrl c:\temp\testWallet -create

    (You only need to execute the first step as the Oracle driver disables validation of the database server certificate by default.)

  2. Edit or create the profile configuration file. To reference a wallet created as described in the previous step, create the file c:\temp\oraConfig\sqlnet.ora with following content:

    WALLET_LOCATION= (SOURCE= (METHOD=file) (METHOD_DATA= (DIRECTORY=c:\temp\testWallet)))

  3. Set an environment variable TNS_ADMIN that points to the folder containing the sqlnet.ora file. For example:

    TNS_ADMIN=c:\temp\oraConfig

Back to top