SQL Tuning - Please

Dear all,
I have this query which is taking too much of time. I guess it is all because of FTSs. Below is the query.
SELECT rpad(nvl(to_char(MDC_SITE_CONVERSIONS.ID), '*'), 20, '*')||
       rpad(nvl(to_char(SMR.id),'*'), 20, '*')||
       rpad(nvl(to_char(MDC_SITE_CONVERSIONS.SITE_ID),'*'), 40, '*')||
       rpad(nvl(to_char(SMR_ALT.id),'*'), 20, '*')||
       rpad(nvl(to_char(MDC_SITE_CONVERSIONS.ALT_SITE_ID),'*'), 40, '*') ||
        rpad(nvl(to_char(MDC_SITE_CONVERSIONS.site_group),'*'), 40 , '*') AS SOMETHING,    
        MDC_SITE_CONVERSIONS.SITE_UNCONV_PRIMID as SITE_UNCONV_PRIMID
FROM MDC_SITE_CONVERSIONS
    ,IOS_SITE_MASTERS SMR
    ,IOS_SITE_MASTERS SMR_ALT
WHERE MDC_SITE_CONVERSIONS.site_id      = smr.site_id(+)
AND   MDC_SITE_CONVERSIONS.alt_site_id  = SMR_ALT.site_id(+)The Explain plan is
| Id  | Operation            |  Name                 | Rows  | Bytes |TempSpc| Cost  |
|   0 | SELECT STATEMENT     |                       |  3853 |   158K|       |    73 |
|*  1 |  HASH JOIN OUTER     |                       |  3853 |   158K|   196K|    73 |
|*  2 |   HASH JOIN OUTER    |                       |  3853 |   116K|       |    39 |
|   3 |    TABLE ACCESS FULL | MDC_SITE_CONVERSIONS  |  3853 | 77060 |       |     8 |
|   4 |    TABLE ACCESS FULL | IOS_SITE_MASTERS      |  2153 | 23683 |       |     8 |
|   5 |   TABLE ACCESS FULL  | IOS_SITE_MASTERS      |  2153 | 23683 |       |     8 |
Predicate Information (identified by operation id):
   1 - access("MDC_SITE_CONVERSIONS"."ALT_SITE_ID"="SMR_ALT"."SITE_ID"(+))
   2 - access("MDC_SITE_CONVERSIONS"."SITE_ID"="SMR"."SITE_ID"(+))
Note: cpu costing is offThe indexes on the table are as below.
MDC_SITE_CONVERSIONS: 3800 records in the table
MDC_SCN_PK,ID
MDC_SCN_UK,SITE_UNCONV_PRIMID
MDC_SCN_UK,SITE_UNCONV_SECID
MDC_SCN_UK,CUSTOMER_OR_VENDOR
IOS_SITE_MASTERS: 2000 records in the table
IOS_SMR_IDX1,SITE_ID
IOS_SMR_PK,IDCould you please let me know how to tune this? I tried the hint INDEX(), but it turned out disastrous.
| Id  | Operation                     |  Name                 | Rows  | Bytes |TempSpc| Cost  |
|   0 | SELECT STATEMENT              |                       |  3853 |   158K|       |  2591 |
|*  1 |  HASH JOIN OUTER              |                       |  3853 |   158K|   196K|  2591 |
|*  2 |   HASH JOIN OUTER             |                       |  3853 |   116K|       |  1298 |
|   3 |    TABLE ACCESS FULL          | MDC_SITE_CONVERSIONS  |  3853 | 77060 |       |     8 |
|   4 |    TABLE ACCESS BY INDEX ROWID| IOS_SITE_MASTERS      |  2153 | 23683 |       |  1267 |
|   5 |     INDEX FULL SCAN           | IOS_SMR_IDX1          |     1 |       |       |     7 |
|   6 |   TABLE ACCESS BY INDEX ROWID | IOS_SITE_MASTERS      |  2153 | 23683 |       |  1267 |
|   7 |    INDEX FULL SCAN            | IOS_SMR_IDX1          |     1 |       |       |     7 |
Predicate Information (identified by operation id):
   1 - access("MDC_SITE_CONVERSIONS"."ALT_SITE_ID"="SMR_ALT"."SITE_ID"(+))
   2 - access("MDC_SITE_CONVERSIONS"."SITE_ID"="SMR"."SITE_ID"(+))
