Depending on exactly what you need to monitor, you may want to change the default JDBC configuration. When you see the same physical database represented as multiple JDBC databases, you may need to revise the automatic discovery rule. Doing this enables you to more effectively monitor the key performance indicators (KPIs) that are of most value to you.

Multiple Databases from Same Vendor

JDBC connections to the same physical Oracle database (with the same URI) may appear as multiple backends. In some circumstances, the Vendor property captured for the database is different. This can happen when different drivers are used to access the database. For example, you might see JDBC backends with the following vendor names:

  • Oracle DB
  • Oracle

If the database driver package name matches the standard Oracle database driver, then the vendor name used is "Oracle DB". If it doesn't match, then the product name from the database metadata (using the java.sql.DatabaseMetaData class) is used as a vendor name. So database calls that use different drivers to reach the same physical database may be detected as separate databases. You can fix this by disabling the use of the Vendor property in the discovery rule.

JDBC with Complex URLs

In this example, the database URL is configured for high availability, so it is quite long and complex. Choosing the Run a regular expression on it URL option is the way to go. Disable the use of the Host and Port properties for JDBC automatic discovery. Instead enable the use of the URL that appears in the JDBC call, along with a regular expression to get the correct database naming and discovery.

For example, to extract all the hosts and all the ports from the following URL:

jdbc:oracle:thin:@(DESCRIPTION_LIST=(LOAD_BALANCE=OFF)(FAILOVER=ON)(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=ON)(ADDRESS=(PROTOCOL=TCP)(HOST=titanpfmcl01)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=trafrefpfm01.global.trafigura.com)))(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=ON)(ADDRESS=(PROTOCOL=TCP)(HOST=titanpfmcl02)(PORT = 1521)))(CONNECT_DATA=(SERVICE_NAME=trafrefpfm01.global.trafigura.com))))
CODE

This sample is for a string that contains the host and service name twice. You can also use port in your regular expression if needed by your requirements.

The following regular expression applied to the previous high availability URL results in a backend name similar to this: titanpfmcl01-trafrefpfm01.global.trafigura.com-titanpfmcl02-trafrefpfm01.global.trafigura.com.

.*HOST=([^\)]*).*SERVICE_NAME=([^\)]*).*HOST=([^\)]*).*SERVICE_NAME=([^\)]*).*
CODE

Note: the expression starts and end with "." Set Regular Expression Groups to 1,2,3,4.
Set the Merge Delimiter to "-".
This configuration looks like this in the UI:

Backend Naming Configuration


EC2 Hosted Databases

AppDynamics automatically discovers JDBC backends based on host, port, URL, database, version and vendor values. To monitor all JDBC databases that contain "EC2" in their host names as a single database, create a JDBC custom discovery rule and use the following match condition: Host Contains "EC2" as shown in the following screen shot.

Match Conditions

Assuming host names of the format "EC2-segment2-segment3", use the following naming configuration:


Backend Naming Configuration

This configuration results in a single database icon on the flow map named "EC2".