Skip to main content

DB, SQL

The following provides various options for Java agents to handle the database and collect SQL performance data. They can trace various DB connection pools such as DBCP, Hikari, and Tomcat and record SQL execution details. Additionally, it provides information collection options for performance optimization, such as recording SQL parameters and tracing DB connection leaks.

  • dbcp_pool_enabled Boolean

    Default true

    It is used to trace DB connection data of DBCP without using JMX.

  • hikari_pool_enabled Boolean

    Default false

    It is used to trace DB connection data of the hikari pool without using JMX.

  • tomcat_ds_enabled Boolean

    Default false

    It enables the function to trace Tomcat DB connection pool data without using JMX.

  • tomcat_pool_enabled Boolean

    Default true

    It enables the function to trace Tomcat DB connection pool data without using JMX.

  • weblogic_ds_enabled Boolean

    Default false

    It enables the function to trace the Weblogic DB connection pool data by using JMX.

  • weblogic_pool_enabled Boolean

    Default true

    It enables the function to trace the Weblogic DB connection pool data without using JMX.

  • jeus_pool_enabled Boolean

    Default true

    It enables the function to trace the JEUS DB connection pool data without using JMX.

  • profile_connection_open_enabled Boolean

    Default true

    It records DB connection open data in the trace details.

  • profile_dbc_close Boolean

    Default false

    It works only when profile_connection_open_enabled is true. DB connection close-up data is recorded in the transaction trace details.

  • profile_sql_param_enabled Boolean

    Default false

    It is used to record SQL parameters in the transaction trace details. The parameters can be viewed by entering a separate security key.

    Note
    • Earlier than Java Agent 2.2.2: The security key is written in the WAS server ${WHATAP_AGENT_HOME}/paramkey.txt file with a 6-letter value. If the paramkey.txt file does not exist, it is automatically created with a random value.

    • Java Agent 2.2.2 or later: For the security key, check the paramkey key value in the WAS server ${WHATAP_AGENT_HOME}/security.conf file. If the security.conf file does not exist, the paramkey key value is automatically created as WHATAP.

    • For more information about the security key configuration file, see the following.

  • profile_sql_resource_enabled Boolean

    Default false

    It traces the CPU and memory usages during collection of SQLs in the transaction trace.

  • profile_update_count Boolean

    Default false

    It collects the number of updates when SQL update statements have been executed through the executeUpdate() method.

  • custom_pool_classes String

    When using a separate connection pool that has not been defined previously, set the class name.

  • ds_update_interval MiliSeconds

    Default 5000

    Set the interval for counting DB connection data.

  • profile_position_sql Boolean

    Default false

    It records the stack traces when SQL statements are executed.

  • profile_sql_param_length Int

    Default 40

    Set the length of the SQL parameter.

    Note

    The maximum value is 128. Even if you enter a number than this value, parameters are saved up to 128 bits.

  • trace_dbc_leak_enabled Boolean

    Default false

    It enables to trace DB connection leaks.

    Caution

    Because leaks are traced using the connection wrapper, be sure to apply it after a test as it can affect the operation services.

  • trace_dbc_leak_fullstack_enabled Boolean

    Default false

    When any DB connection leak is detected, it collects stack traces at this time.

    Caution

    Do not apply this at the peak time, if possible. If the option is applied, the CPU usage may increase slightly. It is recommended to apply it temporarily for troubleshooting purposes only.

  • trace_sql_normalize_enabled Boolean

    Default true

    It enables the function to normalize any SQL statements by extracting the literal part from each SQL statement.

  • profile_error_jdbc_fetch_max Int

    Default 10000

    When SQL Fetch Count(ResultSet.next() call count) exceeds the set value, it is treated as TOO MANY Fetch error. If it is set to 0, it is not treated as an error.

  • profile_error_sql_time_max Int

    Default 30000

    If the SQL execution time exceeds the set value, it is treated as TOO SLOW error. If it is set to 0, it is not treated as an error.

  • hook_connection_open_patterns String

    It registers the method to call upon DB connection open. It is common to register getConnection of any connection pool that has not been set.

    Example
    hook_connection_open_patterns=mypool.ConPool.getConnection
  • hook_jdbc_con_classes String

    Set an unregistered JDBC connection class.

    Example
    hook_jdbc_con_classes=mypool.ConPool
  • hook_jdbc_pstmt_classes String

    Set an unregistered JDBC PreparedStatement class. Note that it must be a structure where the SQL string is delivered to the creator parameter.

    Example
    hook_jdbc_pstmt_classes=org.apache.derby.impl.jdbc.EmbedPreparedStatement
  • hook_jdbc_cstmt_classes String

    Set an unregistered JDBC CallableStatement class.

    Example
    hook_jdbc_cstmt_classes=org.apache.derby.impl.jdbc.EmbedCallableStatement
  • hook_jdbc_stmt_classes String

    Set an unregistered JDBC statement class.

    Example
    hook_jdbc_stmt_classes=org.apache.derby.impl.jdbc.EmbedStatement
  • hook_jdbc_rs_classes String

    Set an unregistered JDBC result set class.

    Example
    hook_jdbc_rs_classes=org.apache.derby.impl.jdbc.EmbedResultSet
  • hook_jdbc_wrapping_driver_patterns String

    The obfuscated JDBC driver like the DB2 driver is difficult to directly perform BCI with the hook_jdbc_xxx option. In this case, SQLs can be traced with the wrapper method. At this time, set Driver.connect for tracing.

  • debug_dbc_stack_enabled Boolean

    Default false

    StackTrace is saved in the transaction trace at the time of DB connection. It is used to obtain connection pool information that is used by applications.

  • ignore_sql_hash_set String Java Agent v2.2.4 or later

    You can set to ignore the SQL statements that match the SQL hash value in the option.