How to do a deep SQL tuning

In order to see why the report is slow in BO, we need to identify a good run and a bad run, and trace them and see if they are using a different plan. See the action plan below: 

1/ try to run Sql Tuning Advisor on it, but with a longer time_limit, when creating the task with DBMS_SQLTUNE.CREATE_TUNING_TASK. Instead of 30 minutes, run it with 2 hour limit and it should complete. 


2/ let's take a 10046 trace of the bad run, when it runs from BO application: 

- connect to BO application and identify the OS pid of the session from BO: 

select spid from v$process... 

- in another session connect as sysdba and run: 

oradebug setospid <spid from above> 
oradebug tracefile_name 
oradebug unlimit 
ORADEBUG EVENT 10046 TRACE NAME CONTEXT FOREVER, LEVEL 12; 

- in the original session run the query and wait until it ends 


After the query ends, exit from BO application, and upload for review the trace file generated. 

3/ I will be waiting the results of the same query in sqlplus 

4/ We will need an SqlT with XTRACT method for this sqlid, 0j7p0qvjqt8pc, to see if it has multiple execution plans. Assure you choose option T when asked for Licensed Oracle Pack. (T, D or N), in order for the script to look into AWR repository as well, if the sqlid is not in the memory anymore. 

Note:215187.1 SQLTXPLAIN.SQL - Enhanced Explain Plan and related diagnostic info for one SQL statement 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值