master
yaml 563 lines 24.3 KB
Raw
1 plugin_name: go.d.plugin
2 modules:
3 - meta:
4 id: collector-go.d.plugin-oracledb
5 plugin_name: go.d.plugin
6 module_name: oracledb
7 monitored_instance:
8 name: Oracle DB
9 link: https://www.oracle.com/database/
10 categories:
11 - data-collection.databases
12 icon_filename: oracle.svg
13 related_resources:
14 integrations:
15 list: []
16 info_provided_to_referring_integrations:
17 description: ""
18 keywords:
19 - database
20 - oracle
21 - sql
22 overview:
23 multi_instance: true
24 data_collection:
25 metrics_description: |
26 This collector monitors the health and performance of Oracle DB servers and collects general statistics, replication and user metrics.
27 method_description: |
28 It establishes a connection to the Oracle DB instance via a TCP or UNIX socket and extracts metrics from the following database tables:
29
30 - `v$sysmetric`
31 - `v$sysstat`
32 - `v$waitclassmetric`
33 - `v$system_wait_class`
34 - `dba_data_files`
35 - `dba_free_space`
36 - `dba_segments`
37 - `dba_temp_files`
38 - `dba_tablespaces`
39 - `v$temp_space_header`
40
41 It also provides `top-queries` and `running-queries` functions using `V$SQLSTATS` and `V$SESSION`.
42 default_behavior:
43 auto_detection:
44 description: |
45 The collector can automatically detect Oracle DB instances running on:
46
47 - Localhost, listening on port 1521
48 - Within Docker containers
49
50 > **Note**: Oracle DB requires a username and password. While Netdata can automatically discover Oracle DB instances and create data collection jobs, these jobs will fail unless you provide the correct credentials.
51 limits:
52 description: ""
53 performance_impact:
54 description: ""
55 additional_permissions:
56 description: ""
57 supported_platforms:
58 include: []
59 exclude: []
60 setup:
61 prerequisites:
62 list:
63 - title: Create a read only user for netdata
64 description: |
65 Follow the official instructions for your oracle RDBMS to create a read-only user for netdata. The operation may follow this approach
66
67 Connect to your Oracle database with an administrative user and execute:
68
69 ```bash
70 CREATE USER netdata IDENTIFIED BY <PASSWORD>;
71
72 GRANT CONNECT TO netdata;
73 GRANT SELECT_CATALOG_ROLE TO netdata;
74 ```
75
76 The `top-queries` and `running-queries` functions require access to `V$SQLSTATS` and `V$SESSION`.
77 configuration:
78 file:
79 name: go.d/oracledb.conf
80 options:
81 description: |
82 The following options can be defined globally: update_every, autodetection_retry.
83 folding:
84 title: Config options
85 enabled: true
86 list:
87 - name: update_every
88 description: Data collection interval (seconds).
89 default_value: 1
90 required: false
91 group: Collection
92 - name: autodetection_retry
93 description: Autodetection retry interval (seconds). Set 0 to disable.
94 default_value: 0
95 required: false
96 group: Collection
97
98 - name: dsn
99 description: "Oracle server DSN (Data Source Name). Format: `oracle://username:password@host:port/service?param1=value1&...&paramN=valueN`."
100 default_value: ""
101 required: true
102 group: Target
103 - name: timeout
104 description: Query timeout (seconds).
105 default_value: 1
106 required: false
107 group: Target
108 - name: functions.top_queries.disabled
109 description: Disable the [top-queries](#top-queries) function.
110 default_value: false
111 required: false
112 group: Functions
113 - name: functions.top_queries.timeout
114 description: Query timeout (seconds). Uses collector timeout if not set.
115 default_value: ""
116 required: false
117 group: Functions
118 - name: functions.top_queries.limit
119 description: Maximum number of queries to return.
120 default_value: 500
121 required: false
122 group: Functions
123
124 - name: functions.running_queries.disabled
125 description: Disable the [running-queries](#running-queries) function.
126 default_value: false
127 required: false
128 group: Functions
129 - name: functions.running_queries.timeout
130 description: Query timeout (seconds). Uses collector timeout if not set.
131 default_value: ""
132 required: false
133 group: Functions
134 - name: functions.running_queries.limit
135 description: Maximum number of queries to return.
136 default_value: 500
137 required: false
138 group: Functions
139
140 - name: vnode
141 description: Associates this data collection job with a [Virtual Node](https://learn.netdata.cloud/docs/netdata-agent/configuration/organize-systems-metrics-and-alerts#virtual-nodes).
142 default_value: ""
143 required: false
144 group: Virtual Node
145 examples:
146 folding:
147 title: Config
148 enabled: true
149 list:
150 - name: TCP socket
151 description: An example configuration.
152 config: |
153 jobs:
154 - name: local
155 dsn: oracle://netdata:secret@127.0.0.1:1521/XE
156 - name: TLS connection (TCPS)
157 description: An example configuration for TLS connection.
158 config: |
159 jobs:
160 - name: local
161 dsn: 'oracle://netdata:secret@127.0.0.1:1521/XE?ssl=true&ssl verify=true'
162 - name: Multi-instance
163 description: |
164 > **Note**: When you define multiple jobs, their names must be unique.
165
166 Local and remote instances.
167 config: |
168 jobs:
169 - name: local
170 dsn: oracle://netdata:secret@127.0.0.1:1521/XE
171
172 - name: remote
173 dsn: oracle://netdata:secret@203.0.113.0:1521/XE
174 troubleshooting:
175 problems:
176 list: []
177 alerts: []
178 functions:
179 description: |
180 This collector exposes real-time functions for interactive troubleshooting in the Live tab.
181 list:
182 - id: top-queries
183 name: Top Queries
184 description: |
185 Retrieves aggregated SQL statement performance metrics from Oracle [V$SQLSTATS](https://docs.oracle.com/en/database/oracle/oracle-database/19/refrn/V-SQLSTATS.html) view.
186
187 This function queries `V$SQLSTATS` which provides SQL execution statistics aggregated across all cursors for each SQL statement. Statistics include execution counts, timing metrics, I/O operations, and resource consumption.
188
189 Use cases:
190 - Identify slow queries consuming the most total execution time
191 - Find queries with high buffer gets or disk reads for I/O optimization
192 - Analyze CPU-intensive queries for resource tuning
193
194 Query text is truncated at 4096 characters for display purposes.
195 parameters:
196 - id: __sort
197 name: Filter By
198 description: Select the primary sort column. Options include total time, CPU time, executions, buffer gets, disk reads, and more. Defaults to total time to focus on most resource-intensive queries.
199 type: select
200 required: true
201 default: totalTime
202 options: []
203 returns:
204 description: Aggregated SQL statistics from `V$SQLSTATS`. Each row represents a unique SQL statement with cumulative metrics across all executions.
205 columns:
206 - name: SQL ID
207 type: string
208 unit: ""
209 visibility: hidden
210 description: "Unique identifier for the SQL statement in the shared pool. Can be used to find execution plans in `V$SQL_PLAN`."
211 - name: Query
212 type: string
213 unit: ""
214 description: "SQL statement text. Truncated to 4096 characters for display purposes."
215 - name: Schema
216 type: string
217 unit: ""
218 description: "Schema under which the SQL was parsed. Useful for identifying which application or user generated the query."
219 - name: Executions
220 type: integer
221 unit: ""
222 description: "Total number of times this SQL statement has been executed. High values indicate frequently run queries."
223 - name: Total Time
224 type: duration
225 unit: "milliseconds"
226 description: "Cumulative elapsed time across all executions. High values indicate queries consuming significant database resources."
227 - name: Avg Time
228 type: duration
229 unit: "milliseconds"
230 description: "Average elapsed time per execution. Use this to compare typical performance across different SQL statements."
231 - name: CPU Time
232 type: duration
233 unit: "milliseconds"
234 description: "Cumulative CPU time consumed across all executions. Compare with total time to identify I/O-bound vs CPU-bound queries."
235 - name: Buffer Gets
236 type: integer
237 unit: ""
238 description: "Total number of logical reads from the buffer cache. High values relative to rows processed may indicate inefficient queries."
239 - name: Disk Reads
240 type: integer
241 unit: ""
242 description: "Total number of physical reads from disk. High values indicate queries that cannot be satisfied from the buffer cache."
243 - name: Rows Processed
244 type: integer
245 unit: ""
246 description: "Total number of rows processed across all executions. Compare with buffer gets to assess query efficiency."
247 - name: Parse Calls
248 type: integer
249 unit: ""
250 visibility: hidden
251 description: "Number of times the SQL was parsed (hard + soft parses). High values may indicate lack of bind variables."
252 - name: Module
253 type: string
254 unit: ""
255 visibility: hidden
256 description: "Application module name set via `DBMS_APPLICATION_INFO`. Useful for identifying which application component generated the query."
257 - name: Action
258 type: string
259 unit: ""
260 visibility: hidden
261 description: "Application action name set via `DBMS_APPLICATION_INFO`. Provides finer-grained identification within a module."
262 - name: Last Active
263 type: string
264 unit: ""
265 visibility: hidden
266 description: "Timestamp when this SQL statement was last executed. Helps identify recently active vs historical queries."
267 performance: |
268 Queries `V$SQLSTATS` which is a lightweight view optimized for statistics retrieval:<br/>• On busy databases with many SQL statements, the query may take longer<br/>• Default limit of 500 rows balances usefulness with performance
269 security: |
270 Query text may contain unmasked literal values including potentially sensitive data:<br/>• Personal information in WHERE clauses or INSERT values<br/>• Business data and internal identifiers<br/>• Access should be restricted to authorized personnel only
271 prerequisites:
272 list:
273 - title: Grant access to V$SQLSTATS
274 description: |
275 The monitoring user must have SELECT privilege on `V$SQLSTATS` and related views.
276
277 1. Grant the required privileges:
278
279 ```sql
280 -- Note: Use V_$ (with underscore) for GRANT - this is the base fixed view
281 -- Queries use the V$ public synonym
282 GRANT SELECT ON V_$SQLSTATS TO netdata;
283 -- Or grant the broader role:
284 GRANT SELECT_CATALOG_ROLE TO netdata;
285 ```
286
287 2. Verify access:
288
289 ```sql
290 SELECT COUNT(*) FROM V$SQLSTATS WHERE ROWNUM <= 1;
291 ```
292
293 :::info
294
295 - `V$SQLSTATS` is available in Oracle 10g and later
296 - The view aggregates statistics across all child cursors for each SQL statement
297 - Some columns like `MODULE` and `ACTION` require applications to set them via `DBMS_APPLICATION_INFO`
298
299 :::
300 availability: |
301 Available when:<br/>• The collector has successfully connected to Oracle DB<br/>• The user has SELECT privilege on `V$SQLSTATS`<br/>• Returns HTTP 503 if the connection cannot be established<br/>• Returns HTTP 500 if the query fails<br/>• Returns HTTP 504 if the query times out
302 require_cloud: true
303 - id: running-queries
304 name: Running Queries
305 description: |
306 Retrieves currently executing SQL statements from Oracle [V$SESSION](https://docs.oracle.com/en/database/oracle/oracle-database/19/refrn/V-SESSION.html) view.
307
308 This function queries `V$SESSION` joined with `V$SQL` to provide a real-time snapshot of all active user sessions currently executing SQL statements. It shows session details, elapsed time, and the SQL being executed.
309
310 Use cases:
311 - Identify long-running queries that may be blocking other sessions
312 - Monitor active workload and session distribution
313 - Debug stuck or slow queries in real-time
314
315 Query text is truncated at 4096 characters for display purposes.
316 parameters:
317 - id: __sort
318 name: Filter By
319 description: Select the primary sort column. Defaults to elapsed time to show longest-running queries first.
320 type: select
321 required: true
322 default: lastCallMs
323 options: []
324 returns:
325 description: Real-time snapshot of currently executing SQL statements. Each row represents an active user session with its current SQL.
326 columns:
327 - name: Session
328 type: string
329 unit: ""
330 description: "Session identifier in format `SID,SERIAL#`. Can be used with `ALTER SYSTEM KILL SESSION` if needed."
331 - name: User
332 type: string
333 unit: ""
334 description: "Oracle username of the session. Useful for identifying workload by user."
335 - name: Status
336 type: string
337 unit: ""
338 description: "Session status (ACTIVE for currently executing). Only active sessions with SQL are shown."
339 - name: Type
340 type: string
341 unit: ""
342 visibility: hidden
343 description: "Session type (USER or BACKGROUND). This function filters to USER sessions only."
344 - name: SQL ID
345 type: string
346 unit: ""
347 visibility: hidden
348 description: "Identifier of the currently executing SQL. Can be used to find the statement in `V$SQL`."
349 - name: Query
350 type: string
351 unit: ""
352 description: "SQL statement text currently being executed. Truncated to 4096 characters."
353 - name: Elapsed
354 type: duration
355 unit: "milliseconds"
356 description: "Time elapsed since the session's last call started. High values indicate long-running operations that may need investigation."
357 - name: SQL Exec Start
358 type: string
359 unit: ""
360 visibility: hidden
361 description: "Timestamp when the current SQL execution started."
362 - name: Module
363 type: string
364 unit: ""
365 visibility: hidden
366 description: "Application module name set via `DBMS_APPLICATION_INFO`. Identifies which application is running the query."
367 - name: Action
368 type: string
369 unit: ""
370 visibility: hidden
371 description: "Application action name set via `DBMS_APPLICATION_INFO`."
372 - name: Program
373 type: string
374 unit: ""
375 visibility: hidden
376 description: "Client program name that established the session (e.g., sqlplus, JDBC Thin Client)."
377 - name: Machine
378 type: string
379 unit: ""
380 visibility: hidden
381 description: "Client machine name or IP address. Useful for identifying query sources."
382 performance: |
383 Queries `V$SESSION` joined with `V$SQL` for currently active sessions:<br/>• Lightweight operation as it only returns currently active user sessions<br/>• Default limit of 500 rows (rarely reached for running queries)
384 security: |
385 Query text may contain unmasked literal values including potentially sensitive data:<br/>• Personal information in WHERE clauses or INSERT values<br/>• Business data and credentials in query parameters<br/>• Access should be restricted to authorized personnel only
386 prerequisites:
387 list:
388 - title: Grant access to V$SESSION
389 description: |
390 The monitoring user must have SELECT privilege on `V$SESSION` and `V$SQL`.
391
392 1. Grant the required privileges:
393
394 ```sql
395 -- Note: Use V_$ (with underscore) for GRANT - this is the base fixed view
396 -- Queries use the V$ public synonym
397 GRANT SELECT ON V_$SESSION TO netdata;
398 GRANT SELECT ON V_$SQL TO netdata;
399 -- Or grant the broader role:
400 GRANT SELECT_CATALOG_ROLE TO netdata;
401 ```
402
403 2. Verify access:
404
405 ```sql
406 SELECT COUNT(*) FROM V$SESSION WHERE ROWNUM <= 1;
407 ```
408
409 :::info
410
411 - Only USER sessions with ACTIVE status and a current SQL ID are returned
412 - The elapsed time is based on `LAST_CALL_ET` which resets when a new SQL starts
413 - BACKGROUND sessions (Oracle internal processes) are filtered out
414
415 :::
416 availability: |
417 Available when:<br/>• The collector has successfully connected to Oracle DB<br/>• The user has SELECT privilege on `V$SESSION` and `V$SQL`<br/>• Returns HTTP 503 if the connection cannot be established<br/>• Returns HTTP 500 if the query fails<br/>• Returns HTTP 504 if the query times out
418 require_cloud: true
419 metrics:
420 folding:
421 title: Metrics
422 enabled: false
423 description: ""
424 availability: []
425 scopes:
426 - name: global
427 description: These metrics refer to the entire monitored application.
428 labels: []
429 metrics:
430 - name: oracledb.sessions
431 description: Sessions
432 unit: sessions
433 chart_type: line
434 dimensions:
435 - name: session
436 - name: oracledb.average_active_sessions
437 description: Average Active Sessions
438 unit: sessions
439 chart_type: line
440 dimensions:
441 - name: active
442 - name: oracledb.sessions_utilization
443 description: Sessions Limit %
444 unit: percent
445 chart_type: area
446 dimensions:
447 - name: session_limit
448 - name: oracledb.current_logons
449 description: Current Logons
450 unit: logons
451 chart_type: line
452 dimensions:
453 - name: logons
454 - name: oracledb.logons
455 description: Logons
456 unit: logons/s
457 chart_type: line
458 dimensions:
459 - name: logons
460 - name: oracledb.database_wait_time_ratio
461 description: Database Wait Time Ratio
462 unit: percent
463 chart_type: area
464 dimensions:
465 - name: db_wait_time
466 - name: oracledb.sql_service_response_time
467 description: SQL Service Response Time
468 unit: seconds
469 chart_type: line
470 dimensions:
471 - name: sql_resp_time
472 - name: oracledb.enqueue_timeouts
473 description: Enqueue Timeouts
474 unit: timeouts/s
475 chart_type: line
476 dimensions:
477 - name: enqueue
478 - name: oracledb.disk_io
479 description: Disk IO
480 unit: bytes/s
481 chart_type: area
482 dimensions:
483 - name: read
484 - name: written
485 - name: oracledb.disk_iops
486 description: Disk IOPS
487 unit: operations/s
488 chart_type: line
489 dimensions:
490 - name: read
491 - name: write
492 - name: oracledb.sorts
493 description: Sorts
494 unit: sorts/s
495 chart_type: line
496 dimensions:
497 - name: memory
498 - name: disk
499 - name: oracledb.table_scans
500 description: Table Scans
501 unit: scans/s
502 chart_type: line
503 dimensions:
504 - name: short_table
505 - name: long_table
506 - name: oracledb.cache_hit_ratio
507 description: Cache Hit Ratio
508 unit: percent
509 chart_type: line
510 dimensions:
511 - name: buffer
512 - name: cursor
513 - name: library
514 - name: row
515 - name: oracledb.global_cache_blocks
516 description: Global Cache Blocks
517 unit: blocks/s
518 chart_type: line
519 dimensions:
520 - name: corrupted
521 - name: lost
522 - name: oracledb.activity
523 description: Activities
524 unit: events/s
525 chart_type: line
526 dimensions:
527 - name: parse
528 - name: execute
529 - name: user_commits
530 - name: user_rollbacks
531 - name: tablespace
532 description: These metrics refer to the Tablespace.
533 labels:
534 - name: tablespace
535 description: Tablespace name.
536 - name: autoextend_status
537 description: Autoextend status (enabled, disabled, mixed).
538 metrics:
539 - name: oracledb.tablespace_utilization
540 description: Tablespace Utilization
541 unit: percent
542 chart_type: area
543 dimensions:
544 - name: utilization
545 - name: oracledb.tablespace_usage
546 description: Tablespace Usage
547 unit: bytes
548 chart_type: stacked
549 dimensions:
550 - name: avail
551 - name: used
552 - name: wait class
553 description: These metrics refer to the [Wait Class](https://docs.oracle.com/en/database/oracle/oracle-database/19/refrn/classes-of-wait-events.html).
554 labels:
555 - name: wait_class
556 description: '[Wait Class name](https://docs.oracle.com/en/database/oracle/oracle-database/19/refrn/classes-of-wait-events.html).'
557 metrics:
558 - name: oracledb.wait_class_wait_time
559 description: Wait Class Wait Time
560 unit: milliseconds
561 chart_type: line
562 dimensions:
563 - name: wait_time