Configuring Decision Server Insights persistence in JDBC
Add a Java™ database connectivity (JDBC) data source to determine the database to use for persisting system data. JDBC is an essential prerequisite for communicating with the database. The data source is looked up by a Java Naming Directory Interface (JNDI) process.
Procedure
- In the <WLP_USER_DIR>/servers/your_runtime_server_name/server.xml
file, create a JDBC data source and configure the JDBC
driver for your database.
The following entries are required for the JDBC data source:
- JNDI name
- Path to the JDBC .jar directory
- Space-separated list of the JDBC .jar files to include
- Database name
- User name
- Password
- Server name
- Database schema name
- Port number
Tip: You can use Eclipse to add a data source to the server configuration file, if you have WebSphere® Application Server Developer Tools installed. For more information, see Adding a data source by using the developer tools.The following code is an example of a DB2® configuration:
<dataSource jndiName="jdbc/db2xa"> <connectionManager maxPoolSize="120"/> <jdbcDriver> <library> <fileset dir="/opt/DB2/java" includes="db2jcc4.jar db2jcc_license_cisuz.jar" /> </library> </jdbcDriver> <properties.db2.jcc databaseName="SAMPLEDB" user="user1" password="pwd1" serverName="localhost" currentSchema="DB2JCC4Lib" portNumber="50000" /> </dataSource>The following code is an example of an Oracle configuration:
<dataSource jndiName="jdbc/oracle_datasource"> <connectionManager maxPoolSize="120"/> <jdbcDriver> <library> <fileset dir="/opt/oracle/java" includes="ojdbc6.jar" /> </library> </jdbcDriver> <properties.oracle databaseName="SAMPLEDB" user="user1" password="pwd1" serverName="localhost" portNumber="1521" /> </dataSource>Where maxPoolSize determines the maximum number of physical connections for the connection pool. The default value is 50. Increase the number of connections depending on your need.
- Uncomment the feature manager for JDBC in the server.xml
file.
For more information, see Editing the Liberty profile configuration by using developer tools.<featureManager> <feature>jdbc-4.0</feature> </featureManager> - Add a persistence configuration item, and set the data
source JNDI name. You can set the delete batch size,
delete pause interval, maximum batch size and maximum
cache age attributes: The following code is an example of a DB2 on distributed
configuration:
<ia_persistence datasourceName="jdbc/db2xa" databaseType="DB2" deleteBatchSize="10000" deletePauseInterval="600000" maxBatchSize="10000" maxCacheAge="1000" />The following code is an example of a DB2 for z/OS® configuration:
<ia_persistence datasourceName="jdbc/db2xa_z" databaseType="DB2 for z/OS" deleteBatchSize="10000" deletePauseInterval="600000" maxBatchSize="10000" maxCacheAge="1000" />The following code is an example of an Oracle configuration:<ia_persistence datasourceName="jdbc/oracle_datasource" databaseType="ORACLE" deleteBatchSize="10000" deletePauseInterval="600000" maxBatchSize="10000" maxCacheAge="1000" />Where dataSourceName is a mandatory property to set, and all of the others are optional:
- datasourceName
- The JNDI reference of the data source that you created in step 1.
- databaseType
Describes the database that is used to persist the data. Valid values are DB2, DB2 for z/OS, and ORACLE.
- deleteBatchSize
The number of entries that are deleted within a single delete statement.
- deletePauseInterval
Defines the amount of time, expressed in milliseconds, between cycles of deletion. The default value is 10 minutes, expressed as 600000.
- maxBatchSize
- The maximum number of entries that can be restored to the system in a single transaction if
recovery occurs. The rows are read in batches of the size that is configured. The default is
2000.
The maxBatchSize value can affect the performance of the recovery process. However, there is no risk of data loss because it is a read only operation.
- maxCacheAge
- The maximum time in milliseconds that the system caches data source information before it looks
up the data source again. The default is 1000.
The system checks the server.xml for new database details at the specified rate.
What to do next
Update the object grid to enable database persistence.