Differece b/w SQL Tunning & SQL Access advisor

What the difference b/w these 2 , i know SQL Access advisor suggest for index or materialize view for fast query....what SQL tunning do?

Mithu,
Please stop lying!!!
You are not new in this field. You have been asking RTFM questions for almost three years!!! When I had three years experience, I didn't need to ask the questions you think you need to ask. I LOOKED THEM UP IN THE DOCUMENTATION!!
I will continue to expose your attitude as abysmal.
You are in flagrant violation of the Etiquette in this forum.
You are a parasite. You don't want to do anything to resolve your own questions.
You are a disgrace to the DBA profession.
In fact, because of this I may want to have your account removed.
Sybrand Bakker
Senior Oracle DBA

Similar Messages

  • SQL Access Advisor is not working

    Hi all .
    I'm running manually a script in order to improve database performance by SQL Access Advisor 10.2 . But it seems not goot when hitting en error .
    DECLARE
    l_taskname VARCHAR2(30) := 'test_sql_access_task';
    l_task_desc VARCHAR2(128) := 'Test SQL Access Task';
    l_wkld_name VARCHAR2(30) := 'test_work_load';
    l_saved_rows NUMBER := 0;
    l_failed_rows NUMBER := 0;
    l_num_found NUMBER;
    BEGIN
    -- Create an SQL Access Advisor task.
    DBMS_ADVISOR.create_task (
    advisor_name => DBMS_ADVISOR.sqlaccess_advisor,
    task_name => l_taskname,
    task_desc => l_task_desc);
    -- Reset the task.
    DBMS_ADVISOR.reset_task(task_name => l_taskname);
    -- Create a workload.
    SELECT COUNT(*)
    INTO l_num_found
    FROM user_advisor_sqlw_sum
    WHERE workload_name = l_wkld_name;
    IF l_num_found = 0 THEN
    DBMS_ADVISOR.create_sqlwkld(workload_name => l_wkld_name);
    END IF;
    -- Link the workload to the task.
    SELECT count(*)
    INTO l_num_found
    FROM user_advisor_sqla_wk_map
    WHERE task_name = l_taskname
    AND workload_name = l_wkld_name;
    IF l_num_found = 0 THEN
    DBMS_ADVISOR.add_sqlwkld_ref(
    task_name => l_taskname,
    workload_name => l_wkld_name);
    END IF;
    -- Set workload parameters.
    DBMS_ADVISOR.set_sqlwkld_parameter(l_wkld_name, 'ACTION_LIST', DBMS_ADVISOR.ADVISOR_UNUSED);
    DBMS_ADVISOR.set_sqlwkld_parameter(l_wkld_name, 'MODULE_LIST', DBMS_ADVISOR.ADVISOR_UNUSED);
    DBMS_ADVISOR.set_sqlwkld_parameter(l_wkld_name, 'SQL_LIMIT', DBMS_ADVISOR.ADVISOR_UNLIMITED);
    DBMS_ADVISOR.set_sqlwkld_parameter(l_wkld_name, 'ORDER_LIST', 'PRIORITY,OPTIMIZER_COST');
    DBMS_ADVISOR.set_sqlwkld_parameter(l_wkld_name, 'USERNAME_LIST', DBMS_ADVISOR.ADVISOR_UNUSED);
    DBMS_ADVISOR.set_sqlwkld_parameter(l_wkld_name, 'VALID_TABLE_LIST', DBMS_ADVISOR.ADVISOR_UNUSED);
    DBMS_ADVISOR.import_sqlwkld_sqlcache(l_wkld_name, 'REPLACE', 2, l_saved_rows, l_failed_rows);
    -- Set task parameters.
    DBMS_ADVISOR.set_task_parameter(l_taskname, '_MARK_IMPLEMENTATION', 'FALSE');
    DBMS_ADVISOR.set_task_parameter(l_taskname, 'EXECUTION_TYPE', 'INDEX_ONLY');
    DBMS_ADVISOR.set_task_parameter(l_taskname, 'MODE', 'COMPREHENSIVE');
    DBMS_ADVISOR.set_task_parameter(l_taskname, 'STORAGE_CHANGE', DBMS_ADVISOR.ADVISOR_UNLIMITED);
    DBMS_ADVISOR.set_task_parameter(l_taskname, 'DML_VOLATILITY', 'TRUE');
    DBMS_ADVISOR.set_task_parameter(l_taskname, 'ORDER_LIST', 'PRIORITY,OPTIMIZER_COST');
    DBMS_ADVISOR.set_task_parameter(l_taskname, 'WORKLOAD_SCOPE', 'PARTIAL');
    DBMS_ADVISOR.set_task_parameter(l_taskname, 'DEF_INDEX_TABLESPACE', DBMS_ADVISOR.ADVISOR_UNUSED);
    DBMS_ADVISOR.set_task_parameter(l_taskname, 'DEF_INDEX_OWNER', DBMS_ADVISOR.ADVISOR_UNUSED);
    DBMS_ADVISOR.set_task_parameter(l_taskname, 'DEF_MVIEW_TABLESPACE', DBMS_ADVISOR.ADVISOR_UNUSED);
    DBMS_ADVISOR.set_task_parameter(l_taskname, 'DEF_MVIEW_OWNER', DBMS_ADVISOR.ADVISOR_UNUSED);
    -- Execute the task.
    DBMS_ADVISOR.execute_task(task_name => l_taskname);
    END;
    can you help me out ?
    REgard .

    Error report:
    ORA-13600: error encountered in Advisor
    ORA-13635: The value provided for parameter ADJUSTED_SCALEUP_GREEN_THRESH cannot be converted to a number.
    ORA-06512: at "SYS.PRVT_ADVISOR", line 3902
    ORA-06512: at "SYS.PRVT_ADVISOR", line 3765
    ORA-06512: at "SYS.DBMS_ADVISOR", line 56
    ORA-06512: at line 10
    13600. 00000 - "error encountered in Advisor\n%s"
    *Cause:    An error occurred in the Advisor.
    This message will be followed by a second message giving
    more details about the nature of the error.
    *Action:   See the Advisor documentation
    for an explanation of the second error message.

  • Privilege for SQL Access Advisor in OEM

    Hi experts,
    I tried to enter the option SQL Access Advisor in Oracle enterprise manager as user sh and got the following german error :
    Berechtigungsfehler
    Sie haben keine ausreichenden Berechtigungen zur Ausführung des SQL Access Advisors. Dazu ist die Rolle OEM_ADVISOR erforderlich. translated to english:
    Privileg error
    You don't have enough Privilegs to execute  SQL Access Advisors. The role OEM_ADVISOR is needed. but the user sh has in my system following roles:
    GRANTEE                        GRANTED_ROLE                   ADM DEF
    SH                             SELECT_CATALOG_ROLE            NO  YES
    SH                             OEM_MONITOR                    NO  NO
    SH                             OEM_ADVISOR                    NO  NO     "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
    SH                             RESOURCE                       NO  YES
    SH                             CWM_USER                       NO  YESCan anyone help me?
    regards
    hqt200475

    Non-default roles are not enabled "by default".
    http://docs.oracle.com/cd/E11882_01/network.112/e16543/authorization.htm#sthref953

  • SQL Access advisor

    We are on SQL Developer 3.2.09. We have a SQL tuning advisor Icon in this version. I am wondering if we can access SQL Access advisor for a specific query - I need advise on Materialized View creation. We can invoke DBMS_ADVISOR package for a set of SQL(s) but do we have this integration buit in SQL Developer. We are using Oracle 10gR2 and 11gR2.
    Thanks

    Pl post details of OS and database versions, along with what you are specifically trying to do.
    http://download.oracle.com/docs/cd/E11882_01/server.112/e16638/advisor.htm
    HTH
    Srini

  • SQL TRACE/TKPROF VS SQL ACCESS ADVISOR

    Hi All,
    Can anyone please tell me what's the exact difference between SQL TRACE/TKPROF and SQL ACCESS ADVISOR in Oracle 10g.(By showing some examples)
    And also why should I go for SQL ACCESS ADVISOR ?? (Since I have used the former all these days) :)
    Why can't I still use SQL TRACE/TKPROF.
    Please if anyone can pour light on this. Thanks in Advance.
    Regards,
    Marlon.

    Better go through below link........
    http://www.remote-dba.net/oracle10g_tuning/t_sqlaccess_advisor.htm_
    -Ek

  • Do i implement SQL Access Advisor Recommendations

    Hi,
    I am using oracle 10.2.0 and i run SQL Access Advisor which gives me recommendations. But i can't figure out how many recommendations or all or some of them on any criteria i should implement and will they improve database performance.
    Thanks
    Umesh

    The Recommendation text would have the information of the SQL for which you have ran the Advisor and gives you the Explain and cost involved. Also,it would tell you the percentage of benefit by implementing the Recommendations.it gives you an adjusted PLan with cost and how you implement the same.
    Follow the process in your Test environment and to see if you get the same recommendations. if so, implement and see whether it really improved the performance or not.

  • Enterprise Manager - sql tuning advisor , Access advisor for SQL Tuning

    Hi,
    NO I mean in oracle 10g you have the enterprise manager which can be used to tune sql statements using the SQL ADvisor and SQL access advisor.
    I believe in oracle 10g the process of SQL Tuning is slightly easier using the Enterprise Manager ...so if some one could explain me that process...
    Again thanking you in advance
    regds
    Manoj Gokhale

    Hi Manoj,
    tune sql statements using the SQL ADvisor and SQL access advisor.Do you have the OEM extra cost "performance pack"?
    The OEM screens are fairly self-explainatory, but here are some references on the 10 SQL tuning advisors:
    http://www.oracle-base.com/articles/10g/AutomaticSQLTuning10g.php
    http://www.remote-dba.net/oracle_10g_tuning/t_oracle_sql_tuning_advisor_session_example.htm

  • Additional licenses reuired for using Sql Tuning Advisor In SQL Developer 4.0.3

    Hi,
    We have Oracle Database 11g Enterprise Edition Release 11.2.0.3.0. Do we need to purchase an additional oracle license for using SQL Tuning Advisor Option in SQL Developer 4.0.3 

    We have Oracle Database 11g Enterprise Edition Release 11.2.0.3.0. Do we need to purchase an additional oracle license for using SQL Tuning Advisor Option in SQL Developer 4.0.3 
    The Oracle Tuning Pack is DATABASE functionality - it is part of the database. Sql Developer just uses it.
    Yes - to use ANY of the features of the tuning pack requires an extra cost license.
    http://docs.oracle.com/cd/B28359_01/license.111/b28287/options.htm#CIHFIHFG
    Oracle Tuning Pack
    The Oracle Tuning Pack provides database administrators with expert performance management for the Oracle environment, including SQL tuning and storage optimizations. The Oracle Diagnostic Pack is a prerequisite product to the Oracle Tuning Pack. Therefore, to use the Tuning Pack, you must also have a Diagnostic Pack.
    The Tuning Pack includes the following features:
      SQL Access Advisor
      SQL Tuning Advisor
      Automatic SQL Tuning
      SQL Tuning Sets
      SQL Monitoring
      Reorganize objects
    In order to use the features listed above, you must purchase licenses for the Tuning Pack, with one exception: SQL Tuning Sets can be used if you have licensed either the Tuning Pack or Oracle Real Application Testing. A new initialization parameter, CONTROL_MANAGEMENT_PACK_ACCESS, is introduced to control access to the Diagnostic Pack and Tuning Pack in the database server. This parameter can be set to one of three values:
      DIAGNOSTIC+TUNING: Diagnostic Pack and Tuning Pack functionally is enabled in the database server.
      DIAGNOSTIC: Only Diagnostic Pack functionality is enabled in the server.
      NONE: Diagnostic Pack and Tuning pack functionally is disabled in the database server.
    The Tuning Pack functionality can be accessed by the Enterprise Manager links as well as through the database server command-line APIs. The use of either interface requires licensing of the Tuning Pack

  • Access Advisor Job fails every time?

    hi
    i made a tuning set and tried to get some recomondations for tuning by starting a sql access advisor job.
    After i submited the job i see unter the "oracle sheduled" my failed job. as error message i get the following information if i click the button for showing the job defintion:
    "ORA-13605: The specified task or object string does not exist for the current user."
    and indeed the user name is shown empty. how can i set a user for an access advisor job? or why doesn't that happen automatically?
    can anyone help me?

    This turned out to work for me, too! It was nothing to do with network switch configuration, per se-- or at least I didn't have to change anything on my switch to fix it. Instead I tried fusiongroup's method of getting into the command-line before the WinPE
    boot hit the "Preparing network connections" step, and I repeatedly ipconfig /renewed until suddenly the TS reached the next step of the sequence instead of failing out.
    I also made this an "Available" sequence instead of a "Required" sequence, which I think buys you a little time in terms of offering a GUI in WinPE for the sequence, instead of just trying to run it.
    One last thing: I was running this on a Workgroup machine that is not joined to our domain; I had followed another tutorial to get the client installed on it even though it's outside the domain. Prior to trying the command-line fix fusiongroup gave, I also
    went into Assets and Compliance in Configuration Manager and right-clicked the machine in the list of devices, and found that I had to "Approve" it for management by SCCM. Don't know if that helped as well.
    Sylvie Andrews

  • Differernce between SQL Tuning Pack and SQL Tuning Advisor, Access Advisor

    Hi. all.
    I have been using "TKPROF" in order to tune SQL till now.
    I am learning 10g, and would like to know the difference
    between "1. SQL Tuning Pack" and "2. SQL Tuning Advisor, Access Advisor".
    Are they same thing? If not, what are the differences in their "functionality"?
    All I know is that SQL Tuning Pack is not free, and SQL Tuning Advisor
    is packed with default installation. Right???
    Could you give me some html links or your "any advice and experience"?
    Thanks in advance. Have a good day.
    Best Regards.

    Hi,
    There are alternatives to the Oracle tuning packs, and remember the SQL advisors are relatuively simple, finding missing indexes and recommending MV's.
    A human can do a better job if you use the right techniques.
    BTW, you can get a SQLTuning advisor license online for only $3k:
    http://www.dba-oracle.com/oracle_news/2005_3_17_dql_tuning_access_advisor_licenses_available_online.htm
    SHAMELESS PITCH! - I wrote a book that describes techniques for tuning with scripts, instead of the advisors, if you are interested:
    http://www.rampant-books.com/book_2005_1_awr_proactive_tuning.htm
    Hope this helps. . . .
    Donald K. Burleson
    Oracle Press author

  • Oracle 10g SQL Tuning Advisor

    I am working as a junior DBA. I tried to tune a query using SQL Tuning Advisor that is with DBMS_SQLTUNE.I have created the tuning task successfully with DBMS_SQLTUNE.create_tuning_task.But when i execute the tuning task with EXEC DBMS_SQLTUNE.execute_tuning_task() i got an error like
    SQL> EXEC DBMS_SQLTUNE.execute_tuning_task(task_name => 'rep_three');
    BEGIN DBMS_SQLTUNE.execute_tuning_task(task_name => 'rep_three'); END;
    ERROR at line 1:
    ORA-00081: address range [0x60000000000A7D70, 0x60000000000A7D74) is not
    readable
    ORA-00600: internal error code, arguments: [kesatmGetSqlStats:optCost], [], [],
    ORA-06512: at "SYS.PRVT_ADVISOR", line 1624
    ORA-06512: at "SYS.DBMS_ADVISOR", line 186
    ORA-06512: at "SYS.DBMS_SQLTUNE", line 1008
    ORA-06512: at line 1The oracle version is Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bi. The OS is HP-UX. The version is HP-UX B.11.23 U ia64.
    I tried to execute DBMS_SQLTUNE as DWH user.I have granted the advisor,DROP ANY SQL PROFILE,ALTER ANY SQL PROFILE,CREATE ANY SQL PROFILE privileges and DBA roles to the DWH user. The way i ran DBMS_SQLTUNE is, first i logged in as DWH user and i tried to execute the query for getting the SQL_ID for the query. For getting the SQL_ID i selected the SQL_ID column value for the DWH user session from v$session.I kept that query executing and meanwhile i opened another session as DWH user and created the tuning task as follows
    DECLARE
      l_sql_tune_task_id  VARCHAR2(100);
    BEGIN
      l_sql_tune_task_id := DBMS_SQLTUNE.create_tuning_task (
                              sql_id      => 'b65fj39dkkb9v',
                              scope       => DBMS_SQLTUNE.scope_limited,
                              time_limit  => 3600,
                              task_name   => 'rep_three',
                              description => 'Report Tuning');
      DBMS_OUTPUT.put_line('l_sql_tune_task_id: ' || l_sql_tune_task_id);
    END;
    /The creation of tuning task was successful.And i executed the tuning task as follows
    EXEC DBMS_SQLTUNE.execute_tuning_task(task_name => 'rep_three');The above mentioned errors came when i executed the tuning task.
    I am also adding the query which i have tried to tune
    select * from dwh.beneficiary_dim BEN_DIM,
                     (Select adr_dp_id,
                   adr_account_no,
                   ADR_ADDRESS_LINE_1 || ' ' ||
                   ADR_ADDRESS_LINE_2 || ' ' ||
                   ADR_ADDRESS_LINE_3 || ' ' ||
                   ADR_ADDRESS_LINE_4 as ADDRESS,
                   adr_pin_code,adr_phone_no,adr_fax_no
              from dwh.beneficiary_address_dim where adr_type_id = 1) PERMANENT_ADD_DIM,
           (Select adr_dp_id,
                   adr_account_no,
                   ADR_ADDRESS_LINE_1 || ' ' ||
                   ADR_ADDRESS_LINE_2 || ' ' ||
                   ADR_ADDRESS_LINE_3 || ' ' ||
                   ADR_ADDRESS_LINE_4 as ADDRESS,
                   adr_pin_code,adr_phone_no,adr_fax_no
              from dwh.beneficiary_address_dim where adr_type_id = 2) BANK_ADD_DIM,
           (Select adr_dp_id,
                   adr_account_no,
                   ADR_ADDRESS_LINE_1 || ' ' ||
                   ADR_ADDRESS_LINE_2 || ' ' ||
                   ADR_ADDRESS_LINE_3 || ' ' ||
                   ADR_ADDRESS_LINE_4 as ADDRESS,
                   adr_pin_code,adr_phone_no,adr_fax_no
              from dwh.beneficiary_address_dim where adr_type_id = 3) NOM_GUARDIAN_ADD_DIM,
           (Select adr_dp_id,
                   adr_account_no,
                   ADR_ADDRESS_LINE_1 || ' ' ||
                   ADR_ADDRESS_LINE_2 || ' ' ||
                   ADR_ADDRESS_LINE_3 || ' ' ||
                   ADR_ADDRESS_LINE_4 as ADDRESS,
                   adr_pin_code,adr_phone_no,adr_fax_no
              from dwh.beneficiary_address_dim where adr_type_id = 4) CORR_ADD_DIM,
           (Select adr_dp_id,
                   adr_account_no,
                   ADR_ADDRESS_LINE_1 || ' ' ||
                   ADR_ADDRESS_LINE_2 || ' ' ||
                   ADR_ADDRESS_LINE_3 || ' ' ||
                   ADR_ADDRESS_LINE_4 as ADDRESS,
                   adr_pin_code,adr_phone_no,adr_fax_no
              from dwh.beneficiary_address_dim where adr_type_id = 6) MINOR_ADDRESS,
                     (Select rp.requestid as requestid,
    decode(rp.value,'ALL','ALL','','ALL',decode(substr(rp.value,1,instr(rp.value,'|',1,1)-1),'','ALL',substr(rp.value,1,instr(rp.value,'|',1,1)-1))) as Name,
    decode(rp.value,'ALL','ALL','','ALL',decode(substr(rp.value,(instr(rp.value,'|',1,1)+1),((instr(rp.value,'|',1,2))-(instr(rp.value,'|',1,1)+1))),'','ALL',substr(rp.value,(instr(rp.value,'|',1,1)+1),((instr(rp.value,'|',1,2))-(instr(rp.value,'|',1,1)+1))))) as Address,
    decode(rp.value,'ALL','ALL','','ALL',decode(substr(rp.value,(instr(rp.value,'|',1,2)+1)),'','ALL',substr(rp.value,(instr(rp.value,'|',1,2)+1)))) as PAN
                      from disadmin.requestparameters rp, disadmin.requestparameters rps, disadmin.reportrequests rr
                     where rp.parameterid = 'CNAS_PARAM_VALUE'   
                       and rr.status = 'A'
                       and rp.requestid = rr.id
                       and rp.id = rps.id) P_PARAM_VALUE,
                     (Select rp.requestid as requestid, rp.value as Type
                        from disadmin.requestparameters rp, disadmin.reportrequests rr
                       where rp.parameterid = 'CNAS_NAME_TYPE'
                         and rr.status = 'A'
                         and rp.requestid = rr.id)  P_NAME_TYPE,
                     (Select rp.requestid as requestid, rp.value as Addtype
                        from disadmin.requestparameters rp, disadmin.reportrequests rr
                       where rp.parameterid = 'CNAS_ADDRESS_TYPE'
                         and rr.status = 'A'
                         and rp.requestid = rr.id) P_ADDRESS_TYPE    
       where ( 1= case when P_NAME_TYPE.Type = 'F' then
                   case when BEN_DIM.BDM_FIRST_HOLDER_NAME like DECODE(P_PARAM_VALUE.Name,'ALL','%'||BEN_DIM.BDM_FIRST_HOLDER_NAME||'%','%'||P_PARAM_VALUE.Name||'%')
                             or BEN_DIM.BDM_FIRST_HOLDER_SURNAME like DECODE(P_PARAM_VALUE.Name,'ALL','%'||BEN_DIM.BDM_FIRST_HOLDER_SURNAME||'%','%'||P_PARAM_VALUE.Name||'%')
                        then 1
                   else null end
                 else            
                   case when P_NAME_TYPE.Type = 'ALL' then
                     case when (BEN_DIM.BDM_FIRST_HOLDER_NAME like DECODE(P_PARAM_VALUE.Name,'ALL','%'||BEN_DIM.BDM_FIRST_HOLDER_NAME||'%','%'||P_PARAM_VALUE.Name||'%')
                                or BEN_DIM.BDM_FIRST_HOLDER_SURNAME like DECODE(P_PARAM_VALUE.Name,'ALL','%'||BEN_DIM.BDM_FIRST_HOLDER_SURNAME||'%','%'||P_PARAM_VALUE.Name||'%'))
                                and BEN_DIM.BDM_SECOND_HOLDER_NAME like DECODE(P_PARAM_VALUE.Name,'ALL','%'||BEN_DIM.BDM_SECOND_HOLDER_NAME||'%','%'||P_PARAM_VALUE.Name||'%')
                                and BEN_DIM.BDM_THIRD_HOLDER_NAME like DECODE(P_PARAM_VALUE.Name,'ALL','%'||BEN_DIM.BDM_THIRD_HOLDER_NAME||'%','%'||P_PARAM_VALUE.Name||'%')
                          then 1
                     else null end
                   else null end 
                 end )                    
         and BEN_DIM.BDM_IT_PAN like DECODE(P_PARAM_VALUE.PAN,'ALL','%'||BEN_DIM.BDM_IT_PAN||'%','%'||P_PARAM_VALUE.PAN||'%')
         and (1 = case when P_ADDRESS_TYPE.ADDTYPE = 1 then
                         case when instr(PERMANENT_ADD_DIM.ADDRESS, DECODE(P_PARAM_VALUE.ADDRESS,'ALL',PERMANENT_ADD_DIM.ADDRESS, P_PARAM_VALUE.ADDRESS)) <> 0
                              then 1
                         else null end
                       when P_ADDRESS_TYPE.ADDTYPE = 3 then
                         case when instr(NOM_GUARDIAN_ADD_DIM.ADDRESS, DECODE(P_PARAM_VALUE.ADDRESS,'ALL',NOM_GUARDIAN_ADD_DIM.ADDRESS, P_PARAM_VALUE.ADDRESS)) <> 0 
                           then 1
                         else null end 
                       when P_ADDRESS_TYPE.ADDTYPE = 4 then
                         case when instr(CORR_ADD_DIM.ADDRESS, DECODE(P_PARAM_VALUE.ADDRESS,'ALL',CORR_ADD_DIM.ADDRESS, P_PARAM_VALUE.ADDRESS)) <> 0 
                           then 1
                         else null end
                       when P_ADDRESS_TYPE.ADDTYPE = 6 then
                         case when instr(MINOR_ADDRESS.ADDRESS, DECODE(P_PARAM_VALUE.ADDRESS,'ALL',MINOR_ADDRESS.ADDRESS, P_PARAM_VALUE.ADDRESS)) <> 0 
                           then 1
                         else null end 
                  else null end );The above query also tries to access some tables from another user DISADMIN. Could you please help me in solving this problem while using SQL Tuning Advisor ? I am the only DBA here.

    will the rows really be updated just by using the package?Considering DMLs
    SQL> select * from test
      2  /
            NO
             1
             2
    SQL> ed
    Wrote file afiedt.buf
      1  DECLARE
      2   my_task_name VARCHAR2(30);
      3  my_sqltext   CLOB;
      4  BEGIN
      5  my_sqltext := 'insert into test values (3)';
      6  my_task_name := DBMS_SQLTUNE.CREATE_TUNING_TASK(
      7   sql_text    => my_sqltext,
      8  task_name   => 'my_sql_tuning_task');
      9* end;
    SQL> /
    PL/SQL procedure successfully completed.
    SQL> BEGIN
      2  DBMS_SQLTUNE.EXECUTE_TUNING_TASK( task_name => 'my_sql_tuning_task' );
      3  END;
      4  /
    PL/SQL procedure successfully completed.
    SQL> select * from test
      2  /
            NO
             1
             2
    SQL> SELECT DBMS_SQLTUNE.REPORT_TUNING_TASK( 'my_sql_tuning_task')
      2    FROM DUAL;
    DBMS_SQLTUNE.REPORT_TUNING_TASK('MY_SQL_TUNING_TASK')
    GENERAL INFORMATION SECTION
    Tuning Task Name   : my_sql_tuning_task
    Tuning Task Owner  : TEST
    Scope              : COMPREHENSIVE
    Time Limit(seconds): 1800
    Completion Status  : COMPLETED
    Started at         : 03/27/2008 05:16:14
    Completed at       : 03/27/2008 05:16:16
    DBMS_SQLTUNE.REPORT_TUNING_TASK('MY_SQL_TUNING_TASK')
    Schema Name: TEST
    SQL ID     : gwkmgmyj9824t
    SQL Text   : insert into test values (3)
    There are no recommendations to improve the statement.
    -------------------------------------------------------------------------------Adith

  • SQL Tuning Advisor evaluates statement using wrong plan_hash_value

    The execution plan for one of my SQL statements changed this morning. The statement is in a third-party package. The new plan runs worse than the old plan. I had the SQL tuning advisor evaluate the statement. I ran it three times. Each time it evaluated the original plan, not the new one. I can tell that because the plan_hash_value shown in the advisor's recommendations is the old plan's plan_hash_value. The old plan no longer appears in DBA_HIST_SQL_PLAN. I do not understand why the advisor is using the original plan, nor where it is getting it. It does not show up in Oracle Enterprise Manager either.
    Has anyone see this before?
    Do you have any suggestions how I can force the advisor to evaluate the new execution plan?
    I am running Oracle Database Server 10gR2 Enterprise Edition.
    Thanks,
    Bill

    Following advice given earlier, I ran the SQL Tuning Advisor by executing DBMS_SQLTUNE from within a SQL*Plus session instead of via Oracle Enterprise Manager. The problem I originally encountered in OEM also happened using DBMS_SQLTUNE. Using DBMS_SQLTUNE I specified plan_hash_value => '3657286666' but the results of running create_tuning_task shows that the utility used a different plan_hash_value. See below:
    Based on this, I think the problem I originally blamed on OEM's creation of a SQL Tuning Advisor job was misdirected. I now believe that OEM supplied the proper information to the advisor, but the advisor did not correctly use what is was given.
    Below is what I submitted when I ran create_tuning_task and execute_tuning_task. Note that the value assigned to plan_hash_value is 3657286666. Following the messages from execute_tuning_task, see the output produced by the execution of report_tuning_task. In EXPLAIN PLANS SECTION heading 1 - ORIGINAL, note that Plan Hash Value = 3541843898.
    I submitted instructions to use plan_hash_value 3657286666 but instead it used 3541843898. Why did it do this??????
    I have not found a published bug that describes this condition.
    Thanks,
    Bill
    SQL> DECLARE
    2 stmt_task VARCHAR2(64);
    3 BEGIN
    4 stmt_task:=dbms_sqltune.create_tuning_task(sql_id => 'ab30ujpshkur3', plan_hash_
    value => '3657286666', time_limit => 3600, task_name => 'Tune_ab30ujpshkur3_3657286666'
    , description => 'Task to tune sql_id ab30ujpshkur3 plan_hash_value 3657286666');
    5 END;
    6 /
    PL/SQL procedure successfully completed.
    SQL> EXECUTE dbms_sqltune.execute_tuning_task('Tune_ab30ujpshkur3_3657286666');
    PL/SQL procedure successfully completed.
    Here is the output produced by report_tuning_task:
    SQL> SET linesize 200
    SQL> SET LONG 999999999
    SQL> SET pages 1000
    SQL> SET longchunksize 20000
    SQL> SELECT dbms_sqltune.report_tuning_task('Tune_ab30ujpshkur3_3657286666', 'TEXT', 'ALL') FROM dual;
    SELECT dbms_sqltune.script_tuning_task('Tune_ab30ujpshkur3_3657286666', 'ALL')
    FROM dual;
    DBMS_SQLTUNE.REPORT_TUNING_TASK('TUNE_AB30UJPSHKUR3_3657286666','TEXT','ALL')
    GENERAL INFORMATION SECTION
    Tuning Task Name : Tune_ab30ujpshkur3_3657286666
    Tuning Task Owner : EXPTEST
    Tuning Task ID : 110190
    Scope : COMPREHENSIVE
    Time Limit(seconds) : 3600
    Completion Status : COMPLETED
    Started at : 08/03/2012 14:47:45
    Completed at : 08/03/2012 14:48:54
    Number of Index Findings : 1
    Schema Name: EXPTEST
    SQL ID : ab30ujpshkur3
    SQL Text : SELECT ATTACHED_ACC_ID FROM SERVICE_EVENTS WHERE TSERV_ID = :B4
    AND EQ_NBR = :B3 AND ASSOC_EQ_NBR = :B2 AND (PERFORMED <= :B1 +
    1/1440 AND PERFORMED >= :B1 - 1/1440)
    FINDINGS SECTION (1 finding)
    1- Index Finding (see explain plans section below)
    The execution plan of this statement can be improved by creating one or more
    indices.
    Recommendation (estimated benefit: 100%)
    - Consider running the Access Advisor to improve the physical schema design
    or creating the recommended index.
    create index EXPTEST.IDX$$_1AE6E0001 on
    EXPTEST.SERVICE_EVENTS('EQ_NBR','ASSOC_EQ_NBR');
    Rationale
    Creating the recommended indices significantly improves the execution plan
    of this statement. However, it might be preferable to run "Access Advisor"
    using a representative SQL workload as opposed to a single statement. This
    will allow to get comprehensive index recommendations which takes into
    account index maintenance overhead and additional space consumption.
    EXPLAIN PLANS SECTION
    1- Original
    Plan hash value: 3541843898
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
    Time |
    | 0 | SELECT STATEMENT | | 1 | 32 | 4 (0)|
    00:00:01 |
    |* 1 | FILTER | | | | |
    |
    |* 2 | TABLE ACCESS BY INDEX ROWID| SERVICE_EVENTS | 1 | 32 | 4 (0)|
    00:00:01 |
    |* 3 | INDEX RANGE SCAN | SEVENTS_PERFORMED | 18 | | 2 (0)|
    00:00:01 |
    Query Block Name / Object Alias (identified by operation id):
    1 - SEL$1
    2 - SEL$1 / SERVICE_EVENTS@SEL$1
    3 - SEL$1 / SERVICE_EVENTS@SEL$1
    Predicate Information (identified by operation id):
    1 - filter(:B1+.000694444444444444444444444444444444444444>=:B1-.0006944444444444444
    444
    44444444444444444444)
    2 - filter("EQ_NBR"=:B3 AND "ASSOC_EQ_NBR"=:B2 AND "TSERV_ID"=:B4)
    3 - access("PERFORMED">=:B1-.000694444444444444444444444444444444444444 AND
    "PERFORMED"<=:B1+.000694444444444444444444444444444444444444)
    Column Projection Information (identified by operation id):
    1 - "ATTACHED_ACC_ID"[VARCHAR2,12]
    2 - "ATTACHED_ACC_ID"[VARCHAR2,12]
    3 - "SERVICE_EVENTS".ROWID[ROWID,10]
    2- Using New Indices
    Plan hash value: 2568062050
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| T
    ime |
    | 0 | SELECT STATEMENT | | 1 | 32 | 2 (0)| 0
    0:00:01 |
    |* 1 | FILTER | | | | |
    |
    |* 2 | TABLE ACCESS BY INDEX ROWID| SERVICE_EVENTS | 1 | 32 | 2 (0)| 0
    0:00:01 |
    |* 3 | INDEX RANGE SCAN | IDX$$_1AE6E0001 | 1 | | 2 (0)| 0
    0:00:01 |
    Query Block Name / Object Alias (identified by operation id):
    1 - SEL$1
    2 - SEL$1 / SERVICE_EVENTS@SEL$1
    3 - SEL$1 / SERVICE_EVENTS@SEL$1
    Predicate Information (identified by operation id):
    1 - filter(:B1+.000694444444444444444444444444444444444444>=:B1-.0006944444444444444
    4
    4444444444444444444444)
    2 - filter("TSERV_ID"=:B4 AND "PERFORMED">=:B1-.000694444444444444444444444444444444
    4
    44444 AND "PERFORMED"<=:B1+.000694444444444444444444444444444444444444)
    3 - access("EQ_NBR"=:B3 AND "ASSOC_EQ_NBR"=:B2)
    Column Projection Information (identified by operation id):
    1 - "ATTACHED_ACC_ID"[VARCHAR2,12]
    2 - "ATTACHED_ACC_ID"[VARCHAR2,12]
    3 - "SERVICE_EVENTS".ROWID[ROWID,10]
    SQL> 2
    DBMS_SQLTUNE.SCRIPT_TUNING_TASK('TUNE_AB30UJPSHKUR3_3657286666','ALL')
    -- Script generated by DBMS_SQLTUNE package, advisor framework --
    -- Use this script to implement some of the recommendations --
    -- made by the SQL tuning advisor. --
    -- NOTE: this script may need to be edited for your system --
    -- (index names, privileges, etc) before it is executed. --
    create index EXPTEST.IDX$$_1AE6E0001 on EXPTEST.SERVICE_EVENTS('EQ_NBR','ASSOC_EQ_NBR')
    ;

  • Sql Tuning advisor Misc message

    HI I am using SQL Tuning advisor to tune one of my queries.I am gettin following recommendation
    Miscellaneous     The optimizer could not merge the view at line ID 4 of the execution plan.
    I am attaching my execution plan .Please let me know what does that mean and what action i have to take
    Execution Plan
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Tim
    | 0 | SELECT STATEMENT | | | | 10130 (100)|
    | 1 | HASH GROUP BY | | 56 | 15848 | 10130 (1)| 00:
    | 2 | VIEW | | 56 | 15848 | 10129 (1)| 00:
    | 3 | WINDOW BUFFER | | 56 | 63280 | 10129 (1)| 00:
    | 4 | VIEW | | 56 | 63280 | 10129 (1)| 00:
    | 5 | WINDOW SORT | | 56 | 24752 | 10129 (1)| 00:
    | 6 | NESTED LOOPS | | 56 | 24752 | 10128 (1)| 00:
    | 7 | NESTED LOOPS | | 55 | 22165 | 10018 (1)| 00:
    | 8 | NESTED LOOPS | | 58 | 21866 | 9902 (1)| 00:
    | 9 | NESTED LOOPS | | 60 | 21060 | 9781 (1)| 00:
    | 10 | NESTED LOOPS | | 60 | 19020 | 9661 (1)| 00:
    | 11 | NESTED LOOPS | | 63 | 18333 | 9534 (1)| 00:
    | 12 | NESTED LOOPS | | 67 | 17755 | 9400 (1)| 00:
    | 13 | NESTED LOOPS | | 67 | 12931 | 9333 (1)| 00:
    | 14 | NESTED LOOPS | | 67 | 11725 | 9266 (1)| 00:
    | 15 | HASH JOIN | | 67 | 10854 | 9198 (1)| 00:
    | 16 | HASH JOIN | | 67 | 10117 | 9160 (1)| 00:
    | 17 | HASH JOIN | | 67 | 9581 | 9154 (1)| 00:
    | 18 | TABLE ACCESS BY INDEX ROWID | T_FACT_AGGR_TAX_RPTG | 1355 | 178K| 9149 (1)| 00:
    | 19 | NESTED LOOPS | | 67 | 9045 | 9149 (1)| 00:
    | 20 | MAT_VIEW ACCESS FULL | MV_T_DIM_INSTM | 1 | 43 | 53 (4)| 00:
    | 21 | BITMAP CONVERSION TO ROWIDS| | | | |
    | 22 | BITMAP INDEX SINGLE VALUE | XB_T_FACT_AGGR_TAX_RPTG_N5 | | | |
    | 23 | MAT_VIEW ACCESS FULL | MV_T_DIM_CURR | 457 | 3656 | 5 (0)| 00:
    | 24 | MAT_VIEW ACCESS FULL | MV_T_DIM_CURR | 457 | 3656 | 5 (0)| 00:
    | 25 | VIEW | index$_join$_007 | 3480 | 38280 | 38 (6)| 00:
    | 26 | HASH JOIN | | | | |
    | 27 | INDEX FAST FULL SCAN | XPK_MV_ORIG_T_DIM_MNGMT_ENT | 3480 | 38280 | 10 (0)| 00:
    | 28 | INDEX FAST FULL SCAN | X_MV_CUR_T_DIM_MNGMT_ENT_N1 | 3480 | 38280 | 27 (4)| 00:
    | 29 | TABLE ACCESS BY INDEX ROWID | T_DIM_DATE | 1 | 13 | 1 (0)| 00:
    | 30 | INDEX UNIQUE SCAN | XPK_T_DIM_DATE | 1 | | 0 (0)|
    | 31 | MAT_VIEW ACCESS BY INDEX ROWID | MV_T_DIM_EXTL_PARTY | 1 | 18 | 1 (0)| 00:
    | 32 | INDEX UNIQUE SCAN | XPK_MV_T_DIM_EXTL_PARTY | 1 | | 0 (0)|
    | 33 | MAT_VIEW ACCESS BY INDEX ROWID | MV_T_DIM_LGL_ENT_BR | 1 | 72 | 1 (0)| 00:
    | 34 | INDEX UNIQUE SCAN | XPK_MV_O_LGL_ENT_BR | 1 | | 0 (0)|
    | 35 | TABLE ACCESS BY INDEX ROWID | T_FACT_DAILY_RATE | 1 | 330 | 2 (0)| 00:
    | 36 | INDEX UNIQUE SCAN | XPK_T_FACT_DAILY_RATE | 1 | | 1 (0)| 00:
    | 37 | TABLE ACCESS BY INDEX ROWID | T_FACT_DAILY_RATE | 1 | 356 | 2 (0)| 00:
    | 38 | INDEX UNIQUE SCAN | XPK_T_FACT_DAILY_RATE | 1 | | 1 (0)| 00:
    | 39 | MAT_VIEW ACCESS BY INDEX ROWID | MV_T_DIM_TRD | 1 | 34 | 2 (0)| 00:
    | 40 | INDEX UNIQUE SCAN | XPK_MV_T_DIM_TRD | 1 | | 1 (0)| 00:
    | 41 | TABLE ACCESS BY INDEX ROWID | T_FACT_DAILY_RATE | 1 | 382 | 2 (0)| 00:
    | 42 | INDEX UNIQUE SCAN | XPK_T_FACT_DAILY_RATE | 1 | | 1 (0)| 00:
    | 43 | TABLE ACCESS BY INDEX ROWID | T_FACT_DAILY_RATE | 1 | 442 | 2 (0)| 00:
    | 44 | INDEX UNIQUE SCAN | XPK_T_FACT_DAILY_RATE | 1 | | 1 (0)| 00:
    | 45 | TABLE ACCESS BY INDEX ROWID | T_FACT_AGGR_WGT_AVG_RATE | 1 | 39 | 2 (0)| 00:
    | 46 | INDEX UNIQUE SCAN | XPK_T_FACT_AGGR_WGT_AVG_RATE | 1 | | 1 (0)| 00:
    Thanks
    Pramod Garre

    No version number? Why? And I am not interested in manually formatting your post to make it readable.
    In the FAQ which you should have read there is a clear explanation of how to use tags so that what you copy in retains its formatting.
    Please read the FAQ and correct what you posted as well as providing more information such as the type of application, the DML being executed, and why you are using the tuning advisor at all?
    There doesn't seem to be much here that couldn't be far more easily created with:
    explain plan for
    <your SQL statement>
    followed by:
    SELECT * FROM TABLE(dbms_xplan.display);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • SQL Tuning Advisor Report

    Hello All,
    I am using Oracle SQL Developer 3.0.04 Build MAIN-04.34. I have tried SQL Tuning Advisor to tune one of the query we have. SQL Tuning advisor has completed its processing after 10 minutes. I would like to save the result of SQL Tuning advisor for my future comaprisions and other purposes. Is there anyway i can export whatever SQL Tuning Advisor shows on the screen?
    Very much appreciate all your inputs.
    Thanks.

    Santosh,
    I suggest you to look into the "Oracle Database Performance Tuning Guide". May be you can download from OTN. You will get information about the Performance Tuning that includes SQL Tuning Advisor also.
    Access Path means the path by which data is retrieved from a database. For example, a query using an index and a query using a full table scan use different access paths.
    Predicate is the WHERE condition in a SQL statement.
    Thanks.
    -Ramesh

  • Need help to debug SQL Tuning Advisor Error Message

    Hi,
    I am getting an error message while try to get recommendations from the SQL Tuning Advisor.
    Environment:
    Oracle Version:  11.2.0.3.0
    O/S: AIX
    Following is my code:
    declare
    my_task_name  varchar2 (30);
    my_sqltext    clob;
    begin
    my_sqltext := 'SELECT DISTINCT MRKT_AREA AS DIVISION, PROMO_ID,
                    PROMO_CODE,
                    RBR_DTL_TYPE.PERF_DETL_TYP, 
                    RBR_DTL_TYPE.PERF_DETL_DESC,
                    RBR_DTL_TYPE.PERF_DETL_SUB_TYP,
                    RBR_DTL_TYPE.PERF_DETL_SUB_DESC,
                    BU_SYS_ITM_NUM,
                    RBR_CPN_LOC_ITEM_ARCHIVE.CLI_SYS_ITM_DESC,
                    PROMO_START_DATE,
                    PROMO_END_DATE,
                    PROMO_VALUE2,
                    PROMO_VALUE1,
                    EXEC_COMMENTS,
                    PAGE_NUM,
                    BLOCK_NUM,
                    AD_PLACEMENT,
                    BUYER_CODE,
                    RBR_CPN_LOC_ITEM_ARCHIVE.CLI_STAT_TYP,
                    RBR_MASTER_CAL_ARCHIVE.STATUS_FLAG
    FROM  (PROMO_REPT_OWNER.RBR_CPN_LOC_ITEM_ARCHIVE
    INNER JOIN PROMO_REPT_OWNER.RBR_MASTER_CAL_ARCHIVE
    ON (RBR_CPN_LOC_ITEM_ARCHIVE.CLI_PROMO_ID = PROMO_ID)
    AND (RBR_CPN_LOC_ITEM_ARCHIVE.CLI_PERF_DTL_ID = PERF_DETAIL_ID)
    AND (RBR_CPN_LOC_ITEM_ARCHIVE.CLI_STR_NBR = STORE_ZONE)
    AND (RBR_CPN_LOC_ITEM_ARCHIVE.CLI_ITM_ID = ITM_ID))
    INNER JOIN PROMO_REPT_OWNER.RBR_DTL_TYPE
    ON (RBR_MASTER_CAL_ARCHIVE.PERF_DETL_TYP = RBR_DTL_TYPE.PERF_DETL_TYP)
    AND (RBR_MASTER_CAL_ARCHIVE.PERF_DETL_SUB_TYP = RBR_DTL_TYPE.PERF_DETL_SUB_TYP)
    WHERE ( ((MRKT_AREA)=40)
    AND ((RBR_DTL_TYPE.PERF_DETL_TYP)=1)
    AND ((RBR_DTL_TYPE.PERF_DETL_SUB_TYP)=1) )
    AND ((CLI_STAT_TYP)=1 Or (CLI_STAT_TYP)=6)
    AND ((RBR_MASTER_CAL_ARCHIVE.STATUS_FLAG)=''A'')
    AND ( ((PROMO_START_DATE) >= to_date(''2011-10-20'', ''YYYY-MM-DD'')
    And (PROMO_END_DATE) <= to_date(''2011-10-26'', ''YYYY-MM-DD'')) )
    ORDER BY MRKT_AREA';
    my_task_name := dbms_sqltune.create_tuning_task
                                 (sql_text => my_sqltext,
                                  user_name => 'PROMO_REPT_OWNER',
                                  scope     => 'COMPREHENSIVE',
                                  time_limit => 3600,
                                  task_name  => 'Test_Query',
                                  description  => 'Test Query');
    end;
    begin
      dbms_sqltune.execute_tuning_task(task_name => 'Test_Query');
    end;
    set serveroutput on size unlimited;
    set pagesize 5000
    set linesize 130
    set long 50000
    set longchunksize 500000
    SELECT DBMS_SQLTUNE.REPORT_TUNING_TASK('Test_Query') FROM DUAL;
    Output:
    snippet .....
    FINDINGS SECTION (1 finding)
    1- Index Finding (see explain plans section below)
    The execution plan of this statement can be improved by creating one or more
    indices.
    Recommendation (estimated benefit: 71.48%)
    - Consider running the Access Advisor to improve the physical schema design
    or creating the recommended index.
    Error: Cannot fetch actions for recommendation: INDEX
    Error: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    Rationale
    Creating the recommended indices significantly improves the execution plan
    of this statement. However, it might be preferable to run "Access Advisor"
    using a representative SQL workload as opposed to a single statement. This
    will allow to get comprehensive index recommendations which takes into
    account index maintenance overhead and additional space consumption.
    snippet
    Any ideas why I am getting ORA-06502 error?
    Thanks in advance
    Rogers

    Bug 14407401 - ORA-6502 from index recommendation section of DBMS_SQLTUNE output (Doc ID 14407401.8)
    Fixed:
    The fix for 14407401 is first included in
    12.1.0.1 (Base Release)

