Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1
Plan Stabalization Using Outline

Plan Stabalization Using Outline

Ratings: (0)|Views: 59 |Likes:
Published by Rahul Gupta

More info:

Published by: Rahul Gupta on Mar 01, 2010
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less





Customer Submitted Case Studies
Case Study:
Plan Stability using oracle stored outlines
 Author: Rahul Gupta , ASE  Email : ecengineer84@gmail.com
Skill Level Rating for this Case Study: Intermediate
About Oracle Customer Submitted Case Studies
Oracle Customer Submitted Case Studies are intended as learning tools and for sharinginformation or knowledge related to a complex event, process, procedure, or to a series of related events. Each case study is written based upon the experience that the writer/sencountered.
Customers should not interpret or use information in these case studies as solutionsor recommendations without first contacting Oracle Support.
Each Case Study contains a skill level rating. The rating provides an indication of whatskill level the reader should have as it relates to the information in the case study.Ratings are:
Expert: significant experience with the subject matter
Intermediate: some experience with the subject matter
Beginner: little experience with the subject matter
Case Study Abstract
This case study is discussed that how we can stabilize a query plan using outlines. Itmight happen that, for a SQL statement due to some reason optimizer is opting for awrong plan instead of the optimize plan. Hints can be used to guide optimizer optimizer,but in some cases it is not possible to edit application SQL to add index hint. In this casestored outline can be used to select a desired plan. But text of the SQL should be samewhile using stored outline which will not be case after adding index hint.
Case History
This case study is based on a real issue running on an oracle database. This isabout how plan change after gathering the statistics and how can be
stabilize them usingoutline
. Concurrent " EOTH daily " a customized one was running proper earlier takingaround 2-3 hours . But user started to complain that it's not getting completed even inwhole day. Moreover, COLD backup was scheduled on daily basis. So Concurrent getsrestarted after the COLD backup. After analyzing we found the plan of the query hasbeen changed because of monthly scheduled stats gather activity. As this Concurrent wasvery critical thus we’re not allowed to change any logic in the program source code. Sowe decided to create the outline for the same.
Pre-Analysis Work (optional)
We ask the user to unable the trace for the problematic concurrent program. In OracleAPPS environment trace can be enable through the front end using.System Administrator
DefineHere search for the program name and then click on the
Enable Trace
( there at the left –bottom )But it won’t work for as the program was not getting completed within the 1 day time andthus it was not possible to us to find the problematic query using trace. So we decided tomonitor at runtime and thus we used the query mentioned below to find the sid of theconcurrent program with the help of its request id.
So with the help of above mentioned query we find the sid for the respective concurrentprogram.
select s.sid from v$session S ,fnd_concurrent_requestsR where r.oracle_session_id=S.audsid andr.request_id=118030209
We got the sid as 135 and thus we used the
to find theproblematic sql . We found that one query with hash_value 2925922762 wasrunning for a very long time and didn’t complete[Summarize the.
Now we got our problematic query.Thus we used
to find the planstability of the query with hash value
. Metalink Doc :
canbe used to find more information about the
select s.sid from v$session S ,fnd_concurrent_requests R wherer.oracle_session_id=S.audsid and r.request_id=
Select a.sql_text , a.hash_value from v$sqlarea a ,v$session b where a.hash_value = b.sql_hash_value andb.sid=135Sql_text Hash_valueSELECT DISTINCT X.INVENTORY_ITEM_ID 2925922762FROMEINV_ONHAND_TXN_HISTORY_DAILY X,EINV_PRICE_LIST_GT YWHEREX.INVENTORY_ITEM_ID = Y.INVENTORY_ITEM_IDAND X.CREATION_DAY =NVL(:B1,TRUNC(SYSDATE)-1)

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->