研发妹子说如果问题不解决她就给我一口大黑锅:记Oracle库SQL执行超时导致业务无法测试优化处理记录

news2025/1/10 3:52:04

备注:本次记录根据后期回顾整理,实际测试过程遇到问题较多,也花费了不少时间,后期整理也有些处理过程被遗漏。

一、问题现象及处理过程

研发中心开发部一同事反馈某Oracle 测试库 10.xxx.xxx.xxx 无法访问,业务无法测试,让我协助帮忙处理下。

尝试登陆该服务器失败,但可以ping通该服务器,于是让系统组同事帮忙通过控制台登陆该服务器看下什么问题,被告知无法进入服务器,报内核错误,于是强制重启。

服务器重启一段时间后,可以正常登陆服务器,数据库已被自动拉起。

告知研发同事进行测试,被告知应用连接超时。
观察数据库日志,发现大量如下报错:

image.png

由于ORA-609,导致ospid(xxxx)进程被aborting了,同时由于TNS-12537报错,最终导致应用连接被关闭。

ORA-609错误原因是因为无法与进入的连接进行联系,所以无法将此连接转入监听器,所以数据库的process中止此进程,因此服务器进程被终止关闭

根据报错信息,在网上及MOS上搜索了下相关信息,并根据相关信息,在Oracle用户$ORACLE_HOME/network/admin下创建sqlnet.ora,并配置

sqlnet.expire_time=10
SQLNET.INBOUND_CONNECT_TIMEOUT=180
DIAG_ADR_ENABLED = OFF

让研发同事连接测试,结果应用连接后,很快超时,数据库负载压力突增,就连编辑文件都会被夯住。

根据报错,又反复调整了几个参数值,应用测试还是超时。

另外观察到ASM日志里保留大量如下错误:

image.png

根据资料显示 WARNING: Waited 139 secs for write IO to PST disk 0 in group 1 这种报错大意为PST通信链路在访问磁盘组中的磁盘时候等待了XXX秒,而且触发了持续的等待。超时等待会在频率触发的基础上递增每次的等待时间。

出现这种状况的原因一般与操作系统网络通信链路,数据库主机磁盘或者超时参数的设置有关。

并根据建议将_asm_hbeatiowait值进行了调整:alter system set “_asm_hbeatiowait”=120 scope=spfile;

并重启了ASM实例,重启完后,依然应用报连接超时。

此时观察到系统日志/var/log/messages里有报如下信息:

image.png

根据 “echo 0 > /proc/sys/kernel/hung_task_timeout_secs” disables this message 查询了相关资料,对此的解释是:

默认情况下, Linux会最多使用40%的可用内存作为文件系统缓存。当超过这个阈值后,文件系统会把将缓存中的内存全部写入磁盘, 导致后续的IO请求都是同步的。

将缓存写入磁盘时,有一个默认120秒的超时时间。出现上面的问题的原因是IO子系统的处理速度不够快,不能在120秒将缓存中的数据全部写入磁盘。IO系统响应缓慢,导致越来越多的请求堆积,最终系统内存全部被占用,导致系统失去响应。

对此的建议修改是:

sysctl -w vm.dirty_ratio=10
sysctl -w vm.dirty_background_ratio=5
sysctl -p
如果系统永久生效,修改/etc/sysctl.conf文件。加入如下两行
vm.dirty_background_ratio = 5
vm.dirty_ratio = 10

重启了数据库和操作系统。

此时也到了周末,期待着经过周末,该问题能否自动修复。

但很遗憾,周一早上观察,依然报连接超时。

研发的同事反馈,部分SQL可以正常查询,但几个关键SQL查询很慢,超过了应用设置的超时时间,其中如下这个SQL要求在3毫米内查出。


