Sql tuning advisor 11g

Dear all,
We have installed oracle 11g on solaris. We have configured EM with this DB.. Is there anyway I can check a query using sql tuning advisor in oracle 11g. ? .. I tried, but I couldn't find the exact navigation ?. I need to submit th query and get the advise from sql tuninig advisor ?
Please guide
Kai

OEM db console ?
Am doing this for educational purpose and not in production
kai

Similar Messages

  • SQL tuning advisor in 11G.

    Hi,
    our dev guys given poor performance query to me to tune.
    Can any one able to provide me steps to get recommendation from SQL tuning advisor by creating tuning task for a manually specified statement.
    Version : 11.1.0.6.0
    OS : SunOS 5.10
    Thanks in advance!
    Govin

    Hi,
    Thanks for your reply,
    Creation of SQL Tuning Task failed due to below one,
    "to_char(max(r.ts), 'mm/dd/yyyy') viewrequest_lastdate"
    saying like
    ERROR at line 8:
    ORA-06550: line 8, column 22:
    PLS-00103: Encountered the symbol "MM" when expecting one of the following:
    * & = - + ; < / > at in is mod remainder not rem
    <an exponent (**)> <> or != or ~= >= <= <> and or like like2
    like4 likec between || member submultiset
    The symbol "*" was substituted for "MM" to continue.
    Then i have replaced with
    "to_char(max(r.ts), :bnd) viewrequest_lastdate". After this task is created & executed. Right now, im getting below error.. plz advice.
    GENERAL INFORMATION SECTION
    Tuning Task Name : my_sql_tuning_task
    Tuning Task Owner : SYS
    Workload Type : Single SQL Statement
    Scope : COMPREHENSIVE
    Time Limit(seconds) : 60
    Completion Status : COMPLETED
    Started at : 10/26/2010 13:36:09
    Completed at : 10/26/2010 13:36:13
    Schema Name: METRICS
    SQL ID : 71kzxnt9vb91q
    SQL Text : select p.prfl_id profile_id, p.prfl_src profile_source,
    p.prfl_nme profile_name,getDistinctUserIDTypes
    (wm_concat(distinct u.usr_ty_cd)) user_id_type,count(distinct
    u.usr_id || u.usr_id_src) userid_count, count(e.nttl_id)
    entitlement_count,to_char(max(r.ts), :bnd) viewrequest_lastdate
    from TABLE1 d, TABLE2 a,TABLE 3 u, TABLE4
    e, TABLE 5 r,TABLE6 p, TABLE7 z where
    d.dept_id = a.dept_id and d.dept_id = z.dept_id (+) and
    a.glbl_id = u.glbl_id and u.usr_id = e.usr_id and u.usr_id_src =
    e.usr_id_src and e.prfl_id = p.prfl_id and e.prfl_src =
    p.prfl_src and e.lst_rvw_rqst_id = r.rqst_id(+) and (d.mgr_glbid
    = :bnd OR z.TO_GLBL_ID = :bnd) and p.prfl_id is not null group
    by p.prfl_id, p.prfl_src, p.prfl_nme order by p.prfl_id
    ERRORS SECTION
    - ORA-01008: not all variables bound
    Thanks
    Govin

  • Oracle11g standarad Edititon-Sql tuning Advisor

    Hi,
    Do we have provision to tune the query using sql tuning advisor in oracle 11g r1 Standard Edition SE
    Thanks
    mafaiz

    Mafaiz,
    Tuning & Diagnostic Packs are available in Enterprise Edition only
    Oracle Database - Standard Edition & Diagnosis Pack???
    Thanks,
    Ajay More
    http://www.moreajays.com

  • SQL Tuning Advisor against the session (is it poosible)

    My Company customer has observed that there is job that are running longer than expected running(5 days).
    They did not gave any information.they want me to run
    SQL Tuning Advisor against the session running this job.
    can you run sql tunning advisor against running session?
    if so how
    Please suggest me your valuable tips so that I approach this work properly.
    DB = 11g
    OS= Solaris 10

    >
    ...SQL Tuning Advisor against the session running this job.
    can you run sql tunning advisor against running session?
    >
    SQL Tuning Advisor is run on statements and not sessions. I don't do much with SQL Tuning Advisor, but I'd consider that current running sessions a lost cause until it completes or you kill it. You can see the "estimate" of how long that current running SQL is going to take in v$session_longops. You can use a script like Tanel's sw.sql
    http://blog.tanelpoder.com/2008/01/08/updated-session-wait-script/
    to see what the wait interface has to say.
    >
    Please suggest me your valuable tips so that I approach this work properly.
    >
    My approach for this would be to determine what the current explain plan is and compare it to one that ran (correctly) in the past and then try to determine why it changed. (bad stats, dropped index, parameter changes, etc).
    Cheers.

  • [OCP exam] doubt about Automatic SQL Tuning Advisor

    Hi,
    Sorry for my poor english.
    I am currently preparing for the OCP  11g exam.
    For that, I have bought some training tools  to help me prepare the exam.
    But, in the chapter related to the SQL tuning advisor, some explanation really confuse me .
    Extract :
    <<
    the SQL automatic tuning  job runs every night during the maintenance window.
    By default, the job makes SQL profile recommendations, tests them, and automatically implements them if they provide better performance improvement)
    >>
    I was persuaded it was the opposite.
    I check several databases/documentation, and it's seems to be always the opposite.
    By default,new sql profile are tested but not implemented automatically (you have to set a parameter ACCEPT_SQL_PROFILES TO TRUE to activate this option)
    But the exam is validated on oracle 11.2.0.1, and I only have 11.2.0.2/11.2.0.3 db available.
    So may be oracle changed the value of the default parameter in the new releases.
    Can someone confirm if I am right or not ?

    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

  • Sql tuning advisor question on bind values

    Hi guys,
    I used the sql tuning wizard in Oracle 11g to get recommendation on how to improve performance on a long running query. Here is the recommendation I received:
    At least one important bind value was missing for this sql statement. The
    accuracy of the advisor's analysis may depend on all important bind values
    being supplied.
    Could someone please help me understand what it means? For example, what is a bind value, why was it missing, and why are they important?
    Thanks!

    I've seen this message maybe once before but I've never investigated it - I don't tend to run the SQL tuning advisor.
    The best thing you could do is investigate the circumstances yourself, maybe trace the tuning advisor and see where it's getting its data from internally.
    As mentioned, where it gets its data from depends on how you populate the tuning advisor - from cursor cache, awr, etc.
    If it's from AWR as you mentioned, have a look at DBA_HIST_SQLSTAT.BIND_DATA for example? Or maybe DBA_HIST_SQLBIND? Etc.
    You can check what the advisor probably pulls out of AWR using something like this:
    select *
    from   table(dbms_Sqltune.select_workload_repository
                 (begin_snap   => 6441,
                  end_snap     => 6443,
                  basic_filter => 'sql_id = ''gr5tqfnz07sxk'''));If the bind_list is empty then you know what it's complaining about.
    I just tried it with an example sql it that I can see has bind data in DBA_HIST_SQLSTAT and DBA_HIST_SQLBIND and the BIND_LIST in the SQLSET returned by the SQL set above is null so that raises some questions ( I might be doing something wrong but as mentioned, it's not really something I tend to use).
    The BIND_DATA raw is populated for me (although the bind_list collection isn't hence why original comment above).
    If you know a representative set of binds, you can kick off your own tuning task manually and supply your own set of binds - see DBMS_SQLTUNE.CREATE_TUNING_TASK.
    You can also extract and inspect the RAW BIND_DATA into a set of binds using DBMS_SQLTUNE.EXTRACT_BINDS.
    e.g. to inspect:
    select x.*
    from   v$sql s
    ,      table(dbms_sqltune.extract_binds(s.bind_data)) x
    where  sql_id = '<sql_id>';Edited by: Dom Brooks on May 17, 2012 5:59 PM

  • Can DBMS_ADVISOR package be used for SQL Tuning Advisor ?

    Can DBMS_ADVISOR package be used for SQL Tuning Advisor ?

    SQL> SELECT * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE    11.1.0.6.0      Production
    TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production

  • 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

  • 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)

  • Stucked between SQL Tuning Advisor and and SQL statement

    Hi,
    There is an important query running on my system which consists
    MEMBER OF function.
    At first place let me explain why i used MEMBER OF,
    I am sending a string( eg : #123#124#125) to query and a function converts this string into a number array.
    After then I use this number array inside my sql.
    The reason I am using this structure, in order to generate a dynamic IN statement inside my sql. (IF you have any other solution that would be great)
    The most important point is; when I put this statement to SQL Tuning Advisor the response is only ORA-00932: inconsistent datatypes: expected UDT got CHAR
    Any answer will be greatly appreciated.
    Thanks

    Solomon Yakobson wrote:
    Object oriented stuff almost never provides better performance over relational. You should stay away from MEMBER OF if performance is a factor. Instead of:
    WHERE expr MEMBER OF nested-tableI'd test:
    WHERE expr IN (SELECT column_value FROM TABLE(nested-table))SY.
    expr IN (SELECT COLUMN_VALUE FROM TABLE (CAST (v_type_number_table AS type_number_table)))worked like a charm. i hope tuning advisor will like it as i do.
    thanks.

  • 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

  • Change automatic SQL Tuning Advisor time

    Hi All,
    can anyone help me in changing "automatic SQL Tuning Advisor" job timingsm because currently it is scheduled during peak hours , i want to change it to evening 6 pm daily.Because during peak hours it is taking more cpu and taking one hour.
    Wed May 08 08:00:10 2013
    Begin automatic SQL Tuning Advisor run for special tuning task "SYS_AUTO_SQL_TUNING_TASK"
    Wed May 08 08:05:47 2013
    thanks
    Mapps

    Hello,
    Here's what you can do,
    Create a new window to the time you want it to run:
    EXEC dbms_scheduler.create_window(window_name => 'YOUR_WINDOW_NAME',
    duration => numtodsinterval(1, 'hour'),
    resource_plan => 'DEFAULT_MAINTENANCE_PLAN',
    repeat_interval => 'FREQ=DAILY;BYHOUR=18;BYMINUTE=0;BYSECOND=0');>
    The above window would be in effect from 6 pm to 7 pm.
    Then, disable automatic sql_tuning and then re-enable it to run on the window you just created:
    EXEC DBMS_AUTO_TASK_ADMIN.DISABLE(client_name => 'sql tuning advisor',
    operation => NULL,
    window_name => NULL);>
    and now set it to run to your window:
    EXEC DBMS_AUTO_TASK_ADMIN.ENABLE(client_name => 'sql tuning advisor',
    operation => NULL,
    window_name => 'YOUR_WINDOW_NAME');

  • SQL Tuning Advisor  Recommends New Explain Plan

    Hi:
    I have to believe this has been asked before but didn't see it in a forum search so I'll ask here. I had SQL Tuning Advisor look at a query and it is recommending a new plan for a 50+% improvement (hazah!). The trouble is, I don't want Oracle to re-write the plan to execute the query better, I want to know how I can re-write the query to generate that more optimal plan in the first place because I have similar systems in the field that I would like to also be optimized. What are my options?
    Thanks.

    Sorry Gaff I know where you are talking about but I don't have your answer, but it may be a good start going over the 19g reference guide for these dictionary views -
    SQL> select view_name from dba_views where view_name like 'DBA%ADVISOR%' ;
    VIEW_NAME
    DBA_ADVISOR_DEFINITIONS
    DBA_ADVISOR_COMMANDS
    DBA_ADVISOR_OBJECT_TYPES
    DBA_ADVISOR_USAGE
    DBA_ADVISOR_TASKS
    DBA_ADVISOR_TEMPLATES
    DBA_ADVISOR_LOG
    ...Best regards.

  • 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

  • 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

Maybe you are looking for

  • Problem while running a query on a multiprovider

    Dear all, I have created a query to generate the balance sheet in FIGL using standard virtual cube 0FILGL_V01 and a custom transactional cube which gets plan data through BPS. The custom plan cube is an exact copy of the 0FIGL_V01 (plan value is popu

  • Importing P2 .mxf files with audio into AE CS4

    I hope this isn't the ultimate newbie question but, I have been working with After Effects for a few months but haven't need audio until now. Is there a different process for importing/exporting with audio? I have brought in the P2 video file but I d

  • Determining what/who is connected to my airport express/extreme?

    In my old Linksys, there was a config page that let me see the IP addresses and MACs of all current attached devices (both wireless and wired) on my network How do I do t his with an Airport Express (and also an Extreme, if the procedure is different

  • Help in installing Oracle Xe in suse 10.2

    I have successfully installed Oracle XE in suse linux 10.2.(my laptop) The place I had installed had a Lan network available. Now I usually work in a location where there is no network. after I get the message that oracle XE is succesfully installed,

  • Field length error

    Hi All, While inserting the quantity value LOSBS in screen fied that " input value is greater that screen field". How to remove this error? Regards Saurabh.