Note: cpu costing is offPlease help me in tuning the query.
Cheers
Deepa

What makes you think that an index would make it faster?
If you were trying to access a fraction of the rows, then it seems that you would need an index on MDC_SITE_CONVERSIONS.site_id and MDC_SITE_CONVERSIONS. alt_site_id, possibly a single composite index of both columns.
BUT you're fetching all the rows in MDC_SITE_CONVERSIONS and outer joining to IOS_SITE_MASTERS twice. So full table scans seem entirely appropriate.

Similar Messages

  • Permissions needed for Applying SQL Tuning Sets/SQL Plans 11g?

    What permission are needed for a user to apply/activate sql tuning sets (sql plans) in 11g? The user can capture and move the the sql tuning sets from a 10g database to an 11g database but is getting "ORA-01031: insufficient privileges" when trying to activate/apply the sqlplans in 11g.
    The user has:
    ADMINISTER SQL MANAGEMENT OBJECT and ADMINISTER SQL TUNING SET and EXECUTE on SYS.DBMS_SPM
    The user is an administrator for our Data Warehouse team but they do not have sysdba priviliges.
    Do you also know of a good white paper that covers the step by step instructions and permissions needed for aquiring and applying/activating sqlplans?
    If more information is needed in order to respond please advise.
    Thank you

    What permission are needed for a user to apply/activate sql tuning sets (sql plans) in 11g? The user can capture and move the the sql tuning sets from a 10g database to an 11g database but is getting "ORA-01031: insufficient privileges" when trying to activate/apply the sqlplans in 11g.
    The user has:
    ADMINISTER SQL MANAGEMENT OBJECT and ADMINISTER SQL TUNING SET and EXECUTE on SYS.DBMS_SPM
    The user is an administrator for our Data Warehouse team but they do not have sysdba priviliges.
    Do you also know of a good white paper that covers the step by step instructions and permissions needed for aquiring and applying/activating sqlplans?
    If more information is needed in order to respond please advise.
    Thank you

  • SQL tuning for a query

    Hello Gurus,
    I have 2 tables. One with a million records and the other with 50,000 records.
    Both have an account id column. The first table contains all the customer accounts and the second table has all the bad debt accounts.
    My problem is I need to update the status column in the first table for all the bad debt records from the second table.
    As I’m still a beginner in SQL tuning, can someone please help me write this query effi ciently considering the table sizes.
    tables description:
    SQL> desc customer
    Name Null? Type
    ACNTNO NUMBER(8)
    STATUS VARCHAR2(6)
    SQL> desc badcustomer
    Name Null? Type
    ACNTNO NUMBER(8)
    The sql I could come up with is:
    update customer outer
    set status='closed'
    where acntno exists (select 'X'
    from badcustomer
    where acntno=outer.acntno);
    Thanks for taking time to read this post.

    To post formatted code, put the {noformat} {noformat}- tag before and after your examples.
    When you post:
    {noformat} select *
    from dual;
    {noformat}
    it will appear as: select *
    from dual;
    on the forum.
    The FAQ will tell you more: http://forums.oracle.com/forums/help.jspa                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • 1Z0-117: Oracle Database 11g Release 2: SQL Tuning Need Materia and Dumps

    Hi all,
    We are preparing for 1Z0-117: Oracle Database 11g Release 2: SQL Tuning, There is shortage of material available on net.
    Can anybody please provide books or Sample question answers and share more idea about the exan.
    mail id XXXXXXXXXXXXX
    Thanks in Advance
    Sandeep
    Edited by: 1005555 on 13 May, 2013 4:54 AM+
    Mod: email deleted, don't draw discussion away from the forum.
    Edited by: PhHein on 13.05.2013 14:16
    Edited by: 1005555 on 13 May, 2013 10:16 PM

    We are preparing for 1Z0-117: Oracle Database 11g Release 2: SQL Tuning, There is shortage of material available on net.There are actually a fair number of articles about the material covered on 117 on the net, but yes, the test is new enough that cheaters have not had much of a chance to email around illegal material such as dumps yet.
    Can anybody please provide books or Dumps and share more idea about the exan.There is a significant amount of legitimate material you can use to study for the exam here:
    http://www.oraclecertificationprep.com/apex/f?p=OCPSG:EXAM_DETAILS:0::NO::P2_EXAM:1Z0-117
    As for ideas about the exam -- it's probably the hardest Oracle certification exam I have ever taken:
    http://ocprep.blogspot.com/2013/03/1z0-117-this-exam-is-rough.html

  • 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

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

  • Use of SQL Tuning pack  in SAP

    We have activated the Oracle 'SQL Tuning pack'  however only one function "SQL Tuning Advisor" is activated/visible in ST04
    and other functionality is not visible. We have already taken license of 'SQL Tuning pack' .
    Other then this we want to use following oracle supported features.
    1) Automatic SQL Tuning Advisor
    2) Real-time SQL Monitoring
    3) Object Reorganization Wizard
    As I know we can use "oracle enterprise manager" to use such oracle features, If SAP allow use of OEM in SAP environment.
    can someone help here please..?
    Thanks,
    Kapil Pandey

    Hello Kapil,
    which other options did you expect to find in ST04? SAP note 1028068 speaks only of the "SQL Tuning Advisor" which will be activated:
    As of Enhancement Package 1 for Basis Release 7.00 (that is, Basis Release 7.01), the function "SQL Tuning Advisor" is contained in the DBA Cockpit. This optional function requires the Oracle Tuning Pack to be licensed.
    The other features should be used via the OEM, because they are not integrated in the DBACOCKPIT transaction:
    - Automatic SQL Tuning Advisor
    - Real-time SQL Monitoring (with OEM you even get a really useful visualization)
    - Object Reorganization Wizard -> better use brspace because it is supported by SAP
    Regards,
    Mark

  • DBA+Sql tuning

    hello everyone i am an oracle developer working in oracle Forms and reports i have a keen interest in this database and would like to become a DBA.. pls suggest me some good books which can teach me about the whole oracle architecture and the other details.
    Apart from that i want to study Sql tuning too for oracle 10g database.. please suggest me some good books regarding both these two topics.

    Hi,
    Apart from that i want to study Sql tuning too for oracle 10g database.. please suggest me some good books regarding both these two topics.Apart from Oracle Documentation, there are many good references available in the market, go through the review and check the table of contents before deciding which book(s) you want to go with.
    Oracle 10g DBA
    http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=Oracle+10g+DBA
    Oracle SQL Tuning
    http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=Oracle+SQL+Tuning
    Regards,
    Hussein

  • Reg: SQL Tuning Advisor -

    Hi Experts,
    A quick question regarding this utility: SQL Tuning Advisor.
    Does this need any special license to use?
    Or, any special Grants/Privileges required for it?
    Please provide pointers for this.
    -- Ranit

    Or, any special Grants/Privileges required for it?
    Grant-wise , a user needs the privilege ADVISOR

  • Any Good Book on SQL , PL/SQL Tuning?

    Hi,
    Please suggest me some good book on SQL , PL/SQL Tuning?
    Thanks.
    --Sam                                                                                                                                                                               

    Anything specific you be looking for?
    Good SQL Books
    Good Online PL SQL Books, Examples &Tutorials
    Good Books for  learning PL/SQL
    good tuning links and books
    Need Assistance for choosing good Pl/SQL books
    Adith

  • OEM - No ad-hoc SQL tuning?

    Am I correct that there is no way to say to Oracle Enterprise Manager's SQL Tuning Advisor, "here is some SQL - please analyze and tune it". The only way to get it to tune something is to find it running and then say "please run the SQL tuning advisor on it".
    In other words, no way to tune a query without running it first...?
    I've been looking for a way to do this in OEM and can't find it.
    Thanks!

    sb92075 wrote:
    Last I checked, explain plans tell you what will happen, not how you might change things to improve itIf/when an experienced & KNOWLEDGEABLE person see a BAD plan, they may be able to reformulate the SQL to produce a better plan.
    which is what the SQL Tuning Advisor does.Those who live by the GUI, die by the GUI.
    Some/many folks would be incapable of doing anything with or to Oracle RDBMS if OEM did not exist or was broken.Did I ask for opinions on the One True Way to be a DBA, or for a comparison of SQL*Plus vs. OEM, or a survey of the competence level of typical DBAs?
    No.
    I asked a simple, technical question about OEM.

  • What is this SQL Tuning Advisor's Advice means

    HI ,
    I am Tuning a query wit hthe help of ORACLE 10 g 's SQL Tuning Advisor.I got the following recommendation .
    **Consider removing the disconnected table or view from this statement or add a join condition which refers to it.**
    I didn't understand what does this mean.
    Can anyone please help me
    Thanks,
    Pramod.
    Edited by: Pramod Garre on Jul 15, 2009 6:20 AM

    Simply saying if i apply that profile i will get Good plan.But I want to change the SQL itself rather than applying profile.in that case what can be done.Automatic SQL Tuning deals with this problem with its SQL Profiling capability. The Automatic Tuning Optimizer creates a profile of the SQL statement called a SQL Profile, consisting of auxiliary statistics specific to that statement. The query optimizer under normal mode makes estimates about cardinality, selectivity, and cost that can sometimes be off by a significant amount resulting in poor execution plans. SQL Profile addresses this problem by collecting additional information using sampling and partial execution techniques to verify and, if necessary, adjust these estimates.During SQL Profiling, the Automatic Tuning Optimizer also uses execution history information of the SQL statement to appropriately set optimizer parameter settings, such as changing the OPTIMIZER_MODE initialization parameter setting from ALL_ROWS to FIRST_ROWS for that SQL statement.
    If you want to change the SQL, You can re-write the SQL and evaluate the Performance recommendations SQL tuning Advisor.

  • Tuning sql automatic using SQL Tuning Advisor Tool

    I need to work on Automatic sql tuning..
    Please give suggestion for the below
    1) I have installed oracle11g client version. confirm this is okey for my project. because i heard we should have oracle enterprise edition for this.
    2) User with only sys privelage can work on this automatic sql tuning using sql tuning advisior tool.
    Please clarify above suggestions.
    ALso suggest me best way to proceed further
    S

    Sunny kichloo wrote:
    This docs will help
    http://www.oracle-base.com/articles/10g/automatic-sql-tuning-10g.php
    http://www.oracle-base.com/articles/11g/automatic-sql-tuning-11gr1.php
    Thanks for your link. i already seen this link.
    Could u pls answer my question on above with " Yes" or "No"
    Kindly reply
    S

  • 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

  • XCelsius 2008 is not backward compatible with ver 4.5

    Post Author: Joseph CA Forum: Xcelsius and Live Office I tried opening a project that was done with ver 4.5 but it just said that "Crystal Xcelsius is unable to load this file. This file may be corrupt or may have features that cannot be supported by

  • I made a movie on iMovie and it says that I need to use iDVD to burn a CD, but I don't have iDVD.

    My grandpa passed away on Tuesday, and I am responsible to make the DVD of pictures for his Funeral, which is (YIKES) tomorrow. I am tryingt to burn a disk with the video, and the "HELP" center told me to use iDVD, which my computer doesn't have... W

  • How to change dinamically variable name?

    Is it possible to change variable name dinamically into loop? loop at itab. move itab-item to field_x. endloop. I would copy my itab-item into field_1, field_2......field_x at each loop. Thanks Alfonso.

  • WAS on Linux seens to be slow

    After having installed WAS for linux, things seemed to work OK. It seemed however that database-generated pages were very slow. To find out what was wrong we mixed platforms: Database on sun, WAS on sun Database on linux, WAS on sun Database on sun,

  • Inserting a background image on JFrame

    I am developing an interactive system for the london 2012 olympics (Not a real one, just a project :-)) I am starting by creating my GUI layout. This is where i have started. import java.awt.*;         import java.awt.event.*; import javax.swing.*; i