Noob in SQL Tuning seeking help

I am trying to learn SQL Tuning and the workings of it. I know the first step is probably explain execution plan of the sql statement? My problem is I do not understand what am I suppose to gather from the execution plan.
SQL> set autotrace traceonly explain
SQL> select * from employees A
     where A.last_employed =
     ( SELECT TO_CHAR(MAX(TO_DATE(PAY_DATE,'MMRR')),'MMYY')
       FROM PAYROLL_VW1 B
       WHERE B.SSN = A.SSN AND B.PAY_TYPE_CODE IN ('02','12','22','32')
      AND STATUS = 'ACTIVE' AND A.BRANCH=B.BRANCH
Execution Plan
   0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=47427 Card=1 Bytes
          =180)
   1    0   FILTER
   2    1     TABLE ACCESS (FULL) OF 'EMPLOYEES' (TABLE) (Cost=1618 Card
          =297964 Bytes=53633520)
   3    1     SORT (AGGREGATE)
   4    3       VIEW OF 'PAYROLL_VW1' (VIEW) (Cost=2290 Card=2 Bytes=
          46)
   5    4         SORT (UNIQUE) (Cost=2290 Card=2 Bytes=217)
   6    5           UNION-ALL
   7    6             FILTER
   8    7               TABLE ACCESS (FULL) OF 'PAYROLL2012' (TABLE) (C
          ost=2284 Card=1 Bytes=105)
   9    6             FILTER
  10    9               TABLE ACCESS (BY INDEX ROWID) OF 'PAYROLL2011'
          (TABLE) (Cost=4 Card=1 Bytes=112)
  11   10                 INDEX (RANGE SCAN) OF 'PAYROLL2011_IDX1' (IND
          EX) (Cost=3 Card=29)So what do I do with the execution plan? What else do I need to check on it? How do I tune the query?
Edited by: apex_disco on May 1, 2012 5:57 AM

I'm not sure how the licensing works. There is a difference between EM and Grid Control. I believe if you just have a single instance, Enterprise Manager is installed and if anything is free I would think that would be. Now, how much of the diagnostic stuff is free? Who knows.
But it may not matter. If you are just playing around "trying to learn SQL Tuning" say, at home on a Linux box, you can install anything you want and play with it.
If adding an index sped things up (in your re-written query that now makes sense) then you must have had a fair amount of records in one of those unindexed tables. If you look at the explain plan now it'll probably show the indexes being used, less records searched, less cost, etc. than the other plan.
But maybe I missed your initial point. Are you trying to learn how to tune queries in general or are you trying to tune this particular query? I assumed the former for my previous replies.
As to your results, your stats </font>tell at least the high level info. The consistent gets and physical reads went WAY down.
Initial Statistics
0 recursive calls
0 db block gets
<font color="red"> 1172490142 consistent gets
4914 physical reads
191496 redo size</font>
2340 bytes sent via SQL*Net to client
329 bytes received via SQL*Net from client
1 SQL*Net roundtrips to/from client
<font color="red">115881 sorts (memory) </font>
0 sorts (disk)
0 rows processed
on those tables and below are my stats now. I think it's a major improvement. Time elapsed has greatly been reduced to 00:00:00.65
Tuned Statistics
352 recursive calls
0 db block gets
<font color="red">31498 consistent gets
1101 physical reads
0 redo size
</font>
2340 bytes sent via SQL*Net to client
329 bytes received via SQL*Net from client
1 SQL*Net roundtrips to/from client
<font color="red">13 sorts (memory) </font>
0 sorts (disk)
0 rows processed
Edited by: Gaff on May 1, 2012 1:18 PM

