Any tool or shortcut to get SQL tuning suggestion???????
Hi I have to tune an application and need to go throught alot many SQL their PLAN and ti tune them.
I want to know ether is there any tool online or may be from oracle to get the tuning suggestions straighytway.my oracle version is 9206
Can i use 10g SQL tuning advisor with 9i database????
Thanks
Gagan
Hi Gagan,
Can i use 10g SQL tuning advisor with 9i databaseNo, but you can do the same thing manually, and often do a better job:
Tune SQL with optimizer parms:
http://www.dba-oracle.com/t_sql_optimizer_parameters.htm
Find missing indexes:
1 - Search for unnecessary large-table, full-table scans
2 - Compare consistent gets to rows returned
http://www.dba-oracle.com/art_sql_tune.htm
Hope this helps. . . .
Donald K. Burleson
Oracle Press author
Similar Messages
-
Is there any Tools for Code coverage for SQL Azure Database projects
I need to capture data base code coverage for all the manual and automated test. this is for Azure DB, is there any tools available for the same? Please advise
Hi,
In order to code coverage for SQL Azure, use Microsoft Test Manager.
This Link helps you in understanding and step by step procedures for manual testing.
http://msdn.microsoft.com/en-us/library/vstudio/hh698492(v=vs.110).aspx
Along with the above link also refer to
http://msdn.microsoft.com/en-us/library/jj156172.aspx
http://msdn.microsoft.com/en-us/library/jj156144.aspx
Girish Prajwal -
SQL tuning suggestions.
Hi
I am not a sql programmer and developers have given me this sql to have a look. I made the following recommendations after going through the sql. Is there anything else that can be added . I did not add about stats because they are representative and up to date.
SELECT /*+ PARALLEL(q1,4) */ *
FROM
(SELECT /*+ FIRST_ROWS(20) */
br.resource_id,
br.resource_code,
x.resource_seq_num employee_resource_number,
br.organization_id,
bd.department_id,
bd.department_code,
pf.full_name employee_name,
(SELECT xxdl_eam_util_pkg.xxdl_eam_get_resource_code(pf.person_id, bd.department_id)
FROM dual)
maximum_cost_resource,
pf.person_id,
x.wip_entity_id wo_id,
(SELECT weo1.wip_entity_name
FROM wip_eam_work_orders_v weo1
WHERE weo1.wip_entity_id = x.wip_entity_id)
wo_number,
CAST(x.start_date AS
TIMESTAMP) start_date,
CAST(x.completion_date AS
TIMESTAMP) completion_date,
wor.operation_seq_num wo_operation_number,
wor.resource_seq_num wo_resource_number,
wor.usage_rate_or_amount HOURS,
BRE.effective_start_date instance_start_date,
BRE.effective_end_date instance_end_date,
BRE.instance_id,
crc.resource_rate AS
resource_cost,
(SELECT xxdl_eam_util_pkg.xxdl_eam_get_all_res_code(pf.person_id, bd.department_id)
FROM dual)
all_resources
FROM per_all_people_f pf,
wip_eam_work_orders_v weo,
wip_operations wo,
wip_operation_resources wor,
(SELECT instance_id,
wip_entity_id,
operation_seq_num,
resource_seq_num,
start_date,
completion_date
FROM wip_op_resource_instances_v) x,
bom_dept_res_instances bdri,
bom_resource_employees BRE,
bom_department_resources bdr,
bom_resources br,
cst_resource_costs crc,
bom_departments bd
WHERE br.organization_id = bd.organization_id
AND bdr.resource_id = br.resource_id
AND bdr.department_id = bd.department_id
AND BRE.resource_id = br.resource_id
AND pf.effective_start_date <=sysdate
AND pf.effective_end_date >= sysdate
AND pf.person_id = BRE.person_id
AND wo.department_id = bd.department_id
AND wor.operation_seq_num(+) = wo.operation_seq_num
AND wor.wip_entity_id(+) = wo.wip_entity_id
AND wor.organization_id(+) = wo.organization_id
AND weo.wip_entity_id = wo.wip_entity_id
AND weo.organization_id = wo.organization_id
-- AND weo.organization_id = 6921
AND DECODE(bd.disable_date,null, sysdate,bd.disable_date) >= sysdate
AND DECODE(br.disable_date,null, sysdate,br.disable_date) >= sysdate
AND DECODE(wo.disable_date,null, sysdate,wo.disable_date) >= sysdate
AND crc.resource_id(+) = BRE.resource_id
AND x.wip_entity_id = wor.wip_entity_id
AND x.operation_seq_num = wor.operation_seq_num
AND x.resource_seq_num = wor.resource_seq_num
AND x.instance_id(+) = BRE.instance_id
AND bdri.department_id = bd.department_id
AND bdri.resource_id = br.resource_id
AND weo.organization_id = 6921
AND bdri.department_id = 5004
UNION
SELECT /*+ FIRST_ROWS(20) */ DISTINCT NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
pf.full_name employee_name,
NULL,
pf.person_id,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL HOURS,
NULL,
NULL,
NULL,
NULL,
NULL
FROM per_all_people_f pf,
wip_eam_work_orders_v weo,
wip_operations wo,
wip_operation_resources wor,
bom_dept_res_instances bdri,
bom_resource_employees BRE,
bom_department_resources bdr,
bom_resources br,
cst_resource_costs crc,
bom_departments bd
WHERE br.organization_id = bd.organization_id
AND bdr.resource_id = br.resource_id
AND bdr.department_id = bd.department_id
AND BRE.resource_id = br.resource_id
AND pf.effective_start_date <=sysdate
AND pf.effective_end_date >= sysdate
AND pf.person_id = BRE.person_id
AND wo.department_id = bd.department_id
AND wor.operation_seq_num(+) = wo.operation_seq_num
AND wor.wip_entity_id(+) = wo.wip_entity_id
AND wor.organization_id(+) = wo.organization_id
AND weo.wip_entity_id = wo.wip_entity_id
AND weo.organization_id = wo.organization_id
AND DECODE(bd.disable_date,null, sysdate,bd.disable_date) >= sysdate
AND DECODE(br.disable_date,null, sysdate,br.disable_date) >= sysdate
AND DECODE(wo.disable_date,null, sysdate,wo.disable_date) >= sysdate
AND crc.resource_id(+) = BRE.resource_id
AND bdri.department_id = bd.department_id
AND bdri.resource_id = br.resource_id
AND weo.organization_id = 6921
AND bdri.department_id = 5004
AND NOT EXISTS
(SELECT instance_id,
wip_entity_id operation_seq_num,
resource_seq_num
FROM wip_op_resource_instances_v)
) q1
ORDER BY department_id,
resource_code,
employee_name,
wo_number
My suggestions:
. Try to use UNION ALL instead of UNION. If you can eliminate UNION all together and flatten the query that will be even better.
2. You are using the function in a select statement xxdl_eam_util_pkg.xxdl_eam_get_resource_code(pf.person_id, bd.department_id)This will slow the performance. Try to get rid of this. Function calls in select are expensive.
3. Dont use the parallel hint and optimize. It wont get you consistent results.
4. Use of per_all_people_F is expensive. The UNION again complicates things. per_all_people_f has to be scanned 2x times.
5. Where does the application get the values for department id? Whether user inputs a value or whether it is hard coded . Most likely user will input value and each time it may be different. If that is the case, then you may be hitting bind peeking. There is not much hope for this. Not much can be done. Whatever you do this can happen. Only way is to pin the plan if you can use literals instead of binds. But that is not possible I think.
6. AND DECODE(bd.disable_date,null, sysdate,bd.disable_date) >= sysdate
AND DECODE(br.disable_date,null, sysdate,br.disable_date) >= sysdate
AND DECODE(wo.disable_date,null, sysdate,wo.disable_date) >= sysdate
Those statements, if you can rewrite would be good. If there are indexes on any of those columns, they are more than likely not used.
7. Are the outer joins really required. If not required remove them.
8. There is a 'WITH' clause in 10g . Try to use that for your subqueries or main query where applicable. It will save some I/O.
9. Try to tune without any hints. Remove the first rows as well and see the difference.
I know that the sql is definately bad and can be rewritten but I am not able to exactly write it for them.
Any inputs or thoughts?
MSKHi,
Any suggestions for reading on Sql tuning
I am looking for a practical book with solutions .
And books showing the Sql internal workings ?Take a look on Amazon some Jonathan Lewis books.
I will also recommend you to take a look on the following blogs:
- http://jonathanlewis.wordpress.com/
- http://www.juliandyke.com/
- http://richardfoote.wordpress.com/
- http://tkyte.blogspot.com/
And also any good interview based good Oracle DBA books ?You can take a look on my blog for some common DBA interview questions.
http://oraclenz.com/category/interview-tips/
Regards,
Francisco Munoz Alvarez
www.oraclenz.com -
Any tool to generate 1 million xml files?
Hi All,
I have customer file and want to generate 1 million xml files to start load performance testing.
Let me know if any tool available.
Thanks
ShruthikaaHi Shruthikaa,
As suggested LoadGen tool can be used for testing stress and performance, also you can do it with visual studio -
Load Testing using Visual Studio
Maheshkumar S Tiwari|User Page|Blog|BizTalk
Server : How Map Works on Port Level -
Need a SQL tuning tool!! Urgent
Hi,
does anyone know any good SQL tuning tool on Oracle?? I need one urgently for a large project.
I've tried Quest SQLLab and it can't solve my problems. It only "advice" me. I need something more powerful!!
Any suggestions??
Many thanks
Boscoall the other columns used in query will not be indexed!
IMSDBA IMS_TRDE_HSTRY_INDX_ARCH IMSDBA IMS_TRDE_HSTRY ARCHIVEDT 1 7 0 ASC
IMSDBA IMS_TRDE_HSTRY_INDX1 IMSDBA IMS_TRDE_HSTRY IMS_TRDE_OID 1 16 16 ASC
IMSDBA PK_IMS_TRDE IMSDBA IMS_TRDE IMS_TRDE_OID 1 16 16 ASC
IMSDBA IMS_TRDE_INDX_ARCH IMSDBA IMS_TRDE ARCHIVEDT 1 7 0 ASCAlso,the table is a very big table indeed:
SEGMENT_NAME BYTES/1024/1024/1024
IMS_TRDE_HSTRY 30.28125GBthanks
Edited by: PhoenixBai on Oct 14, 2009 5:14 PM -
Any tool to search Crystal Reports with embedded SQL
We have hundreds of Crystal Reports with embedded sql statements which have been developed over the years. Is there any tool which will allow us to scan all of the reports to see which ones might use a certain table, or is using a "group by" clause, or whatever ?
We'd prefer to not have to open each report to view the embedded sql.
Any thing that will extract the sql for us and dump it to a file ??
We have the reports as regular disk files, but they are also published to our Business Objects Enterprise XI R2 system (just an fyi in case there's an option on that side).Hi Wayne
There is a sample ras sdk code here that might be if use to you
Link: [https://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/402f2b94-da66-2b10-c598-de0d4b6058dc] -
Illustrator CS6 has suddenly stopped responding. I can open it but get the revolving icon when I try to use any tools etc. Newsgroup User
Moving this discussion to the Illustrator forum.
-
Hi everyone,since one month ago, my sql server 2008 has been experimented that something makes that my cpu server always be on 100% at 10:00 am , and even sometimes have crashed the server because of this,i have no executions jobs programmed at that time,
ran sql history jobs to see if i missed some job, but not even one job seems to be executed at that time, also there is no antivirus or windows update programmed at time
Does any one can recommend me a tool that not be the sql profiler , that we can use to be on monitoring at that time and tried or catch what makes that the sql cpu go to 100%, this happens all days at the same time.
Thanks for your time and if there is any way that i can give you more information please tellme
----More Information
Well basically the sql server its a virtual server, at 10:00 am the sql works slower than usually, the ti support that is monitoring the virtual machine , see that cpu starts to raise at that time (10:00 am) and
usually takes 1-2 minutes to back to normally, i had a back up BD log and differencial at that casually was execute at time, i had to change the time and now does not affect at 10:00, when i had this backups the server crashes, because the cpu was not enough,
now i moved the job (back up log adn diff) and the server dont crashes anymore, but still be something at 10:00 that make the cpu raises to the top. by test we disabled mcaffe and even with mcaffe down the server still having the same issue.
elijos3110Elijos,
What do task manager or ProcessExplorer say at 10:00 AM? Could be an anti-virus program or something.
Hi, thanks for your time, Well
basically the sql server its a virtual server, at 10:00 am the sql works slower than usually, the ti support that is monitoring the virtual machine , see that cpu starts to raise at that time (10:00 am) and usually takes 1-2 minutes to back to normally, i
had a back up BD log and differencial at that casually was execute at time, i had to change the time and now does not affect at 10:00, when i had this backups the server crashes, because the cpu was not enough, now i moved the job (back up log adn diff) and
the server dont crashes anymore, but still be something at 10:00 that make the cpu raises to the top. by test we disabled mcaffe and even with mcaffe down the server still having the same issue.
elijos3110
elijos3110 -
Hi,
Is there any tool to tune PL/SQL apart from oracle DBMS packages.
Regards
MMUPlease Try using DBMS_PROFILER
DBMS_PROFILER Package
Oracle provides a new tool called PL/SQL Profiler. This is a powerful tool to analyze a Program unit execution and determine the runtime behavior. The results generated can then be evaluated to find out the hot areas in the code. This tool helps us identify performance bottlenecks, as well as where excess execution time is being spent in the code. The time spent in executing an SQL statement is also generated. This process is implemented with DBMS_PROFILER package.
The possible profiler statistics that are generated:
1. Total number of times each line was executed.
2. Time spent executing each line. This includes SQL statements.
3. Minimum and maximum duration spent on a specific line of code.
4. Code that is actually being executed for a given scenario. -
Tuning sql automatic using SQL Tuning Advisor Tool
I need to work on Automatic sql tuning..
Please give suggestion for the below
1) I have installed oracle11g client version. confirm this is okey for my project. because i heard we should have oracle enterprise edition for this.
2) User with only sys privelage can work on this automatic sql tuning using sql tuning advisior tool.
Please clarify above suggestions.
ALso suggest me best way to proceed further
SSunny kichloo wrote:
This docs will help
http://www.oracle-base.com/articles/10g/automatic-sql-tuning-10g.php
http://www.oracle-base.com/articles/11g/automatic-sql-tuning-11gr1.php
Thanks for your link. i already seen this link.
Could u pls answer my question on above with " Yes" or "No"
Kindly reply
S -
Hi - I created new tool to create a tactile experience for touch screen users. Created it for son with auditory processing problems and dyslexia. Great for early educational apps. or just for fun. Any idea of how to get it exposure? Thanks for you help!
Hire a marketer, perhaps? Put it up on Amazon? Only not here, that would be in direct violation of the term of use.
-
Any Good Book on SQL , PL/SQL Tuning?
Hi,
Please suggest me some good book on SQL , PL/SQL Tuning?
Thanks.
--SamAnything specific you be looking for?
Good SQL Books
Good Online PL SQL Books, Examples &Tutorials
Good Books for learning PL/SQL
good tuning links and books
Need Assistance for choosing good Pl/SQL books
Adith -
Hi,
I would like to know any SQL tuning methods specific to Oracle exadata so that they could improve the performance of the database?
I am aware that oracle exadata runs with Oracle 11g, but i would like to know wheather there is any tuning scope w.r.t to SQL's on exadata?
regards
sunilWell there are some things that are very different about Exadata. All the standard Oracle SQL tuning you have learned already should not be forgotten as Exadata is running standard 11g database code, but there are many optimizations that have been added that you should be aware of. At a high level, if you are doing OLTP type work you should be trying to make sure that you take advantage of Exadata Smart Flash Cache which will significantly speed up your small I/O's. But long running queries are where the big benefits show up. The high level tuning approach for them is as follows:
1. Check to see if you are getting Smart Scans.
2. If you aren't, fix what ever is preventing them from being used.
We've been involved in somewhere between 25-30 DB Machine installations now and in many cases, a little bit of effort changes performance dramatically. If you are only getting 2 to 3X improvement over your previous platform on these long running queries you are probably not getting the full benefit of the Exadata optimizations. So the first step is learning how to determine if you are getting Smart Scans or not and on what portions of the statement. Wait events, session statistics, V$SQL, SQL Monitoring are all viable tools that can show you that information. -
How to do Indepth table analysis without using any tool
Is there anyway of indepth analysis of tables of a database without using any tool, i.e. by means of sql's, pl/sql's only.
My database has around 800 main tables which have several other related relational tables(objects relating 2 tables on basis of OTO, OTM, MTO, MTM object relationship) and several dependent views(made from among the 800 base table only).
Currently database is indexed, has joins and views, all in working scenario but yet do not gauranty consistent behaviour.
My sole purpose is to analyse all main tables (around 800 of them) in my database by running scripts and prompt errors, warnings, exceptions wherever table needs indexing or change of joins(eg - from cross to inner,etc. ) or check inorder to avoid table full scan for related relational tables and dependent views.
My databse is Oracle10g.
Please do revert for any doubts.My sole purpose is to analyse all main tables (around 800 of them) in my database by running scripts and prompt errors, warnings, exceptions wherever table needs indexing or change of joins(eg - from cross to inner,etc. ) or check inorder to avoid table full scan for related relational tables and dependent views.There are no tools which can tell whether your table needs indexing or whether you need to change joins methods, by just looking at your database. At most, you can get an idea about the missing indexes in case of a parent-child relation. Everything else, falls under application tuning - which involves sql tracing, profiling etc.
If you cannot trace individual sessions, then you are better off monitoring the database with statspack/AWR (if licensed). Generate reports at frequent intervals, look at the resource consuming SQLs and have a discussion with dev team to fix them, whenever possible.
EM can also be used for SQL analysis. -
About Automatic SQL Tuning.
Hii all,
I have tuned one query by using SQL Tuning Advisor in SQL Developer Tool. I have seen much improvement in Explain plan in advisor .. After tuning finished i executed following script.
{code}
select dbms_sqltune.report_tuning_task('staName47421') as Rems
from dual;
{code}
I seen an explain plan but i am not able to see recommended changes in query .. Is it possible to get the query directly from any view ..
I tried and checked in many dynamic views by keeping plan_hash_value as reference .. I found records in some dynamic views like dba_sqltune_plans and dba_advisor_sqlstats but i am unable to find exact sqltext .. Kindly advice if possible to get that query .. My query was taking 17 mins but it got reduced to 2 mins by seeing sql tuned explain plan so i want to see as what are the changes been done .
Regards,
Nitesh.I would rather accept what is in the documentation:
"If a SQL profile is recommended, the database tests the new profile by executing the SQL statement both with and without the profile. If the performance improvement improves at least threefold, then the database accepts the SQL profile, but only if the ACCEPT_SQL_PROFILES task parameter is set to TRUE. Otherwise, the automatic SQL tuning reports merely report the recommendation to create a SQL profile." Automatic SQL Tuning
"If automatic implementation of SQL profiles is enabled (the default is disabled), then the database implements any SQL profiles that promise a great performance benefit. The implementation occurs at tuning time so that the database can immediately benefit from the new plan. You can enable or disable automatic implementation by using the SET_AUTO_TUNING_TASK_PARAMETER API to set the ACCEPT_SQL_PROFILES parameter." DBMS_AUTO_SQLTUNE
Maybe you are looking for
-
BSOD after installing Boot Camp, AMD Radeon 6630M driver issue
I have reinstalled Windows using Boot Camp twice now and get a blue screen right after installing the Boot Camp drivers and restarting. I am installing Windows 7 Ultimate 64-bit on my Mac mini 2011 edition. I created an install disk in Lion and used
-
Why are my colors different?
I have some objects with spot colors in a file. The document color mode is CMYK. When I copy the objects, and place them into a new CMYK file, the colors appear differently. Plus, when I convert the colors to process, the values are different than wh
-
Emailing results of a SQL Query....
I am new to Oracle and was wondering if there is a way to create an email task that could be used to email results of a sql query. My query returns emails addresses that meet a specified criteria. I want to use an email task that takes these addresse
-
Hi , I am creating some FI documents using FB01 and some expense accounts posting to WBS elements. After this we run kka2, i.e result analysis. The problem is that data is populating the COEP table and not COEPB . We transfer the data in BW repo
-
Automated Report on Solman for Parameter Recommendation
Hello Experts, We are having a performance issue with our Solman. There is an inbuilt functionality of Solution Manager to run a report like EWA which will recommend you the Parameter Values for ABAP, Java and Database. This report is used for perfor