Home > SQL Tuning with SQL Access Advisor
Chapter Download:
EMAIL THIS

SQL Tuning with SQL Access Advisor

13 Jun 2005 | Rampant TechPress

Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   

This excerpt, taken from Easy Oracle Automation: Oracle10g Automatic Storage, Memory and Diagnostic Features by Dr. Arun Kumar R, describes the process of using SQL Access Advisor for tuning SQL. Click here to view the entire chapter.

SQL Tuning with SQL Access Advisor

To use the SQL Access Advisor for tuning, perform the following four steps:

  1. Create a task.
  2. Define the workload.
  3. Generate the recommendations.
  4. Implement the recommendations.

Task Operations

A task has all the information relating to the recommendation process and its results. To automatically create a task, use the wizard in OEM or dbms_advisor.quick_tune. After creating a task, the DBA has to execute the task in preparation for the tuning process:

BEGIN
  DBMS_SQLTUNE.EXECUTE_TUNING_TASK (task_name => 'dba_tuning_task_v1' );
END;
/
For the Senior DBA or those who prefer the hands-on approach, use the dbms_advisor.create_task procedure. To view the tasks associated with any specific user or application schema, use the following command:
SELECT TASK_NAME FROM DBA_ADVISOR_LOG WHERE OWNER = 'owner' ;
Similarly, the dba_advisor_log can be used to find the status of a tuning task:
SELECT TASK_NAME FROM DBA_ADVISOR_LOG WHERE task_name = 'dba_tuning_task_v1' ;
The execution progress can be checked with the v$session_longops view, which gives the status of various operations that run longer than six seconds (in absolute time).

To view the results of the task execution, use the report_tuning_task_function:

SELECT DBMS_SQLTUNE.REPORT_TUNING_TASK( 'dba_tuning_task_v1') FROM DUAL;
This report contains all the results and recommendations of the automatic SQL tuning. For each proposed recommendation, the rationale and advantages can be found, along with the SQL commands needed to implement the changes.

There are other useful APIs to be used along with the dbms_sqltune package for managing SQL tuning tasks. They are as follows:

  • drop_tuning_task – used to drop a task and remove all associated results.
  • reset_tuning_task – used to reset a task during execution to its initial state.
  • interrupt_tuning_task – used to interrupt a task and exit with intermediate results.
  • cancel_tuning_task – used to cancel a task execution and remove all results.
Next, the use of workload with SQL Access Advisor will be examined.

Click here to view the entire chapter.



Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Oracle database performance problems and tuning
Oracle tutorial library: SearchOracle.com's learning guides
What managers should consider when starting a database scaling project
Oracle releases new database, says 11g upgrade will cut costs
Oracle raises prices on database management packs
Oracle New Year's resolutions, part 1: Advice for navigating 2009
Solving common Oracle errors guide
Oracle 11g data compression
Varchar or number for better performance?
Do statistics on SYS-owned objects hurt performance in 10g?
Inside the Oracle 11g SQL Performance Advisor, part 1

Oracle and SQL
Oracle tutorial library: SearchOracle.com's learning guides
Can I specify Oracle column order in my database table?
Review: Oracle's 11g R2 database has some good and bad
SELECT statement syntax and examples
Oracle PL/SQL tutorial
PL/SQL datatypes in Oracle
Stored procedures in PL/SQL
PL/SQL functions and triggers in Oracle
Do I need a license for SQL Developer Data Modeler in Oracle?
Using the SQL GROUP BY clause for counting combinations
Oracle and SQL Research

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
autonomous transaction  (SearchOracle.com)
CFML  (SearchOracle.com)
dynamic SQL  (SearchOracle.com)
foreign key  (SearchOracle.com)
Java Database Connectivity  (SearchOracle.com)
Open Database Connectivity  (SearchOracle.com)
Oracle  (SearchOracle.com)
stored procedure  (SearchOracle.com)
The Open Group  (SearchOracle.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary




Oracle Tutorials and Expert Advice
HomeNewsTopicsTipsAsk the ExpertsMultimediaWhite PapersProductsBlogs
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2003 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts