Prerequisite Details for Database Monitoring
Matrix of Metrics per Monitoring Type
Introduction:
Entuity supports management of the following on-prem types of Databases:
- MariaDB
- Microsoft SQL
- MySQL
- Oracle
Some of the database types have specific requirements for being able to poll performance metrics. Prerequisite instructions for each database type are below and a section that contains a matrix of the metrics provided by each monitoring type.
Prerequisite Details for Database Monitoring:
MySQL/MariaDB:
To monitor the database, a user needs to be configured so that the database can be connected to from an external host with privileges allowing the user to query performance metrics.
- Navigate to the directory containing the mysql.exe
- This is located within the [Entuity Home]/database/bin directory on Entuity servers.
-
Run the command below to connect to the database through the command line utility.
./mysql -u [username|root] -P 3306 -h 127.0.0.1 -
If you are using a non-root account, run the commands below as a root user. This will create a new user account and allow external hosts to connect to the database and grant additional privileges to the user.
CREATE USER username@'%' IDENTIFIED BY 'password'; GRANT SELECT, PROCESS ON * . * TO username@'%'; GRANT SELECT, EXECUTE ON sys.* TO username@'%'; GRANT SELECT ON sys.schema_table_statistics_with_buffer TO username@'%'; -
Run the below command FLUSH PRIVILEGES; to add the changes.
FLUSH PRIVILEGES;
To Enable the Performance Schema on a Database:
By default, the performance schema is enabled on most MySQL and MariaDB databases, but this can be disabled which is done on the Entuity MariaDB database. Database monitoring will work without the performance schema enabled; however, certain performance metrics cannot be polled without it. Follow the steps below to enable the performance schema.
- Navigate to the directory containing the my.cnf and edit the file to match below.
-
Note, for Entuity servers the file is my_eye.cnf located in the [Entuity Home]/install/template/etc directory.
performance_schema=1
-
- After the file is edited, the changes should take effect after restarting the database.
- Note, for Entuity servers, configure must be run for the changes to take effect.
- If the performance metrics are still not all being gathered after doing the above instructions, then you may need to run ‘mysql-upgrade.exe’ on the database.
- This is located within the [Entuity Home]/database/bin directory on Entuity servers.
Microsoft SQL:
To monitor the database, a user needs to be configured so that the database can be connected to from an external host with privileges allowing the user to query performance metrics.
- Connect to the Microsoft SQL server using SQL Server Management Studio (SSMS).
- In Object Explorer, right click on the MS SQL server instance that is to be monitored and select properties.
- Open the Security tab and set "Server authentication" to "SQL Server and Windows Authentication mode" followed by clicking OK to save.
- Open the Connections tab and ensure "Allow remote connections to this server" is enabled then click OK to close the window.
- In the Object Explorer pane, expand the Security folder then right-click on the Logins folder.
- Select the New Login... option then click on the SQL authentication option.
- Provide a username in the Login name field, create a password and reenter it into the Confirm password field.
- Uncheck the User must change password at next login option, select master as the Default database, and select English from the default language drop-down menu if it differs from the default.
- Navigate to the Server Roles tab, then select the following:
- ##MS_DatabaseConnector##
- ##MS_DefinitionReader##
- ##MS_PerformanceDefinitionReader##
- ##MS_ServerPerformanceStateReader##
- ##MS_ServerSecurityStateReader##
- ##MS_ServerStateReader##
- public
- Navigate to the User Mapping tab, check msdb, and check the following options under Database role membership.
- SQLAgentReaderRole
- db_datareader
- After configuring the user, click OK to save.
- Open SQL Server Configuration Manager, expand the SQL Server Network Configuration folder on the left and select the Protocols for MSSQLSERVER option.
- Right-click on TCP/IP and select properties.
- Ensure Enabled is set to Yes on the Protocol tab and the IP Addresses tab displays the correct TCP port (the default is 1433).
- Open Windows Defender Firewall and create an inbound rule to allow TCP traffic on the TCP port that was listed in the TCP/IP properties of SQL Server Configuration Manager.
- Complete configuration by restarting the MS SQL Server service so the changes take effect.
Oracle:
To monitor the database, a user needs to be configured so that the database can be connected to from an external host with privileges allowing the user to query the database.
- Connect to the Oracle database with an account that has the CREATE USER system privilege.
- Run the command below supplying the username and password to create a new user for monitoring.
-
Note, if a common user is created the “C##” is required as a prefix before the username.
CREATE USER username IDENTIFIED BY password;
-
- To grant permissions to the new user account, execute one of the following:
-
To grant SELECT access (read-only) to everything, execute the SQL statement below.
GRANT CREATE SESSION, SELECT ANY DICTIONARY, SELECT ANY TABLE, UNDER ANY VIEW, UNLIMITED TABLESPACE to username; -
To grant minimal SELECT permissions, execute the statements below.
GRANT CREATE SESSION to username; GRANT SELECT on sys.dba_data_files to username; GRANT SELECT on sys.dba_temp_files to username; GRANT SELECT on sys.dba_tablespaces to username; GRANT SELECT on sys.dba_free_space to username; GRANT SELECT on sys.dba_indexes to username; GRANT SELECT on sys.v_$datafile to username; GRANT SELECT on sys.v_$instance to username; GRANT SELECT on sys.v_$sysstat to username; GRANT SELECT on sys.gv_$session to username; GRANT SELECT on sys.v_$resource_limit to username; GRANT SELECT on sys.v_$parameter to username; GRANT SELECT on sys.v_$log to username; GRANT SELECT on sys.v_$filestat to username; GRANT SELECT on sys.dba_scheduler_jobs to username; GRANT SELECT on sys.dba_schedular_running_jobs to username; GRANT SELECT on sys.v$version to username; GRANT SELECT on sys.v$sql to username; GRANT SELECT on sys.v$sga to username; GRANT SELECT on sys.v$process to username; GRANT SELECT on sys.v$osstat to username; GRANT SELECT on sys.v$temp_space_header to username;
-
Matrix of Metrics per Monitoring Type:
Please find below the metrics available for each type of monitoring:
| Attributes | MySQL | Oracle | MS SQL |
|---|---|---|---|
| Database Instance | |||
| Database File Path Location | ✓ | ✓ | ✓ |
| Database System Version | ✓ | ✓ | ✓ |
| Database Type | ✓ | ✓ | ✓ |
| Database Version | ✓ | N/A | ✓ |
| Backup Timestamp | ✓ | N/A | ✓ |
| Type of Recovery Model | ✓ | N/A | ✓ |
| Average Query Time | ✓ | ✓ | ✓ |
| Buffer Cache Hit Ratio | ✓ | ✓ | ✓ |
| Connections Active (Count) | ✓ | ✓ | ✓ |
| Connections Attempted (Count) | ✓ | ✓ | ✓ |
| Connection Errors (Count) | ✓ | ✓ | ✓ |
| Connection Errors Rate | ✓ | ✓ | ✓ |
| Connections Max Limit | ✓ | ✓ | ✓ |
| Connections Usage Rate | ✓ | ✓ | ✓ |
| I/O Misc Latency (ms) | ✓ | N/A | ✓ |
| I/O Read Latency (ms) | ✓ | ✓ | ✓ |
| I/O Write Latency (ms) | ✓ | ✓ | ✓ |
| IOPS Misc. | ✓ | N/A | N/A |
| IOPS Read | ✓ | ✓ | ✓ |
| IOPS Write | ✓ | ✓ | ✓ |
| IOPS Total | ✓ | ✓ | ✓ |
| Lock Waits (Count) | ✓ | ✓ | ✓ |
| Lock Contention Rate | ✓ | ✓ | ✓ |
| MBPS Received | ✓ | ✓ | ✓ |
| MBPS Sent | ✓ | ✓ | ✓ |
| MBPS Total | ✓ | ✓ | ✓ |
| Memory Allocated | ✓ | ✓ | ✓ |
| Memory Total | N/A | ✓ | ✓ |
| Memory Used | ✓ | ✓ | ✓ |
| Memory Used % | ✓ | ✓ | ✓ |
| Processor Utilization % | ✓ | ✓ | ✓ |
| Query Delete Latency (ms) | ✓ | ✓ | N/A |
| Query Fetch Latency (ms) | ✓ | ✓ | N/A |
| Query Insert Latency (ms) | ✓ | ✓ | N/A |
| Query Update Latency (ms) | ✓ | ✓ | N/A |
| Query Rate | ✓ | ✓ | ✓ |
| Log Space Remaining | ✓ | ✓ | ✓ |
| Space Remaining | ✓ | ✓ | ✓ |
| Space Remaining % | ✓ | ✓ | ✓ |
| Slow Queries | ✓ | N/A | ✓ |
| Space Total | ✓ | ✓ | ✓ |
| Current Uptime | ✓ | ✓ | ✓ |
| Space Used | ✓ | ✓ | ✓ |
| Space Used % | ✓ | ✓ | ✓ |
| Status | ✓ | ✓ | ✓ |
| Status Detail | ✓ | ✓ | ✓ |
| Schema/Tablespace | |||
| Schema Name | ✓ | ✓ | ✓ |
| Average Query Time | ✓ | N/A | ✓ |
| Buffer Allocated | ✓ | N/A | ✓ |
| Buffer Data | ✓ | N/A | ✓ |
| Buffer Pages | ✓ | N/A | N/A |
| Buffer Pages Cached | ✓ | N/A | ✓ |
| Buffer Pool Free | ✓ | N/A | ✓ |
| Buffer Rows Cached | ✓ | N/A | ✓ |
| Indexes | ✓ | ✓ | ✓ |
| I/O Misc Latency (ms) | ✓ | N/A | ✓ |
| I/O Read Latency (ms) | ✓ | ✓ | ✓ |
| I/O Write Latency (ms) | ✓ | ✓ | ✓ |
| IOPS Misc. | ✓ | N/A | N/A |
| IOPS Read | ✓ | ✓ | ✓ |
| IOPS Write | ✓ | ✓ | ✓ |
| IOPS Total | ✓ | ✓ | ✓ |
| Query Delete Latency (ms) | ✓ | ✓ | N/A |
| Query Fetch Latency (ms) | ✓ | ✓ | N/A |
| Query Insert Latency (ms) | ✓ | ✓ | N/A |
| Query Update Latency (ms) | ✓ | ✓ | N/A |
| Query Rate | ✓ | ✓ | ✓ |
| Total Space Allocated | ✓ | ✓ | ✓ |
| Unused Indexes | ✓ | N/A | ✓ |
| Used Space | ✓ | ✓ | ✓ |
| Used Space % | ✓ | ✓ | ✓ |
| Engine | |||
| Name | ✓ | N/A | ✓ |
| Description | ✓ | N/A | ✓ |
| Jobs | |||
| Host | ✓ | ✓ | ✓ |
| Name | ✓ | ✓ | ✓ |
| Schema | ✓ | N/A | ✓ |
| Type | ✓ | ✓ | ✓ |
| Duration | N/A | ✓ | ✓ |
| Last Executed | ✓ | ✓ | ✓ |
| Status | ✓ | ✓ | ✓ |
Comments
0 comments
Please sign in to leave a comment.