| Documentation Use the Database Counter monitor to make SQL queries for performance metrics from any JDBC-accessible database. This monitor provides optional support for calculating deltas and rates for metrics between monitor runs. You can monitor multiple counters with a single monitor instance. This enables you to watch server loading for performance, availability, and capacity planning. The error and warning thresholds for the monitor can be set on one or more database server performance statistics. To Access Select the Monitors context. In the monitor tree, right-click a group, select New > Monitor, and select the Database Counter monitor. Supported Platforms/Versions This monitor supports monitoring on any database with a valid JDBC driver that supports SQL queries. Setup Requirements and User Permissions The following are several key requirements for using the Database Counter monitor: ● ● You must install or copy a compatible JDBC database driver or database access API into the required SiteScope directory location. Many database driver packages are available as compressed (zipped) archive files or .jar files. Copy the downloaded driver file into the <SiteScope root directory>\WEB-INF\lib subdirectory. If the file is in zip format, unzip the contents to a temporary directory. Stop and restart the SiteScope service after copying the driver file to the SiteScope machine. You must know the syntax for accessing the database driver. Examples of common database driver strings are: com.mercury.jdbc.sqlserver.SQLServerDriver. DataDirect driver from DataDirect Technologies. It is a driver for those Microsoft SQL databases that use Windows authentication. For details on installing the driver, see the note below.Note To install the MSSQL JDBC driver: 1). Download the MSSQL JDBC driver from the Microsoft Download Center, and unzip the contents to a temporary directory. 2). Copy the sqljdbc4.jar file to the <SiteScope root directory>\WEB-INF\lib\ subdirectory. 3). Restart the SiteScope service. 4). Use the Database Connection Tool for connection tuning: Database Connection URL: jdbc:sqlserver://<IP Address>:<port>;InstanceName=<name>;DatabaseName=<name> Database Driver: com.microsoft.sqlserver.jdbc.SQLServerDriver 5). Create the desired database monitor type. com.mercury.jdbc.oracle.OracleDriver. A driver for Oracle databases. When using the driver deployed with SiteScopeBSM Connector, the database connection URL has the form of: jdbc:mercury:oracle://<server name or IP address>:<database server port>;sid=<sid>Note The URL format may differ if you are using another JDBC driver, since the JDBC URL depends on the driver. oracle.jdbc.driver.OracleDriver. SiteScope supports the following categories of JDBC driver supplied by Oracle that are compatible with Java 7: JDBC thin driver for Oracle databases. JDBC OCI (thick) driver. For details on accessing Oracle databases using OCI driver, see How to access Oracle databases using OCI driver. org.postgresql.Driver. The database driver for the Postgresql database. You must know the syntax for the Database connection URL. The Database connection URL normally includes the class of driver you are using, some key name relating to the supplier of the driver software, followed by a combination of server, host, and port identifiers.Examples of common database connection URLs are: jdbc:mercury:sqlserver://<hostname or FQDN>:1433;DatabaseName=master;AuthenticationMethod=type2 where <hostname or FQDN> is the name of the host where the database is running. jdbc:oracle:thin:@<hostname or FQDN>:<port>/<service> where <hostname or FQDN> is the name of the host where the database is running, <port> is the port on which the database interfaces with the driver, and <service> is the Oracle service name.When monitoring Oracle RAC databases, the database connection URL has the form of: jdbc:oracle:thin:@<SCAN (Single Client Access Name) listener>:<port>/<database service name> ❍ ❍ ❍ ■ ■ ❍ ● ❍ ❍ This PDF was generated for your convenience. For the latest documentation, always see https://docs.microfocus.com. | Documentation jdbc:postgresql://<hostname or FQDN>:<port>/<dbname>where <hostname or FQDN> is the name of the host where the database is running, <port> is the port on which the database interfaces with the driver, and <dbname> is the name of the Postgresql database. Generally, only one instance of each type of JDBC driver client should be installed on the SiteScope machine. If there is more than one instance installed, SiteScope may report an error and be unable to connect to the database. For example, installing two ojdbc6.jar files from two different versions of Oracle is unlikely to work. Database drivers that have timeout problems (where database queries processed with these drivers exceed the timeout specified in the monitor's Query timeout field) can be specified in the Timeout proxied query drivers list field (in Preferences > Infrastructure Preferences > General Settings). These drivers are queried separately with a monitorbased timeout. You must have a database user login that SiteScope can use to access the database with CREATE SESSION system privileges. SiteScope is only able to run the SQL queries that this user has permission to run on the database. Note When Windows authentication is used to connect to the database, configure SiteScope using the following settings: Database connection URL: jdbc:mercury:sqlserver://<server name or IP address>:1433;DatabaseName=<database name>;AuthenticationMethod=type2. Database driver: com.mercury.jdbc.sqlserver.SQLServerDriver. Leave the Database User name and Database Password boxes empty, because the Windows user credentials of the account from which the SiteScope service is running are used to establish a connection to the database. ❍ ● ● ● ❍ ❍ ❍ IPv6 Addressing Supported Protocols When Prefer IP version 6 addresses is enabled in SiteScope (Preferences > Infrastructure Preferences > Server Settings), this monitor supports the TCP (JDBC) protocol. Support for IPv6 might also depend on the JDBC driver being used. For details on using IPv6, see Enable SiteScope to Prefer IP Version 6 Addresses. Database Counter Topology The Database Counter monitor can identify the topology of the database system being monitored. The monitor creates the following topology in APM's RTSM. For details on enabling topology reporting, see the task below. For information about retrieving topologies and reporting them to APM, see Report Discovered Topologies to APM. License Consumption Points-based Usage Capacity-based Usage One point per metric One OSi license per monitored host. This PDF was generated for your convenience. For the latest documentation, always see https://docs.microfocus.com. | Documentation How to Configure the Database Counter Monitor 1. PrerequisitesBefore configuring the monitor, make sure you have the necessary Setup Requirements and User Permissions. 2. Configure the monitor propertiesConfigure the monitor properties as required.For a description of each setting, see the UI Descriptions section below.Tip The Database Connection Tool is available when configuring this monitor to test and verify connectivity between SiteScope and an external JDBC compatible database (provided you are an administrator in SiteScope, or a user granted Use monitor tools permissions). To use the tool when configuring or editing a monitor, click the Use Tool button. For details on the tool, see Database Connection Tool. 3. Enable topology reporting - optionalTo enable topology reporting, make sure that Report monitor and related CI topology is selected in Integration Settings (the default setting). For details on the monitor topology, see Database Counter Topology.For user interface details, see Integration Settings. How to access Oracle databases using OCI driver You can monitor an Oracle database using an OCI driver. If the port or SID are changed, you only need to make the change in the tnsnames.ora file (the SiteScope Oracle monitors remain unchanged). a. On the SiteScope server, install the version of Oracle client that you are using. b. Connect to the Oracle database using the Oracle OCI driver. Set ORACLE_HOME environment variable (ORACLE_HOME is the folder where the Oracle client or database has been installed). Add ORACLE_HOME\lib to System PATH (on Windows platforms), or LD_LIBRARY_PATH env variable (on UNIX platforms). Set CLASSPATH environment variable to use Oracle JDBC driver from ORACLE_HOME\jdbc\lib. c. In the \oracle\oraX\network\admin\tnsnames.ora file, configure the service name. You can test this using a SQL+ tool or the SiteScope Database Connection tool (see Database Connection Tool). d. Add a database monitor within SiteScope, and configure the following settings in the Monitor Settings panel: Database connection URL: jdbc:oracle:oci8:@<service name> Database driver: oracle.jdbc.driver.OracleDriver Enter the database user credentials in the Database user name and Database password boxes. e. Copy the ocijdbc11.dll into ORACLE_HOME\java\lib and ojdbc5.jar into ORACLE_HOME\Java\lib\ext or ORACLE_HOME\WebINF\lib. You must manually copy these if the OS environment PATH does not load them. ❍ ❍ ❍ ❍ ❍ ❍ Related workflow: How to Create and Deploy a Monitor UI Descriptions - Database Counter Monitor Settings User interface elements are described below: UI Element Database connection URL Query Description Connection URL to the database you want to connect to. The syntax is jdbc:oracle:thin:@<server name or IP address>:<database server port>:<sid>. Example: To connect to the ORCL database on a machine using port 1521 use: jdbc:oracle:thin:@22.214.171.124:1521:ORCL. The colon (:) and the (@) symbols must be included as shown. Note for using Windows Authentication: If you want to access the database using Windows authentication, enter jdbc:mercury:sqlserver://<server name or IP address>:1433;DatabaseName=<database name>;AuthenticationMethod=type2 as the connection URL, and com.mercury.jdbc.sqlserver.SQLServerDriver as your database driver. Leave the Database user name and Database password boxes empty, because the Windows user credentials of the account from which the SiteScope service is running are used to establish a connection to the database. SQL query that returns at least two columns of data. The values in the first column of data are interpreted as the labels for the entries in the each row. The values in the first row are treated as labels for each entry in the column. This PDF was generated for your convenience. For the latest documentation, always see https://docs.microfocus.com. | Documentation Driver used to connect to the database. Example:org.postgresql.Driver Tip: You can specify database drivers that have timeout problems (where database queries processed Database driver with these drivers exceed the timeout specified in the monitor's Query timeout field) in the Timeout proxied query drivers list field (in Preferences > Infrastructure Preferences > General Settings). These drivers are queried separately with a monitor-based timeout. Database Identifier for the target database server, as it should be reported to APM. machine name Note: This field is used only for topology reporting. Port number, for the target database server, as it should be reported to APM. You can specify the port manually. If none is specified, the monitor attempts to detect the port from the database connection URL. Database port If it fails, topology is still reported, just without IpServiceEndpoint. Note: This field is used only for topology reporting. Name of the database instance, as it should be reported to APM. For SQL servers, the monitor automatically detects and populates this field from the database connection URL. Database For Oracle, the monitor automatically detects the instance name from the database connection URL instance name without populating the field. If the field is empty and auto detection fails, no topology is reported and the default CI type Node is displayed in the Integration Settings panel. Note: This field is used only for topology reporting. SQL query that returns a single numeric value. The value of each counter is calculated by dividing the Divisor query counter value as retrieved from the database divided by the Divisor Query value. No cumulative Turns off the default behavior of calculating the value of a counter as the difference between that counters counter's cumulative values (as retrieved from the database on consecutive monitor runs). Option for providing the user name and password to be used to access the database server: • Use user name and password. Select this option to manually enter user credentials. Enter the user name and password in the User name and Password box. Credentials • Select predefined credentials. Select this option to have SiteScope automatically supply a predefined user name and password (default option). Select the credential profile to use from the Credential profile drop-down list, or click Add Credentials and create a new credential profile. For details on how to perform this task, see How to Configure Credential Preferences. Turns off the default behavior of calculating the value of a counter as the value retrieved from the database (or the delta of two values retrieved from the database over consecutive monitor runs) divided No divide by some number. counters The divisor is either taken from the Divisor Query, or it is the elapsed time in seconds since the previous monitor run. Server performance counters you want to check with this monitor. Use the Get Counters button to select Counters counters. Opens the Select Counters Form, enabling you to select the counters you want to monitor. Note when working in template mode: The maximum number of counters that you can select is 100. Get Counters If you import a template monitor from an earlier version of SiteScope, or perform a copy to template action, the number of counters is not limited. Database Connection Settings The Database Connection Settings enable you to retrieve, share, and reuse database connections for database monitors that use any JDBC-compliant driver. When multiple database monitors use the same database, using a connection pool instead of an open connection for each monitor improves monitor performance and optimizes database server resource utilization. Connections can be shared regardless of monitor enter. For example, SiteScope database logger, database tools (Database Connection, Database Information), database alerts, dynamic updates, and database monitors (Oracle Database, Database Counter, Database Query, DB2 JDBC, Technology Database Integration, and so forth) can share and reuse database connections in a connection pool. Enables SQL connection sharing. This means that you use a connection pool rather than open and close a Use connection new connection for each monitor query. pool Default value: Selected Physically close Maximum number of unused SQL connections in the SQL connection pool. When this number is exceeded, if idle connection unused connections are closed rather than returned to the connection pool. count exceeds Default value: 10 Maximum amount of time, in seconds/minutes/hours/days, that a SQL connection remains unused after it Idle connection has been returned to the SQL connection pool. When the time is exceeded, the connection is timeout automatically closed. Default value: 5 minutes This PDF was generated for your convenience. For the latest documentation, always see https://docs.microfocus.com. | Documentation Query timeout Amount of time, in seconds/minutes/hours/days, to wait for execution of a SQL statement. Not all SQL drivers have this function. If your SQL driver does not support this function, this parameter is ignored. Default value: 1 minute This PDF was generated for your convenience. For the latest documentation, always see https://docs.microfocus.com. | Documentation The following setting panels in the monitor Properties tab are common to all monitors. ● ● ● ● ● ● ● ● ● ● ● ● ● Common Monitor Settings General Settings Monitor Run Settings Dependencies Calculated Metrics Settings Threshold Settings Integration Settings (available when SiteScope is integrated with APM, or with OM and event or metrics integration is enabled) Event Mapping Settings (available when SiteScope is integrated with OM and event integration is enabled, or when a Generic Event Integration is configured in Integration Preferences) Enable/Disable Monitor Enable/Disable Associated Alerts Search/Filter Tags Baseline Settings Logging Settings General Notes and Troubleshooting ● ● When deploying this monitor using a template, an error message is displayed if you clear the Verify monitor properties with remote server check box in the Deployment Values dialog box. You can set additional database options that affect all resources that connect to the database in the JDBC Global Options in the General Preferences container. For details, see JDBC Global Options. This PDF was generated for your convenience. For the latest documentation, always see https://docs.microfocus.com.