AUTH_CHECK_MISMATCH BIND_MISMATCH LANGUAGE_MISMATCH

when I run SQL (further below) I get significant number of results of AUTH_CHECK_MISMATCH LANGUAGE_MISMATCH
Just wondering if APEX 4.1.1 has not installed correctly?
eg1 -AUTH_CHECK_MISMATCH BIND_MISMATCH LANGUAGE_MISMATCH
SELECT SHORTCUT_NAME, ID FROM WWV_FLOW_SHORTCUTS WHERE FLOW_ID = :B3 AND (BUILD_OPTION IS NULL OR (BUILD_OPTION > 0 AND (:B2 IS NULL OR INSTR(:B2 ,':'||BUILD_OPTION||':') = 0) ) OR (BUILD_OPTION < 0 AND (:B1 IS NOT NULL AND INSTR(:B1 ,':'||(0-BUILD_OPTION)||':') = 0) ) ) ORDER BY SHORTCUT_NAMEeg2 - AUTH_CHECK_MISMATCH LANGUAGE_MISMATCH
SELECT ROWID FROM WWV_FLOW_DATA WHERE FLOW_INSTANCE = :B3 AND ITEM_ID = :B2 AND ITEM_NAME = :B1 FOR UPDATE NOWAIT"
select version_count,reason,sql_text from (
select
address,''
||decode(max(                UNBOUND_CURSOR),'Y',               ' UNBOUND_CURSOR')
||decode(max(             SQL_TYPE_MISMATCH),'Y',            ' SQL_TYPE_MISMATCH')
||decode(max(            OPTIMIZER_MISMATCH),'Y',           ' OPTIMIZER_MISMATCH')
||decode(max(              OUTLINE_MISMATCH),'Y',             ' OUTLINE_MISMATCH')
||decode(max(            STATS_ROW_MISMATCH),'Y',           ' STATS_ROW_MISMATCH')
||decode(max(              LITERAL_MISMATCH),'Y',             ' LITERAL_MISMATCH')
||decode(max(           EXPLAIN_PLAN_CURSOR),'Y',          ' EXPLAIN_PLAN_CURSOR')
||decode(max(         BUFFERED_DML_MISMATCH),'Y',        ' BUFFERED_DML_MISMATCH')
||decode(max(             PDML_ENV_MISMATCH),'Y',            ' PDML_ENV_MISMATCH')
||decode(max(           INST_DRTLD_MISMATCH),'Y',          ' INST_DRTLD_MISMATCH')
||decode(max(             SLAVE_QC_MISMATCH),'Y',            ' SLAVE_QC_MISMATCH')
||decode(max(            TYPECHECK_MISMATCH),'Y',           ' TYPECHECK_MISMATCH')
||decode(max(           AUTH_CHECK_MISMATCH),'Y',          ' AUTH_CHECK_MISMATCH')
||decode(max(                 BIND_MISMATCH),'Y',                ' BIND_MISMATCH')
||decode(max(             DESCRIBE_MISMATCH),'Y',            ' DESCRIBE_MISMATCH')
||decode(max(             LANGUAGE_MISMATCH),'Y',            ' LANGUAGE_MISMATCH')
||decode(max(          TRANSLATION_MISMATCH),'Y',         ' TRANSLATION_MISMATCH')
||decode(max(                  INSUFF_PRIVS),'Y',                 ' INSUFF_PRIVS')
||decode(max(              INSUFF_PRIVS_REM),'Y',             ' INSUFF_PRIVS_REM')
||decode(max(         REMOTE_TRANS_MISMATCH),'Y',        ' REMOTE_TRANS_MISMATCH')
||decode(max(     LOGMINER_SESSION_MISMATCH),'Y',    ' LOGMINER_SESSION_MISMATCH')
||decode(max(          INCOMP_LTRL_MISMATCH),'Y',         ' INCOMP_LTRL_MISMATCH')
||decode(max(         OVERLAP_TIME_MISMATCH),'Y',        ' OVERLAP_TIME_MISMATCH')
||decode(max(         MV_QUERY_GEN_MISMATCH),'Y',        ' MV_QUERY_GEN_MISMATCH')
||decode(max(       USER_BIND_PEEK_MISMATCH),'Y',      ' USER_BIND_PEEK_MISMATCH')
||decode(max(           TYPCHK_DEP_MISMATCH),'Y',          ' TYPCHK_DEP_MISMATCH')
||decode(max(           NO_TRIGGER_MISMATCH),'Y',          ' NO_TRIGGER_MISMATCH')
||decode(max(              FLASHBACK_CURSOR),'Y',             ' FLASHBACK_CURSOR')
||decode(max(        ANYDATA_TRANSFORMATION),'Y',       ' ANYDATA_TRANSFORMATION')
||decode(max(          TOP_LEVEL_RPI_CURSOR),'Y',         ' TOP_LEVEL_RPI_CURSOR')
||decode(max(         DIFFERENT_LONG_LENGTH),'Y',        ' DIFFERENT_LONG_LENGTH')
||decode(max(         LOGICAL_STANDBY_APPLY),'Y',        ' LOGICAL_STANDBY_APPLY')
||decode(max(                DIFF_CALL_DURN),'Y',               ' DIFF_CALL_DURN')
||decode(max(                BIND_UACS_DIFF),'Y',               ' BIND_UACS_DIFF')
||decode(max(        PLSQL_CMP_SWITCHS_DIFF),'Y',       ' PLSQL_CMP_SWITCHS_DIFF')
||decode(max(         CURSOR_PARTS_MISMATCH),'Y',        ' CURSOR_PARTS_MISMATCH')
||decode(max(           STB_OBJECT_MISMATCH),'Y',          ' STB_OBJECT_MISMATCH')
||decode(max(             PQ_SLAVE_MISMATCH),'Y',            ' PQ_SLAVE_MISMATCH')
||decode(max(        TOP_LEVEL_DDL_MISMATCH),'Y',       ' TOP_LEVEL_DDL_MISMATCH')
||decode(max(             MULTI_PX_MISMATCH),'Y',            ' MULTI_PX_MISMATCH')
||decode(max(       BIND_PEEKED_PQ_MISMATCH),'Y',      ' BIND_PEEKED_PQ_MISMATCH')
||decode(max(           MV_REWRITE_MISMATCH),'Y',          ' MV_REWRITE_MISMATCH')
||decode(max(         ROLL_INVALID_MISMATCH),'Y',        ' ROLL_INVALID_MISMATCH')
||decode(max(       OPTIMIZER_MODE_MISMATCH),'Y',      ' OPTIMIZER_MODE_MISMATCH')
||decode(max(                   PX_MISMATCH),'Y',                  ' PX_MISMATCH')
||decode(max(          MV_STALEOBJ_MISMATCH),'Y',         ' MV_STALEOBJ_MISMATCH')
||decode(max(      FLASHBACK_TABLE_MISMATCH),'Y',     ' FLASHBACK_TABLE_MISMATCH')
||decode(max(          LITREP_COMP_MISMATCH),'Y',         ' LITREP_COMP_MISMATCH')
reason
from
   v$sql_shared_cursor
group by
   address
) join v$sqlarea using(address) where version_count>2
and parsing_schema_name like 'APEX_0%'
order by version_count desc,address

