# "ORA-00942: table or view does not exist" for Oracle Metrics in Elastic Agent

**URL:** <https://discuss.elastic.co/t/ora-00942-table-or-view-does-not-exist-for-oracle-metrics-in-elastic-agent/328571>\
**Category:** Elastic Agent\
**Tags:** metricbeat\
**Created:** [March 27, 2023, 5:01am UTC](https://discuss.elastic.co/t/ora-00942-table-or-view-does-not-exist-for-oracle-metrics-in-elastic-agent/328571 "2023-03-27T05:01:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wolfram\_Haussig](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfram_haussig/32/70528_2.png) [@Wolfram\_Haussig](https://discuss.elastic.co/u/Wolfram_Haussig)\
**Post date:** [March 27, 2023, 5:01am UTC](https://discuss.elastic.co/t/ora-00942-table-or-view-does-not-exist-for-oracle-metrics-in-elastic-agent/328571/1 "2023-03-27T05:01:39Z")

</div>

Hello all,

I am using the Elastic Agent with the Oracle integration to monitor the metrics of our Oracle DB. In the logs I find the error `Error fetching data for metricset sql.query: fetch variable mode failed: dpiStmt_execute: ORA-00942: table or view does not exist`.

Unfortunately, the integration documentation does not seem to contain any hints which tables are required, so I used the tables outlined in the [metricbeat documentation](https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-oracle.html):

```auto
SELECT * FROM V$BUFFER_POOL_STATISTICS;
SELECT * FROM v$sesstat;
SELECT * FROM v$statname;
SELECT * FROM v$session;
SELECT * FROM v$sysstat;
SELECT * FROM V$LIBRARYCACHE;
SELECT * FROM V$SYSMETRIC;
SELECT * FROM SYS.DBA_TEMP_FILES;
SELECT * FROM DBA_TEMP_FREE_SPACE;
SELECT * FROM dba_data_files;
SELECT * FROM dba_free_space;

```

All of them are readable with the user used in the Oracle integration but I still get those errors.

Has anyone an idea which table I am missing?

Best regards  
Wolfram

---

<div class="post-metadata">

**Author:** ![Agi\_K\_Thomas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/agi_k_thomas/32/130842_2.png) [@Agi\_K\_Thomas](https://discuss.elastic.co/u/Agi_K_Thomas)\
**Post date:** [March 27, 2023, 7:12am UTC](https://discuss.elastic.co/t/ora-00942-table-or-view-does-not-exist-for-oracle-metrics-in-elastic-agent/328571/2 "2023-03-27T07:12:42Z")

</div>

Please check for V$PGASTAT, v$sgastat, V$LIBRARYCACHE, gv$session s, v$process additionally.

---

<div class="post-metadata">

**Author:** ![Wolfram\_Haussig](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfram_haussig/32/70528_2.png) [@Wolfram\_Haussig](https://discuss.elastic.co/u/Wolfram_Haussig)\
**Post date:** [March 29, 2023, 5:03am UTC](https://discuss.elastic.co/t/ora-00942-table-or-view-does-not-exist-for-oracle-metrics-in-elastic-agent/328571/3 "2023-03-29T05:03:40Z")

</div>

Thank you for you fast response, I requested those additional select privileges and I am able to query them:

```auto
Select * from V$PGASTAT;
Select * from v$sgastat;
Select * from gv$session;
Select * from v$process;
select * from V$LIBRARYCACHE;

```

It seems the amount of errors in the Metricbeat logs are reduced but they still exist:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/9/29703d047feb317e185047fb8252d9407c208517.png)  
At about 2pm (the red line) the privileges were granted.

Unfortunately, even the DEBUG logs do not tell me anything:

```auto
07:00:18.117
elastic_agent.metricbeat
[elastic_agent.metricbeat][debug] PublishEvents: 1 events have been published to elasticsearch in 19.993302ms.
07:00:18.117
elastic_agent.metricbeat
[elastic_agent.metricbeat][debug] ackloop: return ack to broker loop:1
07:00:18.117
elastic_agent.metricbeat
[elastic_agent.metricbeat][debug] ackloop: done send ack
07:00:19.482
elastic_agent.metricbeat
[elastic_agent.metricbeat][error] Error fetching data for metricset sql.query: fetch table mode failed: dpiStmt_execute: ORA-00942: table or view does not exist
07:00:19.501
elastic_agent.metricbeat
[elastic_agent.metricbeat][error] Error fetching data for metricset sql.query: fetch table mode failed: dpiStmt_execute: ORA-00942: table or view does not exist
07:00:20.332
elastic_agent.metricbeat
[elastic_agent.metricbeat][debug] PublishEvents: 39 events have been published to elasticsearch in 33.127564ms.
07:00:20.332
elastic_agent.metricbeat
[elastic_agent.metricbeat][debug] ackloop: return ack to broker loop:39
07:00:20.332
elastic_agent.metricbeat
[elastic_agent.metricbeat][debug] ackloop: done send ack
07:00:21.126
elastic_agent.metricbeat
[elastic_agent.metricbeat][debug] PublishEvents: 2 events have been published to elasticsearch in 35.40392ms.
07:00:21.127
elastic_agent.metricbeat
[elastic_agent.metricbeat][debug] ackloop: return ack to broker loop:2
07:00:21.127
elastic_agent.metricbeat
[elastic_agent.metricbeat][debug] ackloop: done send ack
07:00:21.129
elastic_agent.metricbeat
[elastic_agent.metricbeat][debug] PublishEvents: 2 events have been published to elasticsearch in 27.910826ms.
07:00:21.130
elastic_agent.metricbeat
[elastic_agent.metricbeat][debug] ackloop: return ack to broker loop:2
07:00:21.130
elastic_agent.metricbeat
[elastic_agent.metricbeat][debug] ackloop: done send ack
07:00:22.356
elastic_agent.metricbeat
[elastic_agent.metricbeat][error] Error fetching data for metricset sql.query: fetch table mode failed: dpiStmt_execute: ORA-00942: table or view does not exist
07:00:23.189
elastic_agent.metricbeat
[elastic_agent.metricbeat][debug] PublishEvents: 24 events have been published to elasticsearch in 41.832929ms.

```

---

<div class="post-metadata">

**Author:** ![Agi\_K\_Thomas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/agi_k_thomas/32/130842_2.png) [@Agi\_K\_Thomas](https://discuss.elastic.co/u/Agi_K_Thomas)\
**Post date:** [March 29, 2023, 5:29am UTC](https://discuss.elastic.co/t/ora-00942-table-or-view-does-not-exist-for-oracle-metrics-in-elastic-agent/328571/4 "2023-03-29T05:29:29Z")

</div>

The logs shared above are associated with queries having response\_format: table.

Please verify for the permissions for below tables / views additionally

dba\_data\_files  
dba\_temp\_files  
dba\_free\_space  
dba\_temp\_free\_space  
dba\_jobs  
V$SYSTEM\_WAIT\_CLASS

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 26, 2023, 5:29am UTC](https://discuss.elastic.co/t/ora-00942-table-or-view-does-not-exist-for-oracle-metrics-in-elastic-agent/328571/5 "2023-04-26T05:29:36Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
