统计信息 STREAMS AQ: WAITING FOR MESSAGES IN THE QUEUE

2024年 6月 18日 63.1k 0

描述:数据库xtts迁移后,通过该命令EXEC DBMS_STATS.gather_database_stats(degree => 16);收集全库的统计信息,执行上之后就没再看,但是到了第二天
发现数据库的相关收集作业还在执行,比较奇怪。
然后,查询了数据库的相关阻塞和阻塞进程的相关event发现了一个比较奇怪的阻塞。streams aq: waiting for messages in the queue
后续手动测试发现只收集一个表的统计信息也是很慢,然后我杀掉了阻塞的会话,不开并行收集,能很快收集完毕。
怀疑碰到了bug
检查mos上的相关bug和文档发现如下资料:

Bug 33764919 - stats collection stuck on 'streams aq: waiting for messages in the queue' (Doc ID 33764919.8)
Concurrent DBMS_STATS Is Hanged By 'Streams AQ: waiting for messages in the queue' (Doc ID 2727024.1)
Bug 32114729 : CONCURRENT DBMS_STATS IS HANGGED BY 'STREAMS AQ: WAITING FOR MESSAGES IN THE QUEUE'
解决办法:
exec dbms_stats.set_global_prefs('CONCURRENT','FALSE');

#######################################################################################################################
Version 19.3.0.0.0 and later

DBMS_STATS is hanged if current_user is changed before executing DBMS_STATS.

ex)
connect /as sysdba
alter session set current_schema=;
BEGIN DBMS_STATS.GATHER_TABLE_STATS(
      ownname => '',
      tabname => '

',
      estimate_percent => '10',
      granularity => 'AUTO',
      cascade => TRUE,
      force => TRUE  );
END; 

 

A preference CONCURRENT is ALL and the concurrent stats is enabled.

SQL> select DBMS_STATS.GET_PREFS('CONCURRENT') from dual;

DBMS_STATS.GET_PREFS('CONCURRENT')
--------------------------------------------------------------------------------
ALL

 

When the issue is occurring, a session is waiting for 'Streams AQ: waiting for messages in the queue'.

WAIT #140497090265352: nam='Streams AQ: waiting for messages in the queue'

Workaround
Disable concurrent stats gathering.

exec dbms_stats.set_global_prefs('CONCURRENT','FALSE')

相关文章

Oracle如何使用授予和撤销权限的语法和示例
Awesome Project: 探索 MatrixOrigin 云原生分布式数据库
下载丨66页PDF,云和恩墨技术通讯(2024年7月刊)
社区版oceanbase安装
Oracle 导出CSV工具-sqluldr2
ETL数据集成丨快速将MySQL数据迁移至Doris数据库

发布评论