# Oracle extension metric for Data Guard - NOLOGGING activity

**URL:** <https://community.dynatrace.com/t/oracle-extension-metric-for-data-guard-nologging-activity/46249>\
**Category:** Extensions\
**Tags:** databases, oracle, extensions\
**Created:** [June 21, 2024, 9:24am UTC](https://community.dynatrace.com/t/oracle-extension-metric-for-data-guard-nologging-activity/46249 "2024-06-21T09:24:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mn\_24](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@mn\_24](https://community.dynatrace.com/u/mn_24)\
**Post date:** [June 21, 2024, 9:24am UTC](https://community.dynatrace.com/t/oracle-extension-metric-for-data-guard-nologging-activity/46249/1 "2024-06-21T09:24:09Z")

</div>

Hi,

does anybody know what exactly is the query by which this metric is checked OR to give an idea how to check if it is working in other words to replicate this metric and to see if it is working.

| Metric name | Metric key | Description | Unit |
| --- | --- | --- | --- |
| NOLOGGING activity | com.dynatrace.extension.sql-oracle.dataguard.nologgingActivity | Counts the number of files which contain NOLOGGING activity in the last day. If the count is greater than 0 then the standby database is vulnerable; check the dimensions to find out which files must be refreshed on the standby. | Count |

---

<div class="post-metadata">

**Author:** ![Mike\_L](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mike_l/32/11717_2.png) [@Mike\_L](https://community.dynatrace.com/u/Mike_L)\
**Post date:** [June 21, 2024, 9:42am UTC](https://community.dynatrace.com/t/oracle-extension-metric-for-data-guard-nologging-activity/46249/2 "2024-06-21T09:42:36Z")

</div>

Hi,

This is the query behind it:

```markup
SELECT
              DF.FILE#,
              DF.NAME,
              DF.UNRECOVERABLE_CHANGE#,
              COUNT(*) AS FILE_COUNT
          FROM
              V$DATAFILE DF
          JOIN V$DATABASE DB ON DF.CON_ID = DB.CON_ID
          WHERE
              DB.DATABASE_ROLE = 'PRIMARY' AND
              DF.UNRECOVERABLE_TIME > (SYSDATE - 1)
          GROUP BY
              DF.FILE#,
              DF.NAME,
              DF.UNRECOVERABLE_CHANGE#

```

---

<div class="post-metadata">

**Author:** ![mn\_24](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@mn\_24](https://community.dynatrace.com/u/mn_24)\
**Post date:** [June 21, 2024, 2:59pm UTC](https://community.dynatrace.com/t/oracle-extension-metric-for-data-guard-nologging-activity/46249/3 "2024-06-21T14:59:05Z")

</div>

Hi,

thank you.

I understand that with it you monitor if someone on purpose or not used NOLOGGING transactions and by with you want to identify how many datafiles are reported as unrecoverable.

We’ve tested on Data Guard with PDBs and when the JOIN on CON\_ID is in place the query doesn’t return any data.

It should be edited a little bit for example(BUT add also to check from V$DATABASE if the role is PRIMARY !!):

"

SELECT con\_id,file#,  
name,  
unrecoverable\_time,  
unrecoverable\_change#  
FROM v$datafile where UNRECOVERABLE\_TIME \> (SYSDATE - 1);

"

SQL\> SELECT  
DF.FILE#,  
DF.NAME,  
DF.UNRECOVERABLE\_CHANGE#,  
COUNT(\*) AS FILE\_COUNT  
FROM  
V$DATAFILE DF  
GROUP BY  
DF.FILE#,  
DF.NAME,  
DF.UNRECOVERABLE\_CHANGE#;

FILE# NAME &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UNRECOVERABLE\_CHANGE# FILE\_COUNT  
---------- ------------------------------------------------------------------------------------------------------------------------ --------------------- ----------  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;4 +DATADISK/ORA19C/DATAFILE/undotbs1.312.1171006335 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1  
&nbsp; &nbsp; &nbsp; &nbsp; 12 +DATADISK/ORA19C/1A4C5B290B813B27E065000000000001/DATAFILE/users.332.1171007223 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1  
&nbsp; &nbsp; &nbsp; &nbsp; 13 /u00/app/oracle/product/19.3/dbs/tbs1\_data.dbf &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1  
&nbsp; &nbsp; &nbsp; &nbsp; 14 +DATADISK/ORA19C/DATAFILE/dynafras.590.1172210439 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;5004769 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;5 +DATADISK/ORA19C/86B637B62FE07A65E053F706E80A27CA/DATAFILE/system.323.1171006605 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;9 +DATADISK/ORA19C/1A4C5B290B813B27E065000000000001/DATAFILE/system.329.1171007215 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1  
&nbsp; &nbsp; &nbsp; &nbsp; 10 +DATADISK/ORA19C/1A4C5B290B813B27E065000000000001/DATAFILE/sysaux.330.1171007215 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;7 +DATADISK/ORA19C/DATAFILE/users.313.1171006335 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 4824476 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;8 +DATADISK/ORA19C/86B637B62FE07A65E053F706E80A27CA/DATAFILE/undotbs1.325.1171006605 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1  
&nbsp; &nbsp; &nbsp; &nbsp; 11 +DATADISK/ORA19C/1A4C5B290B813B27E065000000000001/DATAFILE/undotbs1.328.1171007215 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3 +DATADISK/ORA19C/DATAFILE/sysaux.311.1171006309 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1

FILE# NAME &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UNRECOVERABLE\_CHANGE# FILE\_COUNT  
---------- ------------------------------------------------------------------------------------------------------------------------ --------------------- ----------  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1 +DATADISK/ORA19C/DATAFILE/system.310.1171006265 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;6 +DATADISK/ORA19C/86B637B62FE07A65E053F706E80A27CA/DATAFILE/sysaux.324.1171006605 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1

13 rows selected.

SQL\> SELECT  
DF.FILE#,  
DF.NAME,  
DF.UNRECOVERABLE\_CHANGE#,  
COUNT(\*) AS FILE\_COUNT  
FROM  
V$DATAFILE DF  
WHERE DF.UNRECOVERABLE\_TIME \> (SYSDATE - 1)  
GROUP BY  
DF.FILE#,  
DF.NAME,  
DF.UNRECOVERABLE\_CHANGE#;

FILE# NAME &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UNRECOVERABLE\_CHANGE# FILE\_COUNT  
---------- ------------------------------------------------------------------------------------------------------------------------ --------------------- ----------  
&nbsp; &nbsp; &nbsp; &nbsp; 14 +DATADISK/ORA19C/DATAFILE/dynafras.590.1172210439 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;5004769 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;7 +DATADISK/ORA19C/DATAFILE/users.313.1171006335 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 4824476 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1

SQL\> SELECT  
&nbsp; 2 &nbsp;DF.FILE#,  
&nbsp; 3 &nbsp;DF.NAME,  
DF.UNRECOVERABLE\_CHANGE#,  
COUNT(\*) AS FILE\_COUNT  
FROM  
V$DATAFILE DF  
JOIN V$DATABASE DB ON DF.CON\_ID = DB.CON\_ID  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WHERE  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DB.DATABASE\_ROLE = ‘PRIMARY’ AND DF.UNRECOVERABLE\_TIME \> (SYSDATE - 1)&nbsp;  
GROUP BY  
DF.FILE#,  
DF.NAME,  
DF.UNRECOVERABLE\_CHANGE#;

no rows selected

SQL\> SELECT CON\_ID FROM V$DATAFILE ;

CON\_ID  
----------  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3

CON\_ID  
----------  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1

13 rows selected.

SQL\> SELECT CON\_ID FROM V$DATABASE;

CON\_ID  
----------  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0

SQL\> SHOW PDBS

CON\_ID CON\_NAME &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OPEN MODE &nbsp;RESTRICTED  
---------- ------------------------------ ---------- ----------  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2 PDB$SEED &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; READ ONLY &nbsp;NO  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3 PDB1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOUNTED

---

<div class="post-metadata">

**Author:** ![Tom\_sSeroteRoos](https://avatars.discourse-cdn.com/v4/letter/t/bb73d2/32.png) [@Tom\_sSeroteRoos](https://community.dynatrace.com/u/Tom_sSeroteRoos)\
**Post date:** [July 4, 2024, 11:43am UTC](https://community.dynatrace.com/t/oracle-extension-metric-for-data-guard-nologging-activity/46249/4 "2024-07-04T11:43:12Z")

</div>

Hi mn\_24,

You are indeed right, our JOIN isn’t working properly.  
This should be fixed on our next version v2.5.1 coming out soon.

Thank you very much for your feedback, it’s thanks to users like you that we can keep improving our product!

---

<div class="post-metadata">

**Author:** ![Mike\_L](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mike_l/32/11717_2.png) [@Mike\_L](https://community.dynatrace.com/u/Mike_L)\
**Post date:** [July 4, 2024, 1:27pm UTC](https://community.dynatrace.com/t/oracle-extension-metric-for-data-guard-nologging-activity/46249/5 "2024-07-04T13:27:21Z")

</div>

Version 2.5.1 with the fix was just added to the Dynatrace hub:&nbsp;[https://www.dynatrace.com/hub/detail/oracle-database/#release-notes](https://www.dynatrace.com/hub/detail/oracle-database/#release-notes)
