【TUNE_ORACLE】列出走了錯誤的排序合併連線的SQL參考

Attack_on_Jager發表於2021-08-13

實驗環境

搭建平臺:VMware Workstation

OS:RHEL 6.10

Grid&DB:Oracle 11.2.0.4


SQL參考

select c.sql_id, c.sql_text, d.owner, d.segment_name, d.mb

  from v$sql_plan a,

       v$sql_plan b,

       v$sql c,

       (select owner, segment_name, sum(bytes / 1024 / 1024) mb

          from dba_segments

         group by owner, segment_name) d

 where a.sql_id = b.sql_id

   and a.child_number = b.child_number

   and b.operation = 'SORT'  --SORT JOIN

   and b.options = 'JOIN'

   and b.access_predicates like '%"="%'

   and a.parent_id = b.id

   and a.object_owner = 'TEST'

   and b.sql_id = c.sql_id

   and b.child_number = c.child_number

   and a.object_owner = d.owner

   and a.object_name = d.segment_name

 order by 4 desc;


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69992972/viewspace-2786817/,如需轉載,請註明出處,否則將追究法律責任。

相關文章