How to create a sql profile

I have a long running sql which uses a view and was taking more than 20 minutes to  get the result.
I can able to fix this sql using a Parallel hint.(It is now giving the result in seconds). The issue is we can not change the code in the background.
How can I create a sql profile so that we need not to change the code?

The below sql is modified sql (Working) :-

select /*+ PARALLEL*/ * from ps_wklst_vw where order_num<250;

The Original sql was as follows:-
select  * from ps_wklst_vw where order_num<250;
OranewAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

slightwv (䄆 Netminder) Commented:
Are you sure it was the parallel hint that made it faster or that the blocks were cached in memory from previous runs?

To get a true idea you need to flush the shared_pool, buffer_cache and depending on your version the result cache:

alter system flush shared_pool;
alter system flush buffer_cache;
exec dbms_result_cache.flush;

You need to think twice before doing this on a production system.

That said it looks like this might be what you are after but I cannot say for sure since I have never personally done it:
Example 17-4 Parallel Query Recommendation
http://docs.oracle.com/cd/E11882_01/server.112/e41573/sql_tune.htm#PFGRF95163
0
OranewAuthor Commented:
Yes, I checked using the explain plan and I just need help with creating the sql profile using the above
0
slightwv (䄆 Netminder) Commented:
So are you saying the explain plan shows the same amount of disk/io parallel versus not parallel?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

OranewAuthor Commented:
I did not check the io but the cost is 2500 vs 35000
0
slightwv (䄆 Netminder) Commented:
The COST in an explain plan is worthless when it comes to performance.  It is a made up number.  Lower cost does not mean faster performance.
0
slightwv (䄆 Netminder) Commented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
OranewAuthor Commented:
This is NOT a solution. Please close
0
slightwv (䄆 Netminder) Commented:
For a solution to the question asked, you need to continue working with the Experts.

I would have gladly continued working on this with you but you never posted back.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.