问题描述
昨天有个朋友在做性能监控时遇到了一个性能问题咨询我是否遇到过? 在所有的数据库实例中只有一个节点查询V$SEGMENT_STATISTICS时几个小时都未出结果, 其实这个问题影响了11.2.0.3 ,11.2.0.4多个版本及平台,而且也是我第二次遇到所以分享出来,希望可以给遇到相同问题的人可以节约时间. 这个问题在MOS上有一个相似的NOTE, 记录查询的是v$segstat view.
专家解答
其实我们可以确认的是 V$SEGMENT_STATISTICS 和V$SEGSTAT 在11G版本中都共同使用了x$ksolsfts
select view_name, view_definition text from v$fixed_View_definition where upper(view_name) like '' SQL> @v v$segstat Show SQL text of views matching "%v$segstat%"... no rows selected VIEW_NAME TEXT ------------------------------ ---------------------------------------------------------------------------------------------------- GV$SEGSTAT select inst_id, fts_tsn, fts_objn, fts_objd, fts_statnam, fts_statid, fts_staval, con_id from x$ksolsfts where fts_inte = 0 V$SEGSTAT select ts#, obj#, dataobj#, statistic_name, statistic#, value, con_id from gv$segstat where inst_id = userenv('instance') SQL> @v V$SEGMENT_STATISTICS Show SQL text of views matching "%V$SEGMENT_STATISTICS%"... -- 输出省略, 11g中也是使用了x$ksolsfts 与其它基表的关连, 在12.2中改写了该VIEW的定义,不过同样也是包含x$ksolsfts, ts$换成了x$kccts.复制
这个问题主要表现查询的view中使用了x$ksolsfts ,而x$ksolsfts 表存在大量的记录及重复记录, 而导致的查询缓慢, 而且在RAC环境中有可能只影响一个节点.
确认方法:
— 正常情况下不存在重复记录
SQL> select statistic# ,count (*) from V$SEGSTAT 2 group by ts#,obj#,dataobj#, statistic# 3 having count (*) > 1; no rows selected复制
— 异常情况时记录数多, 且存在重复记录
SQL> select count(*) from V$SEGSTAT; select count(*) from V$SEGSTAT * ERROR at line 1: ORA-01013: user requested cancel of current operation --因等待时间太久我取消了操作. SQL> select statistic# ,count (*) from V$SEGSTAT where rownum<1e5 2 group by ts#,obj#,dataobj#, statistic# 3 having count (*) > 1 4 ; STATISTIC# COUNT(*) ---------- ---------- 0 2 1 2 2 2 3 2 4 2 5 2 6 2 7 2 8 2 9 2 11 2 12 2 13 2 14 2 15 2 17 2 18 2 20 2 18 rows selected. SQL> select statistic# ,count (*) from V$SEGSTAT where rownum<1e6 2 group by ts#,obj#,dataobj#, statistic# 3 having count (*) > 1; STATISTIC# COUNT(*) ---------- ---------- 0 188 1 188 2 188 3 188 4 188 5 188 ... ... ...复制
解决方法:
1, 应用对应版本中BUG 21050285的补丁
or
2, 重启问题节点的实例可以缓解该问题, 会在启动后重新构造数据.
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
相关阅读
Oracle DataGuard高可用性解决方案详解
孙莹
589次阅读
2025-03-26 23:27:33
Oracle RAC 一键安装翻车?手把手教你如何排错!
Lucifer三思而后行
542次阅读
2025-04-15 17:24:06
【纯干货】Oracle 19C RU 19.27 发布,如何快速升级和安装?
Lucifer三思而后行
456次阅读
2025-04-18 14:18:38
Oracle SQL 执行计划分析与优化指南
Digital Observer
442次阅读
2025-04-01 11:08:44
XTTS跨版本迁移升级方案(11g to 19c RAC for Linux)
zwtian
439次阅读
2025-04-08 09:12:48
【ORACLE】记录一些ORACLE的merge into语句的BUG
DarkAthena
437次阅读
2025-04-22 00:20:37
墨天轮个人数说知识点合集
JiekeXu
436次阅读
2025-04-01 15:56:03
【ORACLE】你以为的真的是你以为的么?--ORA-38104: Columns referenced in the ON Clause cannot be updated
DarkAthena
411次阅读
2025-04-22 00:13:51
Oracle数据库一键巡检并生成HTML结果,免费脚本速来下载!
陈举超
402次阅读
2025-04-20 10:07:02
Oracle 19c RAC更换IP实战,运维必看!
szrsu
390次阅读
2025-04-08 23:57:08
TA的专栏
Java中间件
收录0篇内容
热门文章
一次Connection reset by peer的问题排查
2021-12-07 33979浏览
Java8-Stream: no instance(s) of type variable(s) R exist so that void conforms to R
2021-02-19 32357浏览
nginx: [emerg] "user" directive is not allowed here in /etc/nginx/conf.d/nginx.conf:1
2022-02-15 24275浏览
ORA-00904: "POLTYP": invalid identifier
2019-06-19 12933浏览
PageHelper排坑,处理排序失败: net.sf.jsqlparser.JSQLParserException
2022-05-19 12778浏览