Get comprehensive insights into your Oracle Container Database (CDB) performance with database monitoring, query analysis, and system health metrics using the New Relic Distribution of OpenTelemetry (NRDOT) collector. All Pluggable Databases (PDBs) under the configured CDB are monitored.
Guided installation
To install through the New Relic UI instead, go to one.newrelic.com > Integrations & Agents > Oracle (OpenTelemetry) . This page covers manual installation only.
Prerequisites
Before you begin, ensure you have the following:
- A valid New Relic license key
- Supported architecture: Linux with AMD64 and ARM64
- Network connectivity to New Relic OTLP endpoint
- Oracle Database
19cor later
Install NRDOT Collector
Select the appropriate installation distribution method for your Linux environment:
Configure database user
Create a monitoring user with necessary privileges for your multitenant Oracle Database. This requires creating a common user with the C## prefix.
To set your current active container context to
CDB$ROOT, execute the following statement as aSYSuser:ALTER SESSION SET CONTAINER = CDB$ROOT;For multitenant databases:
Log in to the root database as an administrator.
To create a new user, run the following
CREATE USERstatement:CREATE USER c##<YOUR_DB_USERNAME> IDENTIFIED BY "<YOUR_DB_PASSWORD>" CONTAINER=ALL;GRANT CREATE SESSION TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;Dica
The newly created user'll be a common user with the
C##prefix. TheC##prefix is required for common users by Oracle.
To allow the monitoring user to see every PDB's rows in container-data views, run the following statement as
SYSDBAon the CDB root. This is required for per-PDB metrics and events.ALTER USER c##<YOUR_DB_USERNAME> SET CONTAINER_DATA=ALL CONTAINER=CURRENT;Dica
Ensure your
USER_PASSWORDmeets Oracle new user password requirements.
Grant monitoring privileges for multitenant database
Run the following GRANT statements as SYSDBA on the CDB root. These cover instance detection, metrics collection, per-PDB monitoring, and events collection. You can execute them together as a single script or run each statement individually.
GRANT SELECT ON V_$INSTANCE TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON V_$DATABASE TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON V_$CONTAINERS TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON V_$DATAFILE TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON V_$SYSSTAT TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON V_$CON_SYSSTAT TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON V_$SYSMETRIC TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON V_$CON_SYSMETRIC TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON V_$SESSION TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON V_$RESOURCE_LIMIT TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON V_$OSSTAT TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON V_$SGAINFO TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON V_$ROWCACHE TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON V_$PARAMETER TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON CDB_TABLESPACE_USAGE_METRICS TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON CDB_TABLESPACES TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON DBA_DATA_FILES TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON DBA_FREE_SPACE TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON DBA_RECYCLEBIN TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON V_$SQL TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON V_$SQL_PLAN_STATISTICS_ALL TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON V_$LOCK TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON V_$SESSION_EVENT TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON DBA_PROCEDURES TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON DBA_OBJECTS TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON V_$PDBS TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON CDB_SERVICES TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON CDB_DATA_FILES TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON CDB_PROCEDURES TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON CDB_OBJECTS TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON V_$ASM_DISKGROUP_STAT TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;GRANT SELECT ON V_$ASM_DISK_STAT TO c##<YOUR_DB_USERNAME> CONTAINER=ALL;Dica
The V_$ASM_DISKGROUP_STAT and V_$ASM_DISK_STAT grants are only required if you want to collect ASM diskgroup and disk metrics.
Configure NRDOT Collector
Configure the NRDOT Collector with your CDB-specific settings.
Create the configuration file. The filename must be
oracle-config.yaml.bash$sudo nano /etc/nrdot-collector/oracle-config.yamlAdd the configuration content below to the
oracle-config.yamlfile you created in the previous step.full configuration
This configuration captures essential baseline metrics. To see the complete metric catalog, refer to the configuration reference.
oracle-config.yaml1receivers:2nroracledb:3endpoint: oracle.example.com:15214username: C##newrelic5password: YOUR_PASSWORD6service: YOUR_CDB_SERVICE_NAME7collection_interval: 15s8events:9db.server.query_sample:10enabled: true11db.server.top_query:12enabled: true13db.server.session.wait_sample:14enabled: true15db.server.top_procedure:16enabled: true17db.server.query_plan:18enabled: true1920top_query_collection:21max_query_sample_count: 100022top_query_count: 20023collection_interval: 60s24allowed_comment_keys:25- nr_service_guid2627query_sample_collection:28max_rows_per_query: 10029allowed_comment_keys:30- nr_service_guid3132session_wait_event_collection:33max_rows_per_query: 1003435top_procedure_collection:36max_procedure_sample_count: 100037top_procedure_count: 25038collection_interval: 60s3940# Metrics configuration - This baseline configuration captures essential metrics. To enable advanced monitoring and extended telemetry, refer to the full configuration documentation41metrics:42oracledb.buffer_cache.utilization:43enabled: true44attributes:45- oracle.db.pdb46oracledb.consistent_gets:47enabled: true48attributes:49- oracle.db.pdb50oracledb.cpu_time:51enabled: true52attributes:53- oracle.db.pdb54oracledb.database.cpu.utilization:55enabled: true56attributes:57- oracle.db.pdb58oracledb.database.wait.utilization:59enabled: true60attributes:61- oracle.db.pdb62oracledb.db_block_gets:63enabled: true64attributes:65- oracle.db.pdb66oracledb.enqueue_deadlocks:67enabled: true68attributes:69- oracle.db.pdb70oracledb.execution.utilization:71enabled: true72attributes:73- oracledb.parse.type74- oracle.db.pdb75oracledb.executions:76enabled: true77attributes:78- oracle.db.pdb79oracledb.hard_parses:80enabled: true81attributes:82- oracle.db.pdb83oracledb.host.cpu.utilization:84enabled: true85attributes:86- oracle.db.pdb87oracledb.library_cache.utilization:88enabled: true89attributes:90- oracle.db.pdb91oracledb.logical_reads:92enabled: true93attributes:94- oracle.db.pdb95oracledb.logons:96enabled: true97attributes:98- oracle.db.pdb99oracledb.parse.rate:100enabled: true101attributes:102- oracledb.parse.result103- oracle.db.pdb104oracledb.parse_calls:105enabled: true106attributes:107- oracle.db.pdb108oracledb.pga_memory:109enabled: true110attributes:111- oracle.db.pdb112oracledb.physical_io.requests:113enabled: true114attributes:115- disk.io.direction116- disk.io.block_size117- oracle.db.pdb118oracledb.physical_reads:119enabled: true120attributes:121- oracle.db.pdb122oracledb.physical_writes:123enabled: true124attributes:125- oracle.db.pdb126oracledb.processes.usage:127enabled: true128oracledb.sessions.usage:129enabled: true130attributes:131- session_type132- session_status133- oracle.db.pdb134oracledb.sga.usage:135enabled: true136attributes:137- oracledb.sga.component.name138oracledb.shared_pool.utilization:139enabled: true140attributes:141- oracle.db.pdb142oracledb.sql_service.response.duration:143enabled: true144attributes:145- oracle.db.pdb146oracledb.sqlnet.io.transferred:147enabled: true148attributes:149- network.io.direction150- destination.type151- oracle.db.pdb152oracledb.tablespace_size.usage:153enabled: true154attributes:155- tablespace_name156- oracle.db.pdb157oracledb.transactions.usage:158enabled: true159oracledb.user_commits:160enabled: true161attributes:162- oracle.db.pdb163oracledb.user_rollbacks:164enabled: true165attributes:166- oracle.db.pdb167168# Resource attributes attached to all metrics/logs (all enabled by default)169resource_attributes:170oracle.db.edition:171enabled: true172exporters:173otlp/newrelic:174endpoint: https://otlp.nr-data.net:4318175headers:176api-key: YOUR_LICENSE_KEY177compression: gzip178retry_on_failure:179enabled: true180initial_interval: 5s181max_interval: 30s182max_elapsed_time: 300s183sending_queue:184enabled: true185sizer: bytes186queue_size: 100_000_000187num_consumers: 10188batch:189sizer: bytes190max_size: 1_000_000191min_size: 0192flush_timeout: 5s193service:194pipelines:195metrics/oracledb:196receivers: [nroracledb]197exporters: [otlp/newrelic]198logs/oracledb:199receivers: [nroracledb]200exporters: [otlp/newrelic]Under the Events section, enable these event types to collect their metrics:
Event
Description
db.server.query_samplePer-session active query samples capturing current SQL, wait state, and blocking details.
db.server.top_queryTop N SQL statements by CPU or elapsed time, including execution stats and query plans.
db.server.session.wait_samplePer-session cumulative wait counts and durations from
v$session_event.db.server.top_procedureTop N stored procedures ranked by resource usage, including execution stats.
db.server.query_planExecution plan details for top and sampled queries.
Configure the collection settings for each event type:
Configuration section
Parameter
Value
top_query_collectionmax_query_sample_count1000
top_query_collectiontop_query_count200
top_query_collectioncollection_interval60s
query_sample_collectionmax_rows_per_query100
session_wait_event_collectionmax_rows_per_query100
top_procedure_collectionmax_procedure_sample_count1000
top_procedure_collectiontop_procedure_count250
top_procedure_collectioncollection_interval60s
Dica
For more detailed information about New Relic OTLP endpoint configuration and OpenTelemetry best practices, refer to the OpenTelemetry OTLP documentation.
Update NRDOT Collector configuration
Update the NRDOT Collector configuration to use your oracle-config.yaml file:
$sudo sed -i 's|OTELCOL_OPTIONS="--config=/etc/nrdot-collector/config.yaml"|OTELCOL_OPTIONS="--config=/etc/nrdot-collector/oracle-config.yaml"|' /etc/nrdot-collector/nrdot-collector.confDica
You can also:
- Configure multiple receivers: To monitor multiple Oracle Database instances from one collector.
- Configure SQL Query Receiver: To collect custom metrics from your Oracle Database.
- Link your Oracle Database with APM: To correlate your application performance with database operations. This allows you to see exactly which applications are generating specific database workloads.
- Set up secret management: To securely manage sensitive information, such as database credentials. This helps to enhance the security of your monitoring setup by avoiding hardcoding sensitive data in configuration files.
Restart NRDOT Collector
After updating your configuration, restart the NRDOT Collector:
$sudo systemctl restart nrdot-collector.service$sudo systemctl status nrdot-collector.serviceDica
Always restart the NRDOT Collector after making configuration changes so the new settings take effect.
Find and use your data
Once your data is being collected, you can access comprehensive Oracle Database monitoring through the New Relic UI.
To find your Oracle Database entity in New Relic:
- Go to https://one.newrelic.com > All Capabilities > Databases.
- Set the search criteria as
instrumentation.provider = opentelemetry. - Select your Oracle Database from the list of entities.
Related articles
Troubleshooting
Learn how to troubleshoot your Oracle CDB monitoring setup in New Relic.
Metrics reference
Learn about the available metrics collected by the NRDOT Collector.
RDS instrumentation
Learn how to set up your Oracle Database for RDS monitoring in New Relic.
Docker install
Learn how to run the NRDOT Collector as a sibling container to an Oracle Database instance already running in Docker.