Plan hash value is 0 in trace file

Hi,
One of the developers has a weird problem while coding in java. His query returns no rows when run from the application. But if he runs the same query from sqlplus, it is ok. I traced his session and that's what I got:
{code}
PARSING IN CURSOR #8 len=279 dep=0 uid=1896 oct=3 lid=1896 tim=1385424021598785 hv=3759151842 ad='2dcbe1148' sqlid='3pcuxk7h106r2'
select NAME1, NAME2, ADDRESS1, ADDRESS2, ADDRESS3, ADDRESS4, CITY, STATE, POSTAL, COUNTRY_DESC, SINCE_DT, EFFDT, EFF_STATUS, CUST_ID, ADDRESS_SEQ_NUM, CNTCT_SEQ_NUM, COUNTRY_HOME, HOME_COUNTRY_FLG, VAT_RGSTRN_ID from PS_MKD_CUST_ASX_VW where CUST_ID = :1 and ADDRESS_SEQ_NUM = :2
END OF STMT
PARSE #8:c=5999,e=74768,p=0,cr=4,cu=1,mis=0,r=0,dep=0,og=1,plh=0,tim=1385424021598784
WAIT #8: nam='SQL*Net message to dblink' ela= 1 driver id=675562835 #bytes=1 p3=0 obj#=-1 tim=1385424021598911
WAIT #8: nam='SQL*Net message from dblink' ela= 835 driver id=675562835 #bytes=1 p3=0 obj#=-1 tim=1385424021599782
EXEC #8:c=999,e=1015,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,plh=0,tim=1385424021599859
WAIT #8: nam='SQL*Net message to client' ela= 1 driver id=1952673792 #bytes=1 p3=0 obj#=-1 tim=1385424021599914
WAIT #8: nam='SQL*Net message from client' ela= 782 driver id=1952673792 #bytes=1 p3=0 obj#=-1 tim=1385424021600715
WAIT #8: nam='SQL*Net message to client' ela= 1 driver id=1952673792 #bytes=1 p3=0 obj#=-1 tim=1385424021600773
WAIT #8: nam='SQL*Net message from client' ela= 1058 driver id=1952673792 #bytes=1 p3=0 obj#=-1 tim=1385424021601870
WAIT #8: nam='SQL*Net message to dblink' ela= 1 driver id=675562835 #bytes=1 p3=0 obj#=-1 tim=1385424021602027
WAIT #8: nam='SQL*Net message from dblink' ela= 665 driver id=675562835 #bytes=1 p3=0 obj#=-1 tim=1385424021602705
FETCH #8:c=0,e=841,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,plh=0,tim=1385424021602774{/code}
Notice two things:
1. I traced with bind variables, but their values are not shown
2. The plan hash (plh) in all three phases are zero
Can someone shed a light on this? What am I missing?
P.S. how do you change the style to code?!

It's slightly different here. First I know they are not using NVARCHAR and second, it's not the value that's missing. the whole bind variable section is missing. For example this is the dump from another query just before the one above: As you can see the binds are present and happily showing their values:
PARSING IN CURSOR #3 len=322 dep=0 uid=1896 oct=3 lid=1896 tim=1385421145197998 hv=3861486324 ad='2d8f7d298' sqlid='bas3ndmm2m6rn'
select u.MD_USER_ID, FIRST_NAME, LAST_NAME, LOGON_ID from MD_USER u, MD_USER_ROLE ur,ROLE_TYPE rt where rt.ROLE_TYPE_GROUP_CODE IN ('ES','EPA') and rt.ROLE_TYPE_ID = ur.ROLE_TYPE_ID and ur.MD_USER_ID = u.MD_USER_ID and ur.SUBS_PS_CUST_ID = :1 and ur.SUBS_PS_ADDRESS_SEQ_NO = :2 order by UPPER(LAST_NAME), UPPER(FIRST_NAME)
END OF STMT
BINDS #3:
Bind#0
  oacdty=01 mxl=4000(4000) mxlc=00 mal=00 scl=00 pre=00
  oacflg=01 fl2=1000000 frm=01 csi=46 siz=4000 off=0
  kxsbbbfp=2b9abfd9ba00  bln=4000  avl=06  flg=05
  value="222672"
Bind#1
  oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00
  oacflg=01 fl2=1000000 frm=01 csi=46 siz=24 off=0
  kxsbbbfp=2b9abfd9cda0  bln=22  avl=02  flg=05
  value=1
EXEC #3:c=3000,e=5158,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,plh=4056985626,tim=1385421145203129
WAIT #3: nam='SQL*Net message to client' ela= 2 driver id=1952673792 #bytes=1 p3=0 obj#=-1 tim=1385421145203353
FETCH #3:c=0,e=205,p=0,cr=40,cu=0,mis=0,r=10,dep=0,og=1,plh=4056985626,tim=1385421145203393

