My Oracle Support Banner

Negative Valuues For Metric Average Age Of Messages Per Persistent Queue (Doc ID 3052150.1)

Last updated on FEBRUARY 13, 2025

Applies to:

Oracle Database - Enterprise Edition - Version 19.18.0.0.0 and later
Information in this document applies to any platform.

Symptoms

Negative valuues for Metric Average age of messages per persistent queue


Clarification from below explanation from RDBMS team

For weighted_avg_msg_age : It is negative only in one condition if enqueued_msgs is less than dequeued_msgs and avg_msg_age is also 0. Therefore, SUM (avg_msg_age * (enqueued_msgs - dequeued_msgs)) is +ve and DECODE(SUM(enqueued_msgs - dequeued_msgs), 0, -1, (SUM(enqueued_msgs - dequeued_msgs)) is -ve and there division also comes negative. So if we add a condition like enqueued_msgs must be greater or equals to dequeued_msgs than the above query should work fine.

For first_message_age : It is negative because oldest_msg_enqtm column value is null. Not sure from where oldest_msg_enqtm is getting populated.
Kindly asked DB team about enqueued_msgs, dequeued_msgs, avg_msg_age in GV$PERSISTENT_QUEUES, how it is calculated and why dequeued_msgs is greater than enqueued_msgs if it is expected then why avg_msg_age is coming as 0 for such case.

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.