It is possible to have some more detailed execution on the Oracle instance (RAC or not).

PostgreSQL is not supported yet for the advanced database monitoring.

This extension connect to database with a readonly user and gathers some statistics that are displayed on the HPA portal.

Prerequisites

This is an extension of the Infrastructure agent, this one must be activated APMIA/Infrastructure Agent.

Oracle monitoring

If you activate the Oracle monitoring, set the following values in {{hpa_agent_dir}}/hpa_agent_config.sh :

```
# For Oracle Monitoring
export HPA_CALYPSO_DATABASE_ENABLED=0
export HPA_CALYPSO_DATABASE_RAC_ENABLED=0
export HPA_CALYPSO_DATABASE_INSTANCE_NAME=CALYPSO
export HPA_CALYPSO_DATABASE_HOST=localhost
export HPA_CALYPSO_DATABASE_PORT=1521
export HPA_CALYPSO_DATABASE_USER=calypso
```
  • if you access Oracle with SID, set HPA_CALYPSO_DATABASE_ENABLED=1
  • if you access Oracle with RAC service name, set HPA_CALYPSO_DATABASE_RAC_ENABLED=1
  • set the others properties

To set the password, run the {{hpa_agent_dir}}/deploy.sh <version> command :

  • either password is copied from the previous configuration
  • otherwise the file and properties to update are displayed > Write password in clear text, once the agent started, it encrypts the password.

Oracle User - Option #1

To monitor Oracle database, ensure that the configured user has the access privileges of all the following database tables:

```
v$... tables
dba_data_files
DBA_TABLESPACE_USAGE_METRICS
```

Oracle User - Option #2

Create a user, here iscope_oracledb represents a user name.

```
CREATE USER iscope_oracledb identified by iscope_oracledb
DEFAULT TABLESPACE users
QUOTA UNLIMITED ON users;
GRANT CONNECT TO iscope_oracledb;

create role iscope_role;
 
grant select, insert on PLAN_TABLE to iscope_role;
grant select on dba_data_files to iscope_role;
grant select on dba_segments to iscope_role;
grant select on dba_tablespace_usage_metrics to iscope_role;
grant create session to iscope_role;
grant iscope_role to iscope_oracledb;
```

For Oracle RAC instance :

```
grant select on gv$statname to iscope_role;
grant select on gv$system_wait_class to iscope_role;
grant select on gv$sql to iscope_role;
grant select on gv$waitclassmetric to iscope_role; 
grant select on gv$db_object_cache to iscope_role;
grant select on gv$filestat to iscope_role;
grant select on gv$instance to iscope_role;
grant select on gv$librarycache to iscope_role;
grant select on gv$lock to iscope_role;
grant select on gv$mystat to iscope_role;
grant select on gv$parameter to iscope_role;
grant select on gv$resource_limit to iscope_role;
grant select on gv$rollstat to iscope_role;
grant select on gv$rowcache to iscope_role;
grant select on gv$session to iscope_role;
grant select on gv$session_wait to iscope_role;
grant select on gv$sesstat to iscope_role;
grant select on gv$sga to iscope_role;
grant select on gv$sql_plan to iscope_role;
grant select on gv$sqlarea to iscope_role;
grant select on gv$sysmetric to iscope_role;
grant select on gv$sysstat to iscope_role;
grant select on gv$system_event to iscope_role;
```

For Oracle NOT RAC instance :

```
grant select on v$statname to iscope_role;
grant select on v$system_wait_class to iscope_role;
grant select on v$sql to iscope_role;
grant select on v$waitclassmetric to iscope_role; 
grant select on v$db_object_cache to iscope_role;
grant select on v$filestat to iscope_role;
grant select on v$instance to iscope_role;
grant select on v$librarycache to iscope_role;
grant select on v$lock to iscope_role;
grant select on v$mystat to iscope_role;
grant select on v$parameter to iscope_role;
grant select on v$resource_limit to iscope_role;
grant select on v$rollstat to iscope_role;
grant select on v$rowcache to iscope_role;
grant select on v$session to iscope_role;
grant select on v$session_wait to iscope_role;
grant select on v$sesstat to iscope_role;
grant select on v$sga to iscope_role;
grant select on v$sql_plan to iscope_role;
grant select on v$sqlarea to iscope_role;
grant select on v$sysmetric to iscope_role;
grant select on v$sysstat to iscope_role;
grant select on v$system_event to iscope_role;
```

Other information

Infrastructure agent log files can be found here : {{hpa_agent_dir}}/apmia/logs