select * from (
select q.*,rownum rnum from (
select *
  from (select *
          from (select inxxxx_xxxxx id,
                       d.*,
                       case
                         when quo_num > 0 then
                          '1'
                         when gxxxx_xxxx = '1' then
                          '4'
                         when left_day <= 0 then
                          '3'
                         else
                          '3'
                       end quxxxxx_xxxx,
                       row_number() over(partition by inxxxx_xxxxx order by source_flag asc,quotation_id desc) rn
                  from (select m.com_name coxxxxxxxx,
                               m.com_id,
                               i.info_title,
                               i.inxxxx_xxxxx,
                               (select count(ip.inqxxxx_pxxxx_xxxx) from inxxxx_xxxxx_info ip where ip.relation_id = i.inxxxx_xxxxx and ip.relation_type = '1' and ip.delete_flag = '1') inquiry_prod_num,
                               (select ip.purchase_unit_text from inxxxx_xxxxx_info ip where ip.relation_id = i.inxxxx_xxxxx and ip.relation_type = '1' and ip.delete_flag = '1' and rownum=1) inquiry_prod_unit,
                               (select sum(ip.purxxxx_xxxxx) from inxxxx_xxxxx_info ip where ip.relation_id = i.inxxxx_xxxxx and ip.relation_type = '1' and ip.delete_flag = '1') inquiry_prod_quantity,
                               i.mexxxxx_xxxxx,
                               (select com_id from core_comxxxx_xxx_xxxxx_xxxx where xxxxx_mexxxxx_xxxxx = i.mexxxxx_xxxxx and rownum<=1) xxxxxx_com_id,
                               (select mm.MEMBER_TYPE
                                  from xxxxx.CORE_MEMXXXX_XXXXX mm
                                 where mm.mexxxxx_xxxxx = i.mexxxxx_xxxxx) member_type,
                               (select l.logon_xxxxx_xxxxx from xxxxx.core_xxxxxx_inxxxx l where l.mexxxxx_xxxxx=i.mexxxxx_xxxxx and l.user_role='0' and rownum<=1) logon_xxxxx_xxxxx,
                               i.delivery_province,
                               i.delivery_city,
                               i.xxxxxx_time,
                               i.added_time added_xxxx_inqxxxx,
                               trunc(i.xxxxxx_time) - trunc(sysdate) + 1 left_day,
                               f_get_big_buyer_flag(i.mexxxxx_xxxxx) big_flag,
                               f_get_xxxx_cert_xxxxx(i.mexxxxx_xxxxx) cert_status,
                               q.invite_read_flag read_flag,
                               q.gxxxx_xxxx,
                               '1' source_flag,
                               q.quotation_id quotation_id,
                               (select count(1)
                                  from quoxxxx_info q
                                 where q.relation_id = i.inxxxx_xxxxx
                                   and q.relation_type = '1'
                                   and q.quotation_flag = '1'
                                   and q.mexxxxx_xxxxx = 21484xxxxx) quo_num,
                               (select max(q.added_time)
                                  from quoxxxx_info q
                                 where q.relation_id = i.inxxxx_xxxxx
                                   and q.relation_type = '1'
                                   and q.quotation_flag = '1') added_time_order,
                               '0' selection
                          from inqxxxx_xxxxx       i,
                               quoxxxx_info     q,
                               core_comxxxx_mxxxxx m
                         where i.business_flag = '1'
                           and i.sensetive_flag = '0'
                           and i.confirm_status in ('0', '3')
                           and m.mexxxxx_xxxxx = i.mexxxxx_xxxxx
                           and m.com_status in ('1', '3')
                           and q.relation_type = '1'
                           and i.inxxxx_xxxxx = q.relation_id
                           and q.mexxxxx_xxxxx = 21484xxxxx
                           and q.invite_email is not null
                        union all
                        select m.com_name coxxxxxxxx,
                               m.com_id,
                               i.info_title,
                               i.inxxxx_xxxxx,
                               (select count(ip.inqxxxx_pxxxx_xxxx) from inxxxx_xxxxx_info ip where ip.relation_id = i.inxxxx_xxxxx and ip.relation_type = '1' and ip.delete_flag = '1') inquiry_prod_num,
                               (select ip.purchase_unit_text from inxxxx_xxxxx_info ip where ip.relation_id = i.inxxxx_xxxxx and ip.relation_type = '1' and ip.delete_flag = '1' and rownum=1) inquiry_prod_unit,
                               (select sum(ip.purxxxx_xxxxx) from inxxxx_xxxxx_info ip where ip.relation_id = i.inxxxx_xxxxx and ip.relation_type = '1' and ip.delete_flag = '1') inquiry_prod_quantity,
                               i.mexxxxx_xxxxx,
                               (select com_id from core_comxxxx_xxx_xxxxx_xxxx where xxxxx_mexxxxx_xxxxx = i.mexxxxx_xxxxx and rownum<=1) xxxxxx_com_id,
                               (select mm.MEMBER_TYPE
                                  from xxxxx.CORE_MEMXXXX_XXXXX mm
                                 where mm.mexxxxx_xxxxx = i.mexxxxx_xxxxx) member_type,
                               (select l.logon_xxxxx_xxxxx from xxxxx.core_xxxxxx_inxxxx l where l.mexxxxx_xxxxx=i.mexxxxx_xxxxx and l.user_role='0' and rownum<=1) logon_xxxxx_xxxxx,
                               i.delivery_province,
                               i.delivery_city,
                               i.xxxxxx_time,
                               i.added_time added_xxxx_inqxxxx,
                               trunc(i.xxxxxx_time) - trunc(sysdate) + 1 left_day,
                               f_get_big_buyer_flag(i.mexxxxx_xxxxx) big_flag,
                               f_get_xxxx_cert_xxxxx(i.mexxxxx_xxxxx) cert_status,
                               q.invite_read_flag read_flag,
                               q.gxxxx_xxxx,
                               '1' source_flag,
                               q.quotation_id quotation_id,
                               (select count(1)
                                  from quoxxxx_info q
                                 where q.relation_id = i.inxxxx_xxxxx
                                   and q.relation_type = '1'
                                   and q.quotation_flag = '1'
                                   and q.mexxxxx_xxxxx = 21484xxxxx) quo_num,
                               (select max(q.added_time)
                                  from quoxxxx_info q
                                 where q.relation_id = i.inxxxx_xxxxx
                                   and q.relation_type = '1'
                                   and q.quotation_flag = '1') added_time_order,
                               '0' selection
                          from inqxxxx_xxxxx           i,
                               quoxxxx_info         q,
                               core_product_cn_search p,
                               core_comxxxx_mxxxxx     m
                         where i.business_flag = '1'
                           and i.sensetive_flag = '0'
                           and i.confirm_status in ('0', '3')
                           and m.mexxxxx_xxxxx = i.mexxxxx_xxxxx
                           and m.com_status in ('1', '3')
                           and q.relation_type = '1'
                           and i.inxxxx_xxxxx = q.relation_id
                           and i.xxxxxx_prod_id = p.prod_id
                           and q.mexxxxx_xxxxx = 21484xxxxx
                           and q.xxxxxx_com_id is not null
                        union all
                        select i.coxxxxxxxx,
                               i.com_id,
                               i.info_title,
                               i.inxxxx_xxxxx,
                               (select count(ip.inqxxxx_pxxxx_xxxx) from inxxxx_xxxxx_info ip where ip.relation_id = i.inxxxx_xxxxx and ip.relation_type = '1' and ip.delete_flag = '1') inquiry_prod_num,
                               (select ip.purchase_unit_text from inxxxx_xxxxx_info ip where ip.relation_id = i.inxxxx_xxxxx and ip.relation_type = '1' and ip.delete_flag = '1' and rownum=1) inquiry_prod_unit,
                               (select sum(ip.purxxxx_xxxxx) from inxxxx_xxxxx_info ip where ip.relation_id = i.inxxxx_xxxxx and ip.relation_type = '1' and ip.delete_flag = '1') inquiry_prod_quantity,
                               i.mexxxxx_xxxxx,
                               (select com_id from core_comxxxx_xxx_xxxxx_xxxx where xxxxx_mexxxxx_xxxxx = i.mexxxxx_xxxxx and rownum<=1) xxxxxx_com_id,
                               (select mm.MEMBER_TYPE
                                  from xxxxx.CORE_MEMXXXX_XXXXX mm
                                 where mm.mexxxxx_xxxxx = i.mexxxxx_xxxxx) member_type,
                               (select l.logon_xxxxx_xxxxx from xxxxx.core_xxxxxx_inxxxx l where l.mexxxxx_xxxxx=i.mexxxxx_xxxxx and l.user_role='0' and rownum<=1) logon_xxxxx_xxxxx,
                               i.delivery_province,
                               i.delivery_city,
                               i.xxxxxx_time,
                               i.added_time added_xxxx_inqxxxx,
                               trunc(i.xxxxxx_time) - trunc(sysdate) + 1 left_day,
                               f_get_big_buyer_flag(i.mexxxxx_xxxxx) big_flag,
                               f_get_xxxx_cert_xxxxx(i.mexxxxx_xxxxx) cert_status,
                               i.readFlag read_flag,
                               i.gxxxx_xxxx,
                               '2' source_flag,
                               i.quotation_id quotation_id,
                               (select count(1)
                                  from quoxxxx_info q
                                 where q.relation_id = i.inxxxx_xxxxx
                                   and q.relation_type = '1'
                                   and q.quotation_flag = '1'
                                   and q.mexxxxx_xxxxx = 21484xxxxx) quo_num,
                               nvl((select max(q.added_time)
                                     from quoxxxx_info q
                                    where q.relation_id = i.inxxxx_xxxxx
                                      and q.relation_type = '1'
                                      and q.quotation_flag = '1'),
                                   i.s_added_time) added_time_order,
                               i.selection
                          from (select row_number() over(partition by s.match_xxxxx_xxxxxx order by s.added_time asc) rn,
                                       s.gxxxx_xxxx,
                                       s.added_time s_added_time,
                                       s.read_flxxx_xxxx readFlag,
                                       s.match_id quotation_id,
                                       m.com_id,
                                       m.com_name coxxxxxxxx,
                                       s.selection,
                                       q.*
                                  from xxxxx.systxxx_xxxx_xxxx         s,
                                       xxxxx.inqxxxx_xxxxx              q,
                                       xxxxx.core_comxxxx_mxxxxx        m,
                                       xxxxx.core_comxxxx_xxx_xxxxx_xxxx k
                                 where s.match_xxxxx_xxxxxx = q.inxxxx_xxxxx
                                   and s.xxxxxx_com_id = k.com_id
                                   and s.relation_type in ('3', '4', '5')
                                   and s.delete_flag = '1'
                                   and q.business_flag = '1'
                                   and q.sensetive_flag = '0'
                                   and q.CONFIRM_STATUS in ('0', '3')
                                   and m.mexxxxx_xxxxx = s.mexxxxx_xxxxx
                                   and m.com_status in ('1', '3')
                                   and k.xxxxx_mexxxxx_xxxxx = 21484xxxxx) i
                        union all
                        select i.coxxxxxxxx,
                               i.com_id,
                               i.info_title,
                               i.inxxxx_xxxxx,
                 (select count(ip.inqxxxx_pxxxx_xxxx) from inxxxx_xxxxx_info ip where ip.relation_id = i.inxxxx_xxxxx and ip.relation_type = '1' and ip.delete_flag = '1') inquiry_prod_num,
                 (select ip.purchase_unit_text from inxxxx_xxxxx_info ip where ip.relation_id = i.inxxxx_xxxxx and ip.relation_type = '1' and ip.delete_flag = '1' and rownum=1) inquiry_prod_unit,
                 (select sum(ip.purxxxx_xxxxx) from inxxxx_xxxxx_info ip where ip.relation_id = i.inxxxx_xxxxx and ip.relation_type = '1' and ip.delete_flag = '1') inquiry_prod_quantity,
                               i.mexxxxx_xxxxx,
                               (select com_id from core_comxxxx_xxx_xxxxx_xxxx where xxxxx_mexxxxx_xxxxx = i.mexxxxx_xxxxx and rownum<=1) xxxxxx_com_id,
                               (select mm.MEMBER_TYPE
                                  from xxxxx.CORE_MEMXXXX_XXXXX mm
                                 where mm.mexxxxx_xxxxx = i.mexxxxx_xxxxx) member_type,
                               (select l.logon_xxxxx_xxxxx from xxxxx.core_xxxxxx_inxxxx l where l.mexxxxx_xxxxx=i.mexxxxx_xxxxx and l.user_role='0' and rownum<=1) logon_xxxxx_xxxxx,
                               i.delivery_province,
                               i.delivery_city,
                               i.xxxxxx_time,
                               i.added_time added_xxxx_inqxxxx,
                               trunc(i.xxxxxx_time) - trunc(sysdate) + 1 left_day,
                               f_get_big_buyer_flag(i.mexxxxx_xxxxx) big_flag,
                               f_get_xxxx_cert_xxxxx(i.mexxxxx_xxxxx) cert_status,
                               i.readFlag read_flag,
                               i.gxxxx_xxxx,
                               '3' source_flag,
                               i.quotation_id quotation_id,
                               (select count(1)
                                  from quoxxxx_info q
                                 where q.relation_id = i.inxxxx_xxxxx
                                   and q.relation_type = '1'
                                   and q.quotation_flag = '1'
                                   and q.mexxxxx_xxxxx = 21484xxxxx) quo_num,
                               nvl((select max(q.added_time)
                                     from quoxxxx_info q
                                    where q.relation_id = i.inxxxx_xxxxx
                                      and q.relation_type = '1'
                                      and q.quotation_flag = '1'),
                                   i.s_added_time) added_time_order,
                               '0' selection
                          from (select row_number() over(partition by s.match_xxxxx_xxxxxx order by s.added_time asc) rn,
                                       s.gxxxx_xxxx,
                                       s.added_time s_added_time,
                                       s.read_flag readFlag,
                                       s.match_id quotation_id,
                                       m.com_id,
                                       m.com_name coxxxxxxxx,
                                       q.*
                                  from system_match_xxxxxxcn s,
                                       inqxxxx_xxxxx       q,
                                       core_comxxxx_mxxxxx m
                                 where  s.supp_mexxxxx_xxxxx = 21484xxxxx and s.match_xxxxx_xxxxxx = q.inxxxx_xxxxx
                                   and s.match_method = '2'
                                   and q.business_flag = '1'
                                   and q.sensetive_flag = '0'
                                   and q.CONFIRM_STATUS in ('0', '3')
                                   and m.mexxxxx_xxxxx = q.mexxxxx_xxxxx
                                   and m.com_status in ('1', '3')
                                   AND ((   ((TRUNC(s.ADDED_TIME) >= TRUNC(SYSDATE - 2)) OR q.inxxxx_xxxxx = 2000522250 )
                                       AND NOT EXISTS
                                        (SELECT *
                                            FROM quoxxxx_info k
                                           WHERE k.relation_id = q.inxxxx_xxxxx
                                             AND k.relation_type = '1'
                                             AND k.quotation_flag = '1'
                                             AND k.mexxxxx_xxxxx = 21484xxxxx)) OR
                                       s.gxxxx_xxxx = '1' OR EXISTS
                                        (SELECT *
                                           FROM quoxxxx_info k
                                          WHERE k.relation_id = q.inxxxx_xxxxx
                                            AND k.relation_type = '1'
                                            AND k.quotation_flag = '1'
                                            AND k.mexxxxx_xxxxx = 21484xxxxx))
                                   ) i
                          union all
                        select i.coxxxxxxxx,
                               i.com_id,
                               i.info_title,
                               i.inxxxx_xxxxx,
                 (select count(ip.inqxxxx_pxxxx_xxxx) from inxxxx_xxxxx_info ip where ip.relation_id = i.inxxxx_xxxxx and ip.relation_type = '1' and ip.delete_flag = '1') inquiry_prod_num,
                 (select ip.purchase_unit_text from inxxxx_xxxxx_info ip where ip.relation_id = i.inxxxx_xxxxx and ip.relation_type = '1' and ip.delete_flag = '1' and rownum=1) inquiry_prod_unit,
                 (select sum(ip.purxxxx_xxxxx) from inxxxx_xxxxx_info ip where ip.relation_id = i.inxxxx_xxxxx and ip.relation_type = '1' and ip.delete_flag = '1') inquiry_prod_quantity,
                               i.mexxxxx_xxxxx,
                               (select com_id from core_comxxxx_xxx_xxxxx_xxxx where xxxxx_mexxxxx_xxxxx = i.mexxxxx_xxxxx and rownum<=1) xxxxxx_com_id,
                               (select mm.MEMBER_TYPE
                                  from xxxxx.CORE_MEMXXXX_XXXXX mm
                                 where mm.mexxxxx_xxxxx = i.mexxxxx_xxxxx) member_type,
                               (select l.logon_xxxxx_xxxxx from xxxxx.core_xxxxxx_inxxxx l where l.mexxxxx_xxxxx=i.mexxxxx_xxxxx and l.user_role='0' and rownum<=1) logon_xxxxx_xxxxx,
                               i.delivery_province,
                               i.delivery_city,
                               i.xxxxxx_time,
                               i.added_time added_xxxx_inqxxxx,
                               trunc(i.xxxxxx_time) - trunc(sysdate) + 1 left_day,
                               f_get_big_buyer_flag(i.mexxxxx_xxxxx) big_flag,
                               f_get_xxxx_cert_xxxxx(i.mexxxxx_xxxxx) cert_status,
                               i.readFlag read_flag,
                               i.gxxxx_xxxx,
                               '2' source_flag,
                               i.quotation_id quotation_id,
                               (select count(1)
                                  from quoxxxx_info q
                                 where q.relation_id = i.inxxxx_xxxxx
                                   and q.relation_type = '1'
                                   and q.quotation_flag = '1'
                                   and q.mexxxxx_xxxxx = 21484xxxxx) quo_num,
                               nvl((select max(q.added_time)
                                     from quoxxxx_info q
                                    where q.relation_id = i.inxxxx_xxxxx
                                      and q.relation_type = '1'
                                      and q.quotation_flag = '1'),
                                   i.s_added_time) added_time_order,
                               i.selection
                          from (select row_number() over(partition by s.match_xxxxx_xxxxxx order by s.added_time asc) rn,
                                       s.gxxxx_xxxx,
                                       s.added_time s_added_time,
                                       s.read_flag readFlag,
                                       s.match_id quotation_id,
                                       m.com_id,
                                       m.com_name coxxxxxxxx,
                                       '1' as selection,
                                       q.*
                                  from xxxxx.system_match_xxxxxxcn         s,
                                       xxxxx.inqxxxx_xxxxx              q,
                                       xxxxx.core_comxxxx_mxxxxx        m,
                                       xxxxx.core_comxxxx_xxx_xxxxx_xxxx k
                                 where s.match_xxxxx_xxxxxx = q.inxxxx_xxxxx
                                   and s.xxxxxx_com_id = k.com_id
                                   and s.match_method ='2'
                                   and q.business_flag = '1'
                                   and q.sensetive_flag = '0'
                                   and q.CONFIRM_STATUS in ('0', '3')
                                   and q.mexxxxx_xxxxx = m.mexxxxx_xxxxx
                                   and m.com_status in ('1', '3')
                                   and k.xxxxx_mexxxxx_xxxxx = 21484xxxxx) i
                         where rn <= 1) d)
         where rn <= 1) d where d.quo_num=0 and d.gxxxx_xxxx='0' and d.xxxxxx_time>=trunc(sysdate) order by xxxxxx_time DESC ) q ) p
 where rnum > 1
   and rnum <= 10