Similar Messages

  • Need Help in sql tuning in EXADATA environment

    I am uploadin the sql with its current explain plan, this sql in Prd database is executing in 6-10 mins and we need to improve this sql perf to 1-2 mins as the requirement from business team.
    I am giving some backgroud about this sql tuning requirement, this sql is newly developed in and currently is in UAT phase, we don't have much option for tuning code here since the sql is tool generated through COGNOS DataMart tool, options are there to look into from DBA end with plan level or creating indexes on suitible columns to reduce i/o in minimizing the rows traversing by the sql.
    Is anybody can help me out here?
    WITH "WCRS_CLAIM_DETAIL_VW5"
    AS (SELECT "WCRS_CLAIM_DETAIL_VW"."CLAIM_DETAIL_PK_ID"
    "CLAIM_DETAIL_PK_ID",
    "WCRS_CLAIM_DETAIL_VW"."CLAIM_ID" "CLAIM_ID",
    "WCRS_CLAIM_DETAIL_VW"."CURRENT_SNAPSHOT_IND"
    "CURRENT_SNAPSHOT_IND",
    "WCRS_CLAIM_DETAIL_VW"."LOSS_DT" "LOSS_DT",
    "WCRS_CLAIM_DETAIL_VW"."REGULATORY_STATE_CD"
    "REGULATORY_STATE_CD"
    FROM "CDW_DLV_IDS"."WCRS_CLAIM_DETAIL_VW" "WCRS_CLAIM_DETAIL_VW"
    WHERE "WCRS_CLAIM_DETAIL_VW"."CURRENT_SNAPSHOT_IND" = 'Y'),
    "WCRS_POLICY_DETAIL_VW7"
    AS (SELECT "WCRS_POLICY_DETAIL_VW"."CLAIM_NBR" "CLAIM_NBR",
    "WCRS_POLICY_DETAIL_VW"."CLAIM_SYMBOL_CD" "CLAIM_SYMBOL_CD",
    "WCRS_POLICY_DETAIL_VW"."CURRENT_SNAPSHOT_IND"
    "CURRENT_SNAPSHOT_IND",
    "WCRS_POLICY_DETAIL_VW"."KEY_OFFICE_CD" "KEY_OFFICE_CD",
    "WCRS_POLICY_DETAIL_VW"."POLICY_NBR" "POLICY_NBR"
    FROM "CDW_DLV_IDS"."WCRS_POLICY_DETAIL_VW" "WCRS_POLICY_DETAIL_VW"
    WHERE "WCRS_POLICY_DETAIL_VW"."CURRENT_SNAPSHOT_IND" = 'Y')
    SELECT /*+ gather_plan_statistics monitor bind_aware */
    /* ^^unique_id */
    "T0"."C0" "Account_Name",
    "T0"."C1" "Accident_State_Cd",
    "T0"."C2" "c3",
    "T0"."C3" "PPO_Name",
    "T0"."C4" "Invc_Classification_Type_Desc",
    FIRST_VALUE (
    "T0"."C5")
    OVER (
    PARTITION BY "T0"."C0",
    "T0"."C1",
    "T0"."C2",
    "T0"."C3",
    "T0"."C4",
    "T0"."C6")
    "Claim_Cnt___Distinct",
    "T0"."C7" "Invc_Control_Number",
    "T0"."C8" "Invc_Allowance_Amt",
    "T0"."C9" "Invc_Charge_Amt",
    "T0"."C10" "c10",
    "T0"."C11" "PPO_Reduction_Amt",
    "T0"."C12" "Dup_Ln_Save_Amt",
    "T0"."C13" "c13",
    "T0"."C14" "Sub_Total",
    "T0"."C15" "c15",
    "T0"."C6" "c16"
    FROM (SELECT "T1"."C0" "C0",
    "T1"."C1" "C1",
    "T1"."C2" "C2",
    "T1"."C3" "C3",
    "T1"."C4" "C4",
    "T1"."C6" "C5",
    "T1"."C5" "C6",
    "T0"."C0" "C7",
    "T1"."C7" "C8",
    "T1"."C8" "C9",
    "T1"."C9" "C10",
    "T1"."C10" "C11",
    "T1"."C11" "C12",
    "T1"."C12" "C13",
    "T1"."C13" "C14",
    "T1"."C14" "C15"
    FROM (SELECT COUNT (DISTINCT "INVC_DIM_VW"."INVC_ID") "C0"
    FROM "CDW_DLV_IDS"."WCRS_POLICY_GROUPING_VW" "WCRS_POLICY_GROUPING_VW",
    "WCRS_CLAIM_DETAIL_VW5",
    "EDW_DM"."INVC_DIM_VW" "INVC_DIM_VW",
    "EDW_DM"."PROVIDER_NETWORK_DIM_VW" "PROVIDER_NETWORK_DIM_VW",
    "EDW_DM"."INVC_ACTY_SNPSHT_FACT_VW" "INVC_ACTY_SNPSHT_FACT_VW6",
    "EDW_DM"."CURRENT_MED_INVC_RPT_DT_VW" "CURRENT_MED_INVC_RPT_DT_VW",
    "EDW_DM"."ALL_INVC_SNPSHT_FACT_VW" "ALL_INVC_SNPSHT_FACT_VW",
    "CDW_DLV_IDS"."WCRS_CURRENT_CLAIM_RPT_DT_VW" "WCRS_CURRENT_CLAIM_RPT_DT_VW",
    "CDW_DLV_IDS"."WCRS_CLAIM_FACT_VW" "WCRS_CLAIM_FACT_VW",
    "WCRS_POLICY_DETAIL_VW7",
    "EDW_DM"."INVC_CLAIM_DTL_BRDG_FACT_VW" "INVC_CLAIM_DTL_BRDG_FACT_VW"
    WHERE "INVC_DIM_VW"."INVC_DELETION_IND" <> 'Y'
    AND "INVC_DIM_VW"."INVC_CONSIDRTN_TYPE_DESC" =
    'Original'
    AND "CURRENT_MED_INVC_RPT_DT_VW"."CURRENT_MONTH_RPT_DT" =
    "ALL_INVC_SNPSHT_FACT_VW"."AS_OF_MONTH_END_DT_PK_ID"
    AND "WCRS_CURRENT_CLAIM_RPT_DT_VW"."CURRENT_CLAIM_RPT_DT" =
    "WCRS_CLAIM_FACT_VW"."CLAIM_REPORTING_DT"
    AND "WCRS_POLICY_GROUPING_VW"."ACCOUNT_NM" =
    CAST ('1ST TEAM STAFFING SERVICES, INC.' AS VARCHAR (50 CHAR))
    AND "WCRS_POLICY_DETAIL_VW7"."POLICY_NBR" =
    "WCRS_POLICY_GROUPING_VW"."POLICY_IDENTIFIER"
    AND "WCRS_POLICY_DETAIL_VW7"."CLAIM_NBR" =
    "WCRS_CLAIM_FACT_VW"."CLAIM_NBR"
    AND "WCRS_POLICY_DETAIL_VW7"."CLAIM_SYMBOL_CD" =
    "WCRS_CLAIM_FACT_VW"."CLAIM_SYMBOL_CD"
    AND "WCRS_POLICY_DETAIL_VW7"."KEY_OFFICE_CD" =
    "WCRS_CLAIM_FACT_VW"."KEY_OFFICE_CD"
    AND "WCRS_POLICY_DETAIL_VW7"."CURRENT_SNAPSHOT_IND" =
    'Y'
    AND "WCRS_CLAIM_FACT_VW"."CLAIM_DETAIL_PK_ID" =
    "WCRS_CLAIM_DETAIL_VW5"."CLAIM_DETAIL_PK_ID"
    AND "WCRS_CLAIM_DETAIL_VW5"."CURRENT_SNAPSHOT_IND" =
    'Y'
    AND "WCRS_CLAIM_FACT_VW"."CLAIM_GID" =
    "INVC_CLAIM_DTL_BRDG_FACT_VW"."CLM_GID"
    AND "INVC_CLAIM_DTL_BRDG_FACT_VW"."INVC_GID" =
    "INVC_DIM_VW"."INVC_GID"
    AND "INVC_DIM_VW"."INVC_PK_ID" =
    "INVC_ACTY_SNPSHT_FACT_VW6"."INVC_PK_ID"
    AND "ALL_INVC_SNPSHT_FACT_VW"."MONTH_END_DT_PK_ID" =
    "INVC_ACTY_SNPSHT_FACT_VW6"."MONTH_END_DT_PK_ID"
    AND "ALL_INVC_SNPSHT_FACT_VW"."INVC_GID" =
    "INVC_ACTY_SNPSHT_FACT_VW6"."INVC_GID"
    AND "PROVIDER_NETWORK_DIM_VW"."PROVIDER_NETWORK_PK_ID" =
    "INVC_ACTY_SNPSHT_FACT_VW6"."PPO_PROVIDER_NETWORK_PK_ID"
    AND "WCRS_CURRENT_CLAIM_RPT_DT_VW"."CURRENT_CLAIM_RPT_DT" =
    "WCRS_CLAIM_FACT_VW"."CLAIM_REPORTING_DT") "T0",
    ( SELECT "WCRS_POLICY_GROUPING_VW"."ACCOUNT_NM" "C0",
    "WCRS_CLAIM_DETAIL_VW5"."REGULATORY_STATE_CD" "C1",
    CASE
    WHEN "INVC_DIM_VW"."INVC_IN_OUT_OF_NETWORK_IND" =
    'Y'
    THEN
    'In - Network'
    WHEN "INVC_DIM_VW"."INVC_IN_OUT_OF_NETWORK_IND" =
    'N'
    THEN
    'Out - Network'
    ELSE
    'Others'
    END
    "C2",
    "PROVIDER_NETWORK_DIM_VW"."PROVIDER_NETWORK_NM" "C3",
    "INVC_DIM_VW"."INVC_CLASS_TYPE_DESC" "C4",
    CASE
    WHEN (EXTRACT (
    YEAR FROM ("WCRS_CLAIM_DETAIL_VW5"."LOSS_DT"))
    IS NULL)
    OR (EXTRACT (
    MONTH FROM ("WCRS_CLAIM_DETAIL_VW5"."LOSS_DT"))
    IS NULL)
    THEN
    NULL
    ELSE
    ( EXTRACT (
    YEAR FROM ("WCRS_CLAIM_DETAIL_VW5"."LOSS_DT"))
    || EXTRACT (
    MONTH FROM ("WCRS_CLAIM_DETAIL_VW5"."LOSS_DT")))
    END
    "C5",
    COUNT (DISTINCT "WCRS_CLAIM_DETAIL_VW5"."CLAIM_ID")
    "C6",
    SUM ("INVC_ACTY_SNPSHT_FACT_VW6"."INVC_ALWC_AMT") "C7",
    SUM ("INVC_ACTY_SNPSHT_FACT_VW6"."INVC_CHRGS_AMT")
    "C8",
    SUM (
    "INVC_ACTY_SNPSHT_FACT_VW6"."TOT_INVC_REVIEW_RULE_ALWC_AMT")
    "C9",
    SUM ("INVC_ACTY_SNPSHT_FACT_VW6"."INVC_PPO_REDUC_AMT")
    "C10",
    SUM ("INVC_ACTY_SNPSHT_FACT_VW6"."INVC_DUP_REDUC_AMT")
    "C11",
    SUM ("INVC_ACTY_SNPSHT_FACT_VW6"."INVC_OSR_REDUC_AMT")
    "C12",
    ( SUM (
    "INVC_ACTY_SNPSHT_FACT_VW6"."INVC_CHRGS_AMT")
    - SUM ("INVC_ACTY_SNPSHT_FACT_VW6"."INVC_ALWC_AMT"))
    - SUM (
    "INVC_ACTY_SNPSHT_FACT_VW6"."INVC_DUP_REDUC_AMT")
    "C13",
    SUM (
    "INVC_ACTY_SNPSHT_FACT_VW6"."INVC_CLNT_SPEC_REDUC_AMT")
    "C14"
    FROM "CDW_DLV_IDS"."WCRS_POLICY_GROUPING_VW" "WCRS_POLICY_GROUPING_VW",
    "WCRS_CLAIM_DETAIL_VW5",
    "EDW_DM"."INVC_DIM_VW" "INVC_DIM_VW",
    "EDW_DM"."PROVIDER_NETWORK_DIM_VW" "PROVIDER_NETWORK_DIM_VW",
    "EDW_DM"."INVC_ACTY_SNPSHT_FACT_VW" "INVC_ACTY_SNPSHT_FACT_VW6",
    "EDW_DM"."CURRENT_MED_INVC_RPT_DT_VW" "CURRENT_MED_INVC_RPT_DT_VW",
    "EDW_DM"."ALL_INVC_SNPSHT_FACT_VW" "ALL_INVC_SNPSHT_FACT_VW",
    "CDW_DLV_IDS"."WCRS_CURRENT_CLAIM_RPT_DT_VW" "WCRS_CURRENT_CLAIM_RPT_DT_VW",
    "CDW_DLV_IDS"."WCRS_CLAIM_FACT_VW" "WCRS_CLAIM_FACT_VW",
    "WCRS_POLICY_DETAIL_VW7",
    "EDW_DM"."INVC_CLAIM_DTL_BRDG_FACT_VW" "INVC_CLAIM_DTL_BRDG_FACT_VW"
    WHERE "INVC_DIM_VW"."INVC_DELETION_IND" <> 'Y'
    AND "INVC_DIM_VW"."INVC_CONSIDRTN_TYPE_DESC" =
    'Original'
    AND "CURRENT_MED_INVC_RPT_DT_VW"."CURRENT_MONTH_RPT_DT" =
    "ALL_INVC_SNPSHT_FACT_VW"."AS_OF_MONTH_END_DT_PK_ID"
    AND "WCRS_CURRENT_CLAIM_RPT_DT_VW"."CURRENT_CLAIM_RPT_DT" =
    "WCRS_CLAIM_FACT_VW"."CLAIM_REPORTING_DT"
    AND "WCRS_POLICY_GROUPING_VW"."ACCOUNT_NM" =
    CAST ('1ST TEAM STAFFING SERVICES, INC.' AS VARCHAR (50 CHAR))
    AND "WCRS_POLICY_DETAIL_VW7"."POLICY_NBR" =
    "WCRS_POLICY_GROUPING_VW"."POLICY_IDENTIFIER"
    AND "WCRS_POLICY_DETAIL_VW7"."CLAIM_NBR" =
    "WCRS_CLAIM_FACT_VW"."CLAIM_NBR"
    AND "WCRS_POLICY_DETAIL_VW7"."CLAIM_SYMBOL_CD" =
    "WCRS_CLAIM_FACT_VW"."CLAIM_SYMBOL_CD"
    AND "WCRS_POLICY_DETAIL_VW7"."KEY_OFFICE_CD" =
    "WCRS_CLAIM_FACT_VW"."KEY_OFFICE_CD"
    AND "WCRS_POLICY_DETAIL_VW7"."CURRENT_SNAPSHOT_IND" =
    'Y'
    AND "WCRS_CLAIM_FACT_VW"."CLAIM_DETAIL_PK_ID" =
    "WCRS_CLAIM_DETAIL_VW5"."CLAIM_DETAIL_PK_ID"
    AND "WCRS_CLAIM_DETAIL_VW5"."CURRENT_SNAPSHOT_IND" =
    'Y'
    AND "WCRS_CLAIM_FACT_VW"."CLAIM_GID" =
    "INVC_CLAIM_DTL_BRDG_FACT_VW"."CLM_GID"
    AND "INVC_CLAIM_DTL_BRDG_FACT_VW"."INVC_GID" =
    "INVC_DIM_VW"."INVC_GID"
    AND "INVC_DIM_VW"."INVC_PK_ID" =
    "INVC_ACTY_SNPSHT_FACT_VW6"."INVC_PK_ID"
    AND "ALL_INVC_SNPSHT_FACT_VW"."MONTH_END_DT_PK_ID" =
    "INVC_ACTY_SNPSHT_FACT_VW6"."MONTH_END_DT_PK_ID"
    AND "ALL_INVC_SNPSHT_FACT_VW"."INVC_GID" =
    "INVC_ACTY_SNPSHT_FACT_VW6"."INVC_GID"
    AND "PROVIDER_NETWORK_DIM_VW"."PROVIDER_NETWORK_PK_ID" =
    "INVC_ACTY_SNPSHT_FACT_VW6"."PPO_PROVIDER_NETWORK_PK_ID"
    AND "WCRS_CURRENT_CLAIM_RPT_DT_VW"."CURRENT_CLAIM_RPT_DT" =
    "WCRS_CLAIM_FACT_VW"."CLAIM_REPORTING_DT"
    GROUP BY "WCRS_POLICY_GROUPING_VW"."ACCOUNT_NM",
    "WCRS_CLAIM_DETAIL_VW5"."REGULATORY_STATE_CD",
    CASE
    WHEN "INVC_DIM_VW"."INVC_IN_OUT_OF_NETWORK_IND" =
    'Y'
    THEN
    'In - Network'
    WHEN "INVC_DIM_VW"."INVC_IN_OUT_OF_NETWORK_IND" =
    'N'
    THEN
    'Out - Network'
    ELSE
    'Others'
    END,
    "PROVIDER_NETWORK_DIM_VW"."PROVIDER_NETWORK_NM",
    "INVC_DIM_VW"."INVC_CLASS_TYPE_DESC",
    CASE
    WHEN (EXTRACT (
    YEAR FROM ("WCRS_CLAIM_DETAIL_VW5"."LOSS_DT"))
    IS NULL)
    OR (EXTRACT (
    MONTH FROM ("WCRS_CLAIM_DETAIL_VW5"."LOSS_DT"))
    IS NULL)
    THEN
    NULL
    ELSE
    ( EXTRACT (
    YEAR FROM ("WCRS_CLAIM_DETAIL_VW5"."LOSS_DT"))
    || EXTRACT (
    MONTH FROM ("WCRS_CLAIM_DETAIL_VW5"."LOSS_DT")))
    END) "T1") "T0"
    ORDER BY "Account_Name" ASC NULLS LAST,
    "Accident_State_Cd" ASC NULLS LAST,
    "c3" ASC NULLS LAST,
    "PPO_Name" ASC NULLS LAST,
    "Invc_Classification_Type_Desc" ASC NULLS LAST

    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
    | 0 | SELECT STATEMENT | | 1 | 838 | 1079K (1)| 00:00:34 | | |
    | 1 | TEMP TABLE TRANSFORMATION | | | | | | | |
    | 2 | PX COORDINATOR | | | | | | | |
    | 3 | PX SEND QC (RANDOM) | :TQ10000 | 10M| 317M| 848K (1)| 00:00:27 | | |
    | 4 | LOAD AS SELECT | SYS_TEMP_0FD9D677A_286AAA2E | | | | | | |
    | 5 | PX BLOCK ITERATOR | | 10M| 317M| 848K (1)| 00:00:27 | | |
    |* 6 | TABLE ACCESS STORAGE FULL | WCRS_CLAIM_DETAIL | 10M| 317M| 848K (1)| 00:00:27 | | |
    | 7 | PX COORDINATOR | | | | | | | |
    | 8 | PX SEND QC (RANDOM) | :TQ20000 | 10M| 268M| 44875 (1)| 00:00:02 | | |
    | 9 | LOAD AS SELECT | SYS_TEMP_0FD9D677B_286AAA2E | | | | | | |
    | 10 | PX BLOCK ITERATOR | | 10M| 268M| 44875 (1)| 00:00:02 | | |
    |* 11 | TABLE ACCESS STORAGE FULL | WCRS_POLICY_DETAIL | 10M| 268M| 44875 (1)| 00:00:02 | | |
    | 12 | PX COORDINATOR | | | | | | | |
    | 13 | PX SEND QC (ORDER) | :TQ40017 | 1 | 838 | 186K (2)| 00:00:06 | | |
    | 14 | WINDOW SORT | | 1 | 838 | 186K (2)| 00:00:06 | | |
    | 15 | PX RECEIVE | | 1 | 838 | 186K (2)| 00:00:06 | | |
    | 16 | PX SEND RANGE | :TQ40016 | 1 | 838 | 186K (2)| 00:00:06 | | |
    | 17 | NESTED LOOPS | | 1 | 838 | 186K (2)| 00:00:06 | | |
    | 18 | BUFFER SORT | | | | | | | |
    | 19 | PX RECEIVE | | | | | | | |
    | 20 | PX SEND BROADCAST | :TQ40001 | | | | | | |
    | 21 | VIEW | | 1 | 13 | 93216 (2)| 00:00:03 | | |
    | 22 | SORT GROUP BY | | 1 | 393 | | | | |
    | 23 | PX COORDINATOR | | | | | | | |
    | 24 | PX SEND QC (RANDOM) | :TQ30015 | 1 | 393 | | | | |
    | 25 | SORT GROUP BY | | 1 | 393 | | | | |
    | 26 | PX RECEIVE | | 1 | 393 | | | | |
    | 27 | PX SEND HASH | :TQ30014 | 1 | 393 | | | | |
    | 28 | SORT GROUP BY | | 1 | 393 | | | | |
    |* 29 | HASH JOIN ANTI | | 1 | 393 | 93216 (2)| 00:00:03 | | |
    | 30 | PX RECEIVE | | 1 | 376 | 85197 (2)| 00:00:03 | | |
    | 31 | PX SEND HASH | :TQ30012 | 1 | 376 | 85197 (2)| 00:00:03 | | |
    | 32 | BUFFER SORT | | 1 | 838 | | | | |
    | 33 | NESTED LOOPS | | 1 | 376 | 85197 (2)| 00:00:03 | | |
    | 34 | NESTED LOOPS | | 1 | 358 | 85197 (2)| 00:00:03 | | |
    | 35 | NESTED LOOPS | | 1 | 348 | 85197 (2)| 00:00:03 | | |
    |* 36 | HASH JOIN ANTI | | 1 | 316 | 85179 (2)| 00:00:03 | | |
    | 37 | PX RECEIVE | | 4 | 1156 | 77161 (2)| 00:00:03 | | |
    | 38 | PX SEND HASH | :TQ30010 | 4 | 1156 | 77161 (2)| 00:00:03 | | |
    |* 39 | HASH JOIN ANTI BUFFERED | | 4 | 1156 | 77161 (2)| 00:00:03 | | |
    | 40 | PX RECEIVE | | 371 | 94605 | 69142 (2)| 00:00:03 | | |
    | 41 | PX SEND HASH | :TQ30008 | 371 | 94605 | 69142 (2)| 00:00:03 | | |
    |* 42 | HASH JOIN | | 371 | 94605 | 69142 (2)| 00:00:03 | | |
    | 43 | PX RECEIVE | | 350 | 77000 | 36642 (1)| 00:00:02 | | |
    | 44 | PX SEND BROADCAST | :TQ30007 | 350 | 77000 | 36642 (1)| 00:00:02 | | |
    |* 45 | HASH JOIN | | 350 | 77000 | 36642 (1)| 00:00:02 | | |
    | 46 | PX RECEIVE | | 140 | 25200 | 28624 (1)| 00:00:01 | | |
    | 47 | PX SEND BROADCAST | :TQ30006 | 140 | 25200 | 28624 (1)| 00:00:01 | | |
    |* 48 | HASH JOIN | | 140 | 25200 | 28624 (1)| 00:00:01 | | |
    | 49 | PX RECEIVE | | 140 | 22820 | 25169 (1)| 00:00:01 | | |
    | 50 | PX SEND BROADCAST | :TQ30005 | 140 | 22820 | 25169 (1)| 00:00:01 | | |
    |* 51 | HASH JOIN BUFFERED | | 140 | 22820 | 25169 (1)| 00:00:01 | | |
    | 52 | BUFFER SORT | | | | | | | |
    | 53 | PX RECEIVE | | 9 | 306 | 5 (0)| 00:00:01 | | |
    | 54 | T PX SEND BROADCAS | :TQ30000 | 9 | 306 | 5 (0)| 00:00:01 | | |
    | 55 | INDEX ROWID TABLE ACCESS BY | WCRS_POLICY_GROUPING | 9 | 306 | 5 (0)| 00:00:01 | | |
    |* 56 | AN INDEX RANGE SC | SUK3 | 9 | | 1 (0)| 00:00:01 | | |
    |* 57 | HASH JOIN | | 9699K| 1193M| 25149 (1)| 00:00:01 | | |
    | 58 | PX RECEIVE | | 9699K| 434M| 22205 (1)| 00:00:01 | | |
    | 59 | PX SEND HASH | :TQ30003 | 9699K| 434M| 22205 (1)| 00:00:01 | | |
    | 60 | NESTED LOOPS | | 9699K| 434M| 22205 (1)| 00:00:01 | | |
    | 61 | BUFFER SORT | | | | | | | |
    | 62 | PX RECEIVE | | | | | | | |
    | 63 | DCAST PX SEND BROA | :TQ30002 | | | | | | |
    | 64 | CARTESIAN MERGE JOIN | | 1 | 14 | 13 (0)| 00:00:01 | | |
    | 65 | TERATOR PX BLOCK I | | 1 | 8 | 10 (0)| 00:00:01 | | |
    | 66 | ESS STORAGE FULL TABLE ACC | CURRENT_MED_INVC_RPT_DT | 1 | 8 | 10 (0)| 00:00:01 | | |
    | 67 | T BUFFER SOR | | 1 | 6 | 3 (0)| 00:00:01 | | |
    | 68 | E PX RECEIV | | 1 | 6 | 2 (0)| 00:00:01 | | |
    | 69 | BROADCAST PX SEND | :TQ30001 | 1 | 6 | 2 (0)| 00:00:01 | | |
    | 70 | K ITERATOR PX BLOC | | 1 | 6 | 2 (0)| 00:00:01 | | |
    | 71 | ACCESS STORAGE FULL TABLE | WCRS_CURRENT_CLAIM_RPT_DT | 1 | 6 | 2 (0)| 00:00:01 | | |
    | 72 | TOR PX BLOCK ITERA | | 9699K| 305M| 22192 (1)| 00:00:01 | KEY | KEY |
    |* 73 | STORAGE FULL TABLE ACCESS | WCRS_CURRENT_CLAIM_FACT | 9699K| 305M| 22192 (1)| 00:00:01 | KEY | KEY |
    | 74 | PX RECEIVE | | 10M| 785M| 2907 (2)| 00:00:01 | | |
    | 75 | PX SEND HASH | :TQ30004 | 10M| 785M| 2907 (2)| 00:00:01 | | |
    |* 76 | VIEW | | 10M| 785M| 2907 (2)| 00:00:01 | | |
    | 77 | TOR PX BLOCK ITERA | | 10M| 268M| 2907 (2)| 00:00:01 | | |
    | 78 | STORAGE FULL TABLE ACCESS | SYS_TEMP_0FD9D677B_286AAA2E | 10M| 268M| 2907 (2)| 00:00:01 | | |
    |* 79 | VIEW | | 10M| 168M| 3439 (2)| 00:00:01 | | |
    | 80 | PX BLOCK ITERATOR | | 10M| 317M| 3439 (2)| 00:00:01 | | |
    | 81 | E FULL TABLE ACCESS STORAG | SYS_TEMP_0FD9D677A_286AAA2E | 10M| 317M| 3439 (2)| 00:00:01 | | |
    | 82 | PX BLOCK ITERATOR | | 15M| 599M| 7994 (1)| 00:00:01 | | |
    | 83 | LL TABLE ACCESS STORAGE FU | INVC_CLAIM_DTL_BRDG_FACT | 15M| 599M| 7994 (1)| 00:00:01 | | |
    | 84 | PX BLOCK ITERATOR | | 15M| 521M| 32477 (2)| 00:00:02 | | |
    |* 85 | TABLE ACCESS STORAGE FULL | INVC_DIM | 15M| 521M| 32477 (2)| 00:00:02 | | |
    | 86 | PX RECEIVE | | 15M| 509M| 7994 (1)| 00:00:01 | | |
    | 87 | PX SEND HASH | :TQ30009 | 15M| 509M| 7994 (1)| 00:00:01 | | |
    | 88 | PX BLOCK ITERATOR | | 15M| 509M| 7994 (1)| 00:00:01 | | |
    | 89 | TABLE ACCESS STORAGE FULL | INVC_CLAIM_DTL_BRDG_FACT | 15M| 509M| 7994 (1)| 00:00:01 | | |
    | 90 | PX RECEIVE | | 15M| 404M| 7994 (1)| 00:00:01 | | |
    | 91 | PX SEND HASH | :TQ30011 | 15M| 404M| 7994 (1)| 00:00:01 | | |
    | 92 | PX BLOCK ITERATOR | | 15M| 404M| 7994 (1)| 00:00:01 | | |
    | 93 | TABLE ACCESS STORAGE FULL | INVC_CLAIM_DTL_BRDG_FACT | 15M| 404M| 7994 (1)| 00:00:01 | | |
    | 94 | TABLE ACCESS BY INDEX ROWID | INVC_ACTY_SNPSHT_FACT | 1 | 32 | 18 (0)| 00:00:01 | | |
    |* 95 | INDEX RANGE SCAN | IFK_XPKINVOICE_ACTIVITY_SNAPSH | 1 | | 1 (0)| 00:00:01 | | |
    |* 96 | INDEX UNIQUE SCAN | IFK_XPKPROVIDER_NETWORK_DIM | 1 | 10 | 0 (0)| 00:00:01 | | |
    |* 97 | INDEX RANGE SCAN | IFK_XPKALL_INVC_SNPSHT_FACT | 1 | 18 | 1 (0)| 00:00:01 | | |
    | 98 | PX RECEIVE | | 15M| 254M| 7994 (1)| 00:00:01 | | |
    | 99 | PX SEND HASH | :TQ30013 | 15M| 254M| 7994 (1)| 00:00:01 | | |
    | 100 | PX BLOCK ITERATOR | | 15M| 254M| 7994 (1)| 00:00:01 | | |
    | 101 | TABLE ACCESS STORAGE FULL | INVC_CLAIM_DTL_BRDG_FACT | 15M| 254M| 7994 (1)| 00:00:01 | | |
    | 102 | VIEW | | 1 | 825 | | | | |
    | 103 | SORT GROUP BY | | 1 | 430 | 93216 (2)| 00:00:03 | | |
    | 104 | BUFFER SORT | | | | | | | |
    | 105 | PX RECEIVE | | 1 | 430 | 93216 (2)| 00:00:03 | | |
    | 106 | PX SEND HASH | :TQ40015 | 1 | 430 | 93216 (2)| 00:00:03 | | |
    |*107 | HASH JOIN ANTI BUFFERED | | 1 | 430 | 93216 (2)| 00:00:03 | | |
    | 108 | PX RECEIVE | | 1 | 413 | 85198 (2)| 00:00:03 | | |
    | 109 | PX SEND HASH | :TQ40013 | 1 | 413 | 85198 (2)| 00:00:03 | | |
    | 110 | BUFFER SORT | | 1 | 838 | | | | |
    | 111 | NESTED LOOPS | | 1 | 413 | 85198 (2)| 00:00:03 | | |
    | 112 | NESTED LOOPS | | 1 | 395 | 85197 (2)| 00:00:03 | | |
    | 113 | NESTED LOOPS | | 1 | 369 | 85197 (2)| 00:00:03 | | |
    |*114 | HASH JOIN ANTI | | 1 | 311 | 85179 (2)| 00:00:03 | | |
    | 115 | PX RECEIVE | | 4 | 1136 | 77161 (2)| 00:00:03 | | |
    | 116 | PX SEND HASH | :TQ40011 | 4 | 1136 | 77161 (2)| 00:00:03 | | |
    |*117 | HASH JOIN ANTI BUFFERED | | 4 | 1136 | 77161 (2)| 00:00:03 | | |
    | 118 | PX RECEIVE | | 371 | 92750 | 69143 (2)| 00:00:03 | | |
    | 119 | PX SEND HASH | :TQ40009 | 371 | 92750 | 69143 (2)| 00:00:03 | | |
    |*120 | HASH JOIN | | 371 | 92750 | 69143 (2)| 00:00:03 | | |
    | 121 | PX RECEIVE | | 350 | 72450 | 36642 (1)| 00:00:02 | | |
    | 122 | PX SEND BROADCAST | :TQ40008 | 350 | 72450 | 36642 (1)| 00:00:02 | | |
    |*123 | HASH JOIN | | 350 | 72450 | 36642 (1)| 00:00:02 | | |
    | 124 | PX RECEIVE | | 140 | 23380 | 28624 (1)| 00:00:01 | | |
    | 125 | PX SEND BROADCAST | :TQ40007 | 140 | 23380 | 28624 (1)| 00:00:01 | | |
    |*126 | HASH JOIN | | 140 | 23380 | 28624 (1)| 00:00:01 | | |
    | 127 | PX RECEIVE | | 140 | 15540 | 25169 (1)| 00:00:01 | | |
    | 128 | PX SEND BROADCAST | :TQ40006 | 140 | 15540 | 25169 (1)| 00:00:01 | | |
    |*129 | HASH JOIN BUFFERED | | 140 | 15540 | 25169 (1)| 00:00:01 | | |
    | 130 | BUFFER SORT | | | | | | | |
    | 131 | PX RECEIVE | | 9 | 306 | 5 (0)| 00:00:01 | | |
    | 132 | PX SEND BROADCAST | :TQ40000 | 9 | 306 | 5 (0)| 00:00:01 | | |
    | 133 | ROWID TABLE ACCESS BY INDEX | WCRS_POLICY_GROUPING | 9 | 306 | 5 (0)| 00:00:01 | | |
    |*134 | INDEX RANGE SCAN | SUK3 | 9 | | 1 (0)| 00:00:01 | | |
    |*135 | HASH JOIN | | 9699K| 712M| 25149 (1)| 00:00:01 | | |
    | 136 | PX RECEIVE | | 10M| 287M| 2907 (2)| 00:00:01 | | |
    | 137 | PX SEND HASH | :TQ40004 | 10M| 287M| 2907 (2)| 00:00:01 | | |
    |*138 | VIEW | | 10M| 287M| 2907 (2)| 00:00:01 | | |
    | 139 | PX BLOCK ITERATOR | | 10M| 268M| 2907 (2)| 00:00:01 | | |
    | 140 | E FULL TABLE ACCESS STORAG | SYS_TEMP_0FD9D677B_286AAA2E | 10M| 268M| 2907 (2)| 00:00:01 | | |
    | 141 | PX RECEIVE | | 9699K| 434M| 22205 (1)| 00:00:01 | | |
    | 142 | PX SEND HASH | :TQ40005 | 9699K| 434M| 22205 (1)| 00:00:01 | | |
    | 143 | NESTED LOOPS | | 9699K| 434M| 22205 (1)| 00:00:01 | | |
    | 144 | BUFFER SORT | | | | | | | |
    | 145 | PX RECEIVE | | | | | | | |
    | 146 | PX SEND BROADCAST | :TQ40003 | | | | | | |
    | 147 | IAN MERGE JOIN CARTES | | 1 | 14 | 13 (0)| 00:00:01 | | |
    | 148 | R PX BLOCK ITERATO | | 1 | 8 | 10 (0)| 00:00:01 | | |
    | 149 | ORAGE FULL TABLE ACCESS ST | CURRENT_MED_INVC_RPT_DT | 1 | 8 | 10 (0)| 00:00:01 | | |
    | 150 | BUFFER SORT | | 1 | 6 | 3 (0)| 00:00:01 | | |
    | 151 | PX RECEIVE | | 1 | 6 | 2 (0)| 00:00:01 | | |
    | 152 | AST PX SEND BROADC | :TQ40002 | 1 | 6 | 2 (0)| 00:00:01 | | |
    | 153 | ATOR PX BLOCK ITER | | 1 | 6 | 2 (0)| 00:00:01 | | |
    | 154 | STORAGE FULL TABLE ACCESS | WCRS_CURRENT_CLAIM_RPT_DT | 1 | 6 | 2 (0)| 00:00:01 | | |
    | 155 | PX BLOCK ITERATOR | | 9699K| 305M| 22192 (1)| 00:00:01 | KEY | KEY |
    |*156 | E FULL TABLE ACCESS STORAG | WCRS_CURRENT_CLAIM_FACT | 9699K| 305M| 22192 (1)| 00:00:01 | KEY | KEY |
    |*157 | VIEW | | 10M| 555M| 3439 (2)| 00:00:01 | | |
    | 158 | PX BLOCK ITERATOR | | 10M| 317M| 3439 (2)| 00:00:01 | | |
    | 159 | TABLE ACCESS STORAGE FULL | SYS_TEMP_0FD9D677A_286AAA2E | 10M| 317M| 3439 (2)| 00:00:01 | | |
    | 160 | PX BLOCK ITERATOR | | 15M| 599M| 7994 (1)| 00:00:01 | | |
    | 161 | TABLE ACCESS STORAGE FULL | INVC_CLAIM_DTL_BRDG_FACT | 15M| 599M| 7994 (1)| 00:00:01 | | |
    | 162 | PX BLOCK ITERATOR | | 15M| 641M| 32477 (2)| 00:00:02 | | |
    |*163 | TABLE ACCESS STORAGE FULL | INVC_DIM | 15M| 641M| 32477 (2)| 00:00:02 | | |
    | 164 | PX RECEIVE | | 15M| 509M| 7994 (1)| 00:00:01 | | |
    | 165 | PX SEND HASH | :TQ40010 | 15M| 509M| 7994 (1)| 00:00:01 | | |
    | 166 | PX BLOCK ITERATOR | | 15M| 509M| 7994 (1)| 00:00:01 | | |
    | 167 | TABLE ACCESS STORAGE FULL | INVC_CLAIM_DTL_BRDG_FACT | 15M| 509M| 7994 (1)| 00:00:01 | | |
    | 168 | PX RECEIVE | | 15M| 404M| 7994 (1)| 00:00:01 | | |
    | 169 | PX SEND HASH | :TQ40012 | 15M| 404M| 7994 (1)| 00:00:01 | | |
    | 170 | PX BLOCK ITERATOR | | 15M| 404M| 7994 (1)| 00:00:01 | | |
    | 171 | TABLE ACCESS STORAGE FULL | INVC_CLAIM_DTL_BRDG_FACT | 15M| 404M| 7994 (1)| 00:00:01 | | |
    | 172 | TABLE ACCESS BY INDEX ROWID | INVC_ACTY_SNPSHT_FACT | 1 | 58 | 18 (0)| 00:00:01 | | |
    |*173 | INDEX RANGE SCAN | IFK_XPKINVOICE_ACTIVITY_SNAPSH | 1 | | 1 (0)| 00:00:01 | | |
    | 174 | TABLE ACCESS BY INDEX ROWID | PROVIDER_NETWORK_DIM | 1 | 26 | 0 (0)| 00:00:01 | | |
    |*175 | INDEX UNIQUE SCAN | IFK_XPKPROVIDER_NETWORK_DIM | 1 | | 0 (0)| 00:00:01 | | |
    |*176 | INDEX RANGE SCAN | IFK_XPKALL_INVC_SNPSHT_FACT | 1 | 18 | 1 (0)| 00:00:01 | | |
    | 177 | PX RECEIVE | | 15M| 254M| 7994 (1)| 00:00:01 | | |
    | 178 | PX SEND HASH | :TQ40014 | 15M| 254M| 7994 (1)| 00:00:01 | | |
    | 179 | PX BLOCK ITERATOR | | 15M| 254M| 7994 (1)| 00:00:01 | | |
    | 180 | TABLE ACCESS STORAGE FULL | INVC_CLAIM_DTL_BRDG_FACT | 15M| 254M| 7994 (1)| 00:00:01 | | |
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------

  • Gurus..Help in understanding PL/SQL Tuning

    Hi Gurus,
    I am trying to understand PL/SQL tuning and I have read few articles on PL/SQL profiler,dbms_trace,tk-prof ect.
    When doing PL/SQL tuning I understand we will take trace from DBMS_PROFILER.
    Can any one tell me step by step procedure for DBMS_PROFILER with some example.
    Once you collect what will be the next steps for PL/SQL tuning.
    My understanding is we cannot tune much in PL/SQL block all we can do is we can take out SQL statement from PL/SQL and tune that
    SQL statement.
    Correct me if I am wrong.
    Thanks in advance.
    Regards
    MMU

    check this one, it may help -
    Re: HOw to check the performance of a pl/sql command

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

  • SQL tuning

    Hi All,
    I am new to tuning.
    Can somebody help me in tuning this SQL query.
    SELECT pppd.productid, pppd.sequencenumber, pppd.priceareaid, pppd.startdate, pppd.qtyfrom, pppd.enddate, pppd.price,
    pppd.articleid, pppd.customerid, pppd.distributorid, pppd.supplierid, pppd.adviceprice, pppd.customergroupid, pppd.dimensionvalue1, pppd.dimensionvalue2,
    pppd.dimensionvalue3, pppd.dimensionvalue4, pppd.dimensionvalue5, pppd.dimensionvalue6, pppd.discountpercentage,
    pppd.promotionindicator, pppd.vatindicator
    FROM PPM_PRODUCTPRICE pppd WHERE
    pppd.validindicator=1 AND pppd.startdate <= SYSDATE AND NVL(pppd.enddate,SYSDATE +1) >= SYSDATE
    AND NOT EXISTS
    (SELECT 1 FROM PPM_PRODUCTPRICE pppd2 WHERE pppd2.productid = pppd.productid
    AND NOT (pppd2.sequencenumber = pppd.sequencenumber)
    AND pppd2.priceareaid = pppd.priceareaid
    AND (NVL(pppd2.supplierid,9999999999) = NVL(pppd.supplierid,9999999999) )
    AND (NVL(pppd2.distributorid,9999999999) = NVL(pppd.distributorid,9999999999))
    AND (NVL(pppd2.customerid,9999999999) = NVL(pppd.customerid,9999999999) )
    AND (NVL(pppd2.customergroupid,9999999999) = NVL(pppd.customergroupid,9999999999))
    AND (NVL(pppd2.articleid,9999999999) = NVL(pppd.articleid,9999999999))
    AND (NVL(pppd2.dimensionvalue1,9999999999)=NVL(pppd.dimensionvalue1,9999999999))
    AND (NVL(pppd2.dimensionvalue2,9999999999)=NVL(pppd.dimensionvalue2 ,9999999999))
    AND (NVL(pppd2.dimensionvalue3,9999999999)=NVL(pppd.dimensionvalue3 ,9999999999))
    AND (NVL(pppd2.dimensionvalue4,9999999999)=NVL(pppd.dimensionvalue4 ,9999999999))
    AND (NVL(pppd2.dimensionvalue5,9999999999)=NVL(pppd.dimensionvalue5 ,9999999999))
    AND (NVL(pppd2.dimensionvalue6,9999999999)=NVL(pppd.dimensionvalue6 ,9999999999))
    AND pppd2.qtyfrom = pppd.qtyfrom AND pppd2.startdate BETWEEN pppd.startdate AND SYSDATE
    AND NVL(pppd2.enddate,SYSDATE +1) >= SYSDATE )
    AND productid= 30700

    At a minimum I think you should search the forums for SQL Tuning because I know there is some sort of sticked post identifying the GENERAL steps you should follow to tune a query. Us being here trying to help cannot tune a blanket SQL statement for the most part that is given to us. We don't know so many things that it is hard to form a cohesive answer. Some questions that arise are:
    1. What version of Oracle are you using?
    2. What are the table structures?
    3. What is the question you are truly trying to answer?
    4. What is the explain plan saying?
    5. What is your tuning goal (faster execution? lower I/O?)?
    5. etc.....
    At a minimum it appears that you are using the NVL function a lot and I would probably wager a guess that it is preventing you from using indexes on all those ID columns, if there are any.
    Hope this helps!
    Edited by: Centinul on Sep 12, 2008 12:31 PM
    Here is the link to the post I was discussing: When your query takes too long ...

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • 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

  • List Sql Tuning Sets

    I am hoping for a quick easy answer on this. grin
    We have been generating a number of Sql Tuning Sets via Grid Control and now we want to export them. Of course, they all have these awful, non-descriptive names. How do we list them? I was unable to find any help in the "automatic SQL tuning" guide (Chapter 12) of the Performance Guide, and browsing the DBA_* and other fixed views has not revealed anything, yet.

    Does this help?
    BANPROD_SQL > select id,name,owner,description,created from WRI$_SQLSET_DEFINITIONS order by 1 desc;
    ID NAME OWNER DESCRIPTION CREATED
    10 TUNING_SET_1141930799317 ORACLE Automatically generated by ADDM 09-MAR-06
    9 TUNING_SET_1141921159123 ORACLE Automatically generated by ADDM 09-MAR-06
    8 TUNING_SET_1141831053351 ORACLE Automatically generated by ADDM 08-MAR-06
    7 TUNING_SET_1141826801391 ORACLE Automatically generated by ADDM 08-MAR-06
    6 TOP_SQL_1141752418284 ORACLE Automatically generated by Top SQL 07-MAR-06
    5 TOP_SQL_1141749589578 ORACLE Automatically generated by Top SQL 07-MAR-06
    4 TOP_SQL_1141747575814 ORACLE Automatically generated by Top SQL 07-MAR-06
    2 TOP_SQL_1141746930242 ORACLE Automatically generated by Top SQL 07-MAR-06
    1 TUNING_SET_1141660362671 ORACLE Automatically generated by ADDM 06-MAR-06
    9 rows selected.

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

  • Loading SQL Tuning Sets

    On a 10.2.0.4 database, is it possible to load SQL Tuning sets with SQL from a text file? I can't find anything in the documentation mentioning this but I could have simply missed it and this facility would be very useful to us.
    Our reporting tool is MicroStrategy which operates by building lots of temporary tables: extracting the SQL via Top Activity EM page will put the CTAS statement into the tuning set which (I believe) is ignored by SQL Access Advisor - extracting the sql to a text file, editting to remove the "create table as" and executing in order to load the tuning set is very long winded for a set of queries - at least being able to load the tuning set directly with a set of SQL select statements directly from a text file would help significantly.
    Many thanks for any advice
    Pete

    I did not see a direct way to create the STS from a text file. From the docs:
    "The standard sources for populating an STS are the workload repository, another STS, or the cursor cache"
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/sql_tune.htm#i34915
    But you could try a couple of things:
    1) create one tuning task per statement, using DBMS_SQLTUNE.CREATE_TUNING_TASK, which can use plain text as input: http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/sql_tune.htm#CHDJDHGE
    2) create the STS with queries from cursor cache: http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_sqltun.htm#i1010615
    Both approaches needs some PL/SQL programming, but it can be useful if you can identify your SQL statements some way.
    Regards.

  • ORA-13754: "SQL Tuning Set" "" does not exist for user "SYS"

    While calling dbms_stats.seed_col_usage I got the following error. Can someone help me on how to resolve it
    sqlplus
    SQL*Plus: Release 11.2.0.1.0 Production on Thu Apr 14 14:37:38 2011
    Copyright (c) 1982, 2009, Oracle. All rights reserved.
    Enter user-name: / as sysdba
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE 11.2.0.1.0 Production
    TNS for IBM/AIX RISC System/6000: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    SQL> show user
    USER is "SYS"
    SQL> begin
    2 dbms_stats.seed_col_usage(null,null,400);
    3 end;
    4 /
    begin
    ERROR at line 1:
    ORA-13754: "SQL Tuning Set" "" does not exist for user "SYS".
    ORA-06512: at "SYS.DBMS_SQLTUNE_INTERNAL", line 17379
    ORA-06512: at "SYS.DBMS_STATS", line 28451
    ORA-06512: at line 2
    Thank You
    Sarayu

    According to the documentation:
    SEED_COL_USAGE ProcedureThis procedure iterates over the SQL statements in the specified SQL tuning set, compiles them and seeds column usage information for the columns that appear in these statements.
    Syntax
    DBMS_STATS.SEED_COL_USAGE (
    sqlset_name IN VARCHAR2,
    owner_name IN VARCHAR2,
    time_limit IN POSITIVE DEFAULT NULL);>
    It looks like you need to provide a SQLSET_NAME and OWNER_NAME to use this procedure correctly, to which you've provided NULLs. I don't see any exceptions in the documentation that indicate special processing when NULLs are provided.

  • 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

  • SQL tuning or a simple comprise between time and cost?

    Hi,
    What I understand is that SQL tuning is a simple comprise between time and cost. Objectives of SQL tuning include:
    Reduce Cost
    Reduce Time
    Better Results
    Is it right and correct?
    Adith

    NO, WRONG.
    reducing COST is meaningless, because COST is meaningless. It's used internally by the optimizer to weigh the cost/benefits of different execution plans (access methods) for a single query. cost CANNOT be compared across queries. and if you add a hint to a sql, then it becomes a different sql (proven by looking in v$sql) so you cannot compare costs. in fact, when you provide a hint, oracle artificially lowers the cost associated with the hinted action in order to make that action look better to the optimizer, helping it to be choosen.
    reduce time. reduce io. reduce memory usage. that's it.

  • 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

  • Any tool or shortcut to get SQL tuning suggestion???????

    Hi I have to tune an application and need to go throught alot many SQL their PLAN and ti tune them.
    I want to know ether is there any tool online or may be from oracle to get the tuning suggestions straighytway.my oracle version is 9206
    Can i use 10g SQL tuning advisor with 9i database????
    Thanks
    Gagan

    Hi Gagan,
    Can i use 10g SQL tuning advisor with 9i databaseNo, but you can do the same thing manually, and often do a better job:
    Tune SQL with optimizer parms:
    http://www.dba-oracle.com/t_sql_optimizer_parameters.htm
    Find missing indexes:
    1 - Search for unnecessary large-table, full-table scans
    2 - Compare consistent gets to rows returned
    http://www.dba-oracle.com/art_sql_tune.htm
    Hope this helps. . . .
    Donald K. Burleson
    Oracle Press author

Maybe you are looking for

  • How to disable a single cell in a table (and not the whole column)

    Hi there, I've got a webdynpro table with a few columns, rows can be created dynamically through a button in the table toolbar. Depending on the value of a certain cell I have to disable another cell (in the same row). I tried to manipulate the view

  • Problem with Zen Micro

    I am having a problem with my ZEN Micro. Whenever I plug it in the computer it locks up. I have tried the disk cleanup. I have formated the device. I have removed the firmware. If it isn't pluged it, it will startup to the recovery menu, but as soon

  • Best methods for this project

    Hi I have this to create for a client. http://www.qwerty-design.co.uk/bensons/ If you click on the London area (bottom right if you're not from the UK) and click the map will zoom to reveal two markers. When these are rollover they reveal store names

  • Email Link Created in Muse won't work

    This is odd. I can send an email to my client from any email program. But if I select the email link from his webpage (created in Muse), even though the email is correct when an email window opens, the client is not receiving emails. Some get bounceb

  • Decimals management through TCURX

    Hi Experts, I do have the usual issue with ITL currency in BEx (SAP BI 7.0 / BEx 3.5). As you probably know, Italian Lire is a no-decimal currency, stored that way in TCURX table. I do load my amounts from an Oracle database, through DBConnect. There