Oracle 视图 V$AQ 官方解释,作用,如何使用详细说明

本站中文解释

$views

Oracle 视图 V$AQ$Views 是一个系统定义的视图,可以帮助开发人员查看队列的信息、状态和可用性等信息。这个视图包含字段包括SCHEMA、NAME、TYPE、ENQUEUED、DEQUEUED、ENQUEUES_ERROR、DEQUEUES_ERROR、BYTES_ENQUEUED和BYTES_DEQUEUED等,可以方便地使用SQL语句获取队列当前的状态和可用性信息。

如何使用Oracle视图V$AQ$Views:

1.首先,使用SQL语句可以查询V$AQ$Views来获取某个模式/用户下队列的可用性信息:

select * from V$AQ$Views where SCHEMA=’(模式/用户)’;

2. 使用SQL语句查询V$AQ$Views来获取某个模式/用户下队列的状态信息:

select * from V$AQ$Views where SCHEMA=’(模式/用户)’ and STATUS=’(状态)’;

3. 如果想要获得某个模式/用户下队列的详细信息,也可以使用SQL语句查询V$AQ$Views来获得包括ENQUEUED、DEQUEUED、ENQUEUES_ERROR、DEQUEUES_ERROR、BYTES_ENQUEUED以及BYTES_DEQUEUED等字段值:

select ENQUEUED,DEQUEUED,ENQUEUES_ERROR,DEQUEUES_ERROR,BYTES_ENQUEUED,BYTES_DEQUEUED from V$AQ$Views where SCHEMA=’(模式/用户)’;

官方英文解释

V$AQ displays statistics for the queues in the database.

Column Datatype Description

QID

NUMBER

Unique queue identifier

WAITING

NUMBER

Number of messages in the queue in the state ‘WAITING

READY

NUMBER

Number of messages in the queue in the state ‘READY

EXPIRED

NUMBER

Number of messages in the queue the state ‘EXPIRED

AVERAGE_MSG_AGE

NUMBER

Average age of the messages in the queue’

TOTAL_WAIT

NUMBER

Total wait time of all ‘READY‘ messages in the queue

AVERAGE_WAIT

NUMBER

Average wait time of ‘READY‘ messages in the queue

CON_ID

NUMBER

The ID of the container to which the data pertains. Possible values include:

  • 0: This value is used for rows containing data that pertain to the entire CDB. This value is also used for rows in non-CDBs.

  • 1: This value is used for rows containing data that pertain to only the root

  • n: Where n is the applicable container ID for the rows containing data

See Also:

Oracle Database Advanced
Queuing User’s Guide
for more information about Oracle Database Advanced Queueing


数据运维技术 » Oracle 视图 V$AQ 官方解释,作用,如何使用详细说明