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

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

  • 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

  • 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

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

  • 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

  • LC10 - Monitoring: I get a message that SQL Access Not Possible

    In our SCM 2007 system, when going to transaction LC10 -> Monitoring, I get a message in the top left box that says SQL Access Not Possible.  Also, when I go to LCA03, I get a short dump with: Exception condition "LC_CONNECT_FAILED" raised.
    This started happening after I changed the password for users:  control and lcuser within the livecache database.  I updated these passwords withing SCM -> LC10 -> integration and restarted the SCM system, but I still get this failure.  I can run commands against the livecache database directly with dbmcli using the same username / password I put into LC10 and I don't get any errors.
    This error shows up in the work process trace:
    C  *** ERROR => Connect to database failed, rc = -4008 (POS(1) Unknown user name/password combination)
    If anyone has experienced this before, I appreciate any input.  Thank you.
    ~TJ

    Hello,
    Please update with additional information :
    -> Did you follow the SAP note 616555 to change the passwords in the liveCache.
    -> Please logon to the liveCache server, run the following commands & update
         with the outputs:
           xinstinfo <SID>
          dbmcli -d <SID> -u control,<new_password>
          <enter>
         dbmcli on <SID>>db_state
         dbmcli on <SID>>sql_execute select * from users
         u2026.
         dbmcli on <SID>>sql_connect lcuser,<new_pwd>
         u2026
         dbmcli on <SID>>sql_release
         u2026
         dbmcli on <SID>>sql_execute user-type=SAP select user from dual
         u2026
         dbmcli on <SID>>exit
    -> Run the test connection on your system in /ndb59 for the LCA connection & update the thread with the log.
    Thank you and best regards, Natalia Khlopina

  • SQL Tuning Advisor (STA) recommends indexes that already exists?

    I have enabled the STA to run twice a week, while we are going live with a new application in a new database. I want to insure we have good performance as the load goes up. I was not involved in the original design, which there not not much of, I've discovered. Since we are licensed for it, it seemed like a safe thing to turn on.
    The STA ran last night and the report tells me it looked at 736 SQLs with findings, 143 without findings, and skipped 0.
    What puzzles me is that, in the "Statistics Finding Summary", it's reporting stale stats on some tables which I know are up to date, as I ran stats on them yesterday and there were no updates to them.
    Worse, in the "Index Finding Summary", it reports indexes needed that already do, in fact, exist.
    Is there some reason for this? Is there some way to get the STA to be aware of these and avoid the erroneous findings so that I can concentrate on real ones?
    Thanks in advance for any suggestions.
    PDP

    Hi Mark,
    Thanks for your interest, yes, the index is being used . Here is the evidence that you were asking about.
    It has existed for many weeks, now as the info below will show.
    Here is the STA run info, the run was from 2011-07-28 at 11 PM:
    ========================================
    Advisory Type Name Description User Status Start Time Duration (seconds) Expires In (days)
    SQL Tuning Advisor SYS_AUTO_SQL_TUNING_TASK Automatic SQL Tuning Task SYS COMPLETED Jul 28, 2011 11:00:03 PM 865 UNLIMITED
    Here is part of the Index Finding Summary
    =========================================
    Index Finding Summary
    Table Name Schema References Index Columns
    EINSTANCE_ARCH EINTAKE 74 GLOBAL_PATIENT_ID
    Drilling into that table, we see the following SQL_ID listed first, "g9uf2kmyvc66y" which is just one of many.
    Here is 1 if the sqls, which use the "global_patient_id" as a predicate
    (with the many columns that are actually selected not listed as they are not germain:
    =====================================================================================
    SELECT *
    FROM (SELECT '0' AS locked,
    (... a whole lot of columns selected)
    FROM einstance_arch a
    LEFT OUTER JOIN
    patient d
    ON a.global_patient_id = d.patient_id
    LEFT OUTER JOIN
    referral e
    ON a.instance_id = e.einstance_id,
    einstance_states_arch b
    WHERE a.current_state = b.inst_state_id
    AND a.current_state_id != 15
    AND ( a.global_patient_id = 496 )
    ORDER BY a.instance_id ASC)
    WHERE ROWNUM <= :1
    Here's an explain plan extracted from Toad, the index in question is identified by ==>:
    ======================================================
    Plan
    SELECT STATEMENT ALL_ROWS Cost: 19 Bytes: 4,528 Cardinality: 4
    1 INDEX UNIQUE SCAN INDEX (UNIQUE) EINTAKE.STATES_PK Cost: 0 Bytes: 14 Cardinality: 1
    3 SORT AGGREGATE Bytes: 6 Cardinality: 1
    2 INDEX RANGE SCAN INDEX EINTAKE.DOCUMENT_ATTR_LNK_INST_ID_IDX2 Cost: 1 Bytes: 6 Cardinality: 1
    18 COUNT STOPKEY
    17 VIEW EINTAKE. Cost: 19 Bytes: 4,528 Cardinality: 4
    16 SORT ORDER BY STOPKEY Cost: 19 Bytes: 1,544 Cardinality: 4
    15 NESTED LOOPS
    13 NESTED LOOPS Cost: 18 Bytes: 1,544 Cardinality: 4
    11 NESTED LOOPS OUTER Cost: 10 Bytes: 1,296 Cardinality: 4
    8 HASH JOIN OUTER Cost: 9 Bytes: 1,228 Cardinality: 4
    5 TABLE ACCESS BY INDEX ROWID TABLE EINTAKE.EINSTANCE_ARCH Cost: 6 Bytes: 1,152 Cardinality: 4
    ==> 4 INDEX RANGE SCAN INDEX EINTAKE.EINSTANCE_ARCH_GLBL_PT_ID_IDX3 Cost: 1 Cardinality: 5
    7 TABLE ACCESS BY INDEX ROWID TABLE EINTAKE.PATIENT Cost: 2 Bytes: 19 Cardinality: 1
    6 INDEX UNIQUE SCAN INDEX (UNIQUE) EINTAKE.PATIENT_PK Cost: 1 Cardinality: 1
    10 TABLE ACCESS BY INDEX ROWID TABLE EINTAKE.REFERRAL Cost: 1 Bytes: 17 Cardinality: 1
    9 INDEX RANGE SCAN INDEX EINTAKE.REFERRAL_EINSTANCE_ID Cost: 0 Cardinality: 1
    12 INDEX UNIQUE SCAN INDEX (UNIQUE) EINTAKE.EINSTANCE_STATES_ARCH_PK Cost: 1 Cardinality: 1
    14 TABLE ACCESS BY INDEX ROWID TABLE EINTAKE.EINSTANCE_STATES_ARCH Cost: 2 Bytes: 62 Cardinality: 1
    Here is the DDL info on the index in question:
    ============================
    select object_name, created, last_ddl_time from user_objects where object_name = 'EINSTANCE_ARCH_GLBL_PT_ID_IDX3';
    OBJECT_NAME CREATED LAST_DDL_TIME
    EINSTANCE_ARCH_GLBL_PT_ID_IDX3 2011 07 11 11:22:36 2011 07 11 11:22:36
    1 row selected.
    Regards,
    Paul

  • 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

Maybe you are looking for

  • Function module to get the chars and key figures of an infocube

    Hi Everyone, Can anyone please let me know is there any function module where if I pass the infocube name as the input parameter, it has to give me the output parameters its characteristics and key figures. I require this to display the report in dri

  • Recording from internal mike on MacbookPro

    Trying to record to GB from internal mike, I get no bars on monitor nor anything is recorded. I'm sure all is connected, the internal mike monitor is showing working on the SYSPref audio level, but when I launch GBand I get nothing when I hit the rec

  • Sharing an ISDN connection over LAN

    I'm thinking of updating my Main computer and need some advice/help. Currently I can only get ISDN where I live in Australia, which may be slow but it's also unlimited. I have a PC set up with the ISDN modem (USB connection) which it then shares to t

  • Smoothing of asset

    hi gurus kindly resolve the following what is smoothing of asset what is the impact when smoothing of asset check box is enabled why, when and how smoothing of asset is done thankyou with regards ramesh

  • BPS adhoch query problem.

    Hello gurus, My issue is with Adhoc query,We have two queries designed to retrieve data from the SEM/BPS PCP cube (ZZSEM_C35): Ad hoc - SEM PCP Cube Details Ad hoc - SEM PCP from MultiCube Details The first retrieves data directly from the cube; the