Regarding TKProf

Hi,
We have a long running query in one of production server. I received a mail like "we need to genarate a TKprof for that query". Now how to monitor that query. I now how to do TKprof for a .trc file. before that we need do SQL Trace rit..?
Please Help me on this..!

Hi,
Look into this. very useful.
When your query takes too long ...
Regards,
Simma....

Similar Messages

  • Tkprof and mutiple cursors

    Hi
    I am looking into a performance issues on the following; Oracle 8.1.7.3 on OpenVms and a Pro*C/C++ server application.
    I run sql_trace and tkprof for some Pro*C/C++ operations and I get the following from tkprof
    INSERT INTO VV4_RANGE.TRANSACTION_DETAIL (CALCULATED_VALUE,VALUE,
    CALL_DURATION,CREDIT_BALANCE,FILE_TYPE_UID,FILE_UID,IN_PLATFORM_UID,
    CALLED_PARTY,PROVIDER_ID,RECORD_NUMBER,START_OF_CALL,SUBSCRIBER_UID,
    TARIFF_CORRECT,END_OF_CALL,TRANSACTION_TYPE_UID,EVENT_CAUSE) SELECT
    CALCULATED_VALUE,CALL_CHARGE,CONNECTION_DURATION,CREDIT_BALANCE,
    FILE_TYPE_UID,FILE_UID,IN_PLATFORM_UID,NVL(CALLED_PARTY,LAST_CALLED_PARTY),
    PROVIDER_ID,RECORD_NUMBER,START_DATE,SUBSCRIBER_ID,TARIFF_CORRECT,
    TIME_STAMP,TRANSACTION_TYPE_UID,decode(CALL_STATUS,-1,NULL,CALL_STATUS)
    FROM DATALOADER1_1_8
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.01 0 0 0 0
    Execute 0 0.00 0.00 0 0 0 0
    Fetch 0 0.00 0.00 0 0 0 0
    total 1 0.00 0.01 0 0 0 0
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: 28 (VV4_LOAD)
    This is strange there is only a parse and nothing else. I then checked out the raw trace files, as below
    PARSING IN CURSOR #18 len=567 dep=0 uid=28 oct=2 lid=28 tim=190280724 hv=832202509 ad='5d41c08'
    INSERT INTO VV4_RANGE.TRANSACTION_DETAIL (CALCULATED_VALUE,VALUE,CALL_DURATION,CREDIT_BALANCE,FILE_TYPE_UID,FILE_UID,IN_PLATFORM_UID,CALLED_PARTY,PROVIDER_ID,RECORD_NUMBER,START_OF_CALL,SUBSCRIBER_UID,TARIFF_CORRECT,END_OF_CALL,TRANSACTION_TYPE_UID,EVENT_CAUSE) SELECT CALCULATED_VALUE,CALL_CHARGE,CONNECTION_DURATION,CREDIT_BALANCE,FILE_TYPE_UID,FILE_UID,IN_PLATFORM_UID,NVL(CALLED_PARTY,LAST_CALLED_PARTY),PROVIDER_ID,RECORD_NUMBER,START_DATE,SUBSCRIBER_ID,TARIFF_CORRECT,TIME_STAMP,TRANSACTION_TYPE_UID,decode(CALL_STATUS,-1,NULL,CALL_STATUS) FROM DATALOADER1_1_8
    END OF STMT
    PARSE #18:c=0,e=1,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=190280724
    FETCH #15:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=2,dep=0,og=4,tim=190280724
    FETCH #15:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=2,dep=0,og=4,tim=190280724
    FETCH #15:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=2,dep=0,og=4,tim=190280724
    FETCH #15:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=2,dep=0,og=4,tim=190280724
    FETCH #15:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=2,dep=0,og=4,tim=190280724
    FETCH #15:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=2,dep=0,og=4,tim=190280724
    FETCH #15:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=2,dep=0,og=4,tim=190280724
    FETCH #15:c=0,e=1,p=0,cr=0,cu=0,mis=0,r=2,dep=0,og=4,tim=190280725
    EXEC #16:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=190280725
    FETCH #16:c=0,e=4,p=0,cr=156,cu=9,mis=0,r=0,dep=0,og=4,tim=190280729
    From this I can see there are "exec" and "fetch" is occuring in different cursors to the SQL statement cursor used for the parse.
    My question is now what would cause something like this for an insert statement?
    Thanks
    Patrick

    There are several examples and a detailed explanation of Explain Plan at:
    http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14211/ex_plan.htm
    Regarding TKPROF:
    http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14211/sqltrace.htm Check the 20.4 point

  • Invisible index getting accessed during query execution

    Hello Guys,
    There is a strange problem , I am encountering . I am working on tuning the performance of one of the concurrent request in our 11i ERP System having database 11.1.0.7
    I had enabled oradebug trace for the request and generated tkprof out of it. For below query which is taking time , I found that , in the trace generated , wait event is "db file sequential read" on an PO_LINES_N10 index but in the generated tkprof , for the same below query , the full table scan for PO_LINES_ALL is happening , as that table is 600 MB in size.
    Below is the query ,
    ===============
    UPDATE PO_LINES_ALL A
    SET A.VENDOR_PRODUCT_NUM = (SELECT SUPPLIER_ITEM FROM APPS.IRPO_IN_BPAUPDATE_TMP C WHERE BATCH_ID = :B1 AND PROCESSED_FLAG = 'P' AND ACTION = 'UPDATE' AND C.LINE_ID =A.PO_LINE_ID AND ROWNUM = 1 AND SUPPLIER_ITEM IS NOT NULL),
    LAST_UPDATE_DATE = SYSDATE
    ===============
    Index PO_LINES_N10 is on the column LAST_UPDATE_DATE , logically for such query , index should not have got used as that indexed column is not in select / where clause.
    Also, why there is discrepancy between tkprof and trace generated for the same query .
    So , I decided to INVISIBLE the index PO_LINES_N10 but still that index is getting accessed in the trace file .
    I have also checked the below parameter , which is false so optimizer should not make use of invisible indexes during query execution.
    SQL> show parameter invisible
    NAME TYPE VALUE
    optimizer_use_invisible_indexes boolean FALSE
    Any clue regarding this .
    Thanks and Regards,
    Prasad
    Edited by: Prasad on Jun 15, 2011 4:39 AM

    Hi Dom,
    Sorry for the late reply , but yes , an update statement is trying to update that index even if it's invisible.
    Also, it seems performance issue started appearing when this index got created , so now I have dropped that index in test environment and ran the concurrent program again with oradebug level 12 trace enabled and found bit improvement in the results .
    With index dropped -> 24 records/min got processed
    With index -> 14 records/min got processed
    so , I am looking forward without this index in the production too but before that, I have concerns regarding tkprof output. Can we further improve the performance of this query.
    Please find the below tkprof with and without index .
    ====================
    Sql statement
    ====================
    UPDATE PO_LINES_ALL A SET A.VENDOR_PRODUCT_NUM = (SELECT SUPPLIER_ITEM FROM
    APPS.IRPO_IN_BPAUPDATE_TMP C
    WHERE
    BATCH_ID = :B1 AND PROCESSED_FLAG = 'P' AND ACTION = 'UPDATE' AND C.LINE_ID =
    A.PO_LINE_ID AND ROWNUM = 1 AND SUPPLIER_ITEM IS NOT NULL),
    LAST_UPDATE_DATE = SYSDATE
    =========================
    TKPROF with Index for the above query ( processed 643 records )
    =========================
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 2499.64 2511.99 98158 645561632 13105579 1812777
    Fetch 0 0.00 0.00 0 0 0 0
    total 2 2499.64 2511.99 98158 645561632 13105579 1812777
    =============================
    TKPROF without Index for the above query ( processed 4452 records )
    =============================
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 10746.96 10544.13 84125 3079376156 1870058 1816289
    Fetch 0 0.00 0.00 0 0 0 0
    total 2 10746.96 10544.13 84125 3079376156 1870058 1816289
    =============================
    Explain plan which is same in both the cases
    =============================
    Rows Row Source Operation
    0 UPDATE PO_LINES_ALL (cr=3079377095 pr=84127 pw=0 time=0 us)
    1816289 TABLE ACCESS FULL PO_LINES_ALL (cr=83175 pr=83026 pw=0 time=117690 us cost=11151 size=29060624 card=1816289)
    0 COUNT STOPKEY (cr=3079292918 pr=20 pw=0 time=0 us)
    0 TABLE ACCESS BY INDEX ROWID IRPO_IN_BPAUPDATE_TMP (cr=3079292918 pr=20 pw=0 time=0 us cost=4 size=22 card=1)
    180368800 INDEX RANGE SCAN IRPO_IN_BPAUPDATE_N1 (cr=51539155 pr=3 pw=0 time=16090005 us cost=3 size=0 card=1)(object id 372721)
    There is a lot increase in the CPU ,so I would like to further tune this query. I have run SQL Tuning task but didn't get any recommendations for the same.
    Since in the trace , I have got db scattered read wait event for the table "PO_LINES_ALL" but disk reads are not much , so am not sure the performance improvement even if I pin this table (620 MB in size and is it feasible to pin , SGA is 5GB with sga_target set ) in the shared pool .
    I have already gathers stats for the concerned tables and rebuilt the indexes .
    Is there any other thing that can be performed to tune this query further and bring down CPU, time taken to execute.
    Thanks a lot for your reply.
    Thanks and Regards,
    Prasad
    Edited by: Prasad on Jun 28, 2011 3:52 AM
    Edited by: Prasad on Jun 28, 2011 3:54 AM
    Edited by: Prasad on Jun 28, 2011 3:56 AM

  • Need clarification on TKprof

    Hi experts,
    here i am showing the tkprof result.....
    TKPROF: Release 9.2.0.1.0 - Production on Tue Oct 9 13:06:20 2012
    Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    Trace file: c:\orcl_ora_4040_kamaltrc.trc
    Sort options: default
    count    = number of times OCI procedure was executed
    cpu      = cpu time in seconds executing
    elapsed  = elapsed time in seconds executing
    disk     = number of physical reads of buffers from disk
    query    = number of buffers gotten for consistent read
    current  = number of buffers gotten in current mode (usually for update)
    rows     = number of rows processed by the fetch or execute call
    DECLARE
      P_MONTH VARCHAR2(32767);
      P_YEAR VARCHAR2(32767);
    BEGIN
      P_MONTH := '11';
      P_YEAR := '2012';
      MOJ_PRD.CALC_PAYROLL ( P_MONTH, P_YEAR );
      COMMIT;
    END;
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.01       0.00          0          0          0           0
    Execute      2      0.76       1.05          0          0          0           1
    Fetch        0      0.00       0.00          0          0          0           0
    total        3      0.78       1.06          0          0          0           1
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    Parsing user id: 63  (MOJ_PRD)
    DELETE FROM HR_JUDGE_PRE_MONTH_SALARY_TEMP
             WHERE 1 = 1
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        0      0.00       0.00          0          0          0           0
    Execute      1      0.03       0.09         27         72       6438        1231
    Fetch        0      0.00       0.00          0          0          0           0
    total        1      0.03       0.09         27         72       6438        1231
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: 63  (MOJ_PRD)   (recursive depth: 1)
    error during execute of EXPLAIN PLAN statement
    ORA-00942: table or view does not exist
    parse error offset: 80
    DELETE FROM HR_JUDGE_ALW_DED_STD_TEMP
             WHERE 1 = 1
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        0      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.02         20         37        969         861
    Fetch        0      0.00       0.00          0          0          0           0
    total        1      0.00       0.02         20         37        969         861
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: 63  (MOJ_PRD)   (recursive depth: 1)
    error during execute of EXPLAIN PLAN statement
    ORA-00942: table or view does not exist
    parse error offset: 80
    SELECT judge_code, date_of_joining, date_of_relieving,CONTRACT_TYPE_CODE
            FROM HR_JUDGE_MASTER
           WHERE enabled_flag = 'Y'
           -- AND judge_code = '114899'
             AND workflow_completion_status = 'Y'
             AND include_pay = 'Y'
             AND judge_status NOT IN ('000003', '000004', '000007')
    -- AND date_of_relieving IS NULL
             AND (   (date_of_relieving IS NULL)
                  OR (TO_DATE (TO_CHAR (date_of_relieving, 'MM/YYYY'), 'MM/YYYY') >=
                                 TO_DATE (TO_CHAR (SYSDATE, 'MM/YYYY'), 'MM/YYYY')
             AND judge_code IN (SELECT judge_code
                                  FROM JUDGE_TEMP)
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        0      0.00       0.00          0          0          0           0
    Execute      2      0.00       0.00          0          0          0           0
    Fetch      524      0.04       0.98        288        568          0         522
    total      526      0.04       0.98        288        568          0         522
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: 63  (MOJ_PRD)   (recursive depth: 1)
    error during execute of EXPLAIN PLAN statement
    ORA-00942: table or view does not exist
    parse error offset: 154
    INSERT INTO HR_JUDGE_ALW_DED_STD_TEMP
             SELECT *
               FROM HR_JUDGE_ALW_DED
              WHERE percent_value_tag = 'S' AND judge_code = :b1
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        0      0.00       0.00          0          0          0           0
    Execute    261      0.07       3.02        464       2926        269         861
    Fetch        0      0.00       0.00          0          0          0           0
    total      261      0.07       3.02        464       2926        269         861
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: 63  (MOJ_PRD)   (recursive depth: 1)
    error during execute of EXPLAIN PLAN statement
    ORA-00942: table or view does not exist
    parse error offset: 140
    SELECT   NVL (MAX (a.actual_to_date + 1),
                        b.date_of_joining
                       ) AS start_date
              FROM HR_JUDGE_MONTH_SALARY a, HR_JUDGE_MASTER b
             WHERE a.judge_code(+) = b.judge_code AND b.judge_code = :b1
          GROUP BY b.judge_code, b.date_of_joining
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        0      0.00       0.00          0          0          0           0
    Execute    261      0.00       0.00          0          0          0           0
    Fetch      261      2.01     133.50      28045     194499          0         261
    total      522      2.01     133.51      28045     194499          0         261
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: 63  (MOJ_PRD)   (recursive depth: 1)
    error during execute of EXPLAIN PLAN statement
    ORA-00942: table or view does not exist
    parse error offset: 223
    SELECT MIN (a.applied_to_date) AS d1
           FROM HR_JUDGE_LEAVE_ATTEN a
          WHERE a.applied_to_date >= :b3
            AND a.applied_from_date <=
                                      ((TO_DATE (:b2, 'dd/MM/rrrr')) + 20
            AND a.judge_code = :b1
            --AND a.leave_code = 'ORDINARY'
            AND a.salary_advance_req = 'Y'
            AND a.enabled_flag = 'Y'
            AND a.workflow_completion_status = 'Y'
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        0      0.00       0.00          0          0          0           0
    Execute    261      0.03       0.00          0          0          0           0
    Fetch      261      0.00       0.74        103       3547          0         261
    total      522      0.03       0.75        103       3547          0         261
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: 63  (MOJ_PRD)   (recursive depth: 1)
    error during execute of EXPLAIN PLAN statement
    ORA-00942: table or view does not exist
    parse error offset: 117whey all explain plan are failed
    can u help me in this regards....
    Thanks in advance
    kanish

    EXPLAIN PLAN needs a specific public table installed in the database to store the plan output.
    Look in the documentation [url http://docs.oracle.com/cd/E11882_01/server.112/e16638/ex_plan.htm#PFGRF009]here, particularly section 12.2 on the PLAN_TABLE output table.
    Looks like either your schema has lost privileges on the plan_table or else the plan_table does not exist. That is a bit unusual so you might cooperate with your DBA in finding out why this is so.
    Your DBA might need to execute the catplan.sql script described in the above link.

  • Sqltrace and tkprof

    can anyone xplain how to do sqltrace and tkprof
    here i am getting an error while executing a query
    at firs i gave
    set autotrace on
    SQL> select * from dept;
    DEPTNO DEPT_NAME
    500 INFORMATION SYSTEMS
    CIVIL
    400 INFORMATION TECHNOLOGY
    100 computers
    200 mechanical
    300 electrical
    6 rows selected.
    Execution Plan
    0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=3 Card=6
    1 0 TABLE ACCESS (FULL) OF 'DEPT' (TABLE) (Cost=3 Car
    =96)
    Statistics
    1 recursive calls
    0 db block gets
    8 consistent gets
    0 physical reads
    0 redo size
    360 bytes sent via SQL*Net to client
    276 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    6 rows processed
    after that
    SQL> ed
    Wrote file afiedt.buf
    1 tkprof pra.trc
    2 explain=dthpc/dthpc
    3* table=dept
    SQL> /
    tkprof pra.trc
    ERROR at line 1:
    ORA-00900: invalid SQL statement
    can anyone help me out regarding tkprof

    SQL> ed
    Wrote file afiedt.buf
    +1 tkprof pra.trc+
    +2 explain=dthpc/dthpc+
    +3* table=dept+
    i am confused as what you are trying to do here? are you combining explain plan and tkprof?

  • Looking for your advise on this TKProf

    Hello There,
    I am looking for your advise on the following TKProf:
    TKPROF: Release 11.1.0.7.0 - Production on Thu Apr 28 16:37:23 2011
    Copyright (c) 1982, 2007, Oracle. All rights reserved.
    Trace file: DCPRD_ora_9930_AIBRAHIM80.trc
    Sort options: prsdsk exedsk fchdsk
    count = number of times OCI procedure was executed
    cpu = cpu time in seconds executing
    elapsed = elapsed time in seconds executing
    disk = number of physical reads of buffers from disk
    query = number of buffers gotten for consistent read
    current = number of buffers gotten in current mode (usually for update)
    rows = number of rows processed by the fetch or execute call
    The following statement encountered a error during parse:
    SELECT ROWID,VENDOR_NAME,VENDOR_NUMBER,VENDOR_SITE_CODE,TERRITORY_SHORT_NAME,CONCATENATED_ADDRESS,LANGUAGE_DESCRIPTION,AREA_CODE,PHONE,COUNTRY,LANGUAGE,INVOICE_CURRENCY_CODE,VENDOR_ID,VENDOR_SITE_ID FROM AP_VENDOR_DISP_V WHERE (VENDOR_ID=:1) and (VENDOR_SITE_ID=:2)
    Error encountered: ORA-01445
    SQL ID: 5uz1ugat7bn9k
    Plan Hash: 1624111731
    SELECT COUNT( DECODE( POD.PREVENT_ENCUMBRANCE_FLAG , 'Y', NULL , DECODE(
    POD.ENCUMBERED_FLAG , 'Y', 'Y' , NULL ) ) ) , COUNT( DECODE(
    POD.PREVENT_ENCUMBRANCE_FLAG , 'Y', NULL , DECODE( POD.ENCUMBERED_FLAG ,
    'Y', NULL , 'N' ) ) ) , COUNT( DECODE( POD.PREVENT_ENCUMBRANCE_FLAG , 'Y',
    'Y' , NULL ) )
    FROM
    PO_DISTRIBUTIONS_ALL POD , PO_LINE_LOCATIONS_ALL POLL , PO_HEADERS_ALL POH
    WHERE POLL.LINE_LOCATION_ID(+) = POD.LINE_LOCATION_ID AND POH.PO_HEADER_ID =
    POD.PO_HEADER_ID AND ( (:B2 <> :B11 AND NVL(POLL.CANCEL_FLAG,'N') <> 'Y')
    OR (:B2 = :B11 AND NVL(POH.CANCEL_FLAG,'N') <> 'Y') ) AND ( ( :B2 <> :B11
    AND NVL(POLL.CLOSED_CODE,:B10 ) <> :B9 ) OR ( :B2 = :B11 AND
    NVL(POH.CLOSED_CODE,:B10 ) <> :B9 ) ) AND ( ( :B5 = :B8 AND
    POD.PO_DISTRIBUTION_ID = :B3 ) OR ( :B5 = :B7 AND POD.LINE_LOCATION_ID =
    :B3 ) OR ( :B5 = :B6 AND POD.PO_LINE_ID = :B3 ) OR ( :B5 = :B4 AND :B2 =
    :B1 AND POD.PO_RELEASE_ID = :B3 ) OR ( :B5 = :B4 AND :B2 <> :B1 AND
    POD.PO_HEADER_ID = :B3 ) ) AND ( ( :B2 <> :B1 AND POD.PO_RELEASE_ID IS NULL
    ) OR ( :B2 = :B1 AND POD.PO_RELEASE_ID IS NOT NULL ) )
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 114604 414.24 434.04 0 0 0 0
    Fetch 114604 45.91 750.41 46028 2831063 0 114604
    total 229209 460.15 1184.46 46028 2831063 0 114604
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 183 (recursive depth: 1)
    Number of plan statistics captured: 1
    Rows (1st) Rows (avg) Rows (max) Row Source Operation
    1 1 1 SORT AGGREGATE (cr=12 pr=9 pw=0 time=0 us)
    1 1 1 CONCATENATION (cr=12 pr=9 pw=0 time=0 us)
    1 1 1 FILTER (cr=12 pr=9 pw=0 time=0 us)
    1 1 1 FILTER (cr=12 pr=9 pw=0 time=0 us)
    1 1 1 NESTED LOOPS OUTER (cr=12 pr=9 pw=0 time=0 us cost=7 size=57 card=1)
    1 1 1 NESTED LOOPS (cr=7 pr=4 pw=0 time=0 us cost=5 size=42 card=1)
    1 1 1 TABLE ACCESS BY INDEX ROWID PO_DISTRIBUTIONS_ALL (cr=4 pr=4 pw=0 time=0 us cost=4 size=29 card=1)
    1 1 1 INDEX RANGE SCAN PO_DISTRIBUTIONS_N11 (cr=3 pr=3 pw=0 time=0 us cost=3 size=0 card=5)(object id 45031)
    1 1 1 TABLE ACCESS BY INDEX ROWID PO_HEADERS_ALL (cr=3 pr=0 pw=0 time=0 us cost=1 size=13 card=1)
    1 1 1 INDEX UNIQUE SCAN PO_HEADERS_U1 (cr=2 pr=0 pw=0 time=0 us cost=0 size=0 card=1)(object id 45109)
    1 1 1 TABLE ACCESS BY INDEX ROWID PO_LINE_LOCATIONS_ALL (cr=5 pr=5 pw=0 time=0 us cost=2 size=15 card=1)
    1 1 1 INDEX UNIQUE SCAN PO_LINE_LOCATIONS_U1 (cr=3 pr=3 pw=0 time=0 us cost=1 size=0 card=1)(object id 45204)
    0 0 0 FILTER (cr=0 pr=0 pw=0 time=0 us)
    0 0 0 FILTER (cr=0 pr=0 pw=0 time=0 us)
    0 0 0 NESTED LOOPS OUTER (cr=0 pr=0 pw=0 time=0 us cost=6 size=57 card=1)
    0 0 0 NESTED LOOPS (cr=0 pr=0 pw=0 time=0 us cost=4 size=42 card=1)
    0 0 0 TABLE ACCESS BY INDEX ROWID PO_DISTRIBUTIONS_ALL (cr=0 pr=0 pw=0 time=0 us cost=3 size=29 card=1)
    0 0 0 INDEX UNIQUE SCAN PO_DISTRIBUTIONS_U1 (cr=0 pr=0 pw=0 time=0 us cost=2 size=0 card=1)(object id 45078)
    0 0 0 TABLE ACCESS BY INDEX ROWID PO_HEADERS_ALL (cr=0 pr=0 pw=0 time=0 us cost=1 size=477061 card=36697)
    0 0 0 INDEX UNIQUE SCAN PO_HEADERS_U1 (cr=0 pr=0 pw=0 time=0 us cost=0 size=0 card=1)(object id 45109)
    0 0 0 TABLE ACCESS BY INDEX ROWID PO_LINE_LOCATIONS_ALL (cr=0 pr=0 pw=0 time=0 us cost=2 size=11849205 card=789947)
    0 0 0 INDEX UNIQUE SCAN PO_LINE_LOCATIONS_U1 (cr=0 pr=0 pw=0 time=0 us cost=1 size=0 card=1)(object id 45204)
    0 0 0 FILTER (cr=0 pr=0 pw=0 time=0 us)
    0 0 0 FILTER (cr=0 pr=0 pw=0 time=0 us)
    0 0 0 NESTED LOOPS OUTER (cr=0 pr=0 pw=0 time=0 us cost=7 size=57 card=1)
    0 0 0 NESTED LOOPS (cr=0 pr=0 pw=0 time=0 us cost=5 size=42 card=1)
    0 0 0 TABLE ACCESS BY INDEX ROWID PO_DISTRIBUTIONS_ALL (cr=0 pr=0 pw=0 time=0 us cost=4 size=29 card=1)
    0 0 0 INDEX RANGE SCAN PO_DISTRIBUTIONS_N1 (cr=0 pr=0 pw=0 time=0 us cost=3 size=0 card=1)(object id 45023)
    0 0 0 TABLE ACCESS BY INDEX ROWID PO_HEADERS_ALL (cr=0 pr=0 pw=0 time=0 us cost=1 size=13 card=1)
    0 0 0 INDEX UNIQUE SCAN PO_HEADERS_U1 (cr=0 pr=0 pw=0 time=0 us cost=0 size=0 card=1)(object id 45109)
    0 0 0 TABLE ACCESS BY INDEX ROWID PO_LINE_LOCATIONS_ALL (cr=0 pr=0 pw=0 time=0 us cost=2 size=15 card=1)
    0 0 0 INDEX UNIQUE SCAN PO_LINE_LOCATIONS_U1 (cr=0 pr=0 pw=0 time=0 us cost=1 size=0 card=1)(object id 45204)
    0 0 0 FILTER (cr=0 pr=0 pw=0 time=0 us)
    0 0 0 FILTER (cr=0 pr=0 pw=0 time=0 us)
    0 0 0 NESTED LOOPS OUTER (cr=0 pr=0 pw=0 time=0 us cost=10 size=57 card=1)
    0 0 0 NESTED LOOPS (cr=0 pr=0 pw=0 time=0 us cost=8 size=42 card=1)
    0 0 0 TABLE ACCESS BY INDEX ROWID PO_DISTRIBUTIONS_ALL (cr=0 pr=0 pw=0 time=0 us cost=7 size=29 card=1)
    0 0 0 INDEX RANGE SCAN PO_DISTRIBUTIONS_N3 (cr=0 pr=0 pw=0 time=0 us cost=3 size=0 card=21)(object id 45049)
    0 0 0 TABLE ACCESS BY INDEX ROWID PO_HEADERS_ALL (cr=0 pr=0 pw=0 time=0 us cost=1 size=13 card=1)
    0 0 0 INDEX UNIQUE SCAN PO_HEADERS_U1 (cr=0 pr=0 pw=0 time=0 us cost=0 size=0 card=1)(object id 45109)
    0 0 0 TABLE ACCESS BY INDEX ROWID PO_LINE_LOCATIONS_ALL (cr=0 pr=0 pw=0 time=0 us cost=2 size=15 card=1)
    0 0 0 INDEX UNIQUE SCAN PO_LINE_LOCATIONS_U1 (cr=0 pr=0 pw=0 time=0 us cost=1 size=0 card=1)(object id 45204)
    0 0 0 FILTER (cr=0 pr=0 pw=0 time=0 us)
    0 0 0 FILTER (cr=0 pr=0 pw=0 time=0 us)
    0 0 0 NESTED LOOPS OUTER (cr=0 pr=0 pw=0 time=0 us cost=8 size=57 card=1)
    0 0 0 NESTED LOOPS (cr=0 pr=0 pw=0 time=0 us cost=6 size=42 card=1)
    0 0 0 TABLE ACCESS BY INDEX ROWID PO_DISTRIBUTIONS_ALL (cr=0 pr=0 pw=0 time=0 us cost=5 size=29 card=1)
    0 0 0 INDEX RANGE SCAN PO_DISTRIBUTIONS_N4 (cr=0 pr=0 pw=0 time=0 us cost=3 size=0 card=3)(object id 45054)
    0 0 0 TABLE ACCESS BY INDEX ROWID PO_HEADERS_ALL (cr=0 pr=0 pw=0 time=0 us cost=1 size=13 card=1)
    0 0 0 INDEX UNIQUE SCAN PO_HEADERS_U1 (cr=0 pr=0 pw=0 time=0 us cost=0 size=0 card=1)(object id 45109)
    0 0 0 TABLE ACCESS BY INDEX ROWID PO_LINE_LOCATIONS_ALL (cr=0 pr=0 pw=0 time=0 us cost=2 size=15 card=1)
    0 0 0 INDEX UNIQUE SCAN PO_LINE_LOCATIONS_U1 (cr=0 pr=0 pw=0 time=0 us cost=1 size=0 card=1)(object id 45204)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file sequential read 46028 1.12 712.45
    SELECT ROW_ID,ORG_ID,PO_RELEASE_ID,PO_HEADER_ID,RELEASE_TYPE,AGENT_ID,VENDOR_ID,SHIP_TO_LOCATION_ID,SHIP_TO_LOCATION,SHIP_TO_ORGANIZATION_ID,VENDOR_SITE_ID,APPROVED_DATE,APPROVED_FLAG,AUTHORIZATION_STATUS,CANCEL_DATE,CANCEL_REASON,CANCELLED_BY,CANCEL_FLAG,HOLD_BY,HOLD_DATE,HOLD_REASON,HOLD_FLAG,CLOSED_CODE,FROZEN_FLAG,PRINT_COUNT,PRINTED_DATE,CREATED_BY,CREATION_DATE,LAST_UPDATED_BY,LAST_UPDATE_DATE,LAST_UPDATE_LOGIN,PROGRAM_APPLICATION_ID,PROGRAM_ID,PROGRAM_UPDATE_DATE,REQUEST_ID,ATTRIBUTE2,ATTRIBUTE3,ATTRIBUTE4,ATTRIBUTE1,ATTRIBUTE5,ATTRIBUTE6,ATTRIBUTE7,ATTRIBUTE8,ATTRIBUTE9,ATTRIBUTE10,ATTRIBUTE11,ATTRIBUTE12,ATTRIBUTE13,ATTRIBUTE15,ATTRIBUTE14,ATTRIBUTE_CATEGORY,PO_NUM,RELEASE_NUM,REVISION_NUM,RELEASE_REVISION_NUM,REVISED_DATE,RELEASE_DATE,VENDOR_NAME,VENDOR_SITE_CODE,CURRENCY_CODE,AGENT_NAME,STATUS,FIRM_STATUS_LOOKUP_CODE,ACCEPTANCE_REQUIRED_FLAG,ACCEPTANCE_DUE_DATE,PCARD_ID,GOVERNMENT_CONTEXT,AGREEMENT_TYPE,AMOUNT_LIMIT,MIN_RELEASE_AMOUNT,PRICE_UPDATE_TOLERANCE,AGREEMENT_BUYER,AGREEMENT_CONTACT,AGREEMENT_DESCRIPTION,NOTE_TO_SUPPLIER,NOTE_TO_RECEIVER,START_DATE,END_DATE,PAYMENT_TERMS,PAY_ON_CODE,SHIPPING_CONTROL,GLOBAL_ATTRIBUTE_CATEGORY,GLOBAL_ATTRIBUTE1,GLOBAL_ATTRIBUTE2,GLOBAL_ATTRIBUTE3,GLOBAL_ATTRIBUTE4,GLOBAL_ATTRIBUTE5,GLOBAL_ATTRIBUTE6,GLOBAL_ATTRIBUTE7,GLOBAL_ATTRIBUTE8,GLOBAL_ATTRIBUTE9,GLOBAL_ATTRIBUTE10,GLOBAL_ATTRIBUTE11,GLOBAL_ATTRIBUTE12,GLOBAL_ATTRIBUTE13,GLOBAL_ATTRIBUTE14,GLOBAL_ATTRIBUTE15,GLOBAL_ATTRIBUTE16,GLOBAL_ATTRIBUTE17,GLOBAL_ATTRIBUTE18,GLOBAL_ATTRIBUTE19,GLOBAL_ATTRIBUTE20,TYPE_LOOKUP_CODE,PO_AUTHORIZATION_STATUS,FOB_LOOKUP_CODE,FREIGHT_TERMS_LOOKUP_CODE FROM PO_RELEASES_V WHERE NVL(consigned_consumption_flag, 'N') <> 'Y' and ((authorization_status is null or authorization_status not in ('IN PROCESS', 'PRE-APPROVED' ))) and ((NOT(RELEASE_TYPE IN ('BLANKET', 'SCHEDULED')) OR (((PO_RELEASES_V.security_level_code = 'PUBLIC' ) OR (PO_RELEASES_V.security_level_code = 'PRIVATE' AND 183739=AGENT_ID) OR (PO_RELEASES_V.security_level_code = 'HIERARCHY' AND ((183739=AGENT_ID) OR (EXISTS (SELECT 'Y' FROM PO_ACTION_HISTORY POAH2 WHERE POAH2.employee_id =183739 AND POAH2.object_type_code = (DECODE(PO_RELEASES_V.DOCUMENT_TYPE, 'BLANKET', 'PA', 'STANDARD', 'PO' , 'PLANNED' , 'PO' , 'CONTRACT' , 'PA', 'RELEASE' , 'RELEASE' ) ) AND POAH2.object_id = PO_RELEASES_V.PO_RELEASE_ID)) OR (183739 IN (SELECT H.superior_id FROM PO_EMPLOYEE_HIERARCHIES H, PO_SYSTEM_PARAMETERS PSP WHERE H.employee_id = PO_RELEASES_V.AGENT_ID AND H.position_structure_id = NVL(PSP.SECURITY_POSITION_STRUCTURE_ID,-1) AND PSP.ORG_ID = PO_RELEASES_V.ORG_ID )))) OR (PO_RELEASES_V.security_level_code = 'PURCHASING' AND ((183739=AGENT_ID) OR (EXISTS (SELECT 'Y' FROM PO_ACTION_HISTORY POAH2 WHERE POAH2.employee_id =183739 AND POAH2.object_type_code = (DECODE(PO_RELEASES_V.DOCUMENT_TYPE, 'BLANKET', 'PA', 'STANDARD', 'PO' , 'PLANNED' , 'PO' , 'CONTRACT' , 'PA', 'RELEASE' , 'RELEASE' ) ) AND POAH2.object_id = PO_RELEASES_V.PO_RELEASE_ID)) OR (EXISTS(SELECT NULL FROM PO_AGENTS WHERE agent_id= 183739 AND SYSDATE BETWEEN NVL(start_date_active, SYSDATE) AND NVL(end_date_active, SYSDATE+1))))))AND (('MODIFY' = 'VIEW_ONLY' ) OR ( 'MODIFY' = 'MODIFY' AND PO_RELEASES_V.access_level_code IN ('MODIFY','FULL') ) OR ( 'MODIFY' = 'FULL' AND PO_RELEASES_V.access_level_code = 'FULL' ) OR ( 183739 = AGENT_ID))))) and (LAST_UPDATED_BY = last_updated_by
    AND nvl(cancel_flag,'N') ='N'
    AND nvl(closed_code,'OPEN') !='FINALLY CLOSED'
    AND nvl(frozen_flag,'N') !='Y'
    AND release_type IN ('BLANKET','SCHEDULED')
    AND EXISTS (SELECT 'Header is not frozen'
    FROM po_headers ph
    WHERE ph.po_header_id = po_releases_v.po_header_id
    AND NVL(ph.frozen_flag,'N') ='N'
    AND nvl(ph.closed_code,'OPEN') !='FINALLY CLOSED')
    AND ('' IS NULL
    OR po_releases_v.authorization_status IN
    (SELECT plc.lookup_code
    FROM po_lookup_codes plc
    WHERE plc.lookup_type = 'AUTHORIZATION STATUS'
    AND plc.displayed_field LIKE ''))) order by po_num desc, release_num desc
    call count cpu elapsed disk query current rows
    Parse 1 168.61 160.43 288 4291 14 0
    Execute 1 0.01 0.00 0 0 0 0
    Fetch 1 166.81 580.89 18452 2628283 0 2
    total 3 335.43 741.33 18740 2632574 14 2
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 183
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    SQL*Net message to client 1 0.00 0.00
    SQL*Net more data to client 3 0.00 0.00
    db file sequential read 18452 0.88 417.79
    SQL*Net message from client 1 0.00 0.00
    SQL ID: 3ktacv9r56b51
    Plan Hash: 458693102
    select owner#,name,namespace,remoteowner,linkname,p_timestamp,p_obj#,
    nvl(property,0),subname,type#,d_attrs
    from
    dependency$ d, obj$ o where d_obj#=:1 and p_obj#=obj#(+) order by order#
    call count cpu elapsed disk query current rows
    Parse 131 0.00 0.01 0 0 8 0
    Execute 131 0.01 0.03 0 0 0 0
    Fetch 1125 0.25 9.06 386 3632 0 994
    total 1387 0.26 9.10 386 3632 8 994
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 2)
    Number of plan statistics captured: 3
    Rows (1st) Rows (avg) Rows (max) Row Source Operation
    1 7 20 SORT ORDER BY (cr=27 pr=4 pw=0 time=0 us cost=20 size=375 card=5)
    1 7 20 NESTED LOOPS OUTER (cr=27 pr=4 pw=0 time=18 us cost=19 size=375 card=5)
    1 7 20 TABLE ACCESS BY INDEX ROWID DEPENDENCY$ (cr=4 pr=1 pw=0 time=2 us cost=4 size=155 card=5)
    1 7 20 INDEX RANGE SCAN I_DEPENDENCY1 (cr=3 pr=0 pw=0 time=0 us cost=3 size=0 card=5)(object id 116)
    1 7 20 TABLE ACCESS BY INDEX ROWID OBJ$ (cr=23 pr=3 pw=0 time=0 us cost=3 size=44 card=1)
    1 7 20 INDEX RANGE SCAN I_OBJ1 (cr=16 pr=2 pw=0 time=0 us cost=2 size=0 card=1)(object id 1288242)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file sequential read 386 0.20 8.95
    SQL ID: cvn54b7yz0s8u
    Plan Hash: 2991757387
    select /*+ index(idl_ub1$ i_idl_ub11) +*/ piece#,length,piece
    from
    idl_ub1$ where obj#=:1 and part=:2 and version=:3 order by piece#
    call count cpu elapsed disk query current rows
    Parse 165 0.00 0.00 0 0 8 0
    Execute 165 0.08 0.06 0 0 0 0
    Fetch 449 0.09 10.49 379 1740 0 410
    total 779 0.17 10.56 379 1740 8 410
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Number of plan statistics captured: 3
    Rows (1st) Rows (avg) Rows (max) Row Source Operation
    1 1 2 TABLE ACCESS BY INDEX ROWID IDL_UB1$ (cr=5 pr=1 pw=0 time=0 us cost=4 size=21 card=1)
    1 1 2 INDEX RANGE SCAN I_IDL_UB11 (cr=4 pr=0 pw=0 time=3 us cost=3 size=0 card=1)(object id 110)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file sequential read 379 0.22 10.44
    ********************************************************************************

    SQL ID: 8r75sj1fpjn1k
    Plan Hash: 1052563856
    SELECT PLC_STA.DISPLAYED_FIELD, DECODE(POR.CANCEL_FLAG, 'Y',
    PLC_CAN.DISPLAYED_FIELD, NULL), DECODE(NVL(POR.CLOSED_CODE, 'OPEN'), 'OPEN',
    NULL, PLC_CLO.DISPLAYED_FIELD), DECODE(POR.FROZEN_FLAG, 'Y',
    PLC_FRO.DISPLAYED_FIELD, NULL), DECODE(POR.HOLD_FLAG, 'Y',
    PLC_HLD.DISPLAYED_FIELD, NULL), POR.AUTHORIZATION_STATUS,
    NVL(POR.CANCEL_FLAG, 'N'), NVL(POR.CLOSED_CODE, 'OPEN'),
    NVL(POR.FROZEN_FLAG, 'N'), NVL(POR.HOLD_FLAG, 'N')
    FROM
    PO_RELEASES POR, PO_LOOKUP_CODES PLC_STA, PO_LOOKUP_CODES PLC_CAN,
    PO_LOOKUP_CODES PLC_CLO, PO_LOOKUP_CODES PLC_FRO, PO_LOOKUP_CODES PLC_HLD
    WHERE PLC_STA.LOOKUP_CODE = DECODE(POR.APPROVED_FLAG, 'R',
    POR.APPROVED_FLAG, NVL(POR.AUTHORIZATION_STATUS,'INCOMPLETE')) AND
    PLC_STA.LOOKUP_TYPE IN ('PO APPROVAL', 'DOCUMENT STATE') AND
    PLC_CAN.LOOKUP_CODE = 'CANCELLED' AND PLC_CAN.LOOKUP_TYPE = 'DOCUMENT
    STATE' AND PLC_CLO.LOOKUP_CODE = NVL(POR.CLOSED_CODE, 'OPEN') AND
    PLC_CLO.LOOKUP_TYPE = 'DOCUMENT STATE' AND PLC_FRO.LOOKUP_CODE = 'FROZEN'
    AND PLC_FRO.LOOKUP_TYPE = 'DOCUMENT STATE' AND PLC_HLD.LOOKUP_CODE = 'ON
    HOLD' AND PLC_HLD.LOOKUP_TYPE = 'DOCUMENT STATE' AND POR.PO_RELEASE_ID =
    :B1
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 114597 37.02 40.60 0 0 0 0
    Fetch 114597 64.11 68.70 239 2988322 0 114597
    total 229195 101.13 109.30 239 2988322 0 114597
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 183 (recursive depth: 1)
    Number of plan statistics captured: 1
    Rows (1st) Rows (avg) Rows (max) Row Source Operation
    1 1 1 NESTED LOOPS (cr=27 pr=6 pw=0 time=0 us)
    1 1 1 NESTED LOOPS (cr=26 pr=5 pw=0 time=0 us cost=18 size=323 card=1)
    1 1 1 MERGE JOIN CARTESIAN (cr=20 pr=4 pw=0 time=0 us cost=14 size=265 card=1)
    1 1 1 MERGE JOIN CARTESIAN (cr=16 pr=4 pw=0 time=0 us cost=11 size=207 card=1)
    1 1 1 MERGE JOIN CARTESIAN (cr=12 pr=4 pw=0 time=0 us cost=8 size=149 card=1)
    1 1 1 NESTED LOOPS (cr=8 pr=4 pw=0 time=0 us cost=5 size=91 card=1)
    1 1 1 TABLE ACCESS BY INDEX ROWID PO_RELEASES_ALL (cr=4 pr=2 pw=0 time=0 us cost=2 size=33 card=1)
    1 1 1 INDEX UNIQUE SCAN PO_RELEASES_U1 (cr=2 pr=2 pw=0 time=0 us cost=1 size=0 card=1)(object id 45219)
    1 1 1 TABLE ACCESS BY INDEX ROWID FND_LOOKUP_VALUES (cr=4 pr=2 pw=0 time=0 us cost=3 size=58 card=1)
    1 1 1 INDEX RANGE SCAN FND_LOOKUP_VALUES_U1 (cr=3 pr=1 pw=0 time=0 us cost=2 size=0 card=1)(object id 33540)
    1 1 1 BUFFER SORT (cr=4 pr=0 pw=0 time=0 us cost=5 size=58 card=1)
    1 1 1 TABLE ACCESS BY INDEX ROWID FND_LOOKUP_VALUES (cr=4 pr=0 pw=0 time=0 us cost=3 size=58 card=1)
    1 1 1 INDEX RANGE SCAN FND_LOOKUP_VALUES_U1 (cr=3 pr=0 pw=0 time=0 us cost=2 size=0 card=1)(object id 33540)
    1 1 1 BUFFER SORT (cr=4 pr=0 pw=0 time=0 us cost=8 size=58 card=1)
    1 1 1 TABLE ACCESS BY INDEX ROWID FND_LOOKUP_VALUES (cr=4 pr=0 pw=0 time=0 us cost=3 size=58 card=1)
    1 1 1 INDEX RANGE SCAN FND_LOOKUP_VALUES_U1 (cr=3 pr=0 pw=0 time=0 us cost=2 size=0 card=1)(object id 33540)
    1 1 1 BUFFER SORT (cr=4 pr=0 pw=0 time=0 us cost=11 size=58 card=1)
    1 1 1 TABLE ACCESS BY INDEX ROWID FND_LOOKUP_VALUES (cr=4 pr=0 pw=0 time=0 us cost=3 size=58 card=1)
    1 1 1 INDEX RANGE SCAN FND_LOOKUP_VALUES_U1 (cr=3 pr=0 pw=0 time=0 us cost=2 size=0 card=1)(object id 33540)
    1 1 1 INLIST ITERATOR (cr=6 pr=1 pw=0 time=0 us)
    1 1 1 INDEX RANGE SCAN FND_LOOKUP_VALUES_U1 (cr=6 pr=1 pw=0 time=0 us cost=3 size=0 card=1)(object id 33540)
    1 1 1 TABLE ACCESS BY INDEX ROWID FND_LOOKUP_VALUES (cr=1 pr=1 pw=0 time=0 us cost=4 size=58 card=1)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file sequential read 239 0.23 4.54
    SQL ID: 7ng34ruy5awxq
    Plan Hash: 3984801583
    select i.obj#,i.ts#,i.file#,i.block#,i.intcols,i.type#,i.flags,i.property,
    i.pctfree$,i.initrans,i.maxtrans,i.blevel,i.leafcnt,i.distkey,i.lblkkey,
    i.dblkkey,i.clufac,i.cols,i.analyzetime,i.samplesize,i.dataobj#,
    nvl(i.degree,1),nvl(i.instances,1),i.rowcnt,mod(i.pctthres$,256),
    i.indmethod#,i.trunccnt,nvl(c.unicols,0),nvl(c.deferrable#+c.valid#,0),
    nvl(i.spare1,i.intcols),i.spare4,i.spare2,i.spare6,decode(i.pctthres$,null,
    null,mod(trunc(i.pctthres$/256),256)),ist.cachedblk,ist.cachehit,
    ist.logicalread
    from
    ind$ i, ind_stats$ ist, (select enabled, min(cols) unicols,
    min(to_number(bitand(defer,1))) deferrable#,min(to_number(bitand(defer,4)))
    valid# from cdef$ where obj#=:1 and enabled > 1 group by enabled) c where
    i.obj#=c.enabled(+) and i.obj# = ist.obj#(+) and i.bo#=:1 order by i.obj#
    call count cpu elapsed disk query current rows
    Parse 24 0.01 0.00 0 0 4 0
    Execute 80 0.03 0.04 0 0 0 0
    Fetch 470 0.27 6.55 197 882 0 390
    total 574 0.31 6.60 197 882 4 390
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 2)
    Number of plan statistics captured: 24
    Rows (1st) Rows (avg) Rows (max) Row Source Operation
    1 5 18 SORT ORDER BY (cr=11 pr=3 pw=0 time=0 us cost=8 size=376 card=2)
    1 5 18 HASH JOIN OUTER (cr=11 pr=3 pw=0 time=2 us cost=7 size=376 card=2)
    1 5 18 NESTED LOOPS OUTER (cr=7 pr=2 pw=0 time=7560 us cost=3 size=290 card=2)
    1 5 18 TABLE ACCESS CLUSTER IND$ (cr=6 pr=2 pw=0 time=7555 us cost=3 size=186 card=2)
    1 1 1 INDEX UNIQUE SCAN I_OBJ# (cr=2 pr=0 pw=0 time=0 us cost=1 size=0 card=1)(object id 3)
    0 0 0 TABLE ACCESS BY INDEX ROWID IND_STATS$ (cr=1 pr=0 pw=0 time=0 us cost=0 size=52 card=1)
    0 0 0 INDEX UNIQUE SCAN I_IND_STATS$_OBJ# (cr=1 pr=0 pw=0 time=0 us cost=0 size=0 card=1)(object id 647660)
    0 0 0 VIEW (cr=4 pr=1 pw=0 time=0 us cost=3 size=43 card=1)
    0 0 0 SORT GROUP BY (cr=4 pr=1 pw=0 time=0 us cost=3 size=16 card=1)
    0 0 0 TABLE ACCESS CLUSTER CDEF$ (cr=4 pr=1 pw=0 time=0 us cost=2 size=16 card=1)
    1 1 1 INDEX UNIQUE SCAN I_COBJ# (cr=2 pr=0 pw=0 time=0 us cost=1 size=0 card=1)(object id 27)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file sequential read 197 0.35 6.34
    SQL ID: 96g93hntrzjtr
    Plan Hash: 841937906
    select /*+ rule */ bucket_cnt, row_cnt, cache_cnt, null_cnt, timestamp#,
    sample_size, minimum, maximum, distcnt, lowval, hival, density, col#,
    spare1, spare2, avgcln
    from
    hist_head$ where obj#=:1 and intcol#=:2
    call count cpu elapsed disk query current rows
    Parse 38 0.01 0.00 0 0 2 0
    Execute 663 0.28 0.24 0 0 0 0
    Fetch 663 0.05 4.84 150 2731 0 656
    total 1364 0.34 5.09 150 2731 2 656
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: RULE
    Parsing user id: SYS (recursive depth: 1)
    Number of plan statistics captured: 38
    Rows (1st) Rows (avg) Rows (max) Row Source Operation
    1 1 1 TABLE ACCESS BY INDEX ROWID HIST_HEAD$ (cr=4 pr=1 pw=0 time=0 us)
    1 1 1 INDEX RANGE SCAN I_HH_OBJ#_INTCOL# (cr=3 pr=0 pw=0 time=0 us)(object id 194)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file sequential read 150 0.28 4.80
    SQL ID: ga9j9xk5cy9s0
    Plan Hash: 467424113
    select /*+ index(idl_sb4$ i_idl_sb41) +*/ piece#,length,piece
    from
    idl_sb4$ where obj#=:1 and part=:2 and version=:3 order by piece#
    call count cpu elapsed disk query current rows
    Parse 165 0.00 0.01 0 0 8 0
    Execute 165 0.05 0.07 0 0 0 0
    Fetch 369 0.11 3.79 141 1107 0 204
    total 699 0.16 3.88 141 1107 8 204
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Number of plan statistics captured: 3
    Rows (1st) Rows (avg) Rows (max) Row Source Operation
    2 2 2 TABLE ACCESS BY INDEX ROWID IDL_SB4$ (cr=6 pr=0 pw=0 time=0 us cost=4 size=19 card=1)
    2 2 2 INDEX RANGE SCAN I_IDL_SB41 (cr=5 pr=0 pw=0 time=9 us cost=3 size=0 card=1)(object id 113)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file sequential read 141 0.20 3.75
    SQL ID: 39m4sx9k63ba2
    Plan Hash: 2769382227
    select /*+ index(idl_ub2$ i_idl_ub21) +*/ piece#,length,piece
    from
    idl_ub2$ where obj#=:1 and part=:2 and version=:3 order by piece#
    call count cpu elapsed disk query current rows
    Parse 165 0.03 0.01 0 0 8 0
    Execute 165 0.05 0.06 0 0 0 0
    Fetch 219 0.03 3.08 114 759 0 93
    total 549 0.11 3.16 114 759 8 93
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Number of plan statistics captured: 3
    Rows (1st) Rows (avg) Rows (max) Row Source Operation
    2 1 2 TABLE ACCESS BY INDEX ROWID IDL_UB2$ (cr=5 pr=1 pw=0 time=0 us cost=4 size=20 card=1)
    2 1 2 INDEX RANGE SCAN I_IDL_UB21 (cr=4 pr=0 pw=0 time=9 us cost=3 size=0 card=1)(object id 112)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file sequential read 114 0.13 3.06
    SQL ID: 8swypbbr0m372
    Plan Hash: 872636971
    select order#,columns,types
    from
    access$ where d_obj#=:1
    call count cpu elapsed disk query current rows
    Parse 131 0.00 0.01 0 0 8 0
    Execute 131 0.02 0.02 0 0 0 0
    Fetch 1017 0.05 2.77 113 2170 0 886
    total 1279 0.07 2.81 113 2170 8 886
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 2)
    Number of plan statistics captured: 3
    Rows (1st) Rows (avg) Rows (max) Row Source Operation
    0 4 12 TABLE ACCESS BY INDEX ROWID ACCESS$ (cr=11 pr=1 pw=0 time=0 us cost=4 size=200 card=8)
    0 4 12 INDEX RANGE SCAN I_ACCESS1 (cr=7 pr=0 pw=0 time=3 us cost=3 size=0 card=8)(object id 118)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file sequential read 113 0.14 2.74
    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
    call count cpu elapsed disk query current rows
    Parse 100 168.74 160.81 295 4538 40 0
    Execute 119 3.39 3.38 2 43 0 12
    Fetch 107 166.95 583.44 18545 2628759 0 364
    total 326 339.08 747.64 18842 2633340 40 376
    Misses in library cache during parse: 30
    Misses in library cache during execute: 11
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    SQL*Net message to client 221 0.00 0.00
    SQL*Net message from client 221 100.05 191.50
    db file sequential read 18558 0.88 420.50
    log file sync 2 0.01 0.01
    SQL*Net more data to client 52 0.00 0.00
    SQL*Net more data from client 9 0.03 0.03
    SQL*Net break/reset to client 2 0.00 0.00
    OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
    call count cpu elapsed disk query current rows
    Parse 2161 0.50 0.48 0 0 282 0
    Execute 349226 639.57 671.70 7 86 74 9
    Fetch 365281 113.87 886.34 48788 5852890 0 362441
    total 716668 753.94 1558.53 48795 5852976 356 362450
    Misses in library cache during parse: 119
    Misses in library cache during execute: 136
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file sequential read 48795 1.12 781.12
    latch: row cache objects 1 0.00 0.00
    344378 user SQL statements in session.
    4837 internal SQL statements in session.
    349215 SQL statements in session.
    Trace file: DCPRD_ora_9930_AIBRAHIM80.trc
    Trace file compatibility: 11.1.0.7
    Sort options: prsdsk exedsk fchdsk
    1 session in tracefile.
    344378 user SQL statements in trace file.
    4837 internal SQL statements in trace file.
    349215 SQL statements in trace file.
    196 unique SQL statements in trace file.
    32265404 lines in trace file.
    2505 elapsed seconds in trace file.
    Regards,
    Tareq

  • Any way to generate trace report from the TKPROF formatted trace file?

    As titled.
    Is there any automatically way to make a report on SQL tuning report from the TKPROF formatted trace file(or from the dynamic performance views)
    Paul

    Dave,
    That's what report queries are for, take a look at shared components. Walk through the create report query wizard, and on the final page, you'll get a URL that you can use to integrate this with your page. You'll find the same URL when editing your report query afterwards.
    Alternatively, suppose you already have you report page, but don't want to always go there, you can just copy that report region print link (reference my answer to your previous question), and make that the target of a branch or from another page.
    Regards,
    Marc

  • Help required regarding tunning the query mentioned

    HI all ,
    Query mentioned below takes around 1 hr to complete . It's being used by the autoconfig kindly me in tunning it ..
    QUery :
    UPDATE WF_ITEM_ATTRIBUTE_VALUES WIAV SET WIAV.TEXT_VALUE = REPLACE(WIAV.TEXT_VALUE,:B1,:B2)
    WHERE (WIAV.ITEM_TYPE, WIAV.NAME) = (SELECT WIA.ITEM_TYPE, WIA.NAME
    FROM WF_ITEM_ATTRIBUTES WIA WHERE WIA.TYPE = 'URL'
    AND WIA.ITEM_TYPE = WIAV.ITEM_TYPE
    AND WIA.NAME = WIAV.NAME)
    AND WIAV.TEXT_VALUE IS NOT NULL
    AND INSTR(WIAV.TEXT_VALUE
    , :B1) > 0
    Plan :*
    <pre>
    | Id | Operation | Name | Rows | Bytes | Cost |
    | 0 | UPDATE STATEMENT | | 453 | 14496 | 284K|
    | 1 | UPDATE | WF_ITEM_ATTRIBUTE_VALUES | | | |
    |* 2 | FILTER | | | | |
    |* 3 | TABLE ACCESS FULL | WF_ITEM_ATTRIBUTE_VALUES | 453 | 14496 | 282K|
    |* 4 | TABLE ACCESS BY INDEX ROWID| WF_ITEM_ATTRIBUTES | 1 | 33 | 2 |
    |* 5 | INDEX UNIQUE SCAN | WF_ITEM_ATTRIBUTES_PK | 1 | | 1 |
    Predicate Information (identified by operation id):
    2 - filter(("SYS_ALIAS_2"."ITEM_TYPE","SYS_ALIAS_2"."NAME")= (SELECT /*+ */
    "WIA"."ITEM_TYPE","WIA"."NAME" FROM "APPLSYS"."WF_ITEM_ATTRIBUTES" "WIA" WHERE
    "WIA"."NAME"=:B1 AND "WIA"."ITEM_TYPE"=:B2 AND "WIA"."TYPE"='URL'))
    3 - filter("SYS_ALIAS_2"."TEXT_VALUE" IS NOT NULL AND
    INSTR("SYS_ALIAS_2"."TEXT_VALUE",:Z)>0)
    4 - filter("WIA"."TYPE"='URL')
    5 - access("WIA"."ITEM_TYPE"=:B1 AND "WIA"."NAME"=:B2)
    </pre>
    Index :*
    <pre>
    INDEX_NAME COLUMN_NAME
    APPLSYS WF_ITEM_ATTRIBUTE_VALUES_PK 1 ITEM_TYPE
    2 ITEM_KEY
    3 NAME
    </pre>
    regds
    Rahul
    Edited by: RahulG on Jan 2, 2009 10:47 PM
    Edited by: RahulG on Jan 2, 2009 10:48 PM

    RahulG wrote:
    HI all ,
    Query mentioned below takes around 1 hr to complete . It's being used by the autoconfig kindly me in tunning it ..
    A few notes:
    1. Your query is using bind variables. If you're already on 9i or later (probably 9iR2 according to plan output), this statement will be subject to bind variable peeking and therefore the output of EXPLAIN PLAN is only of limited use, since the actual execution plan might be different and/or might be based on different cardinality estimates based on the actual bind values peeked at hard parse time. You can use the V$SQL_PLAN view to get the actual execution plan(s) if the statement is still cached in the shared pool, from 10g on DBMS_XPLAN.DISPLAY_CURSOR is available for that purpose.
    2. The execution plan posted suggests that only 453 rows will correspond to the filter criteria (but, as mentioned in 1. is based on an unknown bind variable value when using EXPLAIN PLAN), and probably therefore the optimizer didn't unnest the subquery but runs this as recursive FILTER query potentially for each row passing the filter criteria on the driving table WF_ITEM_ATTRIBUTE_VALUES. Depending on the actual number of rows this might be inefficient, and unnesting the subquery and turning it into a join might be more appropriate. This might accomplished e.g. by providing more representative statistics to the optimizer (are the statistics up-to-date?).
    Although you can't change the SQL you could try this manually by using the UNNEST hint to see if it makes any difference in the execution plan (and run time):
    WHERE (WIAV.ITEM_TYPE, WIAV.NAME) = (SELECT /*+ UNNEST */ WIA.ITEM_TYPE, WIA.NAME
    ...3. The composite index WF_ITEM_ATTRIBUTE_VALUES_PK can only be used on the first column ITEM_TYPE for effective index access, the NAME column would have to be used as filter on all index leaf blocks that would be found using a range scan on ITEM_TYPE. This might be quite inefficient, and/or might lead to a lot of rows/blocks that need to be visited in the table using this index access path.
    4. You could try to trace the execution by enabling extended SQL trace, e.g. using the (undocumented) DBMS_SUPPORT package in 9i. Running the "tkprof" utility on the generated trace file tells you the actual row source cardinalities (which can then be compared to the estimates of the optimizer) and - if the "waits" have been enabled - what your statement has waited for most.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Oem explain plan produced doesn't correspond to explain plan with tkprof

    Hello all,
    I am running OEM on a 10.2.0.3 database and I have a very slow query with cognos 8 BI on my data warehouse.
    I went to the dbconsole through OEM and connected to target database I went to look at the query execution and then got an explain plan.
    Then I did a trace file and ran it throught tkprof.
    When I look at both produced explain plan, I can see the tree looks the same exept the corresponding values. In OEM, it says I am going throug 18000 rows and in the tkprof result it says more like millions of records.
    As anybody had these kind of results?
    Shall I have more confidence in TKprof then OEM?
    It is very important to me since I am being chalanged by an external DBA.

    I would recommend you to get Christian Antogini´s book "Troublshooting Oracle Performance", (http://www.antognini.ch/top/) which explains everything you need to know when analyzing Oracle SQL Performance and Explain Plans.
    If you properly trace your SQL Statement, you will get "STAT" lines in the trace file. These stat lines show you the actual number of rows processed per row source operation. Explain plan per default does only show you the "estimated" row counts for the row source operations no matter whether you use "explain=" in the tkprof call or OEM to get the explain plan. Tkprof reads the STAT lines from the trace and outputs a section which is similar to an execution plan but contains the "real" number of rows.
    However, if you want to troubleshoot Oracle Performance, I would recommend you to run the statement with the hint /*+ GATHER_PLAN_STATISTICS */ or set statistics_level=ALL in your session (not database-wide!).
    If you do, you can get an excellent execution plan with DBMS_XPLAN.DISPLAY_CURSOR containing both estimated rows as well as actual rows combined with the "number of starts" for e.g. nested loop joins.
    Get the book, read it, and you will be able to discuss this issue with your external dba in a professional way. ;-)
    Regards,
    Martin
    www.ora-solutions.net

  • TKPROF facility

    I have various procedures, functions that effectively make up the application. When a user submits a request via the web the processing is too slow I need to improve the performance of the application.
    To assist is the TKPROF the tool to use i.e. will it produce statistics on all SQL statements that occur within my code ?
    Apologise if my questions seems elementary but I havent done any tuning as such.
    Regards.

    hi,
    the TKPROF utility is going to help u for sure...
    for u r session set the SQL TRACE to TRUE is initialization parameters..its going to give u an o/p with in trace file format (TRC)
    convert all those in readable format by using TKPROF...
    if u need more assistance in this.. do let me know.
    as i did all these things recently
    -thanks
    Jai

  • ? Regarding 'SQL user-defined function' execution performance ?

    Hi All,
    I have an user-defined function in SQL which am using in a SQL select statement and i found that the execution time taken by the user-defined function is 9-10 minutes as a result of which my whole query execution time is affected.
    How to i improvise the execution time. Should i do some sort of scheduling for executing the user-defined functions only. Am new to the database world. Your early response with a good suggestion would really be appreciated.
    Thanks in Advance.

    Try to read SQL tuning documents along with TkProf. Then only you will be able to detect the problem.
    There is no instant method by which you can solve this problem.
    But, you can get idea from this samples.
    Tuning:
    http://www.dba-oracle.com/art_sql_tune.htm
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::NO::P11_QUESTION_ID:8764517459743
    Reading TkProf:
    http://www.dbspecialists.com/presentations/use_explain.html
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:920429344869
    Regards.
    Satyaki De.

  • Help in understanding TKPROF output

    Hi All,
    Following is the TKPROF output of a user_dump_dest trace file, obtained by setting trace to 10046@level 12.
    select "CHNNL"."CHNNL_BK" "C0", case "GEOG12"."SUB_STATE_PRVNC_CD" when
    *:"SYS_B_000" then :"SYS_B_001" when :"SYS_B_002" then :"SYS_B_003" when*
    *:"SYS_B_004" then :"SYS_B_005" when :"SYS_B_006" then :"SYS_B_007" when*
    *:"SYS_B_008" then :"SYS_B_009" when :"SYS_B_010" then :"SYS_B_011" when*
    *:"SYS_B_012" then :"SYS_B_013" else "GEOG12"."SUB_STATE_PRVNC_NAME_TXT" end*
    *"C1", "TIME_PERIOD13"."MONTH_CD" "C2", lpad(to_char(EXTRACT( MONTH*
    FROM
    *(TIMESTAMP :"SYS_B_014") )), :"SYS_B_015", :"SYS_B_016") "C3", sum(case*
    when "TIME_PERIOD13"."DAY_CLNDR_DATE"=TIMESTAMP :"SYS_B_017" then
    *"SALES_FACT"."EXTND_NET_SALE_AMNT" else :"SYS_B_018" end ) over (partition*
    by "CHNNL"."CHNNL_BK", case "GEOG12"."SUB_STATE_PRVNC_CD" when :"SYS_B_019"
    then :"SYS_B_020" when :"SYS_B_021" then :"SYS_B_022" when :"SYS_B_023"
    then :"SYS_B_024" when :"SYS_B_025" then :"SYS_B_026" when :"SYS_B_027"
    then :"SYS_B_028" when :"SYS_B_029" then :"SYS_B_030" when :"SYS_B_031"
    then :"SYS_B_032" else "GEOG12"."SUB_STATE_PRVNC_NAME_TXT" end ,
    *"TIME_PERIOD13"."MONTH_CD") "C4", sum(case when*
    *"TIME_PERIOD13"."DAY_CLNDR_DATE" between (TIMESTAMP :"SYS_B_033" -*
    NUMTODSINTERVAL( EXTRACT( DAY FROM TIMESTAMP :"SYS_B_034" ), :"SYS_B_035" )
    + INTERVAL :"SYS_B_036" DAY) and TIMESTAMP :"SYS_B_037" then
    *"SALES_FACT"."EXTND_NET_SALE_AMNT" else :"SYS_B_038" end ) over (partition*
    by "CHNNL"."CHNNL_BK", case "GEOG12"."SUB_STATE_PRVNC_CD" when :"SYS_B_039"
    then :"SYS_B_040" when :"SYS_B_041" then :"SYS_B_042" when :"SYS_B_043"
    then :"SYS_B_044" when :"SYS_B_045" then :"SYS_B_046" when :"SYS_B_047"
    then :"SYS_B_048" when :"SYS_B_049" then :"SYS_B_050" when :"SYS_B_051"
    then :"SYS_B_052" else "GEOG12"."SUB_STATE_PRVNC_NAME_TXT" end ,
    *"TIME_PERIOD13"."MONTH_CD") "C5", sum(case when*
    *"TIME_PERIOD13"."DAY_CLNDR_DATE"=TIMESTAMP :"SYS_B_053" then*
    *"SALES_FACT"."QTY_SOLD_IN_CASES" else :"SYS_B_054" end ) over (partition by*
    *"CHNNL"."CHNNL_BK", case "GEOG12"."SUB_STATE_PRVNC_CD" when :"SYS_B_055"*
    then :"SYS_B_056" when :"SYS_B_057" then :"SYS_B_058" when :"SYS_B_059"
    then :"SYS_B_060" when :"SYS_B_061" then :"SYS_B_062" when :"SYS_B_063"
    then :"SYS_B_064" when :"SYS_B_065" then :"SYS_B_066" when :"SYS_B_067"
    then :"SYS_B_068" else "GEOG12"."SUB_STATE_PRVNC_NAME_TXT" end ,
    *"TIME_PERIOD13"."MONTH_CD") "C6", sum(case when*
    *"TIME_PERIOD13"."DAY_CLNDR_DATE" between (TIMESTAMP :"SYS_B_069" -*
    NUMTODSINTERVAL( EXTRACT( DAY FROM TIMESTAMP :"SYS_B_070" ), :"SYS_B_071" )
    + INTERVAL :"SYS_B_072" DAY) and TIMESTAMP :"SYS_B_073" then
    *"SALES_FACT"."QTY_SOLD_IN_CASES" else :"SYS_B_074" end ) over (partition by*
    *"CHNNL"."CHNNL_BK", case "GEOG12"."SUB_STATE_PRVNC_CD" when :"SYS_B_075"*
    then :"SYS_B_076" when :"SYS_B_077" then :"SYS_B_078" when :"SYS_B_079"
    then :"SYS_B_080" when :"SYS_B_081" then :"SYS_B_082" when :"SYS_B_083"
    then :"SYS_B_084" when :"SYS_B_085" then :"SYS_B_086" when :"SYS_B_087"
    then :"SYS_B_088" else "GEOG12"."SUB_STATE_PRVNC_NAME_TXT" end ,
    *"TIME_PERIOD13"."MONTH_CD") "C7", sum(case when*
    *"TIME_PERIOD13"."DAY_CLNDR_DATE"=TIMESTAMP :"SYS_B_089" then*
    *"SALES_FACT"."QTY_SOLD_IN_KLGMS" else :"SYS_B_090" end ) over (partition by*
    *"CHNNL"."CHNNL_BK", case "GEOG12"."SUB_STATE_PRVNC_CD" when :"SYS_B_091"*
    then :"SYS_B_092" when :"SYS_B_093" then :"SYS_B_094" when :"SYS_B_095"
    then :"SYS_B_096" when :"SYS_B_097" then :"SYS_B_098" when :"SYS_B_099"
    then :"SYS_B_100" when :"SYS_B_101" then :"SYS_B_102" when :"SYS_B_103"
    then :"SYS_B_104" else "GEOG12"."SUB_STATE_PRVNC_NAME_TXT" end ,
    *"TIME_PERIOD13"."MONTH_CD") "C8", sum(case when*
    *"TIME_PERIOD13"."DAY_CLNDR_DATE" between (TIMESTAMP :"SYS_B_105" -*
    NUMTODSINTERVAL( EXTRACT( DAY FROM TIMESTAMP :"SYS_B_106" ), :"SYS_B_107" )
    + INTERVAL :"SYS_B_108" DAY) and TIMESTAMP :"SYS_B_109" then
    *"SALES_FACT"."QTY_SOLD_IN_KLGMS" else :"SYS_B_110" end ) over (partition by*
    *"CHNNL"."CHNNL_BK", case "GEOG12"."SUB_STATE_PRVNC_CD" when :"SYS_B_111"*
    then :"SYS_B_112" when :"SYS_B_113" then :"SYS_B_114" when :"SYS_B_115"
    then :"SYS_B_116" when :"SYS_B_117" then :"SYS_B_118" when :"SYS_B_119"
    then :"SYS_B_120" when :"SYS_B_121" then :"SYS_B_122" when :"SYS_B_123"
    then :"SYS_B_124" else "GEOG12"."SUB_STATE_PRVNC_NAME_TXT" end ,
    *"TIME_PERIOD13"."MONTH_CD") "C9", sum("SALES_FACT"."EXTND_GROSS_SALE_AMNT")*
    over (partition by "CHNNL"."CHNNL_BK", case "GEOG12"."SUB_STATE_PRVNC_CD"
    when :"SYS_B_125" then :"SYS_B_126" when :"SYS_B_127" then :"SYS_B_128"
    when :"SYS_B_129" then :"SYS_B_130" when :"SYS_B_131" then :"SYS_B_132"
    when :"SYS_B_133" then :"SYS_B_134" when :"SYS_B_135" then :"SYS_B_136"
    when :"SYS_B_137" then :"SYS_B_138" else
    *"GEOG12"."SUB_STATE_PRVNC_NAME_TXT" end , "TIME_PERIOD13"."MONTH_CD") "C10",*
    *((sum(case when ("TIME_PERIOD13"."DAY_CLNDR_DATE"=TIMESTAMP :"SYS_B_139")*
    then "SALES_FACT"."EXTND_NET_SALE_AMNT" else :"SYS_B_140" end ) over
    *(partition by "CHNNL"."CHNNL_BK", case "GEOG12"."SUB_STATE_PRVNC_CD" when*
    *:"SYS_B_141" then :"SYS_B_142" when :"SYS_B_143" then :"SYS_B_144" when*
    *:"SYS_B_145" then :"SYS_B_146" when :"SYS_B_147" then :"SYS_B_148" when*
    *:"SYS_B_149" then :"SYS_B_150" when :"SYS_B_151" then :"SYS_B_152" when*
    *:"SYS_B_153" then :"SYS_B_154" else "GEOG12"."SUB_STATE_PRVNC_NAME_TXT" end*
    *, "TIME_PERIOD13"."MONTH_CD")+sum(case when*
    *"TIME_PERIOD13"."DAY_CLNDR_DATE" between (TIMESTAMP :"SYS_B_155" -*
    NUMTODSINTERVAL( EXTRACT( DAY FROM TIMESTAMP :"SYS_B_156" ), :"SYS_B_157" )
    + INTERVAL :"SYS_B_158" DAY) and TIMESTAMP :"SYS_B_159" then
    *"SALES_FACT"."EXTND_NET_SALE_AMNT" else :"SYS_B_160" end ) over (partition*
    by "CHNNL"."CHNNL_BK", case "GEOG12"."SUB_STATE_PRVNC_CD" when :"SYS_B_161"
    then :"SYS_B_162" when :"SYS_B_163" then :"SYS_B_164" when :"SYS_B_165"
    then :"SYS_B_166" when :"SYS_B_167" then :"SYS_B_168" when :"SYS_B_169"
    then :"SYS_B_170" when :"SYS_B_171" then :"SYS_B_172" when :"SYS_B_173"
    then :"SYS_B_174" else "GEOG12"."SUB_STATE_PRVNC_NAME_TXT" end ,
    *"TIME_PERIOD13"."MONTH_CD"))+(sum(case when*
    *("TIME_PERIOD13"."DAY_CLNDR_DATE"=TIMESTAMP :"SYS_B_175") then*
    *"SALES_FACT"."QTY_SOLD_IN_CASES" else :"SYS_B_176" end ) over (partition by*
    *"CHNNL"."CHNNL_BK", case "GEOG12"."SUB_STATE_PRVNC_CD" when :"SYS_B_177"*
    then :"SYS_B_178" when :"SYS_B_179" then :"SYS_B_180" when :"SYS_B_181"
    then :"SYS_B_182" when :"SYS_B_183" then :"SYS_B_184" when :"SYS_B_185"
    then :"SYS_B_186" when :"SYS_B_187" then :"SYS_B_188" when :"SYS_B_189"
    then :"SYS_B_190" else "GEOG12"."SUB_STATE_PRVNC_NAME_TXT" end ,
    *"TIME_PERIOD13"."MONTH_CD")+sum(case when "TIME_PERIOD13"."DAY_CLNDR_DATE"*
    between (TIMESTAMP :"SYS_B_191" - NUMTODSINTERVAL( EXTRACT( DAY FROM
    TIMESTAMP :"SYS_B_192" ), :"SYS_B_193" ) + INTERVAL :"SYS_B_194" DAY) and
    TIMESTAMP :"SYS_B_195" then "SALES_FACT"."QTY_SOLD_IN_CASES" else
    *:"SYS_B_196" end ) over (partition by "CHNNL"."CHNNL_BK", case*
    *"GEOG12"."SUB_STATE_PRVNC_CD" when :"SYS_B_197" then :"SYS_B_198" when*
    *:"SYS_B_199" then :"SYS_B_200" when :"SYS_B_201" then :"SYS_B_202" when*
    *:"SYS_B_203" then :"SYS_B_204" when :"SYS_B_205" then :"SYS_B_206" when*
    *:"SYS_B_207" then :"SYS_B_208" when :"SYS_B_209" then :"SYS_B_210" else*
    *"GEOG12"."SUB_STATE_PRVNC_NAME_TXT" end , "TIME_PERIOD13"."MONTH_CD")))*
    +(sum(case  when ("TIME_PERIOD13"."DAY_CLNDR_DATE"=TIMESTAMP :"SYS_B_211")
    then "SALES_FACT"."QTY_SOLD_IN_KLGMS" else :"SYS_B_212" end ) over
    *(partition by "CHNNL"."CHNNL_BK", case "GEOG12"."SUB_STATE_PRVNC_CD" when*
    *:"SYS_B_213" then :"SYS_B_214" when :"SYS_B_215" then :"SYS_B_216" when*
    *:"SYS_B_217" then :"SYS_B_218" when :"SYS_B_219" then :"SYS_B_220" when*
    *:"SYS_B_221" then :"SYS_B_222" when :"SYS_B_223" then :"SYS_B_224" when*
    *:"SYS_B_225" then :"SYS_B_226" else "GEOG12"."SUB_STATE_PRVNC_NAME_TXT" end*
    *, "TIME_PERIOD13"."MONTH_CD")+sum(case when*
    *"TIME_PERIOD13"."DAY_CLNDR_DATE" between (TIMESTAMP :"SYS_B_227" -*
    NUMTODSINTERVAL( EXTRACT( DAY FROM TIMESTAMP :"SYS_B_228" ), :"SYS_B_229" )
    + INTERVAL :"SYS_B_230" DAY) and TIMESTAMP :"SYS_B_231" then
    *"SALES_FACT"."QTY_SOLD_IN_KLGMS" else :"SYS_B_232" end ) over (partition by*
    *"CHNNL"."CHNNL_BK", case "GEOG12"."SUB_STATE_PRVNC_CD" when :"SYS_B_233"*
    then :"SYS_B_234" when :"SYS_B_235" then :"SYS_B_236" when :"SYS_B_237"
    then :"SYS_B_238" when :"SYS_B_239" then :"SYS_B_240" when :"SYS_B_241"
    then :"SYS_B_242" when :"SYS_B_243" then :"SYS_B_244" when :"SYS_B_245"
    then :"SYS_B_246" else "GEOG12"."SUB_STATE_PRVNC_NAME_TXT" end ,
    *"TIME_PERIOD13"."MONTH_CD")) "C11" from "THA_SALES_DBA"."CHNNL" "CHNNL",*
    *(select "GEOG"."GEOG_KEY" "GEOG_KEY", "GEOG"."SUB_STATE_PRVNC_CD"*
    *"SUB_STATE_PRVNC_CD", "GEOG"."SUB_STATE_PRVNC_NAME_TXT"*
    *"SUB_STATE_PRVNC_NAME_TXT" from "THA_SALES_DBA"."GEOG" "GEOG" where*
    *"GEOG"."SUB_STATE_PRVNC_LOAD_DATA_TYPE"=:"SYS_B_247") "GEOG12",*
    *"THA_SALES_DBA"."TIME_PERIOD" "TIME_PERIOD13", "THA_SALES_DBA"."SALES_FACT"*
    *"SALES_FACT", (select "PROD"."PROD_KEY" "PROD_KEY", "PROD"."PROD_DVSN_CD"*
    *"PROD_DVSN_CD", "PROD"."PCKG_SIZE_CD" "PCKG_SIZE_CD" from*
    *"THA_SALES_DBA"."PROD" "PROD" where "PROD"."LOAD_DATA_TYPE_CD"=:"SYS_B_248")*
    *"PROD14", "THA_SALES_DBA"."DSTRBTR" "DSTRBTR" where*
    *"PROD14"."PROD_DVSN_CD"=:"SYS_B_249" and "PROD14"."PCKG_SIZE_CD"=*
    *:"SYS_B_250" and "DSTRBTR"."DSTRBTR_CD"<>:"SYS_B_251" and CASE*
    WHEN("DSTRBTR"."DSTRBTR_CD" IS NULL) OR ("CHNNL"."CHNNL_BK" IS NULL) THEN
    NULL ELSE ("DSTRBTR"."DSTRBTR_CD"||"CHNNL"."CHNNL_BK") END<>:"SYS_B_252"
    and "SALES_FACT"."CHNNL_KEY"="CHNNL"."CHNNL_KEY" and
    *"SALES_FACT"."DSTRBTR_KEY"="DSTRBTR"."DSTRBTR_KEY" and*
    *"SALES_FACT"."GEOG_KEY"="GEOG12"."GEOG_KEY" and "SALES_FACT"."PROD_KEY"=*
    *"PROD14"."PROD_KEY" and "SALES_FACT"."TIME_PERIOD_KEY"=*
    *"TIME_PERIOD13"."TIME_PERIOD_KEY"*
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.01       0.00          0          0          0           0
    Execute      1      0.01       0.01          0          0          0           0
    Fetch     7632    129.92     245.70     406278      12619         35      763042
    total     7634    129.95     245.73     406278      12619         35      763042
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 68
    Rows     Row Source Operation
    *763042 WINDOW BUFFER (cr=12619 pr=406278 pw=257613 time=239232878 us)*
    *763042 WINDOW BUFFER (cr=12619 pr=372409 pw=237458 time=217248824 us)*
    *763042 WINDOW BUFFER (cr=12619 pr=339595 pw=217662 time=194593662 us)*
    *763042 WINDOW BUFFER (cr=12619 pr=307255 pw=198149 time=177438908 us)*
    *763042 WINDOW BUFFER (cr=12619 pr=275292 pw=178940 time=157976971 us)*
    *763042 WINDOW BUFFER (cr=12619 pr=244097 pw=160017 time=139997871 us)*
    *763042 WINDOW BUFFER (cr=12619 pr=213275 pw=141404 time=119675383 us)*
    *763042 WINDOW BUFFER (cr=12619 pr=184170 pw=123525 time=105714100 us)*
    *763042 WINDOW BUFFER (cr=12619 pr=155800 pw=105953 time=88478655 us)*
    *763042 WINDOW BUFFER (cr=12619 pr=128025 pw=88650 time=71243641 us)*
    *763042 WINDOW BUFFER (cr=12619 pr=100871 pw=71641 time=54047210 us)*
    *763042 WINDOW BUFFER (cr=12619 pr=73821 pw=54957 time=35324144 us)*
    *763042 WINDOW SORT (cr=12619 pr=48205 pw=38587 time=18865032 us)*
    *763042 HASH JOIN (cr=12619 pr=0 pw=0 time=3127703 us)*
    *15098 TABLE ACCESS FULL TIME_PERIOD (cr=693 pr=0 pw=0 time=15216 us)*
    *763042 HASH JOIN (cr=11926 pr=0 pw=0 time=2344335 us)*
    *1845 TABLE ACCESS FULL GEOG (cr=92 pr=0 pw=0 time=1910 us)*
    *763194 HASH JOIN (cr=11834 pr=0 pw=0 time=1577327 us)*
    *11 TABLE ACCESS FULL CHNNL (cr=7 pr=0 pw=0 time=47 us)*
    *765432 HASH JOIN (cr=11827 pr=0 pw=0 time=1580849 us)*
    *2 TABLE ACCESS FULL DSTRBTR (cr=7 pr=0 pw=0 time=50 us)*
    *765432 HASH JOIN (cr=11820 pr=0 pw=0 time=814835 us)*
    *313 TABLE ACCESS FULL PROD (cr=174 pr=0 pw=0 time=1195 us)*
    *1045260 TABLE ACCESS FULL SALES_FACT (cr=11646 pr=0 pw=0 time=31 us)*
    Elapsed times include waiting on following events:
    Event waited on                             Times   Max. Wait  Total Waited
    ----------------------------------------   Waited  ----------  ------------
    SQLNet message to client 7633 0.00 0.01*
    SQLNet message from client 7633 1826.57 2334.17*
    SQLNet more data from client 1 0.00 0.00*
    direct path write temp                       5332        0.09          6.23
    direct path read temp                      389239        0.09        115.09
    The query is automatically generated by Cognos 8.2. The database is 64-bit Oracle 10.2.0.4 on Windows 2003 Enterprise Edition R2.
    I am unable to understand the "*WINDOW BUFFER/WINDOW SORT*" statement under the Row Source Operation. Could one of you please explain this operation to me?
    Thanks and Regards,
    Sriraman

    The WINDOW BUFFER/WINDOW SORT operations are used when processing analytical SQLs, you can see these in your SQL statement. In WINDOW BUFFER the SQL engine do calculations above some buffered data subset and in the WINDOW SORT data subsets are being sorted.
    Dusan

  • Using TKPROF help

    Hi All
    when using TKPROF if we do not specify table=schema.table name and the plan_table exists in m98_v32 then would the explain plan be generated in m98_v32.plan_table as in example below
    tkprof metxprd1_ora_12463.trc metxprd1_ora_12463.lst sys=no explain=M98_V32/saturn5gg
    regards
    kedar

    You can try and let us know the result. Why asking instead of trying?

  • Ellapsed time too much in tkprof output

    Hi All,
    I don't know exactly how to interprete Tkprof output file but i have a problem of performance inserting data to my one table, it takes around 1min but before it was 10 secs. i trace the program and analyze the output from tkprof and i get the following portion:
    insert /*+ APPEND +*/ into T_NAME(COL1,  COL2, COL3, .....)
    values
    (:s1 ,:s2 ,:s3 ,:s4 ,:s5 ,:s6 ,:s7 ,:s8 ,:s9 ,:s10 ,:s11 ,:s12 ,:s13 ,:s14 ,
    :s15 ,:s16 ,:s17 ,:s18 ,:s19 ,:s20 ,:s21 ,:s22 ,:s23 ,:s24 ,:s25 ,:s26 ,
    :s27 ,:s28 ,:s29 ,:s30 ,:s31 ,:s32 ,:s33 ,:s34 ,:s35 ,:s36 ,:s37 ,:s38 ,
    :s39 ,:s40 ,:s41 ,:s42 ,:s43 ,:s44 ,:s45 ,:s46 ,:s47 ,:s48 ,:s49 ,:s50 ,
    :s51 ,:s52 ,:s53 ,:s54 ,:s55 ,:s56 ,:s57 ,:s58 ,:s59 ,:s60 ,:s61 ,:s62 ,
    :s63 ,:s64 ,:s65 ,:s66 ,:s67 ,:s68 )
    call count cpu elapsed disk query current rows
    Parse 2 0.00 0.00 0 0 0 0
    Execute 3 2.94 292.24 12144 1501 57125 4728
    Fetch 0 0.00 0.00 0 0 0 0
    total 5 2.94 292.24 12144 1501 57125 4728
    Misses in library cache during parse: 2
    Misses in library cache during execute: 3
    Optimizer mode: ALL_ROWS
    Parsing user id: 103 (USERNAME)
    Rows Execution Plan
    0 INSERT STATEMENT MODE: ALL_ROWS
    When interpreting this, i got huge value on Ellapsed, disk column during execution:
    The command was exectued 3 times and it was taking 292 secs means 97 secs per execution. I thought it was making my insert problem slow.
    So if i'm not wrong how to avaoid this insertion problem, how to reduce this time of ellapsed.
    What is the problem causing table insertion slow.
    Please help because it is affecting our business
    Thanks for your help
    Raitsarevo

    raitsarevo wrote:
    Hi,
    Gathering statistics will affect performance or not. I mean when i gather statistics of my table now, will this affect operation in this table during execution, the table will be locked or not, indexes will be also or not. Can users work in the table during stat gathering.
    Can anybody give me script to gather stats for partitionned table please.
    Gathering statistics is a good idea in general but it's very unlikely that will help in your particular case. The data needs to be inserted into the table and indexes need to be maintained, this in independent from any statistics. Still it's a good idea in general to refresh statistics if e.g. bulk inserts increased the size and number of rows significantly.
    Have you followed up the advices already given so far regarding further checks and running your statement with tracing enabled at a higher level?
    You can enable this using the following instead of using sql_trace = true:
    ALTER SESSION SET EVENTS '10046 trace name context forever, level 8';and switch it off like that:
    ALTER SESSION SET EVENTS '10046 trace name context off';For more information regarding this, e.g. enabling trace in another session, see e.g. here:
    http://www.juliandyke.com/Diagnostics/Trace/EnablingTrace.html
    raitsarevo wrote:
    Hi guys,
    Reading an output fromENterprise manager, i found that this insert statement is consuming to much "db file sequential read ". I know that is causing wait event. So my question is how to reduce this consumption.
    Thanks
    Raitsarevo.That's very likely caused by the required index maintenance and there is not much you can do about it apart from dropping the indexes. As already mentioned by Jonathan you might hits bugs of the ASSM space management, therefore it would also be good to know if the tablespace the object resides in uses ASSM or not (check the columns EXTENT_MANAGEMENT, ALLOCATION_TYPE, SEGMENT_SPACE_MANAGEMENT of DBA_TABLESPACES).
    Try to generate the extended trace as advised and post the tkprof output here.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Tkprof not showing the Execution Plan for Statement

    Hi all
    using oracle 9i release 2
    I have issued the following statements
    alter session set sql_trace
    alter session set events '10046 trace name context forever, level 12';
    --then executed a pl-sql procedure
    after reading the traceout outfile it shows the Execution plan for statements directly wirtten under begin and end block and doesnot displays the plan for the statements written like this
    procedure a is
    cursor b is
    select ename,dname from dept a,emp b
    where a.deptno=b.deptno;
    begin
    for x in a loop --plan not found but stats are written
    select ename into v_ename from emp where empno=300; --does show the plan+stats
    end;
    what I am missing to get the actual plan in trace output file
    thanks in advance

    You have to exit sql*plus after running the procedure, example tkprof is below:
    declare
    cursor c is
    select ename, dname
    from emp, dept
    where emp.deptno = dept.deptno;
    begin
    for v_x in c
    loop
    dbms_output.put_line(v_x.ename || ' ' ||v_x.dname);
    end loop;
    end;
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.00 0.06 0 0 0 1
    Fetch 0 0.00 0.00 0 0 0 0
    total 2 0.00 0.06 0 0 0 1
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: 68
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    SQL*Net message to client 1 0.00 0.00
    SQL*Net message from client 1 0.00 0.00
    SELECT ENAME, DNAME
    FROM
    EMP, DEPT WHERE EMP.DEPTNO = DEPT.DEPTNO
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 15 0.01 0.00 0 44 0 14
    total 17 0.01 0.00 0 44 0 14
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: 68 (recursive depth: 1)
    Rows Row Source Operation
    14 NESTED LOOPS
    14 TABLE ACCESS FULL EMP
    14 TABLE ACCESS BY INDEX ROWID DEPT
    14 INDEX UNIQUE SCAN DEPT_PK (object id 40350)
    Best Regards
    Krystian Zieja / mob

Maybe you are looking for

  • IPod Touch Screen Isn't Work?

    On my ipod touch the screen wont work in spots of it and it wont go up or down a web or app store or ect.

  • Hi! I am newbie to Reports need help with check boxes

    Hi! I am newbie to Reports need help with check boxes. I am try-in to make a new check boxes that will validate in runtime. I have created two frames and one frame is dummy and other frame has big X line on it with conditions. Is this a right way to

  • Error "Protocol [REMOTE_JDBC] not supported." while logging WORKSPACE ADMIN

    Hi All, I am trying the create a seperate domain for workspace admin, which is deployed in the Weblogic server. When I try to login, I get the error "Protocol [REMOTE_JDBC] not supported". Am I missing some configuration? Thanks in advance. Regards,

  • Scene Selection Menu Question

    I will try and make this question as unconfusing as possible. I have a DVD with a basic menu screen. It offers to play the whole film or go to the scene selection menu. When I go to the scene selection menu obviously I have the option to do just that

  • Trouble Importing From a CD

    I am trying to import songs that I previously burned on a CD-RW in mp3 format. When I put the CD in my computer, all the songs come up automatically in my library. I can play them as long as I have the CD in. However when I take the CD out it keeps t