?尝试执行了下该SQL,发现当查到有数据的时候,会非常慢,超过一分钟,当查询无数据的时候会很快,也就一秒左右。

备注:

在处理过程中,也遇到了监听报WARNING: Subscription for node down event still pending告警,如下所示
在10g以后,涉及到Oracle监听器的消息默认会订阅到ONS(Oracle Notification Service),在非RAC环境,建议禁止订阅这些消息。

并根据MOS资料,在GRID用户 $ORACLE_HOME/network/admin下修改 listener.ora

添加 SUBSCRIBE_FOR_NODE_DOWN_EVENT_LISTENER=OFF

并对监听执行 lsnrctl reload。

根据一段时间观察,监听日志未再报 WARNING: Subscription for node down event still pending告警。

二、解决过程

该数据库服务器为64G,SGA和PGA分别设置了30G和10G。

对比了一个线上11G和此环境配置差不多的生产库,调整了下SGA和PGA以及sysctl.conf、limits.conf的参数,重启数据库和服务器依然如此。

并查询了SQL的缓存命中率。

于是将应用程序运行了一段时间,抓取问题时段的ASH报告,如下:

image.png

发现主要是direct path read等待事件。direct path read是 11G推出的一个新特性,

Direct path read的目的是让一些不常使用的大表数据(冷数据)在全表扫描时,每次都从磁盘读到用户的私有内存(PGA),而不要去挤占有限的、宝贵的、频繁使用的数据(热数据)所在的共享内存(SGA-buffer cache)。