Similar Messages

  • Plan hash value for two queries!

    Hi,
    DB : Oracle 11g (11.2.0.3.0)
    OS: RHEL 5
    I have two question:
    1. Can two queries have same plan hash value? I mean I have below two queries:
    SELECT /+ NO_MERGE */ MIN(payor.next_review_date)*
    * FROM payor*
    * WHERE payor.review_complete = 0*
    * AND payor.closing_date IS NULL*
    * AND payor.patient_key = 10;*
    and
    SELECT  MIN(payor.next_review_date)
    * FROM payor*
    * WHERE payor.review_complete = 0*
    * AND payor.closing_date IS NULL*
    * AND payor.patient_key = 10;*
    When I tried to review the execution plan for both queries, the plan hash value remain same. Does it mean that execution plan for both queries are same? If yes, then how Oracle understands or changes the execution plan based on hint. If no then what plan hash value represents?
    2. If the execution plan with hint and without hint is same except for a given query except no.of rows and bytes. Does it mean that query with less rows and bytes scanned is better?
    Thanks in advance
    -Onkar

    Hi,
    there are two different things. One is EXPLAIN PLAN, which is how the optimizer thinks the query will be executed. It contains some estimates of cost, cardinalities etc. There is also EXECUTION PLAN. It also contains all this information regarding the optimizer estimates, but on the top of that, it also contains information about actual I/O incurred, actual cardinalities, actual timings etc.
    So if a hint is changing optimizer estimates, but the plan stays the same, then impact on query's performance is zero.
    If the actual numbers are changing, this is probably also irrelevant to the hint (e.g. you can have less physical reads because more blocks are found in the buffer cache the second time you're running the query, or you less work because you don't have to parse the statement etc.).
    Actually, most of optimizer hints don't affect optimizer estimates; rather, they try to get the optimizer to use a certain access method or a certain join order etc. regardless of the cost. So you must be talking about such hints as cardinality, dynamic_sampling etc. If that's not the case -- please clarify, because this means that something wrong is going on here (e.g. an INDEX hint may work or it may fail to work, but if it fails, optimizer estimates shouldn't change).
    Best regards,
    Nikolay

  • Generating MD5 hash value for any specific flat file

    Hi experts,
    I am developing a program that will generate flat files and also I should generate the MD5 Hash value for each and every flat files. My question is how can I generate the MD5 hash value for the generated .txt files.
    Thanks in advance
    Shabir

    You can use functions
    MD5_CALCULATE_HASH_FOR_CHAR for text file
    MD5_CALCULATE_HASH_FOR_RAW for binary

  • Forcing / reuse plan hash value ...

    friends....
    db: 11gr2
    os: linux
    for quite sometime I am trying to tune this query but somehow can't get runtime less than 35 seconds...
    I tried to get recent plan details from sql id but saw database was using "Cardinality feedback used for this statement" and was showing me many different plan with different hash value ....
    some of the plans are really good and finishes in 5 seconds and some took 55 seconds.
    my question is
    1. how can I force oracle to use/run query as per historic hash value with minimal runtime? is it possible?
    2. can we see what hint or changes done in query by oracle for that particular hash value?
    I can see explain plan but fail to use id/operation details in actual query?
    my current explain plan slows at below operation id:
    0. SELECT STATEMENT============12  rows======00:00:35
    1. SORT ORDER BY===============12 rows======00:00:35
    2. ---NESTED LOOPS OUTER==========12  rows=====00:00:35
    3. -----NESTED LOOPS==============12  rows=====00:00:35
    4. --------NESTED LOOPS ============ 12K rows ====00:00:01
    5. ----------SORT UNIQUE=============4  rows=====00:00:01
    ...but hash value with good plan using "Hash Join Right Semi" for step-3 and "access table by index" for step 4...

    using "Cardinality feedback used for this statement" and was showing me many different plan with different hash value ....
    some of the plans are really good and finishes in 5 seconds and some took 55 seconds.A not unusual experience with cardinality feedback.
    If you don't like the feature - and my experiences have been very mixed - turn it off.
    Either via system wide parameter optimizeruse_feedback or on a statement basis using the parameter via opt_param hint or alter session.
    1. how can I force oracle to use/run query as per historic hash value with minimal runtime? is it possible?a. SQL Plan Baselines
    b. SQL Profile via COE_XFR_SQL_PROFILE.sql, see Oracle Support doc id 215187.1.
    c. Hint the plan you want using the outline hints from plans above - see DBMS_XPLAN.DISPLAY_AWR and the format parameter '+OUTLINE'
    2. can we see what hint or changes done in query by oracle for that particular hash value?See DBMS_XPLAN.DISPLAY_CURSOR / DISPLAY_AWR and the format parameter '+OUTLINE'
    my current explain plan slows at below operation id:
    but hash value with good plan using "Hash Join Right Semi" for step-3 and "access table by index" for step 4... You've got the template tuning threads which detail the information required to comment on this.

  • Trace files showing bind variables value=""

    10g on solaris
    Hi All,
    We have an issue with an informatica workflow issuing an update statment to Oracle in trems of performace.
    I switched the tracing on using DBMS_SUPPORT with binds set to TRUE. It has captured the trace files accordingly against a controlled set of data. Twot trace files were produced.
    The first trace files shows the SELECT statment being issues that identifies the records that will be updated.
    The 2nd trace file shows the actual UPDATE statment being issued as a PL/SQL loop to do the update.
    There were 20 records that the users have rigged to updated and the update statment shows 20 cases where updates took place. All updates took place succesfully after checking the post results. However my issue is why the trace files are showing the bind vaules as being set to ""?..any ideas appreciated!
    an extract of the trace file...
    PARSING IN CURSOR #1 len=123 dep=0 uid=1482 oct=6 lid=1482 tim=994827916280 hv=3649357857 ad='8b5b98f0'
    UPDATE /*+ index(FCT_TASK IDX_FCT_TASK_CASE_SBL_ROW_ID)*/ FCT_TASK SET DWH_LAST_UPD_DT = SYSDATE WHERE CASE_SBL_ROW_ID = :1
    END OF STMT
    PARSE #1:c=10000,e=980,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=1,tim=994827916264
    =====================
    PARSING IN CURSOR #5 len=227 dep=1 uid=0 oct=3 lid=0 tim=994827919231 hv=2190775527 ad='8e622670'
    select u.name,o.name, t.update$, t.insert$, t.delete$, t.enabled from obj$ o,user$ u,trigger$ t where t.baseobject=:1 and t.obj#=o.obj# and o.owner#=u.user# and bitand(property,16)=0 and bitand(property,8
    )=0 order by o.obj#
    END OF STMT
    PARSE #5:c=0,e=1310,p=0,cr=0,cu=0,mis=1,r=0,dep=1,og=1,tim=994827919223
    BINDS #5:
    bind 0: dty=2 mxl=22(22) mal=00 scl=00 pre=00 oacflg=00 oacfl2=0001 size=24 offset=0
    bfp=ffffffff7c058d98 bln=22 avl=04 flg=05
    value=425212
    EXEC #5:c=10000,e=9476,p=0,cr=0,cu=0,mis=1,r=0,dep=1,og=4,tim=994827928883
    FETCH #5:c=0,e=104,p=0,cr=1,cu=0,mis=0,r=0,dep=1,og=4,tim=994827929051
    STAT #5 id=1 cnt=0 pid=0 pos=1 obj=0 op='SORT ORDER BY (cr=1 pr=0 pw=0 time=172 us)'
    STAT #5 id=2 cnt=0 pid=1 pos=1 obj=0 op='NESTED LOOPS (cr=1 pr=0 pw=0 time=110 us)'
    STAT #5 id=3 cnt=0 pid=2 pos=1 obj=0 op='NESTED LOOPS (cr=1 pr=0 pw=0 time=105 us)'
    STAT #5 id=4 cnt=0 pid=3 pos=1 obj=79 op='TABLE ACCESS BY INDEX ROWID TRIGGER$ (cr=1 pr=0 pw=0 time=103 us)'
    STAT #5 id=5 cnt=0 pid=4 pos=1 obj=123 op='INDEX RANGE SCAN I_TRIGGER1 (cr=1 pr=0 pw=0 time=78 us)'
    STAT #5 id=6 cnt=0 pid=3 pos=2 obj=18 op='TABLE ACCESS BY INDEX ROWID OBJ$ (cr=0 pr=0 pw=0 time=0 us)'
    STAT #5 id=7 cnt=0 pid=6 pos=1 obj=36 op='INDEX UNIQUE SCAN I_OBJ1 (cr=0 pr=0 pw=0 time=0 us)'
    STAT #5 id=8 cnt=0 pid=2 pos=2 obj=22 op='TABLE ACCESS CLUSTER USER$ (cr=0 pr=0 pw=0 time=0 us)'
    STAT #5 id=9 cnt=0 pid=8 pos=1 obj=11 op='INDEX UNIQUE SCAN I_USER# (cr=0 pr=0 pw=0 time=0 us)'
    BINDS #1:
    bind 0: dty=1 mxl=32(30) mal=00 scl=00 pre=00 oacflg=01 oacfl2=800000 size=32 offset=0
    bfp=ffffffff7c17b0a0 bln=32 avl=04 flg=05
    value=""
    EXEC #1:c=8390000,e=8740989,p=55593,cr=55610,cu=3,mis=1,r=1,dep=0,og=1,tim=994836657483
    BINDS #1:
    bind 0: dty=1 mxl=32(30) mal=00 scl=00 pre=00 oacflg=01 oacfl2=800000 size=32 offset=0
    bfp=ffffffff7c17b0a0 bln=32 avl=04 flg=05
    value=""
    EXEC #1:c=7980000,e=7962369,p=55591,cr=55608,cu=1,mis=0,r=1,dep=0,og=1,tim=994844621479
    BINDS #1:
    bind 0: dty=1 mxl=32(30) mal=00 scl=00 pre=00 oacflg=01 oacfl2=800000 size=32 offset=0
    bfp=ffffffff7c17b0a0 bln=32 avl=04 flg=05
    value=""
    ect ect ect...
    Regards
    Satnam

    spliffer wrote:
    Having investigated on the comment of NVARCHAR2 not allowing bind variables to be displayed in the trace file... I checked the datatype of the table/column being used in the index and its is defined as VARCHAR2(15)... ? so Im still not sure as to why we are still getting this.. could it be to do with the clinet application and the way in which it passes the bind vlaues to the oracle update statment?
    any ideas appreciated?
    regards
    SatnamHere is a very brief demonstration.
    The script:
    VARIABLE V1 VARCHAR2
    VARIABLE V2 NVARCHAR2
    EXEC :V1:='A'
    EXEC :V2:='A'
    ALTER SESSION SET TRACEFILE_IDENTIFIER = 'FIND_ME';
    ALTER SESSION SET EVENTS '10046 TRACE NAME CONTEXT FOREVER, LEVEL 12';
    SELECT
    FROM
      (SELECT
        ROWNUM COUNTER,
        CHR(MOD(ROWNUM-1,26)+65) CHARACTER
      FROM
        DUAL
      CONNECT BY
        LEVEL<=100)
    WHERE
      CHARACTER= :V1;
    SELECT
    FROM
      (SELECT
        ROWNUM COUNTER,
        CHR(MOD(ROWNUM-1,26)+65) CHARACTER
      FROM
        DUAL
      CONNECT BY
        LEVEL<=100)
    WHERE
      CHARACTER= :V2;
    SELECT SYSDATE FROM DUAL;
    ALTER SESSION SET EVENTS '10046 TRACE NAME CONTEXT OFF';In the script we have two bind variables defined, the first a VARCHAR2 and the second a NVARCHAR2. The output of the script looks like this in both cases:
       COUNTER C
             1 A
            27 A
            53 A
            79 AThe 10046 trace file looks like this:
    PARSING IN CURSOR #3 len=152 dep=0 uid=31 oct=3 lid=31 tim=2874162497 hv=2898495116 ad='a5259590'
    SELECT
    FROM
      (SELECT
        ROWNUM COUNTER,
        CHR(MOD(ROWNUM-1,26)+65) CHARACTER
      FROM
        DUAL
      CONNECT BY
        LEVEL<=100)
    WHERE
      CHARACTER= :V1
    END OF STMT
    PARSE #3:c=0,e=128,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,tim=2874162493
    BINDS #3:
    kkscoacd
    Bind#0
      oacdty=01 mxl=32(01) mxlc=00 mal=00 scl=00 pre=00
      oacflg=03 fl2=1000000 frm=01 csi=178 siz=32 off=0
      kxsbbbfp=0f176c88  bln=32  avl=01  flg=05
      value="A"
    EXEC #3:c=0,e=498,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,tim=2874163947
    WAIT #3: nam='SQL*Net message to client' ela= 3 driver id=1413697536 #bytes=1 p3=0 obj#=10192 tim=2874164058
    FETCH #3:c=0,e=68,p=0,cr=0,cu=0,mis=0,r=1,dep=0,og=1,tim=2874164215
    WAIT #3: nam='SQL*Net message from client' ela= 299 driver id=1413697536 #bytes=1 p3=0 obj#=10192 tim=2874164657
    WAIT #3: nam='SQL*Net message to client' ela= 2 driver id=1413697536 #bytes=1 p3=0 obj#=10192 tim=2874164903
    FETCH #3:c=15625,e=359,p=0,cr=0,cu=0,mis=0,r=3,dep=0,og=1,tim=2874165155
    WAIT #3: nam='SQL*Net message from client' ela= 1162 driver id=1413697536 #bytes=1 p3=0 obj#=10192 tim=2874166774
    STAT #3 id=1 cnt=4 pid=0 pos=1 obj=0 op='VIEW  (cr=0 pr=0 pw=0 time=76 us)'
    STAT #3 id=2 cnt=100 pid=1 pos=1 obj=0 op='COUNT  (cr=0 pr=0 pw=0 time=50 us)'
    STAT #3 id=3 cnt=100 pid=2 pos=1 obj=0 op='CONNECT BY WITHOUT FILTERING (cr=0 pr=0 pw=0 time=47 us)'
    STAT #3 id=4 cnt=1 pid=3 pos=1 obj=0 op='FAST DUAL  (cr=0 pr=0 pw=0 time=4 us)'
    WAIT #0: nam='SQL*Net message to client' ela= 3 driver id=1413697536 #bytes=1 p3=0 obj#=10192 tim=2874167438
    WAIT #0: nam='SQL*Net message from client' ela= 3939 driver id=1413697536 #bytes=1 p3=0 obj#=10192 tim=2874171452
    =====================
    PARSING IN CURSOR #2 len=152 dep=0 uid=31 oct=3 lid=31 tim=2874171761 hv=2346424803 ad='a597e190'
    SELECT
    FROM
      (SELECT
        ROWNUM COUNTER,
        CHR(MOD(ROWNUM-1,26)+65) CHARACTER
      FROM
        DUAL
      CONNECT BY
        LEVEL<=100)
    WHERE
      CHARACTER= :V2
    END OF STMT
    PARSE #2:c=0,e=155,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,tim=2874171757
    BINDS #2:
    kkscoacd
    Bind#0
      oacdty=01 mxl=32(02) mxlc=01 mal=00 scl=00 pre=00
      oacflg=03 fl2=1000010 frm=02 csi=2000 siz=32 off=0
      kxsbbbfp=0f176c88  bln=32  avl=02  flg=05
      value=""
    EXEC #2:c=0,e=489,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,tim=2874173190
    WAIT #2: nam='SQL*Net message to client' ela= 3 driver id=1413697536 #bytes=1 p3=0 obj#=10192 tim=2874173300
    FETCH #2:c=0,e=68,p=0,cr=0,cu=0,mis=0,r=1,dep=0,og=1,tim=2874173453
    WAIT #2: nam='SQL*Net message from client' ela= 326 driver id=1413697536 #bytes=1 p3=0 obj#=10192 tim=2874173906
    WAIT #2: nam='SQL*Net message to client' ela= 2 driver id=1413697536 #bytes=1 p3=0 obj#=10192 tim=2874174137
    FETCH #2:c=0,e=334,p=0,cr=0,cu=0,mis=0,r=3,dep=0,og=1,tim=2874174398
    WAIT #2: nam='SQL*Net message from client' ela= 1052 driver id=1413697536 #bytes=1 p3=0 obj#=10192 tim=2874175570
    STAT #2 id=1 cnt=4 pid=0 pos=1 obj=0 op='VIEW  (cr=0 pr=0 pw=0 time=76 us)'
    STAT #2 id=2 cnt=100 pid=1 pos=1 obj=0 op='COUNT  (cr=0 pr=0 pw=0 time=46 us)'
    STAT #2 id=3 cnt=100 pid=2 pos=1 obj=0 op='CONNECT BY WITHOUT FILTERING (cr=0 pr=0 pw=0 time=43 us)'
    STAT #2 id=4 cnt=1 pid=3 pos=1 obj=0 op='FAST DUAL  (cr=0 pr=0 pw=0 time=4 us)'
    WAIT #0: nam='SQL*Net message to client' ela= 1 driver id=1413697536 #bytes=1 p3=0 obj#=10192 tim=2874176119
    WAIT #0: nam='SQL*Net message from client' ela= 998 driver id=1413697536 #bytes=1 p3=0 obj#=10192 tim=2874177197
    ...Notice that the value for the bind variable defined as VARCHAR2 printed in the trace file, while the value for the bind variable defined as NVARCHAR2 did not print in the trace file.
    If I had set the STATISTICS_LEVEL to ALL (or used a GATHER_PLAN_STATISTICS hint) I could retrieve the actual execution plan for the above SQL statements like this (if not, replace ALLSTATS LAST with TYPICAL):
    SET PAGESIZE 1000
    SET LINESIZE 160
    SELECT /*+ LEADING(S) */
      T.PLAN_TABLE_OUTPUT
    FROM
      (SELECT
        SQL_ID,
        CHILD_NUMBER
      FROM
        V$SQL
      WHERE
        SQL_TEXT LIKE '%  CHARACTER= :V_') S,
      TABLE(DBMS_XPLAN.DISPLAY_CURSOR(S.SQL_ID,S.CHILD_NUMBER,'ALLSTATS LAST +COST')) T;The output of the above looks like this:
    SQL_ID  33wwr3kqc71nc, child number 0
    SELECT   * FROM   (SELECT     ROWNUM COUNTER,     CHR(MOD(ROWNUM-1,26)+65) CHARACTER   FROM
        DUAL   CONNECT BY     LEVEL<=100) WHERE   CHARACTER= :V1
    Plan hash value: 761049541
    | Id  | Operation                      | Name | Starts | E-Rows | Cost (%CPU)| A-Rows |   A-Time   |
    |*  1 |  VIEW                          |      |      1 |      1 |     2   (0)|      4 |00:00:00.01 |
    |   2 |   COUNT                        |      |      1 |        |            |    100 |00:00:00.01 |
    |   3 |    CONNECT BY WITHOUT FILTERING|      |      1 |        |            |    100 |00:00:00.01 |
    |   4 |     FAST DUAL                  |      |      1 |      1 |     2   (0)|      1 |00:00:00.01 |
    Predicate Information (identified by operation id):
       1 - filter("CHARACTER"=:V1)
    SQL_ID  7qzd4aq5xr6g3, child number 0
    SELECT   * FROM   (SELECT     ROWNUM COUNTER,     CHR(MOD(ROWNUM-1,26)+65) CHARACTER   FROM
        DUAL   CONNECT BY     LEVEL<=100) WHERE   CHARACTER= :V2
    Plan hash value: 761049541
    | Id  | Operation                      | Name | Starts | E-Rows | Cost (%CPU)| A-Rows |   A-Time   |
    |*  1 |  VIEW                          |      |      1 |      1 |     2   (0)|      4 |00:00:00.01 |
    |   2 |   COUNT                        |      |      1 |        |            |    100 |00:00:00.01 |
    |   3 |    CONNECT BY WITHOUT FILTERING|      |      1 |        |            |    100 |00:00:00.01 |
    |   4 |     FAST DUAL                  |      |      1 |      1 |     2   (0)|      1 |00:00:00.01 |
    Predicate Information (identified by operation id):
       1 - filter(SYS_OP_C2C("CHARACTER")=:V2)Notice in the Predicate Information section of the second execution plan, a function is applied to the column - that SYS_OP_C2C function will likely prevent a normal (non-function based) index from helping to improve the execution performance.
    To answer your question, it is the client application that must correctly define the bind variable types.
    Charles Hooper
    Co-author of "Expert Oracle Practices: Oracle Database Administration from the Oak Table"
    http://hoopercharles.wordpress.com/
    IT Manager/Oracle DBA
    K&M Machine-Fabricating, Inc.

  • Explain Plan from TKPROF trace file.

    Hello,
    My procedure is taking time for that i have trace on in procedure fo find explain plan of particular query.
    Using below statement Trace is on.
       EXECUTE IMMEDIATE 'ALTER SESSION SET SQL_TRACE = TRUE';
       EXECUTE IMMEDIATE 'ALTER SESSION SET TIMED_STATISTICS = TRUE';Now for getting expalin plan from TKPROF i have used below statement but for some query i have found explain paln and some case i cant found explain plan.
    tkprof mf_ora_23773.trc mf_ora_23773.txt explain =abc/abc
    can u please help me to analyze where i m wrong?
    Thanks.

    First of all, you should best avoid using the explain= clause on the tkprof command line.
    This will run explain plan on the statement in the trace file, and that explain plan can even be wrong, as there is no information on datatypes in the trace file.
    The real explain plan data is flushed to the trace file, when the program issues commit or rollback. Oracle always issues an implicit commit when the program disconnects, so when you run the program to completion you should have explain plan output in your trace files.
    You won't get explain plan output if you don't have access to the objects in the SQL statement. Also recursive SQL won't produce explain plan result.
    One would need to see part of your trace file to verify your assertion the explain clause doesn't always work.
    Sybrand Bakker
    Senior Oracle DBA

  • Calculating hash values for really big files

    I am using the following code to calculate the hash values of files
    public static String hash(File f, String algorithm)
                throws IOException, NoSuchAlgorithmException {
            if (!f.isFile()) {
                throw new IOException("Not a file");
            RandomAccessFile raf = new RandomAccessFile(f, "r");
            byte b[] = new byte[(int) raf.length()];
            raf.readFully(b);
            raf.close();
            MessageDigest messageDigest = MessageDigest.getInstance(algorithm);
            messageDigest.update(b);
            return toHexString(messageDigest.digest());
        }Now the problem is, for really big files, 100 MB or over, I get an OutOfMemoryError.
    I have used the -Xms and -Xms options to increase the JVM heap size, and untimately made it to work. However, I think this is lame and there is also a limit to the -Xmx option.
    Is there any other way I can calculate the hash values of these really big files?
    Thanks a lot in advance.

    why do u open the file the way u do ?
    why to u upload ALL the file AT ONCE into the memory ?
    i would do it like this:
    FileInputStream fis = new FileInputStream (f);
    int fileSize = f.available();
    byte buffer[] = new byte[1000];
    MessageDigest messageDigest = MessageDigest.getInstance(algorithm);
    for(int read = 0;read < fileSize;read +=1000;)
    if(fis.available() > 1000)
    fis.read(buffer, read, 1000);
    else if(fis.available() > 0)
    fis.read(buffer, read, fis.available());
    else
    break;
    messageDigest.update(b);
    fis.close();
    return toHexString(messageDigest.digest());

  • Bind value truncated in trace file

    Hi,
    I ran a level 12 trace, but it looks like the display of the bind variable values in the trace file is limited to about 255 characters. Is there any setting I can change to get it to dump the entire value?
    Thanks!

    I can't find any related information as to why this limitation is there but I guess it is only to keep the trace file readable (with parameter "avl" indicating the actual value length in the trace file).

  • Naming trace file

    I have generated many trace files for analysis using tkprof. However, I have a difficulty in locating the exact trace file (.trc) from 100s of trace files. Naming my trace file will save time. Is there a way to name the trace file when I start tracing? (i.e. when I set sql_trace to true).
    thanks
    Srinidhi Rao

    You can use tracefile_identifier feature:
    ALTER SESSION SET TRACEFILE_IDENTIFIER = 'traceid';When this parameter value is set, the trace file name has the following format:
    sid_ora_pid_traceid.trc
    Best Regards,
    Gokhan
    If this question is answered, please mark appropriate posts as correct/helpful and the thread as closed. Thanks

  • Not able to get the actual plan from trace file

    Hi all
    I have a Db package and want to get actual execution plan of all the statements in that pakcage it does provides the plan for System's statements but does not displays the plan for Sql statements
    DB version 9.2.0 using the following sequence of insructions
    set timing on
    set serveroutput on
    alter session set events '10046 trace name context forever ,level 12';
    begin
    run_service.collect_data(sysdate);
    end;
    alter session set sql_trace=false;
    exit; ---exit from Sql
    now look at the output
    select distinct obj#,containerobj#,pflags,xpflags,mflags
    from
    sum$, suminline$ where sumobj#=obj# and inline#=:1
    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 1 0.00 0.00 1 1 0 0
    total 3 0.00 0.00 1 1 0 0
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: SYS (recursive depth: 2)
    Rows Row Source Operation
    0 SORT UNIQUE
    0 NESTED LOOPS
    0 TABLE ACCESS BY INDEX ROWID SUMINLINE$
    0 INDEX RANGE SCAN I_SUMINLINE$_2 (object id 1614116)
    0 TABLE ACCESS BY INDEX ROWID SUM$
    0 INDEX UNIQUE SCAN I_SUM$_1 (object id 319)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file sequential read 1 0.00 0.00
    SELECT SEQ_NUM, S_DATE, S_TIME, CSTATUS, G_SERVICE,
    B_REFERENCE, V_REFERENCE, M_PRIORITY
    FROM GL_HIST
    ORDER BY S_DATE DESC, S_TIME DESC
    call count cpu elapsed disk query current rows
    Parse 1 0.01 0.01 0 0 0 0
    Execute 2819 0.37 0.32 0 0 0 0
    Fetch 2819 2.50 20.47 2786 20164 0 2819
    total 5639 2.88 20.81 2786 20164 0 2819
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    Parsing user id: 15550 (recursive depth: 1)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file sequential read 2786 0.05 18.19
    latch free 4 0.04 0.06
    UPDATE G_ORIG SET G_SERVICE = :B1
    WHERE
    SEQ_NUM = :B5 AND S_DATE = :B4 AND S_TIME = :B3 AND
    C_STATUS = :B2 AND NVL(G_SERVICE, '+') <> NVL(:B1, '+')
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.03 0 0 0 0
    Execute 3731 0.74 0.99 261 18712 119 54
    Fetch 0 0.00 0.00 0 0 0 0
    total 3732 0.74 1.02 261 18712 119 54
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    Parsing user id: 15550 (recursive depth: 1)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file sequential read 261 0.01 0.19
    latch free 9 0.01 0.04
    COMMIT

    Remove the line alter session set sql_trace=false and just exit/disconnect. The explain plain is contained in the STAT lines in the trace file and are only written when the cursor closes. If you turn off tracing before the cursor closes the STAT lines will not get written.

  • How to proceed further once the explain plan and trace files are generated?

    Hi Friends,
    I need to improve the performance of on of the views that i am working on.
    As suggested in the thread - http://forums.oracle.com/forums/thread.jspa?threadID=863295&tstart=0 , i gave generated the explain plan and the trace file.
    From the explain plan, we can see the expensive operations for the query.
    Can any one please tell, how to proceed further from here on i.e. how to make this expensive operations less expensive?
    For ex: FULL TABLE SCAN might be an expensive operation when the table has indexes.In such cases, how can we avoid such operations to make query faster?
    Regards,
    Sreekanth Munagala.

    Hi Veena,
    An earlier post by you regarding P45 is as below
    Starter report P45(3) / P46 efiling for UK
    from my understanding though i have not worked on GB Payroll you have said that you deleted IT 65 details of leaver,however there must be clusters generated in system from where the earlier data needs to be deleted and may be that is why you are facing the issue.
    In Indian payroll when we execute text file for efiling of tax after challan mapping all the data compiles and sits in PCL cluster and therefore we are unable to generate form 16 with proper output,here we delete the clusters and rerun again the mappings and then check form 16.
    Hope this might help you,Experts have suggested you earlier also,they may correct me for this.
    Salil

  • Explain plan not displayed in sql trace file

    Hello,
    I don't understand why in sql trace file, after tkprof transformation, for several queries the explain plan is displayed and for several queries, no explain plan is displayed.
    How can I have the explain plan for all queries?
    Thanks for your help.

    Was this a trace started on an already running task? Was the trace stopped before the task completed? Did the trace file reach its set size limit before the task compled?
    In all three cases above you would have cursors that were not closed and stats information not written to the trace file resulting in incomplete data for some SQL.
    HTH -- Mark D Powell --

  • High SQL*Net message values in trace file.

    Hi all,
    This is my first post here. I will try to more less describe the problem i am facing.
    Any help is more than welcome!
    I am facing some performance issues with application. Slow GUI. I run some tests, i tracked the session. what i found in trace file is:
    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse     1734     1.61   1.61             0            0            0              0
    Execute   1734   32.52  32.56           0           26          15             4
    Fetch     1737     14.46  14.51           2        41867        84          2847
    total     5205     48.59   48.69            2        41893        99          2851
    Misses in library cache during parse: 7
    Misses in library cache during execute: 5
    Elapsed times include waiting on following events:
      Event waited on                             Times       Max. Wait     Total Waited
      ----------------------------------------           Waited       ----------            ------------
      SQL*Net message to client            5207           0.00               0.02
      SQL*Net message from client        5206          106.18             339.72
      log file sync                                    3               0.00               0.00
      SQL*Net more data to client            51              0.00               0.00
      SQL*Net more data from client        10              0.00               0.00
      Disk file operations I/O                    1               0.00               0.00
      db file sequential read                     2               0.00               0.01
      library cache: mutex X                    1               0.05               0.05
    Look at Max. Wait and Total Waited columns. Is it possible to safely tune it by changing SDU in sql*net ? and if so, is it needed to change the SDU value on client and server sides ?

    66ff73bb-87bd-4c84-bada-0141fb25344b wrote:
    Hi all,
    This is my first post here. I will try to more less describe the problem i am facing.
    Any help is more than welcome!
    I am facing some performance issues with application. Slow GUI. I run some tests, i tracked the session. what i found in trace file is:
    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse     1734     1.61   1.61             0            0            0              0
    Execute   1734   32.52  32.56           0           26          15             4
    Fetch     1737     14.46  14.51           2        41867        84          2847
    total     5205     48.59   48.69            2        41893        99          2851
    Misses in library cache during parse: 7
    Misses in library cache during execute: 5
    Elapsed times include waiting on following events:
      Event waited on                             Times       Max. Wait     Total Waited
      ----------------------------------------           Waited       ----------            ------------
      SQL*Net message to client            5207           0.00               0.02
      SQL*Net message from client        5206          106.18             339.72
      log file sync                                    3               0.00               0.00
      SQL*Net more data to client            51              0.00               0.00
      SQL*Net more data from client        10              0.00               0.00
      Disk file operations I/O                    1               0.00               0.00
      db file sequential read                     2               0.00               0.01
      library cache: mutex X                    1               0.05               0.05
    Look at Max. Wait and Total Waited columns. Is it possible to safely tune it by changing SDU in sql*net ? and if so, is it needed to change the SDU value on client and server sides ?
    When you start with the wrong question, no matter how good an answer you get, it won't matter very much.
    you do NOT have any problem; just a useless observation.

  • In trace file and output file showing bind variable instead of value

    Hi,
    database 9i
    optimizer = choose(for cost based)
    In my trace file and output file showing bind variable instead of value.
    in my trace file 20 queries.
    I alse set this parameter in session level.
    alter session set events '10046 trace name context forever, level 4';
    but still showing traceoutput file bind variable.
    Pls help its very urgent

    Can you post the query for which the bind variable values are not being shown and the trace output for the same?
    Probably it is listed down somewhere when you actually executed the query among the others. Try completely analyzing your trace file..

  • The selected signed file could not be authenticated. The file might have been tampered with or an error might have occured during download. Please verify the MD5 hash value against the Cisco Systems web site

    I am trying to load any 9.0.3 firmware on my UCM 5.0.4.2000-1 server. Every newer firmware I load throws the following error. I have verified the MD5 is correct and also downloaded the file several times with the same result. I can load the same firmware file on another UCM server and it loads fine. Any ideas?
    Thanks in advance!
    Error Message:
    The selected signed file could not be authenticated. The file might have been  tampered with or an error might have occured during download. Please verify the  MD5 hash value against the Cisco Systems web site:  9b:b6:31:09:18:15:e7:c0:97:9f:e6:fe:9a:19:94:99
    Firmware File: cmterm-7970_7971-sccp.9-0-3.cop.sgn
    UCM version: 5.0.4.2000-1

    Thanks for your reply. We have a lab environment where I maintain  UCM 5.0, 5.1, 6.0, 6.1, 7.0, 7.1 and 8.0 servers each running the latest released firmware for our QA testing team. I have downloaded and installed the latest device packages but find that if I try to install any firmware newer then 8.3.1 on either 5.0.4 or 6.0 i start getting MD5 hash authentication errors. It looks like 9.0.3 firmware should work on UCM 5.0 and 6.0 so I am lost as to why I can't seem to update any firmware for any model phone if it is newer then version 8.3.1 on either 5.0 or 6.0. while 5.1 and 6.1 work without issues. Maybe it is just a bug. I mostly wanted to see if anyone else has experienced this or if it is just me.

Maybe you are looking for

  • Safari for vista

    Safari has a problem with opening new tabs. In chrome, jus a click opens the link in a new tab automatically. it doesnt happen in safari. we have to click after holding Ctrl key which is not so easy compared with Chrome Hope Safari come with an optio

  • Avoiding the runaround!

    Anyone know how I get a BT engineer out? We need to try and avoid the runaround we get in India before it drives us completely mad. Anyone I can speak to in the UK who can actually apply common sense and not just endlessly pass us on to yet another o

  • Why isn't my iMac using all of my RAM

    Hi, I've recently upgraded the RAM in my iMac (System details below) from 4GB to 12GB as it was running a little slow, I have found this has made no difference and at times seems even slower. I was doing some work with video files and was converting

  • Can anyone help me to find out the problem?

    My purpose is to do five time the product of two random number and user enter the answer each time,but it just keep running again whatever i enter the right or wrong answer,And it cannot verify my answer after the first running(At first time,it works

  • Status Led AP 1250 Ligthweight

    Hi: Somebody could you help me, a few day l have 3 AP Ligthweight 1250, today l was checking my infrastructure and l saw that these 3 AP can´t join to the controller, l reset the AP  to the, and its can not  join, l checked physicly the AP, and the E