I'm seeing the same thing now, APEX 4.0. Two-node setup. Please let me know if you've found any reason why, I'm checking the environment settings across both nodes now.

Similar Messages

  • AUTH_CHECK_MISMATCH and LANGUAGE_MISMATCH

    Hi all
    I have identified that same sql_id has 4 child_number in v$sql, in order to find out what is the reason of execution changes I looked into v$sql_shared_cursor with sql_id and I saw
    AUTH_CHECK_MISMATCH=Y and LANGUAGE_MISMATCH=Y for 4 child sql ;
    1-why value=y for all childs ? doesnt have to someone has value=N ?
    2-What is the exact mean of these mismatchs give me some example ? when these mismatchs happens ?
    3-V$Sql_Shared_Cursor is the best view to find child number changes or execution changes ?
    Best Regards
    10.2.2
    Edited by: EB on Feb 5, 2009 5:36 PM

    EB wrote:
    I have identified that same sql_id has 4 child_number in v$sql, in order to find out what is the reason of execution changes I looked into v$sql_shared_cursor with sql_id and I saw
    AUTH_CHECK_MISMATCH=Y and LANGUAGE_MISMATCH=Y for 4 child sql ;
    2-What is the exact mean of these mismatchs give me some example ? when these mismatchs happens ?The AUTH_CHECK_MISMATCH is usually indicating that a VPD/RLS policy is active and therefore the SQL is actually unique and not sharable, although not visible in V$SQL.
    See e.g. AskTom for an example: http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:62048567543425#673597500346350876
    The LANGUAGE_MISMATCH indicates that different NLS related settings, e.g. different NLS_SORT or NLS_COMP settings were used that influence the meaning/sort output/filter predicates and therefore are not sharable.
    You can try it yourself by simply executing a query like "SELECT * FROM <TABLE> ORDER BY <VARCHAR_COL>" twice, the first time using a binary sort order ("ALTER SESSION SET NLS_SORT = binary"), the second time using a different sort order like "ALTER SESSION SET NLS_SORT = german". Then you'll find two child cursors for this statement.
    A quick test with 10g XE though revealed that a different NLS_SORT setting already showed a 'Y' in both the AUTH_CHECK_MISMATCH and LANGUAGE_MISMATCH columns, although I'm not sure why the AUTH_CHECK_MISMATCH column shows 'Y' in this particular case.
    So may be you simply have sessions that use different NLS settings which could already be caused by different NLS client settings.
    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/

  • Query taking longer to execute the second time.

    Hello,
    I have a query joing few tables and views and when i execute it the first them, it executes within a seconds, immediately if i execute it the second time it takes about 40 seconds to execute. I am using Oracle 11g [11.2.0.1.0].
    Please find the TKPROF output.
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.26       0.24          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch       23      0.81       0.82          0       5610          0         326
    total       25      1.07       1.07          0       5610          0         326
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 127
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.23       0.23          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch       23     41.01      41.00          0      38218          0         326
    total       25     41.24      41.24          0      38218          0         326
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 127 

    Hi Nicholay,
    VPD is not being used in our application. ArcSDE Multi-Versionsed View uses some functions in VW_ objects. In Oracle 10g I dont have this issue.
    Here is the output from V$SQL_SHARED_CURSOR.
    "SQL_ID"                      "ADDRESS"                     "CHILD_ADDRESS"               "CHILD_NUMBER"                "UNBOUND_CURSOR"              "SQL_TYPE_MISMATCH"           "OPTIMIZER_MISMATCH"          "OUTLINE_MISMATCH"            "STATS_ROW_MISMATCH"          "LITERAL_MISMATCH"            "FORCE_HARD_PARSE"            "EXPLAIN_PLAN_CURSOR"         "BUFFERED_DML_MISMATCH"       "PDML_ENV_MISMATCH"           "INST_DRTLD_MISMATCH"         "SLAVE_QC_MISMATCH"           "TYPECHECK_MISMATCH"          "AUTH_CHECK_MISMATCH"         "BIND_MISMATCH"               "DESCRIBE_MISMATCH"           "LANGUAGE_MISMATCH"           "TRANSLATION_MISMATCH"        "BIND_EQUIV_FAILURE"          "INSUFF_PRIVS"                "INSUFF_PRIVS_REM"            "REMOTE_TRANS_MISMATCH"       "LOGMINER_SESSION_MISMATCH"   "INCOMP_LTRL_MISMATCH"        "OVERLAP_TIME_MISMATCH"       "EDITION_MISMATCH"            "MV_QUERY_GEN_MISMATCH"       "USER_BIND_PEEK_MISMATCH"     "TYPCHK_DEP_MISMATCH"         "NO_TRIGGER_MISMATCH"         "FLASHBACK_CURSOR"            "ANYDATA_TRANSFORMATION"      "INCOMPLETE_CURSOR"           "TOP_LEVEL_RPI_CURSOR"        "DIFFERENT_LONG_LENGTH"       "LOGICAL_STANDBY_APPLY"       "DIFF_CALL_DURN"              "BIND_UACS_DIFF"              "PLSQL_CMP_SWITCHS_DIFF"      "CURSOR_PARTS_MISMATCH"       "STB_OBJECT_MISMATCH"         "CROSSEDITION_TRIGGER_MISMATCH""PQ_SLAVE_MISMATCH"           "TOP_LEVEL_DDL_MISMATCH"      "MULTI_PX_MISMATCH"           "BIND_PEEKED_PQ_MISMATCH"     "MV_REWRITE_MISMATCH"         "ROLL_INVALID_MISMATCH"       "OPTIMIZER_MODE_MISMATCH"     "PX_MISMATCH"                 "MV_STALEOBJ_MISMATCH"        "FLASHBACK_TABLE_MISMATCH"    "LITREP_COMP_MISMATCH"        "PLSQL_DEBUG"                 "LOAD_OPTIMIZER_STATS"        "ACL_MISMATCH"                "FLASHBACK_ARCHIVE_MISMATCH"  "LOCK_USER_SCHEMA_FAILED"     "REMOTE_MAPPING_MISMATCH"     "LOAD_RUNTIME_HEAP_FAILED"    "HASH_MATCH_FAILED"           "PURGED_CURSOR"               "BIND_LENGTH_UPGRADEABLE"    
    "7rtqvjtyp06k9"               "000007FFABD3A918"            "000007FFABD49C88"            "1"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                          
    "7rtqvjtyp06k9"               "000007FFABD3A918"            "000007FFABD3A7B8"            "0"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                          
    "7rtqvjtyp06k9"               "000007FFABD3A918"            "000007FFABD46A40"            "2"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                          
    "7rtqvjtyp06k9"               "000007FFABD3A918"            "000007FFABD3A7B8"            "0"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                          
    "7rtqvjtyp06k9"               "000007FFABD3A918"            "000007FFABD49C88"            "1"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                          
    "7rtqvjtyp06k9"               "000007FFABD3A918"            "000007FFABD46A40"            "2"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                          
    "7rtqvjtyp06k9"               "000007FFABD3A918"            "000007FFABD3A7B8"            "0"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                          
    "7rtqvjtyp06k9"               "000007FFABD3A918"            "000007FFABD49C88"            "1"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                          
    "7rtqvjtyp06k9"               "000007FFABD3A918"            "000007FFABD46A40"            "2"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           Edited by: 955237 on 29 Aug, 2012 1:57 AM

  • AUTH_CHECK_MISMATCH

    Hi all
    I am seeing too many AUTH_CHECK_MISMATCH in v$sql_shared_cursor.
    There is and .net application that login oracle via user X ,all packages these using by application are in user Y.X has only execute permission on all Y packages.
    This might be reason of AUTH_CHECK_MISMATCH ? Or have you any advice ?
    there is not same table names in diffrent schemas and there is not synonyms that related problem tables.Also I am not using VPD.

    Are you sure that there is no change on NLS related values?
    If you have LANGUAGE_MISMATCH without any NLS modification, it would be a bug.
    1. You might like to have more investigation using v$ses_optimizer_env and/or v$sql_optimizer_env views.
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28320/dynviews_3.htm#REFRN30308
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28320/dynviews_3.htm#REFRN30311
    Could you post the result when you have any meanginful comparsion through these views?
    2. And search metalink for bugs.
    ==================================
    Dion Cho - Oracle Performance Storyteller
    http://dioncho.wordpress.com (english)
    http://ukja.tistory.com (korean)
    ==================================

  • Gather_Plan_Statistics + DBMS_XPLAN A-rows for parallel queries

    Looks like gather_plan_statistics + dbms_xplan displays incorrect A-rows for parallel queries. Is there any way to get the correct A-rows for a parallel query?
    Version details:
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi on HPUX
    Create test tables:
    -- Account table
    create table test_tacprof
    parallel (degree 2) as
    select object_id ac_nr,
           object_name ac_na
    from all_objects;      
    alter table test_tacprof add constraint test_tacprof_pk primary key (ac_nr);
    -- Account revenue table
    create table test_taccrev
    parallel (degree 2) as
    select apf.ac_nr         ac_nr,
           fiv.r             tm_prd,
           apf.ac_nr * fiv.r ac_rev
    from   (select rownum r from all_objects where rownum <= 5) fiv,
           test_tacprof apf;
    alter table test_taccrev add constraint test_taccrev_pk primary key (ac_nr, tm_prd);
    -- Table to hold query results
    create table test_4accrev as
    select apf.ac_nr, apf.ac_na, rev.tm_prd, rev.ac_rev
    from test_taccrev rev,
         test_tacprof apf
    where 1=2;
    Run query with parallel dml/query disabled:
    ALTER SESSION DISABLE PARALLEL QUERY;
    ALTER SESSION DISABLE PARALLEL DML;
    INSERT INTO test_4accrev
       SELECT /*+ gather_plan_statistics */
              apf.ac_nr,
              apf.ac_na,
              rev.tm_prd,
              rev.ac_rev
         FROM test_taccrev rev, test_tacprof apf
        WHERE apf.ac_nr = rev.ac_nr AND tm_prd = 4;
    SELECT *
      FROM TABLE (DBMS_XPLAN.display_cursor (NULL, NULL, 'ALLSTATS LAST'));
    | Id  | Operation          | Name         | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Use
    |*  1 |  HASH JOIN         |              |      1 |  30442 |  23412 |00:00:00.27 |     772 |  1810K|  1380K| 2949K (0)|
    |   2 |   TABLE ACCESS FULL| TEST_TACPROF |      1 |  26050 |  23412 |00:00:00.01 |     258 |       |       |    
    |*  3 |   TABLE ACCESS FULL| TEST_TACCREV |      1 |  30441 |  23412 |00:00:00.03 |     514 |       |       |    
    ROLLBACK ;
    A-rows are correctly reported with no parallel.
    Run query with parallel dml/query enabled:
    ALTER SESSION enable PARALLEL QUERY;
    alter session enable parallel dml;
    insert into test_4accrev
    select /*+ gather_plan_statistics */ apf.ac_nr, apf.ac_na, rev.tm_prd, rev.ac_rev
    from test_taccrev rev,
         test_tacprof apf
    where apf.ac_nr = rev.ac_nr
    and   tm_prd = 4;    
    select * from table(dbms_xplan.display_cursor(null,null,'ALLSTATS LAST'));                
    | Id  | Operation                | Name         | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-M
    |   1 |  PX COORDINATOR          |              |      1 |        |  23412 |00:00:00.79 |       6 |       |       |          |
    |   2 |   PX SEND QC (RANDOM)    | :TQ10001     |      0 |  30442 |      0 |00:00:00.01 |       0 |       |       |          |
    |*  3 |    HASH JOIN             |              |      0 |  30442 |      0 |00:00:00.01 |       0 |  2825K|  1131K|          |
    |   4 |     PX BLOCK ITERATOR    |              |      0 |  30441 |     0 |00:00:00.01 |       0 |       |       |          |
    |*  5 |      TABLE ACCESS FULL   | TEST_TACCREV |      0 |  30441 |      0 |00:00:00.01 |       0 |       |       |       
    |   6 |     BUFFER SORT          |              |      0 |        |      0 |00:00:00.01 |       0 | 73728 | 73728 |          |
    |   7 |      PX RECEIVE          |              |      0 |  26050 |      0 |00:00:00.01 |       0 |       |       |          |
    |   8 |       PX SEND BROADCAST  | :TQ10000     |      0 |  26050 |      0 |00:00:00.01 |       0 |       |       |          |
    |   9 |        PX BLOCK ITERATOR |              |      0 |  26050 |      0 |00:00:00.01 |       0 |       |       |          |
    |* 10 |         TABLE ACCESS FULL| TEST_TACPROF |      0 |  26050 |      0 |00:00:00.01 |       0 |       |       |          |
    rollback;
    A-rows are zero execpt for final step.

    I'm sorry for posting following long test case.
    But it's the most convenient way to explain something. :-)
    Here is my test case, which is quite similar to yours.
    Note on the difference between "parallel select" and "parallel dml(insert here)".
    (I know that Oracle implemented psc(parallel single cursor) model in 10g, but the details of the implementation is quite in mystery as Jonathan said... )
    SQL> select * from v$version;
    BANNER                                                                         
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod               
    PL/SQL Release 10.2.0.1.0 - Production                                         
    CORE     10.2.0.1.0     Production                                                     
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production                        
    NLSRTL Version 10.2.0.1.0 - Production                                         
    SQL>
    SQL> alter system flush shared_pool;
    System altered.
    SQL>
    SQL> alter table t parallel 4;
    Table altered.
    SQL>
    SQL> select /*+ gather_plan_statistics */ count(*) from t t1, t t2
      2  where t1.c1 = t2.c1 and rownum <= 1000
      3  order by t1.c2;
      COUNT(*)                                                                     
          1000                                                                     
    SQL>
    SQL> select sql_id from v$sqlarea
    where sql_text like 'select /*+ gather_plan_statistics */ count(*) from t t1, t t2%';
    SQL_ID                                                                         
    bx61bkyh9ffb6                                                                  
    SQL>
    SQL> select * from table(dbms_xplan.display_cursor('&sql_id',null,'allstats last'));
    Enter value for sql_id: bx61bkyh9ffb6
    PLAN_TABLE_OUTPUT                                                              
    SQL_ID  bx61bkyh9ffb6, child number 0          <-- Cooridnator and slaves shared the cursor                          
    select /*+ gather_plan_statistics */ count(*) from t t1, t t2 where t1.c1 = t2.c
    1 and rownum <= 1000 order by t1.c2                                            
    Plan hash value: 3015647771                                                    
    PLAN_TABLE_OUTPUT                                                              
    | Id  | Operation                  | Name     | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |                               
    |   1 |  SORT AGGREGATE            |          |      1 |      1 |      1 |00:00:00.62 |       6 |       |       |          |                                   
    |*  2 |   COUNT STOPKEY            |          |      1 |        |   1000 |00:00:00.62 |       6 |       |       |          |                                   
    |   3 |    PX COORDINATOR          |          |      1 |        |   1000 |00:00:00.50 |       6 |       |       |          |                                   
    |   4 |     PX SEND QC (RANDOM)    | :TQ10002 |      0 |     16M|      0 |00:00:00.01 |       0 |       |       |          |                                   
    |*  5 |      COUNT STOPKEY         |          |      0 |        |      0 |00:00:00.01 |       0 |       |       |          |                                   
    |*  6 |       HASH JOIN BUFFERED   |          |      0 |     16M|      0 |00:00:00.01 |       0 |  1285K|  1285K|  717K (0)|                                   
    |   7 |        PX RECEIVE          |          |      0 |  10000 |      0 |00:00:00.01 |       0 |       |       |          |                                   
    |   8 |         PX SEND HASH       | :TQ10000 |      0 |  10000 |      0 |00:00:00.01 |       0 |       |       |          |                                   
    |   9 |          PX BLOCK ITERATOR |          |      0 |  10000 |      0 |00:00:00.01 |       0 |       |       |          |                                   
    |* 10 |           TABLE ACCESS FULL| T        |      0 |  10000 |      0 |00:00:00.01 |       0 |       |       |          |                                   
    |  11 |        PX RECEIVE          |          |      0 |  10000 |      0 |00:00:00.01 |       0 |       |       |          |                                   
    |  12 |         PX SEND HASH       | :TQ10001 |      0 |  10000 |      0 |00:00:00.01 |       0 |       |       |          |                                   
    |  13 |          PX BLOCK ITERATOR |          |      0 |  10000 |      0 |00:00:00.01 |       0 |       |       |          |                                   
    |* 14 |           TABLE ACCESS FULL| T        |      0 |  10000 |      0 |00:00:00.01 |       0 |       |       |          |                                   
    38 rows selected.
    SQL>
    SQL> select sql_id, child_number, executions, px_servers_executions
      2  from v$sql where sql_id = '&sql_id';
    SQL_ID                                  CHILD_NUMBER EXECUTIONS                
    PX_SERVERS_EXECUTIONS                                                          
    bx61bkyh9ffb6                                      0          1                
                        8                                                          
    SQL>
    SQL> insert /*+ gather_plan_statistics */ into t select * from t;
    10000 rows created.
    SQL>
    SQL> select sql_id from v$sqlarea
    where sql_text like 'insert /*+ gather_plan_statistics */ into t select * from t%';
    SQL_ID                                                                         
    9dkmu9bdhg5h0                                                                  
    SQL>
    SQL> select * from table(dbms_xplan.display_cursor('&sql_id', null, 'allstats last'));
    Enter value for sql_id: 9dkmu9bdhg5h0
    PLAN_TABLE_OUTPUT                                                              
    SQL_ID  9dkmu9bdhg5h0, child number 0       <-- Coordinator Cursor                         
    insert /*+ gather_plan_statistics */ into t select * from t                    
    Plan hash value: 3050126167                                                    
    | Id  | Operation            | Name     | Starts | E-Rows | A-Rows |   A-Time   | Buffers |                                                                    
    |   1 |  PX COORDINATOR      |          |      1 |        |  10000 |00:00:00.20 |       3 |                                                                    
    |   2 |   PX SEND QC (RANDOM)| :TQ10000 |      0 |  10000 |      0 |00:00:00.01 |       0 |                                                                    
    |   3 |    PX BLOCK ITERATOR |          |      0 |  10000 |      0 |00:00:00.01 |       0 |                                                                    
    |*  4 |     TABLE ACCESS FULL| T        |      0 |  10000 |      0 |00:00:00.01 |       0 |                                                                    
    SQL_ID  9dkmu9bdhg5h0, child number 1        <-- Slave(s)
    insert /*+ gather_plan_statistics */ into t select * from t                    
    PLAN_TABLE_OUTPUT                                                              
    Plan hash value: 3050126167                                                    
    | Id  | Operation            | Name     | Starts | E-Rows | A-Rows |   A-Time  | Buffers |                                                                    
    |   1 |  PX COORDINATOR      |          |      0 |        |      0 |00:00:00.01 |       0 |                                                                    
    |   2 |   PX SEND QC (RANDOM)| :TQ10000 |      0 |  10000 |      0 |00:00:00.01 |       0 |                                                                    
    |   3 |    PX BLOCK ITERATOR |          |      1 |  10000 |   2628 |00:00:00.20 |      16 |                                                                    
    |*  4 |     TABLE ACCESS FULL| T        |      4 |  10000 |   2628 |00:00:00.02 |      16 |                                                                    
    SQL>
    SQL> select sql_id, child_number, executions, px_servers_executions
      2  from v$sql where sql_id = '&sql_id';  <-- 2 child cursors here
    SQL_ID                                  CHILD_NUMBER EXECUTIONS                
    PX_SERVERS_EXECUTIONS                                                          
    9dkmu9bdhg5h0                                      0          1                
                        0                                                          
    9dkmu9bdhg5h0                                      1          0                
                        4                                                          
    SQL>
    SQL> set serveroutput on
    -- check mismatch
    SQL> exec print_table('select * from v$sql_shared_cursor where sql_id = ''&sql_id''');
    Enter value for sql_id: 9dkmu9bdhg5h0
    SQL_ID                        : 9dkmu9bdhg5h0                                  
    ADDRESS                       : 6AD85A70                                       
    CHILD_ADDRESS                 : 6BA596A8                                       
    CHILD_NUMBER                  : 0                                              
    UNBOUND_CURSOR                : N                                              
    SQL_TYPE_MISMATCH             : N                                              
    OPTIMIZER_MISMATCH            : N                                              
    OUTLINE_MISMATCH              : N                                              
    STATS_ROW_MISMATCH            : N                                              
    LITERAL_MISMATCH              : N                                              
    SEC_DEPTH_MISMATCH            : N                                              
    EXPLAIN_PLAN_CURSOR           : N                                              
    BUFFERED_DML_MISMATCH         : N                                              
    PDML_ENV_MISMATCH             : N                                              
    INST_DRTLD_MISMATCH           : N                                              
    SLAVE_QC_MISMATCH             : N                                              
    TYPECHECK_MISMATCH            : N                                              
    AUTH_CHECK_MISMATCH           : N                                              
    BIND_MISMATCH                 : N                                              
    DESCRIBE_MISMATCH             : N                                              
    LANGUAGE_MISMATCH             : N                                              
    TRANSLATION_MISMATCH          : N                                              
    ROW_LEVEL_SEC_MISMATCH        : N                                              
    INSUFF_PRIVS                  : N                                              
    INSUFF_PRIVS_REM              : N                                              
    REMOTE_TRANS_MISMATCH         : N                                              
    LOGMINER_SESSION_MISMATCH     : N                                              
    INCOMP_LTRL_MISMATCH          : N                                              
    OVERLAP_TIME_MISMATCH         : N                                              
    SQL_REDIRECT_MISMATCH         : N                                              
    MV_QUERY_GEN_MISMATCH         : N                                              
    USER_BIND_PEEK_MISMATCH       : N                                              
    TYPCHK_DEP_MISMATCH           : N                                              
    NO_TRIGGER_MISMATCH           : N                                              
    FLASHBACK_CURSOR              : N                                              
    ANYDATA_TRANSFORMATION        : N                                              
    INCOMPLETE_CURSOR             : N                                              
    TOP_LEVEL_RPI_CURSOR          : N                                              
    DIFFERENT_LONG_LENGTH         : N                                              
    LOGICAL_STANDBY_APPLY         : N                                              
    DIFF_CALL_DURN                : N                                              
    BIND_UACS_DIFF                : N                                              
    PLSQL_CMP_SWITCHS_DIFF        : N                                              
    CURSOR_PARTS_MISMATCH         : N                                              
    STB_OBJECT_MISMATCH           : N                                              
    ROW_SHIP_MISMATCH             : N                                              
    PQ_SLAVE_MISMATCH             : N                                              
    TOP_LEVEL_DDL_MISMATCH        : N                                              
    MULTI_PX_MISMATCH             : N                                              
    BIND_PEEKED_PQ_MISMATCH       : N                                              
    MV_REWRITE_MISMATCH           : N                                              
    ROLL_INVALID_MISMATCH         : N                                              
    OPTIMIZER_MODE_MISMATCH       : N                                              
    PX_MISMATCH                   : N                                              
    MV_STALEOBJ_MISMATCH          : N                                              
    FLASHBACK_TABLE_MISMATCH      : N                                              
    LITREP_COMP_MISMATCH          : N                                              
    SQL_ID                        : 9dkmu9bdhg5h0                                  
    ADDRESS                       : 6AD85A70                                       
    CHILD_ADDRESS                 : 6B10AA00                                       
    CHILD_NUMBER                  : 1                                              
    UNBOUND_CURSOR                : N                                              
    SQL_TYPE_MISMATCH             : N                                              
    OPTIMIZER_MISMATCH            : N                                              
    OUTLINE_MISMATCH              : N                                              
    STATS_ROW_MISMATCH            : N                                              
    LITERAL_MISMATCH              : N                                              
    SEC_DEPTH_MISMATCH            : N                                              
    EXPLAIN_PLAN_CURSOR           : N                                              
    BUFFERED_DML_MISMATCH         : N                                              
    PDML_ENV_MISMATCH             : N                                              
    INST_DRTLD_MISMATCH           : N                                              
    SLAVE_QC_MISMATCH             : N                                              
    TYPECHECK_MISMATCH            : N                                              
    AUTH_CHECK_MISMATCH           : N                                              
    BIND_MISMATCH                 : N                                              
    DESCRIBE_MISMATCH             : N                                              
    LANGUAGE_MISMATCH             : N                                              
    TRANSLATION_MISMATCH          : N                                              
    ROW_LEVEL_SEC_MISMATCH        : N                                              
    INSUFF_PRIVS                  : N                                              
    INSUFF_PRIVS_REM              : N                                              
    REMOTE_TRANS_MISMATCH         : N                                              
    LOGMINER_SESSION_MISMATCH     : N                                              
    INCOMP_LTRL_MISMATCH          : N                                              
    OVERLAP_TIME_MISMATCH         : N                                              
    SQL_REDIRECT_MISMATCH         : N                                              
    MV_QUERY_GEN_MISMATCH         : N                                              
    USER_BIND_PEEK_MISMATCH       : N                                              
    TYPCHK_DEP_MISMATCH           : N                                              
    NO_TRIGGER_MISMATCH           : N                                              
    FLASHBACK_CURSOR              : N                                              
    ANYDATA_TRANSFORMATION        : N                                              
    INCOMPLETE_CURSOR             : N                                              
    TOP_LEVEL_RPI_CURSOR          : N                                              
    DIFFERENT_LONG_LENGTH         : N                                              
    LOGICAL_STANDBY_APPLY         : N                                              
    DIFF_CALL_DURN                : Y      <-- Mismatch here. diff_call_durn
    BIND_UACS_DIFF                : N                                              
    PLSQL_CMP_SWITCHS_DIFF        : N                                              
    CURSOR_PARTS_MISMATCH         : N                                              
    STB_OBJECT_MISMATCH           : N                                              
    ROW_SHIP_MISMATCH             : N                                              
    PQ_SLAVE_MISMATCH             : N                                              
    TOP_LEVEL_DDL_MISMATCH        : N                                              
    MULTI_PX_MISMATCH             : N                                              
    BIND_PEEKED_PQ_MISMATCH       : N                                              
    MV_REWRITE_MISMATCH           : N                                              
    ROLL_INVALID_MISMATCH         : N                                              
    OPTIMIZER_MODE_MISMATCH       : N                                              
    PX_MISMATCH                   : N                                              
    MV_STALEOBJ_MISMATCH          : N                                              
    FLASHBACK_TABLE_MISMATCH      : N                                              
    LITREP_COMP_MISMATCH          : N                                              
    PL/SQL procedure successfully completed.

  • BUG 11930680 & APEX_040100

    I am finding this bug 11930680 is affecting my APEX 4.1.1 install.. I am Running 11.2.0.1 on Redhat linux
    eg
    I get 21 versions of this SQL in APEX_040100 in v$sql_shared_cursor, with reasons AUTH_CHECK_MISMATCH LANGUAGE_MISMATCH
    SELECT SHORTCUT_NAME, ID
    FROM WWV_FLOW_SHORTCUTS
    WHERE FLOW_ID = :B3 AND (BUILD_OPTION IS NULL OR (BUILD_OPTION &gt; 0 AND (:B2 IS NULL OR INSTR(:B2 ,':'||BUILD_OPTION||':') = 0) ) OR (BUILD_OPTION &lt; 0 AND (:B1 IS NOT NULL AND INSTR(:B1 ,':'||(0-BUILD_OPTION)||':') = 0) ) )
    ORDER BY SHORTCUT_NAMEAny many, many other APEX_040100 SQLs having same issue, which I think is slowing down APEX
    Should I
    - Grant MERGE ANY VIEW to SYS (as per http://magnusjohanssontuning.wordpress.com/2012/08/01/cursor-not-shared-for-different-users/)
    - set optimizer_secure_view_merging=false (as per oracle Workaround)
    Anyone have similar problems?
    This is My SQL to find problem SQLs.. try it on your apex system
    select version_count,address,hash_value,parsing_schema_name,reason,sql_text from (
    select
    address,''
    ||decode(max(                UNBOUND_CURSOR),'Y',               ' UNBOUND_CURSOR')
    ||decode(max(             SQL_TYPE_MISMATCH),'Y',            ' SQL_TYPE_MISMATCH')
    ||decode(max(            OPTIMIZER_MISMATCH),'Y',           ' OPTIMIZER_MISMATCH')
    ||decode(max(              OUTLINE_MISMATCH),'Y',             ' OUTLINE_MISMATCH')
    ||decode(max(            STATS_ROW_MISMATCH),'Y',           ' STATS_ROW_MISMATCH')
    ||decode(max(              LITERAL_MISMATCH),'Y',             ' LITERAL_MISMATCH')
    ||decode(max(           EXPLAIN_PLAN_CURSOR),'Y',          ' EXPLAIN_PLAN_CURSOR')
    ||decode(max(         BUFFERED_DML_MISMATCH),'Y',        ' BUFFERED_DML_MISMATCH')
    ||decode(max(             PDML_ENV_MISMATCH),'Y',            ' PDML_ENV_MISMATCH')
    ||decode(max(           INST_DRTLD_MISMATCH),'Y',          ' INST_DRTLD_MISMATCH')
    ||decode(max(             SLAVE_QC_MISMATCH),'Y',            ' SLAVE_QC_MISMATCH')
    ||decode(max(            TYPECHECK_MISMATCH),'Y',           ' TYPECHECK_MISMATCH')
    ||decode(max(           AUTH_CHECK_MISMATCH),'Y',          ' AUTH_CHECK_MISMATCH')
    ||decode(max(                 BIND_MISMATCH),'Y',                ' BIND_MISMATCH')
    ||decode(max(             DESCRIBE_MISMATCH),'Y',            ' DESCRIBE_MISMATCH')
    ||decode(max(             LANGUAGE_MISMATCH),'Y',            ' LANGUAGE_MISMATCH')
    ||decode(max(          TRANSLATION_MISMATCH),'Y',         ' TRANSLATION_MISMATCH')
    ||decode(max(                  INSUFF_PRIVS),'Y',                 ' INSUFF_PRIVS')
    ||decode(max(              INSUFF_PRIVS_REM),'Y',             ' INSUFF_PRIVS_REM')
    ||decode(max(         REMOTE_TRANS_MISMATCH),'Y',        ' REMOTE_TRANS_MISMATCH')
    ||decode(max(     LOGMINER_SESSION_MISMATCH),'Y',    ' LOGMINER_SESSION_MISMATCH')
    ||decode(max(          INCOMP_LTRL_MISMATCH),'Y',         ' INCOMP_LTRL_MISMATCH')
    ||decode(max(         OVERLAP_TIME_MISMATCH),'Y',        ' OVERLAP_TIME_MISMATCH')
    ||decode(max(         MV_QUERY_GEN_MISMATCH),'Y',        ' MV_QUERY_GEN_MISMATCH')
    ||decode(max(       USER_BIND_PEEK_MISMATCH),'Y',      ' USER_BIND_PEEK_MISMATCH')
    ||decode(max(           TYPCHK_DEP_MISMATCH),'Y',          ' TYPCHK_DEP_MISMATCH')
    ||decode(max(           NO_TRIGGER_MISMATCH),'Y',          ' NO_TRIGGER_MISMATCH')
    ||decode(max(              FLASHBACK_CURSOR),'Y',             ' FLASHBACK_CURSOR')
    ||decode(max(        ANYDATA_TRANSFORMATION),'Y',       ' ANYDATA_TRANSFORMATION')
    ||decode(max(          TOP_LEVEL_RPI_CURSOR),'Y',         ' TOP_LEVEL_RPI_CURSOR')
    ||decode(max(         DIFFERENT_LONG_LENGTH),'Y',        ' DIFFERENT_LONG_LENGTH')
    ||decode(max(         LOGICAL_STANDBY_APPLY),'Y',        ' LOGICAL_STANDBY_APPLY')
    ||decode(max(                DIFF_CALL_DURN),'Y',               ' DIFF_CALL_DURN')
    ||decode(max(                BIND_UACS_DIFF),'Y',               ' BIND_UACS_DIFF')
    ||decode(max(        PLSQL_CMP_SWITCHS_DIFF),'Y',       ' PLSQL_CMP_SWITCHS_DIFF')
    ||decode(max(         CURSOR_PARTS_MISMATCH),'Y',        ' CURSOR_PARTS_MISMATCH')
    ||decode(max(           STB_OBJECT_MISMATCH),'Y',          ' STB_OBJECT_MISMATCH')
    ||decode(max(             PQ_SLAVE_MISMATCH),'Y',            ' PQ_SLAVE_MISMATCH')
    ||decode(max(        TOP_LEVEL_DDL_MISMATCH),'Y',       ' TOP_LEVEL_DDL_MISMATCH')
    ||decode(max(             MULTI_PX_MISMATCH),'Y',            ' MULTI_PX_MISMATCH')
    ||decode(max(       BIND_PEEKED_PQ_MISMATCH),'Y',      ' BIND_PEEKED_PQ_MISMATCH')
    ||decode(max(           MV_REWRITE_MISMATCH),'Y',          ' MV_REWRITE_MISMATCH')
    ||decode(max(         ROLL_INVALID_MISMATCH),'Y',        ' ROLL_INVALID_MISMATCH')
    ||decode(max(       OPTIMIZER_MODE_MISMATCH),'Y',      ' OPTIMIZER_MODE_MISMATCH')
    ||decode(max(                   PX_MISMATCH),'Y',                  ' PX_MISMATCH')
    ||decode(max(          MV_STALEOBJ_MISMATCH),'Y',         ' MV_STALEOBJ_MISMATCH')
    ||decode(max(      FLASHBACK_TABLE_MISMATCH),'Y',     ' FLASHBACK_TABLE_MISMATCH')
    ||decode(max(          LITREP_COMP_MISMATCH),'Y',         ' LITREP_COMP_MISMATCH')
    reason
    from
       v$sql_shared_cursor
    group by
       address
    ) join v$sqlarea using(address) where version_count>2
    and parsing_schema_name like 'APEX_0%'
    order by version_count desc,address;

    Hi,
    are you sure that you are calling f from schema apex_040100 and not from the previous version? As a test, can you prefix your call with apex_040100.f
    If you check your error/access logs of Apache and mod_plsql, do you see any errors?
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Cursor_sharing改成force,会引起什么bug吗?

    公司的数据库内有一套老的应用,跑了好多年了,但没有绑定变量,导致SQLAREA占用大量资源
    我想将cursor_sharing改成force,会不会引起bug
    我在此之前将此参数similar ,应用会报错
    数据库版 10.2.0.4 64bit
    SELECT substr(sql_text, 1, 40) "SQL", count(*), sum(executions) "TotExecs"
    FROM v$sqlarea
    WHERE executions < 5
    GROUP BY substr(sql_text, 1, 40) HAVING count(*) > 30 ORDER BY 2 desc;
    结果为
    1     SELECT …………     22625     23047
    2     insert …………     21437     21437
    3     insert …………     21429     21429
    4     select …………     19464     22630
    5     delete …………     18655     18655
    6     INSERT …………     18078     20520
    7     SELECT …………     13218     15798
    8     INSERT …………     9060     9060
    9     INSERT …………     9060     9060
    10     select ………… 7870     8451
    11     insert …………     7837     8350
    12     select …………     7790     7790
    13     select …………     7789     7789
    14     insert …………     7768     7937
    15     SELECT …………     7716     9052
    16     insert …………     6636     6643
    17     SELECT …………     6392     6392
    18     UPDATE …………     6077     6439
    19     SELECT …………     6027     6389
    20     update …………     4414     4414
    21     INSERT …………     4018     4016

    1. 不推荐在任何版本上继续使用 CURSOR_SHARING=SIMILAR
    2. cursor_sharing=force 在某些特性条件下会触发bug, 主要是在低版本(9iR2,10gR2早期),具体是否触发bug取决于SQL的写法。
    建议你直接参考以下 10.2.0.4上cursor_sharing的 bug list:
    NB     Bug     Fixed     Description
    12862170     12.1.0.0     INSERT ALL fails with ORA-600[kkslhsh1] with CURSOR_SHARING enabled / High Version Count on HASH_MATCH_FAILED
    12374212     11.2.0.3, 12.1.0.0     Assorted dump , internal errors, memory corruptions with cursor_sharing = force
    12334286     11.2.0.3, 12.1.0.0     High version counts with CURSOR_SHARING=FORCE (BIND_MISMATCH and INCOMP_LTRL_MISMATCH)
    11063191     11.2.0.2.7, 11.2.0.2.BP17, 11.2.0.3.2, 11.2.0.3.BP04, 12.1.0.0     ORA-4031 with hint /*+ CURSOR_SHARING_EXACT */ - excessive "KKSSP^nn" memory
    10013170     11.2.0.3, 12.1.0.0     ORA-600 [736] from literal replacement with a "WAIT n" clause
    9877964     11.2.0.3, 12.1.0.0     ORA-600 [19003] raised by LIKE :BIND in query
    9680430     11.2.0.3, 12.1.0.0     High version count with CURSOR_SHARING = FORCE due to CBO transformation
    9411496     11.2.0.2, 12.1.0.0     ORA-979 on GROUP BY query with CURSOR_SHARING set
    9362218     11.2.0.2, 12.1.0.0     Literals replaced by binds when CURSOR_SHARING=EXACT
    9348402     12.1.0.0     OERI [kks-hash-collision] can occur with CURSOR_SHARING=FORCE|SIMILAR
    9223586     11.2.0.2, 12.1.0.0     Problems with variable length NCHAR literals with cursor sharing
    9031183     11.2.0.2, 12.1.0.0     ORA-1722 with CURSOR_SHARING=SIMILAR and with NCHAR
    8246445     11.2.0.2, 12.1.0.0     Query rewrite not working for multi-MV rewrite with literal replacement
    5751866     11.2.0.2     Wrong Results with CASE and CURSOR_SHARING
    9767674     10.2.0.5.5     Dump [kkslmtl] using CURSOR_SHARING - superceded
    8794693     11.2.0.2     Dump [kkscsmtl] using literal replacement (CURSOR_SHARING)
    8453245     11.2.0.1     Many child cursors with CURSOR_SHARING = FORCE
    8264642     11.2.0.1     ORA-600 [kkexbindopn0] with CURSOR_SHARING = SIMILAR
    7516867     10.2.0.5, 11.1.0.7.1, 11.2.0.1     Intermittent Wrong results from literal replacement with fix for bug 6163785
    7272297     10.2.0.4.1, 10.2.0.5, 11.1.0.7, 11.2.0.1     Memory corruption / OERI[17114] / OERI[17125] with literal replacement
    6337716     10.2.0.5, 11.1.0.7, 11.2.0.1     Wrong max column size for NULL strings with literal replacement
    4071519     10.2.0.5, 11.1.0.7, 11.2.0.1     GROUP BY query with CURSOR_SHARING fails with ORA-1802
    3461251     11.1.0.7, 11.2.0.1     V$SQL_SHARED_CURSOR shows all N with CURSOR_SHARING
    7296258     10.2.0.5, 11.1.0.7.1     Intermittent Wrong results from literal replacement and remote objects
    6163785     10.2.0.5, 11.1.0.7     Intermittent Wrong Results with dblink and cursor_sharing
    8202234          Intermittent Wrong Results with dblink and cursor_sharing
    4867724     10.2.0.5, 11.1.0.6     Literal replacement limits column names to 30 characters

  • Ora-4031 after reducing the max sga

    Oracle 10g R2 and Baan 5c on AIX 5.3 L (p550, 3792M , 4 lcpu)
    After I reduced the max_sga_size (so to avoid the paging), now I see more ora-4031 (out of shared memory loading library cache object) warnings in the udump trc file, not in alert file. In addition, they appeared in the log.ora.sql of Baan as an error message, so the query requests were hung or stopped.
    Reading from other posts and metalink note: 146599.1, it indicated that the system has extensive fragmentation problem. (REQUEST_FAILURES is > 0 and LAST_FAILURE_SIZE is > SHARED_POOL_RESERVED_MIN_ALLOC. )
    So I used the tips form AskTom to find the query scripts that may have bind variable problem and I did found some, most of them in 2~4 multiples. However, not all of them gave ora-4031 warning/error, actually only very few.
    So what should I do for the best practice of the performance? Correct the problems with the bind variable of all queries or
    increase the max SGA again.
    All the queries were produced by the Baan´s processes or modules.

    I got hit this thread while searching some other subjects.
    (This is kind of old... but answered for a long time)
    I think this is somewhat interesting problem.
    Here is one query showing in the query of mulitple copies in system by using asktom technique. The system return 3 copies.
    SELECT /*+ FIRST_ROWS INDEX(A TTSSOC@$IDX@) */ A.T$CLST FROM >BAANDB.TTSSOC@ A WHERE (A.T$CLST = :@ OR A.T$CLST = :@) AND A.T$ORNO = :@I think there is a chance that you're hitting bind mismatch problem.
    Is [email protected]$CLST(What an annoying names~) column is VARCHAR2 type? If yes, following thread will be helpful.
    Re: Is there any way to avoid hard parsing caused by "BIND_MISMATCH" in 10g

  • "latch: row cache objects" and high "VERSION_COUNT"

    Hello,
    we are being faced with a situation where the database spends most of it's time waiting for latches in the shared pool (as seen in the AWR report).
    All statements issued by the application are using bind variables, but what we can see in V$SQL is that even though the statements are using bind variables some of them have a relatively high version_count (> 300) and many invaliadations (100 - 200) even though the tables involved are very small (some not more than 3 or 4 rows).
    Here is some (hopefully enough) information about the environment
    Version: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production (on RedHat EL 5)
    Parameters:
    cursor_bind_capture_destination       memory+disk
    cursor_sharing                        EXACT
    cursor_space_for_time                 FALSE
    filesystemio_options                  none
    hi_shared_memory_address              0
    memory_max_target                     12288M
    memory_target                         12288M
    object_cache_optimal_size             102400
    open_cursors                          300
    optimizer_capture_sql_plan_baselines  FALSE
    optimizer_dynamic_sampling            2
    optimizer_features_enable             11.2.0.2
    optimizer_index_caching               0
    optimizer_index_cost_adj              100
    optimizer_mode                        ALL_ROWS
    optimizer_secure_view_merging         TRUE
    optimizer_use_invisible_indexes       FALSE
    optimizer_use_pending_statistics      FALSE
    optimizer_use_sql_plan_baselines      TRUE
    plsql_optimize_level                  2
    session_cached_cursors                50
    shared_memory_address                 0The shared pool size (according to AWR) is 4,832M     
    The buffer cache is 3,008M     
    Now, my question: is a version_count of > 300 a problem (we have about 10-15 of those with a total of ~7000 statements in v$sqlarea). Those are also the statements listed in the AWR report at the top in the section "SQL ordered by Version Count" and "SQL ordered by Sharable Memory"
    Is it possible that those statements are causing the the latch contention in the shared pool?
    I went through https://blogs.oracle.com/optimizer/entry/why_are_there_more_cursors_in_11g_for_my_query_containing_bind_variables_1
    The tables involved are fairly small and all the execution plans for each cursor are identical.
    I can understand some of the invalidations that happen, because we have 7 schemas that have identical tables, but from my understanding that shouldn't cause such a high invalidation number. Or am I mistaken?
    I'm not that experienced with Oracle tuning at that level, so I would appreciate any pointer on how I can find out where exactly the latch problem occurs
    After flushing the shared pool, the problem seems to go away for a while. But apparently that is only fighting symptoms, not fixing the root cause of the problem.
    Some of the statements in question:
    SELECT * FROM QRTZ_SIMPLE_TRIGGERS WHERE TRIGGER_NAME = :1 AND TRIGGER_GROUP = :2
    UPDATE QRTZ_TRIGGERS SET TRIGGER_STATE = :1 WHERE TRIGGER_NAME = :2 AND TRIGGER_GROUP = :3 AND TRIGGER_STATE = :4
    UPDATE QRTZ_TRIGGERS SET TRIGGER_STATE = :1 WHERE JOB_NAME = :2 AND JOB_GROUP = :3 AND TRIGGER_STATE = :4
    SELECT TRIGGER_STATE FROM QRTZ_TRIGGERS WHERE TRIGGER_NAME = :1 AND TRIGGER_GROUP = :2
    UPDATE QRTZ_SIMPLE_TRIGGERS SET REPEAT_COUNT = :1, REPEAT_INTERVAL = :2, TIMES_TRIGGERED = :3 WHERE TRIGGER_NAME = :4 AND TRIGGER_GROUP = :5
    DELETE FROM QRTZ_TRIGGER_LISTENERS WHERE TRIGGER_NAME = :1 AND TRIGGER_GROUP = :2So all of them are using bind variables.
    I have seen that the columns used in the where clause all have histograms available. Would removing them reduce the number of invalidations?
    Unfortunately I did not save the information from v$sql_shared_cursor before the shared pool was flushed, but most of the invalidations occurred in the ROLL_INVALID_MISMATCH column if that is of any help. There are some invalidations reported for AUTH_CHECK_MISMATCH and TRANSLATION_MISMATCH but to my understanding they caused by executing the statement for different schemas if I'm not mistaken.
    Looking at v$latch_missed, most of the waits for parent = 'row cache objects' are for "kqrpre: find obj" and "kqreqd: reget"

    >
    In the AWR report, what does the Dictionary Cache Stats section say?
    >
    Here they are:
    Dictionary Cache Stats                                                                                                     
    Cache                 Get Requests      Pct Miss     Scan Reqs    Mod Reqs      Final Usage                                
    dc_awr_control        65                0.00         0            2             1                                          
    dc_constraints        729               33.33        0            729           1                                          
    dc_global_oids        60                23.33        0            0             31                                         
    dc_histogram_data     7,397             10.53        0            0             2,514                                      
    dc_histogram_defs     21,797            9.83         0            0             5,239                                      
    dc_object_grants      4                 25.00        0            0             12                                         
    dc_objects            27,683            2.29         0            223           2,581                                      
    dc_profiles           1,842             0.00         0            0             1                                          
    dc_rollback_segments  1,634             0.00         0            0             39                                         
    dc_segments           7,335             6.94         0            360           1,679                                      
    dc_sequences          139               5.76         0            139           19                                         
    dc_table_scns         53                100.00       0            0             0                                          
    dc_tablespace_quotas  1,956             0.10         0            0             4                                          
    dc_tablespaces        17,488            0.00         0            0             11                                         
    dc_users              58,013            0.03         0            0             164                                        
    global database name  4,261             0.00         0            0             1                                          
    outstanding_alerts    54                0.00         0            0             9                                          
    sch_lj_oids           4                 0.00         0            0             2                                          
    Library Cache Activity                                                                                                     
    Namespace             Get Requests     Pct Miss     Pin Requests          Pct Miss      Reloads   Invalidations            
    ACCOUNT_STATUS        3,664            0.03         0                                   0         0                        
    BODY                  560              2.14         2,343                 0.60          0         0                        
    CLUSTER               52               0.00         52                    0.00          0         0                        
    DBLINK                3,668            0.00         0                                   0         0                        
    EDITION               1,857            0.00         3,697                 0.00          0         0                        
    INDEX                 99               19.19        99                    19.19         0         0                        
    OBJECT ID             68               100.00       0                                   0         0                        
    SCHEMA                2,646            0.00         0                                   0         0                        
    SQL AREA              32,996           2.26         1,142,497             0.21          189       226                      
    SQL AREA BUILD        848              62.15        0                                   0         0                        
    SQL AREA STATS        860              82.09        860                   82.09         0         0                        
    TABLE/PROCEDURE       17,713           2.62         26,112                4.88          61        0                        
    TRIGGER               1,704            2.00         6,737                 0.52          1         0                        

  • Huge version_count for cursor sharing for store method

    Hi,
    I'm using Oracle BPM 10.3.2, which is connected to database (11.2.0.3.0).
    For quite huge table with 250 columns and 10 000 rows we are using buil-in load and store method, which is available for BPMObject, which is created for database table.
    Build-in store method is updating always whole database object, no matter if any field was changed and all variables are bind so shared cursor are used.
    Unfortunately even if all updates are similar, database is creating new child because of "bind mismatch" of the variable.
    Bind mismatch is because, variable content is different and i.e. varchar2 can have 3 length 32, 128 and 2000 characters.
    If database find new combination of variable length to update, new version or cursor is created.
    Can I anyway force to use the same cursor for all updates (I've tried cursor_sharing parameter in sys.v_$parameter, but it doesn't work)?
    Any other ideas?
    BR,
    Wujek

    It might be that your shared pool is fragmented especially if your application is using literals and not using bind variables. High number of version count does not always mean a terrible thing, but most likely it is. You may also have bind_mismatch (the most common reason) that is causing your high version count of SQLs. Read about bind_mismatch and see if this could be the reason in your application. I suggest to execute the command 'alter system flush shared pool;' during idle time (at night when there is no activity) every day to clean up the SQLs that are considered a candidate to be flushed out of the shared pool. I am suggesting this because your application might using literals. REMEMBER, this is NOT a fix. It is just kind of Aspirin until you fix the real problem in your application. You may benchmark and see how it will perform. My last suggestion which is the most important, please think about upgrading your database. This version of Oracle is an old one and Oracle itself is not well supporting it.

Maybe you are looking for