热数据只在第一次访问时从磁盘读,读到SGA的buffer cache后,再次访问会直接从内存读,效率高、对存储压力小。

从共享内存读到直接路径读,这个变化在不频繁的全表扫描时是起到积极作用的,但某些SQL由于业务设计问题,导致SQL执行计划不合适,就会对数据库产生致命影响。

于是就尝试将 direct path read这一特性进行强制关闭。

ALTER SYSTEM SET _serial_direct_read=‘NEVER’ SCOPE=BOTH;

并通过如下语句查询执行结果:

SELECT x.ksppinm NAME, y.ksppstvl VALUE, x.ksppdesc describ
FROM SYS.x$ksppi x, SYS.x$ksppcv y
WHERE x.indx = y.indx
AND (x.ksppinm = '_small_table_threshold'
OR x.ksppinm = '_serial_direct_read');

复制

我将之前执行的SQL重新又执行了一次,耗时从原来的一分多钟一下子降到了一秒多,于是又重新找了几个变量带入进去,查询时间基本在3秒以下。

通知研发人员复测下,反馈时间确实块了很多,业务测试通过了。

三、后续

对于该环境,通过和研发的沟通,目前存在硬解析较高,因为研发未对SQL添加绑定变量,导致硬解析高。另外禁用了direct path read是否会对其它SQL产生影响,还在观察中。

