tuning tips for developers -...
TRANSCRIPT
www.sagecomputing.com.au
Tuning Tips for Developers
Penny Cookson SAGE Computing Services
SAGE Computing Services
Customised Oracle Training Workshops and Consulting
SAGE Computing Services
Customised Oracle Training Workshops and Consulting
Penny Cookson
Managing Director and Principal Consultant
Working with Oracle products since 1987
Oracle Magazine Educator of the Year 2004
www.sagecomputing.com.au
BEGINdbms_stats.gather_table_stats(ownname=>'AUSOUG', tabname=>'BOOKINGS_LARGE', cascade=>TRUE, method_opt => 'FOR ALL COLUMNS SIZE 1 FOR COLUMNS SIZE 254 RESOURCE_CODE, STATUS ',no_invalidate=>FALSE);END;/
Is there an index?
Is the column selective enough?
Do we have statistics?
Do we have skewed data?
Do we have a histogram?
Have the values changed since
we gathered it?
You need the DBA to install this initially and give you the SQLT_USER_ROLE(ADVISOR and SELECT_CATALOG_ROLE)
SQLTXPLAIN documentation
Is there an index?
Is the column selective enough?
Do we have statistics?
Do we have skewed data?
Do we have a histogram?
Have the values changed since
we gathered it?
What is the effect of Bind
Variables?
Works best with Performance Pack and DBA privs but you can run as a normal user with SELECT_CATALOG_ROLE
From Oracle
You need the DBA to install this initially and give you the SQLT_USER_ROLE(ADVISOR and SELECT_CATALOG_ROLE)
sqltxtract 458phj6d932uu Manager1
You need the SQLTXPLAIN password
SQLD360
Nothing installed
Don’t need Oracle account
Analyses AWR/ASH
You can run it with SELECT_CATALOG_ROLE
More information if you have Performance Packs
SELECT a.buffer_gets, a.executions,TRUNC(a.buffer_gets / nullif(a.executions,0)) getsper,a.sql_fulltext
FROM v$sqlstats aWHERE a. buffer_gets / nullif(a.executions,0) > :readsORDER BY a.buffer_gets / nullif(a.executions,0) DESC;
What statement is causing the problem
What to ask for:DEV/TEST: SQLTEXPLAIN installed
SQLT_USER_ROLE grantedSQLTXPLAIN passwordWhich packs are licensed?
Or worst caseSELECT_CATALOG_ROLE
PROD: User with CREATE SESSION andSELECT_CATALOG_ROLEWhich packs are licensed?
For Production Support/Developers who are expected to
assist with production performance problems
What to use:Explain Plan: Can be misleading
dbms_xplan.display_cursor: for what it really did
SQLD360: for pretty much everything about the one statement -no objects required (Accenture Enkitec Group)
v$ tables: v$sqlstats, v$sql_plan, v$sqlplan_statistics
SQLTXPLAIN: for pretty much everything about the one statement if you can get access and the DBA will create the objects (Oracle)
SQLHC: if your DBA won’t create the objects for SQLTXPLAIN (Oracle)
eDB360: for everything about everything (Accenture Enkitec Group)
Is there an index?
Is the column selective enough?
Do we have statistics?
Do we have skewed data?
Do we have a histogram?
Have the values changed since
we gathered it?
What is the effect of Bind
Variables?
What is the effect of the Optimisation Environment?
Do we have extended statistics?
Are they the right indexes
(order)?
Are they collected correctly
(sample size)?
www.sagecomputing.com.au
Questions?
Penny Cookson SAGE Computing Services
SAGE Computing Services
Customised Oracle Training Workshops and Consulting