Configuring the Connection Between the SRC VTA and the External Account and Session Database (SRC CLI)

The SRC VTA requires a relational database to store accounts and session data. The database connection information specifies how the SRC VTA connects to this database. You must configure the connection to the external database for each SRC VTA group.

Note: The values shown in the following sample procedure should work for a MySQL database. The values are different for an Oracle database, or other database servers. The values may also differ for different versions of the same brand of database server. You must understand how to connect to your particular brand and version of database server using JDBC before configuring the database connection.

Following is an example Oracle configuration:

user@host> show configuration shared vta group test database
check-valid-connection-sql 'select 1 from dual';
connection-url jdbc:oracle:thin:@//10.10.1.2:1521/vta;
datasource-mapping Oracle9i;
driver-class oracle.jdbc.OracleDriver;
max-pool-size 50;
min-pool-size 5;
password ********;
user-name vta;

user@host>

Use the following statements to configure the connection to the external database:

shared vta group name database { connection-url connection-url ; driver-class driver-class; user-name user-name; password password; data-source-mapping data-source-mapping; min-pool-size min-pool-size;max-pool-size max-pool-size;check-valid-connection-sql check-valid-connection-sql;}

To configure the connection to the external database:

  1. From configuration mode, access the statement that configures the connection to the external database. For example, to configure the connection for the SRC VTA group called vta1:
    [edit]user@host# edit shared vta group vta1 database
  2. Configure the URL connection information. For example, to specify the connection url as jdbc:mysql://10.10.10.1:3306/vta1:
    [edit shared vta group vta1 database]user@host# set connection-url jdbc:mysql://10.10.10.1:3306/vta1
  3. Configure the driver class information. For example, to configure a JDBC driver for MySQL:
    [edit shared vta group vta1 database]user@host# set driver-class com.mysql.jdbc.Driver
  4. Configure the username used to access the database. For example to configure the username called admin1:
    [edit shared vta group vta1 database]user@host# set user-name admin1
  5. Configure the password used to access the database. For example, to configure the password as pwd1:
    [edit shared vta group vta1 database]user@host# set password pwd1
  6. Configure the data source mapping information. For example, for MySQL:
    [edit shared vta group vta1 database]user@host# set data-source-mapping mySQL
  7. Specify the minimum number of simultaneous connections to the database.
    [edit shared vta group vta1 database]user@host# set min-pool-size min-pool-size ;
  8. Specify the maximum number of simultaneous connections to the database.
    [edit shared vta group vta1 database]user@host# set max-pool-size max-pool-size ;

    Note: The max-concurrency option should be set greater than or equal to the max-pool-size option; otherwise, database connections are likely to be unused, see Configuring Event Handlers Overview.

  9. Specify the SQL used to check whether a database connection is still valid.
    [edit shared vta group vta1 database]user@host# check-valid-connection-sql check-valid-connection-sql ;

    The specified SQL depends on the type of database server. For example, with Oracle, you can use “select 1 from dual,” and with MySQL or MS SQL Server, you can use “select 1”.

Related Documentation