image.png

也欢迎关注我微信公众号

image.png

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1656975.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

振动分析的一些概念

一.时域分析 振动测试领域中&#xff0c;通常使用标准是ISO 10816系列标准&#xff0c;其要去使用有效值&#xff08;RMS&#xff09;来表示震动信号的能量大小&#xff0c;并提供一组限制值&#xff0c;以帮助用户评估机器的振动水平是否正常。 1.位移&#xff1a; 峰峰&…

STM32--LoRa通信模块

ATK-LORA-01_V3.0(V3.0 是版本号&#xff0c;型号是 ATK-LORA-01 &#xff0c;下面均以 ATK-LORA-01表示该产品) 是 ALIENTEK 推出的一款体积小、微功率、低功耗、高性能远距离 LORA 无线串口模块。模块设计是采用高效的 ISM 频段射频 SX1278 扩频芯片&#xff0c;模…

【Java SE】对象的比较

&#x1f970;&#x1f970;&#x1f970;来都来了&#xff0c;不妨点个关注叭&#xff01; &#x1f449;博客主页&#xff1a;欢迎各位大佬!&#x1f448; 本期内容满满干货&#xff0c;将会深入介绍对象与对象之间是如何进行比较的&#xff0c;我们知道基本数据类型是可以直…

Linux0.11中MINIX 文件系统

阅读linux 的源码的时候对minix 文件系统有很多的疑惑&#xff0c;根据自己的认识将这些做一个总结。 MINIX 文件系统由六个部分组成&#xff0c;分别是引导块&#xff0c;超级块&#xff0c;i结点位图&#xff0c;逻辑块位图&#xff0c;i结点&#xff0c;数据块。 引导块&am…

面试集中营—Redis架构篇

一、Redis到底是多线程还是单线程 1、redis6.0版本之前的单线程&#xff0c;是指网络请求I/O与数据的读写是由一个线程完成的&#xff1b; 2、redis6.0版本升级成了多线程&#xff0c;指的是在网络请求I/O阶段应用的多线程技术&#xff1b;而键值对的读写还是由单线程完成的。所…

每日Attention学习6——Context Aggregation Module

模块出处 [link] [code] [IJCAI 22] Boundary-Guided Camouflaged Object Detection 模块名称 Context Aggregation Module (CAM) 模块作用 增大感受野&#xff0c;全局特征提取 模块结构 模块代码 import torch import torch.nn as nn import torch.nn.functional as Fcla…

万兆以太网MAC设计(13)主机与FPGA之间进行PING

文章目录 前言&#xff1a;一、ICMP校验和计算二、上板效果1、终端命令行1、wireshark捕捉 前言&#xff1a; 在上板尝试进行PING操作的时候&#xff0c;发现一直是请求超时的情况&#xff0c;结果排查发现是首部校验和没有计算的问题。在UDP层&#xff0c;我们不进行校验和是…

【python】基于岭回归算法对学生成绩进行预测

前言 在数据分析和机器学习领域&#xff0c;回归分析是一种预测连续数值的监督学习技术。当数据特征与目标变量之间存在线性关系时&#xff0c;线性回归模型尤其有用。然而&#xff0c;当特征数量多于样本数量&#xff0c;或者特征之间存在多重共线性时&#xff0c;普通最小二…

jsp 实验16 MVC 表白墙

源代码以及执行结果截图&#xff1a; ExpressWish_Bean.java package web; import java.util.HashMap; import java.util.ArrayList; import java.util.Iterator; public class ExpressWish_Bean { public HashMap<String,ExpressWish> wishList; ArrayList&…

【AI知识】Stable diffusion常用提示词分享

模型&#xff08;Model&#xff09; majicmixRealistic_v7 majicmixRealistic&#xff08;麦橘写实&#xff09;是融合了多种展现日常生活人物形象的写实风格模型&#xff0c;人物的外观更加接近现实生活&#xff0c;对于光影、皮肤、人物动态均有较好的表现&#xff0c;非常…

Java | Leetcode Java题解之第70题爬楼梯

题目&#xff1a; 题解&#xff1a; public class Solution {public int climbStairs(int n) {double sqrt5 Math.sqrt(5);double fibn Math.pow((1 sqrt5) / 2, n 1) - Math.pow((1 - sqrt5) / 2, n 1);return (int) Math.round(fibn / sqrt5);} }

版本控制工具之Git的基础使用教程

Git Git是一个分布式版本控制系统&#xff0c;由Linux之父Linus Torvalds 开发。它既可以用来管理和追踪计算机文件的变化&#xff0c;也是开发者协作编写代码的工具。 本文将介绍 Git 的基础原理、用法、操作等内容。 一、基础概念 1.1 版本控制系统 版本控制系统&#x…

如何区分APP页面是H5还是原生页面?

刚刚接触手机测试的同学&#xff0c;或多或少都有过这样的疑问&#xff1a;APP页面哪些是H5页面&#xff1f;哪些是原生页面?单凭肉眼&#xff0c;简直太难区分了&#xff01;我总结了6个小技巧&#xff0c;希望能帮大家答疑解惑。 1、看断网的情况 断开网络&#xff0c;显示…

推荐 3 个 yyds 的开源项目!

本期推荐开源项目目录&#xff1a; 1. AI 搜索引擎 2. 大模型聊天框架 3. 模仿抖音的移动端短视频 01 AI 搜索引擎 Perplexica 是一个开源的、由 AI 驱动的搜索引擎。它深入互联网寻找答案&#xff0c;不仅搜索网络&#xff0c;还理解您的问题。 Perplexica 受到 Perplexity AI…

今天来聊聊Numpy!

numpy&#xff1f;what&#xff5e;什么是numpy&#xff1f; 小编先暂且不提。 ​ 大家先暂且看看这句话&#xff0c;“你给我翻 译翻译&#xff0c;什么他妈的是他妈的惊喜&#xff1f; 这还用翻译&#xff0c;都说了… 惊喜嘛……”。 惊喜这段出自《让子…

Could not find the Qt platform plugin “dxcb“ in ““、 重点:是dxcb

这个重点就在于是dxcb不是xcb&#xff0c;让我一顿好找。 https://bugs.launchpad.net/ubuntu/source/deepin-qt5dxcb-plugin/bug/1826629 这篇文章描述了应该是deepin系统的一个问题&#xff0c;应该已经修复了不知道为什么我还会遇到。 不过知道是dxcb后直接去qtcreater里的系…

ICode国际青少年编程竞赛- Python-2级训练场-坐标与列表遍历

ICode国际青少年编程竞赛- Python-2级训练场-坐标与列表遍历 1、 for i in range(5):Flyer[i].step(Dev.x -Flyer[i].x) Dev.step(Item.y - Dev.y)2、 for i in range(7):Flyer[i].step(Dev.y - Flyer[i].y) Dev.step(Item[2].x - Dev.x)3、 for i in range(5):Flyer[i].…

基于若依框架搭建网站的开发日志(一):若依框架搭建、启动、部署

RuoYi&#xff08;基于SpringBoot开发的轻量级Java快速开发框架&#xff09; 链接&#xff1a;开源地址 若依是一款开源的基于VueSpringCloud的微服务后台管理系统&#xff08;也有SpringBoot版本&#xff09;&#xff0c;集成了用户管理、权限管理、定时任务、前端表单生成等…

MYSQL8.0.20安装教程

一&#xff1a;下载mysql MySQL :: Download MySQL Installer (Archived Versions) 二&#xff1a;选中server only&#xff0c;点击next 三&#xff1a;点击server 选项&#xff0c;点击Execute 弹窗点击安装 四&#xff1a;安装项为绿色后&#xff0c;点击next 五&#xf…

大数据中的HDFS读写流程(namenode,datanode)

HDFS读写流程 读取流程 1、客户端请求上传文件 2、namenode检查是否存在&#xff0c;可以上传&#xff0c; 3、客户端请求第一个block块上传到datanode 4、namenode返回3个datanode节点&#xff0c;d1,d2,d3 5、客户端请求dn1调用数据&#xff0c;d1收到请求会继续调用d2&#…