Hi! I do these short webinars on Oracle technical contents, usually on Mondays. I post the slides and replay to my website. This week’s content is ‘Why is my System Slow’…where I show some nice SQL to help find poorly performing SQL then produce explain plans. In the past, I’ve shown you my JS Tuner, I recently renamed this to SQL Tuner. Copy the SQL you find in there, use the GATHER_PLAN_STATISICS feature and get useful tuning information. I’ve always encouraged people to use Toad as a SQL Tuning Tool. I’ve done this particular webinar for Dell, at user groups, and will do parts of it again on upcoming Toad Road Shows. I have dedicated an entire chapter to this exact topic in my recent Toad Unleashed book. There are two lines of thought with Oracle Performance Tuning: Oracle Working Too Hard Oracle Not Allowed to Work I’ll review a quick scenario in this blog for the first item. Next weeks blog, I’ll cover the 2 nd . Oracle Working Too Hard…can show up in a number of places. I’ve blogged on Stats Pack a while back, Toad has a nice interface to this…and you don’t need any special licensing (diagnostics pack) as it does not use AWR information (I’m told you need Oracle’s Diagnostic Pack licensing to review ANY AWR information). Here I look for the wait event ‘db file scattered read’, indicating a lot of full table scans perhaps. I’ll produce an article discussing a good plan to find these kinds of issues. Anyway, back to ‘Oracle Working Too Hard’… I call this script ‘FILE_IO_INFO.sql’. This shows the busy tablespaces by data file. We can see here that File #4, is doing a lot reads from the EXAMPLE tablespace. Take this file number and a SYS password and run this script TABLE_IO_INFO.sql: This is a view into the actual library cache! I used to do quite a bit of ‘internals’ research on the database, I am always fascinated with how things work, including the Oracle database. Anyway, you take that file number from the prior script and plug it in here, and this script will show you the objects accessing that tablespace. Now, you have partial SQL text. You can use either of the 2 following scripts and use this partial SQL text to get useful explain plan information using this partial SQL text: FIND_VSQL_SQL.sql Select plan_table_output From v$sql s, table(dbms_xplan.display_cursor(s.sql_id, s.child_number)) t Where s.sql_text like '%&Enter_SQL_Text%' …or…this one that finds the SQL in AWR tables (you must have the Oracle Diagnostics Pack licensing to use this script…)…FIND_AWR_SQL.sql Select plan_table_output From dba_hist_sqltext s, Table(dbms_xplan.display_cursor(s.sql_id)) t Where s.sql_text like '%&Enter_SQL_Text%' You can ask me for any of the scripts referenced in this blog. Next week, I’ll discuss Finding Problems when Oracle is Not Allowed to Work …ie: contention. I will produce an article that brings all these pieces together! Dan Hotka Oracle ACE Director Author/Instructor/CEO
↧