Hello everyone, hope you all doing good. It’s been too long I haven’t updated new post on my blog due to my busy schedule.
So here I will be sharing very interesting post of creating sql baseline and force query to use better execution plan (plan hash value).
Most of us have come across this scenario where query which was running fine till yesterday now suddenly running long.
So there could be many reasons why query performance has been changed suddenly, so one of the reason is change in query plan.
In such situation we need to find out best execution plan (Plan_hash_value) and force query to use that plan.
Below are the steps to create and fix bad query by creating sql baseline.
STEP 1: GENERATE ALL PREVIOUS HISTORY RUN DETAILS OF SQL_ID FROM AWR
Enter value for sql_id: 7hgwdax4mn20v
/*In this scenario sql_id=7hgwdax4mn20v and plan_hash_value for good plan that we want to force is 1355798266.*/
Follow the below steps to create sql baseline for sql_id
STEP 2: DROP SQL TUNING SET (STS) IF EXISTS
STEP 3: CREATE SQL TUNING SET
/* Populate STS from AWR by specifying snapshot for desired plan which we found using above query.
In this scenario snap id's are 23483 and 23484 and change plan_hash_value accordingly.*/
STEP 4: CHECK SQL SET DETAILS
STEP 5: LOAD THE DESIRED PLAN FROM STS AS SQL PLAN BASELINE
STEP 6: CHECK SQL PLAN BASELINE INFORMATION
STEP 7: ENABLE FIXED=YES
STEP 8: Check the SQL baseline details
Use the plan name received from the STEP 6 output to get the baseline details
STEP 9: PURGE OLD EXECUTION PLAN FROM SHARED POOL
Find below two parameters required to purge specific sql from the shared pool.
Now use the below command to purge sql from the shared pool.
I hope this article helped you. Your suggestions/feedback are most welcome.
Keep learning... Have a great day!!!
Thank you,
Amit Pawar
Email: amitpawar.dba@gmail.com
WhatsApp No: +91-8454841011
very good blog,thanks you for sharing this infromation to us oracle dba online training in hyderabad
ReplyDeleteThanks for splitting your comprehension with us. It’s really useful to me & I hope it helps the people who in need of this vital informationOracle DBA Training in Chennai
ReplyDeleteYour website have a valuable information,thanks for sharing information.
ReplyDeleteOracle DBA Training in Hyderabad
Thanks for sharing . You fixed from the available good plans . but what if we dont have any good plan and only one plan is running in database.. can you please share that scenario as well .
ReplyDeleteVery Nice.Well Said. To the Point and Well Explained.
ReplyDeletetuning oracle database performance
oracle sql performance tuning
sql performance tuning
oracle sql performance tuning and optimization
improve sql query performance
oracle database performance tuning
oracle performance tuning tips
sql query performance tuning
sql tuning for oracle
performance tuning in oracle
oracle sql free download
Amit Oracle DBA Blog is very good blog.
ReplyDeleteEasy "water hack" burns 2 lbs OVERNIGHT
ReplyDeleteMore than 160,000 men and women are utilizing a easy and secret "water hack" to drop 2 lbs each and every night as they sleep.
It's effective and it works all the time.
Just follow these easy step:
1) Grab a glass and fill it half glass
2) And now learn this weight losing hack
so you'll be 2 lbs skinnier as soon as tomorrow!
nice post
ReplyDeleteThose guidelines additionally worked to become a good way to recognize that other people online have the identical fervor like mine to grasp a great deal more around this condition. and I could assume you are an expert on this subject. Same as your blog i found another one Oracle Taleo .Actually I was looking for the same information on internet for Oracle Taleo and came across your blog. I am impressed by the information that you have on this blog. Thanks a million and please keep up the gratifying work.
ReplyDeleteThankyou for the valuable content.It was really helpful in understanding the concept.# BOOST Your GOOGLE RANKING.It’s Your Time To Be On #1st Page
ReplyDeleteOur Motive is not just to create links but to get them indexed as will
Increase Domain Authority (DA).We’re on a mission to increase DA PA of your domain
High Quality Backlink Building Service
1000 Backlink at cheapest
50 High Quality for just 50 INR
2000 Backlink at cheapest
5000 Backlink at cheapest
ice post, it's very informative. I found the best information. I updated my knowledge with this blog. We are also providing the best services click on below links to visit our website.
ReplyDeleteOracle Fusion HCM Training
Workday Training
Okta Training
Palo Alto Training
Adobe Analytics Training
Very well explained 👏
ReplyDeleteThanks and I have a nifty offer: How Much Is Home Renovation home interior renovation
ReplyDelete