Maybe you are looking for

  • How do I swap a symbol on each keyframe of my animation ?

    Hello, I have a VERY big animation, with a huge amount of keyframes, and I like to swap a symbol in this animation with another one. If I just use the swap button on the first frame, Flash only swaps the symbol for the first tween, whereas I have hun

  • Can i use a font such as Yuppy, Chalkboard which is basically included in iOS  for commercial purpose?

    hi! I make a e-book and it will be published on appstore and android market as application. I'm wondering about font. Can i use a font such as Yuppy, Chalkboard which is basically included in iOS  for commercial purpose like me? I bought a mountain l

  • How to see which photos have been added???

    I have the new iMovie 10.0.1. In the old version, when you added a photo to a movie from iphoto... it put a green check mark on the picture to know you added it. The new version does not.  Driving me a bit nutty because I can't always remember which

  • Why does Acrobat X Reduce File Size make significantly bigger files?

    Drawings at AO size, probably from AutoCad, each pdf ranging in size from 600 to 800kb.  No encription.  No attachments.  No embedded fonts.  Reprinted them through Acrobat X Pro to A3 then combined them. Binder size was about 5MB, too large for my c

  • Re: implement a validation layer in j2me

    Unfortunately there's no simple solution of this problem - at least for simple developer. I would advice do not think a lot about money. First try to upload some demo version and see what will happen. If you'll see that you're booming - then find app