What datadtype is a SQL Plan to be loaded?

Is the SQL Plan to loaded the pls_integer datatype?
See the following script. It define a SQL Plan as the pls_integer (similar with the integer datatype).
I can not imagine how can the a SQL plan be defined as the integer datatype?
To load plans from a SQL Tuning Set, use the LOAD_PLANS_FROM_SQLSET function of the DBMS_SPM package:
DECLARE
  my_plans pls_integer;
BEGIN
  my_plans := DBMS_SPM.LOAD_PLANS_FROM_SQLSET(
   sqlset_name => 'tset1');
END;
/

qkc wrote:
Is the SQL Plan to loaded the pls_integer datatype?
See the following script. It define a SQL Plan as the pls_integer (similar with the integer datatype).
I can not imagine how can the a SQL plan be defined as the integer datatype?
To load plans from a SQL Tuning Set, use the LOAD_PLANS_FROM_SQLSET function of the DBMS_SPM package:
DECLARE
my_plans pls_integer;
BEGIN
my_plans := DBMS_SPM.LOAD_PLANS_FROM_SQLSET(
sqlset_name => 'tset1');
END;
You seem to have a number of questions about DBMS_SPM, have you thought of consulting the documentation?
http://www.oracle.com/technology/documentation/index.html#database
If you're looking for a supplement to that, Morgans Library has lots of information as well.
http://www.morganslibrary.org/library.html

Similar Messages

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

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

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

  • SQL Plan Management (11.2.0.1)

    Hi Guys,
    I'm doing some testing as below.
    I tried to keep the SQL plan in baseline. (when the table has no index, as such performing full scan)
    However, after i create the index. It's not picking the original plan which i put it in baseline. It's using range scan.
    Can advise what have i done wrong?
    thanks!
    SQL> show parameter OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES;
    NAME TYPE VALUE
    optimizer_capture_sql_plan_baselines boolean FALSE
    SQL> CREATE TABLE spm_test_tab (
    2 id NUMBER,
    3 description VARCHAR2(50)
    4 );
    Table created.
    SQL>
    SQL> DECLARE
    2 TYPE t_tab IS TABLE OF spm_test_tab%ROWTYPE;
    3 l_tab t_tab := t_TAB();
    4 BEGIN
    5 FOR i IN 1 .. 10000 LOOP
    6 l_tab.extend;
    7 l_tab(l_tab.last).id := i;
    8 l_tab(l_tab.last).description := 'Description for ' || i;
    9 END LOOP;
    10
    11 FORALL i IN l_tab.first .. l_tab.last
    12 INSERT INTO spm_test_tab VALUES l_tab(i);
    13
    14 COMMIT;
    15 END;
    16 /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> EXEC DBMS_STATS.gather_table_stats(USER, 'SPM_TEST_TAB', cascade=>TRUE);
    PL/SQL procedure successfully completed.
    SQL> set linesize 2000
    SQL> set pagesize 2000
    SQL> SET AUTOTRACE TRACE
    SQL>
    SQL> SELECT description
    2 FROM spm_test_tab
    3 WHERE id = 99;
    Execution Plan
    Plan hash value: 3128910679
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 25 | 13 (0)| 00:00:01 |
    |* 1 | TABLE ACCESS FULL| SPM_TEST_TAB | 1 | 25 | 13 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    1 - filter("ID"=99)
    Statistics
    26 recursive calls
    5 db block gets
    49 consistent gets
    0 physical reads
    944 redo size
    228 bytes sent via SQL*Net to client
    239 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    1 rows processed
    SQL>
    SQL> set autotrace off;
    SQL>
    SQL> SELECT sql_id, sql_text
    2 FROM v$sql
    3 WHERE sql_text LIKE '%spm_test_tab%'
    4 AND sql_text NOT LIKE '%dba_sql_plan_baselines%'
    5 AND sql_text NOT LIKE '%EXPLAIN%';
    SQL_ID SQL_TEXT
    gat6z1bc6nc2d SELECT description FROM spm_test_tab WHERE id = 99
    44b32kmh8ub2g DECLARE TYPE t_tab IS TABLE OF spm_test_tab%ROWTYPE; l_tab t_tab := t_TAB(); BEGIN
    SQL> SET SERVEROUTPUT ON
    SQL> DECLARE
    2 l_plans_loaded PLS_INTEGER;
    3 BEGIN
    4 l_plans_loaded := DBMS_SPM.load_plans_from_cursor_cache(
    5 sql_id => 'gat6z1bc6nc2d');
    6
    7 DBMS_OUTPUT.put_line('Plans Loaded: ' || l_plans_loaded);
    8 END;
    9 /
    Plans Loaded: 1
    PL/SQL procedure successfully completed.
    SQL> SELECT sql_handle, plan_name, enabled, accepted
    2 FROM dba_sql_plan_baselines
    3 WHERE sql_text LIKE '%spm_test_tab%'
    4 AND sql_text NOT LIKE '%dba_sql_plan_baselines%';
    SQL_HANDLE PLAN_NAME ENA ACC
    SYS_SQL_7b76323ad90440b9 SQL_PLAN_7qxjk7bch8h5tb65c37c8 YES YES
    SQL>
    SQL> ALTER SYSTEM FLUSH SHARED_POOL;
    System altered.
    SQL>
    SQL> CREATE INDEX spm_test_tab_idx ON spm_test_tab(id);
    Index created.
    SQL> EXEC DBMS_STATS.gather_table_stats(USER, 'SPM_TEST_TAB', cascade=>TRUE);
    PL/SQL procedure successfully completed.
    SQL>
    SQL> SET AUTOTRACE TRACE
    SQL>
    SQL> SELECT description
    2 FROM spm_test_tab
    3 WHERE id = 99;
    Execution Plan
    Plan hash value: 2792204123
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 25 | 2 (0)| 00:00:01 |
    | 1 | TABLE ACCESS BY INDEX ROWID| SPM_TEST_TAB | 1 | 25 | 2 (0)| 00:00:01 |
    |* 2 | INDEX RANGE SCAN | SPM_TEST_TAB_IDX | 1 | | 1 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    2 - access("ID"=99)
    Statistics
    1072 recursive calls
    3 db block gets
    192 consistent gets
    0 physical reads
    888 redo size
    242 bytes sent via SQL*Net to client
    239 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    18 sorts (memory)
    0 sorts (disk)
    1 rows processed
    SQL> set autotrace off;
    SQL> SELECT sql_handle, plan_name, enabled, accepted
    2 FROM dba_sql_plan_baselines
    3 ;
    SQL_HANDLE PLAN_NAME ENA ACC
    SYS_SQL_7b76323ad90440b9 SQL_PLAN_7qxjk7bch8h5tb65c37c8 YES YES

    Check the value of OPTIMIZER_USE_SQL_PLAN_BASELINES.
    Double check the sql id and exact matching signature of both statements .
    Turn autotrace off, execute statement then use:
    SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,'ALLSTATS LAST'));to get the actual execution plan of the last executed statement in that session
    If in doubt, enable a SQL Plan Management trace:
    alter session set events 'trace[RDBMS.SQL_Plan_Management.*]';

  • Oracle 11g stats and SQL plan mgt

    Oracle 11.0.1.7:
    - According to what I have read so far in the various documents it looks like when dbms gather stats run and if that results in new sql plan oracle will not automatically start using that plan until it's verified by sql tuning advisor or is evolved. Is that correct? Is that the default behaviour?
    - I just upgraded from 10g to 11g so I am not sure how stats is behaving currently. I am really concerned and want to understand how it's behaving.
    - How can I tell what's going on currently in the system in terms of stats gathering and if the new better plan is being used or not.

    You have the default setting for the two parameters in place. That means, that if SQL Plan Baselines exist, they will be used, thereby preventing new execution plans from getting used without evolvement
    optimizer_use_sql_plan_baselines=true does that.
    But by default, there are no SQL Plan Baselines as long as you don't create them - for example with the setting of
    optimizer_capture_sql_plan_baselines=trueYou can check whether SQL Plan Baselines exist with
    select * from dba_sql_plan_baselines;It should return no rows.

  • SQL PLAN MANAGEMENT - Locking in a more 'expensive', better plan.?

    Environment: 11.2.0.3 on HP-UX Itanium.
    We're preparing for an upgrade of our main production database from 10.2.0.3 to 11.2.0.3. We're using SQL Tuning Sets to capture execution plans from the 10G environment and load them into the upgraded (test) environment as SQL Plan Baselines. We've been using SQL Performance Analyzer to identify plans which have regressed from 10G to 11G. For these regressed plans we wish to use SPM to lock in the better 10G plan.
    We've been successful in locking in the 10G plans for those regressed queries where the 11g CBO "Cost" of the query is higher than it is in 10g, however we have some examples where SPA has shown a performance regression for queries (measured in terms of elapsed time, or buffer gets or CPU time), but the 11G explain plan has a lower "cost" as identified by the CBO. Ie: the 11G "cost" is lower, but the plan is worse.
    For these small number of queries, I have not been able to get the 11G optimiser to choose the 10G plans even though they are "fixed, enabled and accepted" within SPM. The optimiser consistently chooses what it considers its "lower cost" plan, even though it is a worst plan. Am I missing something here or should it be possible, with the use of SPM to have the optimiser chose the 10G plan, regardless of what its internal cost says?
    SQL> show parameter baseline
    NAME                                 TYPE        VALUE
    optimizer_capture_sql_plan_baselines boolean     FALSE
    optimizer_use_sql_plan_baselines     boolean     TRUE

    I'm at a bit of a loss now as to where to proceed without posting the entire SPM Trace file, so excuse me for taking up so much bandwidth.
    But first some background. Our test databases should be identical in terms of schemas. That is we have a 10G prod database. From that we clone it to two test databases. One we leave at 10G, the other we upgrade to 11G. So there should be no schema differences between the 11G and 10G databases.
    h5.
    *** 2013-02-12 15:41:27.671
    SPM: statement found in SMB
    *** 2013-02-12 15:41:27.881
    SPM: fixed planId's of plan baseline are: 386463207
    SPM: using qksan to reproduce, cost and select accepted plan, sig = 17844158604836855983
    SPM: plan reproducibility round 1 (plan outline + session OFE)
    SPM: using qksan to reproduce accepted plan, planId = 386463207
    SPM: plan reproducibility - session OFE = 11020003, hinted OFE = 10020003
    SPM: planId in plan baseline = 386463207, planId of reproduced plan = 3080367404
    ------- START SPM Plan Dump -------
    SPM: failed to reproduce the plan using the following info:
      parse_schema name        : CARADM
      plan_baseline signature  : 17844158604836855983
      plan_baseline plan_id    : 386463207
      plan_baseline hintset    :
        hint num  1 len 27 text: IGNORE_OPTIM_EMBEDDED_HINTS
        hint num  2 len 37 text: OPTIMIZER_FEATURES_ENABLE('10.2.0.3')
        hint num  3 len 36 text: OPT_PARAM('_always_anti_join' 'off')
        hint num  4 len 36 text: OPT_PARAM('_always_semi_join' 'off')
        hint num  5 len 40 text: OPT_PARAM('_index_join_enabled' 'false')
        hint num  6 len 43 text: OPT_PARAM('_optim_peek_user_binds' 'false')
        hint num  7 len 49 text: OPT_PARAM('_optimizer_skip_scan_enabled' 'false')
        hint num  8 len 39 text: OPT_PARAM('optimizer_index_cost_adj' 1)
        hint num  9 len 40 text: OPT_PARAM('optimizer_index_caching' 100)
        hint num 10 len 10 text: FIRST_ROWS
        hint num 11 len 29 text: OUTLINE_LEAF(@"SEL$EE94F965")
        hint num 12 len 22 text: MERGE(@"SEL$9E43CB6E")
        hint num 13 len 17 text: OUTLINE(@"SEL$4")
        hint num 14 len 24 text: OUTLINE(@"SEL$9E43CB6E")
        hint num 15 len 22 text: MERGE(@"SEL$58A6D7F6")
        hint num 16 len 17 text: OUTLINE(@"SEL$3")
        hint num 17 len 24 text: OUTLINE(@"SEL$58A6D7F6")
        hint num 18 len 15 text: MERGE(@"SEL$1")
        hint num 19 len 17 text: OUTLINE(@"SEL$2")
        hint num 20 len 17 text: OUTLINE(@"SEL$1")
        hint num 21 len 36 text: FULL(@"SEL$EE94F965" "CPGR"@"SEL$1")
        hint num 22 len 153 text: INDEX(@"SEL$EE94F965" "CPGP"@"SEL$1" ("CL_PROVIDER_GROUP_PERIOD"."CPGR_ID" "CL_PROVIDER_GROUP_PERIOD"."CPDE_ID" "CL_PRO
    VIDER_GROUP_PERIOD"."START_DATE"))
        hint num 23 len 77 text: INDEX_RS_ASC(@"SEL$EE94F965" "CPDE"@"SEL$2" ("CL_PROVIDER_DETAIL"."CPDE_ID"))
        hint num 24 len 62 text: INDEX(@"SEL$EE94F965" "CFCO"@"SEL$3" ("FN_ACCOUNT"."CPDE_ID"))
        hint num 25 len 84 text: LEADING(@"SEL$EE94F965" "CPGR"@"SEL$1" "CPGP"@"SEL$1" "CPDE"@"SEL$2" "CFCO"@"SEL$3")
        hint num 26 len 38 text: USE_NL(@"SEL$EE94F965" "CPGP"@"SEL$1")
        hint num 27 len 38 text: USE_NL(@"SEL$EE94F965" "CPDE"@"SEL$2")
        hint num 28 len 38 text: USE_NL(@"SEL$EE94F965" "CFCO"@"SEL$3")
    SPM: generated non-matching plan:
    ----- Explain Plan Dump -----
    ----- Plan Table -----
    ============
    Plan Table
    ============
    -------------------------------------------------------------+-----------------------------------+
    | Id  | Operation                        | Name              | Rows  | Bytes | Cost  | Time      |
    -------------------------------------------------------------+-----------------------------------+
    | 0   | SELECT STATEMENT                 |                   |       |       |    22 |           |
    | 1   |  SORT UNIQUE                     |                   |    41 |  3116 |    21 |  00:00:01 |
    | 2   |   NESTED LOOPS                   |                   |       |       |       |           |
    | 3   |    NESTED LOOPS                  |                   |    41 |  3116 |    20 |  00:00:01 |
    | 4   |     NESTED LOOPS                 |                   |   826 |   50K |    11 |  00:00:01 |
    | 5   |      NESTED LOOPS                |                   |   826 |   26K |     3 |  00:00:01 |
    | 6   |       TABLE ACCESS FULL          | CL_PROVIDER_GROUP |   116 |  2668 |     2 |  00:00:01 |
    | 7   |       INDEX RANGE SCAN           | CPGP_UK           |     7 |    63 |     1 |  00:00:01 |
    | 8   |      TABLE ACCESS BY INDEX ROWID | CL_PROVIDER_DETAIL|     1 |    30 |     1 |  00:00:01 |
    | 9   |       INDEX UNIQUE SCAN          | CPDE_PK           |     1 |       |     1 |  00:00:01 |
    | 10  |     INDEX RANGE SCAN             | FACC_CPDE_FK_I    |     1 |       |     1 |  00:00:01 |
    | 11  |    TABLE ACCESS BY INDEX ROWID   | FN_ACCOUNT        |     1 |    14 |     1 |  00:00:01 |
    -------------------------------------------------------------+-----------------------------------+
    Predicate Information:
    7 - access("CPGR"."CPGR_ID"="CPGP"."CPGR_ID")
    9 - access("CPDE"."CPDE_ID"="CPGP"."CPDE_ID")
    10 - access("CPDE"."CPDE_ID"="CFCO"."CPDE_ID")
    10 - filter("CFCO"."CPDE_ID" IS NOT NULL)
    11 - filter((UPPER("CPGR"."NAME") LIKE UPPER('%'||:1||'%') OR UPPER("NAME") LIKE UPPER('%'||:2||'%') OR UPPER("ABN") LIKE UPPER(:3||'%') OR "CFCO"."A
    CCT_NO" LIKE UPPER(:4||'%')))
    Content of other_xml column
    ===========================
      db_version     : 11.2.0.3
      parse_schema   : CARADM
      plan_hash      : 524147661
      plan_hash_2    : 3080367404
      Outline Data:
      /*+
        BEGIN_OUTLINE_DATA
          IGNORE_OPTIM_EMBEDDED_HINTS
          OPTIMIZER_FEATURES_ENABLE('11.2.0.3')
          DB_VERSION('11.2.0.3')
          OPT_PARAM('_always_anti_join' 'off')
          OPT_PARAM('_always_semi_join' 'off')
          OPT_PARAM('_index_join_enabled' 'false')
          OPT_PARAM('_optim_peek_user_binds' 'false')
          OPT_PARAM('_optimizer_skip_scan_enabled' 'false')
          OPT_PARAM('optimizer_index_cost_adj' 1)
          OPT_PARAM('optimizer_index_caching' 100)
          FIRST_ROWS
          OUTLINE_LEAF(@"SEL$EE94F965")
          MERGE(@"SEL$9E43CB6E")
          OUTLINE(@"SEL$4")
          OUTLINE(@"SEL$9E43CB6E")
          MERGE(@"SEL$58A6D7F6")
          OUTLINE(@"SEL$3")
          OUTLINE(@"SEL$58A6D7F6")
          MERGE(@"SEL$1")
          OUTLINE(@"SEL$2")
          OUTLINE(@"SEL$1")
          FULL(@"SEL$EE94F965" "CPGR"@"SEL$1")
          INDEX(@"SEL$EE94F965" "CPGP"@"SEL$1" ("CL_PROVIDER_GROUP_PERIOD"."CPGR_ID" "CL_PROVIDER_GROUP_PERIOD"."CPDE_ID" "CL_PROVIDER_GROUP_PERIOD"."STA
    RT_DATE"))
          INDEX_RS_ASC(@"SEL$EE94F965" "CPDE"@"SEL$2" ("CL_PROVIDER_DETAIL"."CPDE_ID"))
          INDEX(@"SEL$EE94F965" "CFCO"@"SEL$3" ("FN_ACCOUNT"."CPDE_ID"))
          LEADING(@"SEL$EE94F965" "CPGR"@"SEL$1" "CPGP"@"SEL$1" "CPDE"@"SEL$2" "CFCO"@"SEL$3")
          USE_NL(@"SEL$EE94F965" "CPGP"@"SEL$1")
          USE_NL(@"SEL$EE94F965" "CPDE"@"SEL$2")
          USE_NL(@"SEL$EE94F965" "CFCO"@"SEL$3")
          NLJ_BATCHING(@"SEL$EE94F965" "CFCO"@"SEL$3")
        END_OUTLINE_DATA
    ------- END SPM Plan Dump -------
    SPM: plan reproducibility round 1 (plan outline only)
    SPM: using qksan to reproduce accepted plan, planId = 386463207
    SPM: planId in plan baseline = 386463207, planId of reproduced plan = 4009937738
    ------- START SPM Plan Dump -------
    SPM: failed to reproduce the plan using the following info:
      parse_schema name        : CARADM
      plan_baseline signature  : 17844158604836855983
      plan_baseline plan_id    : 386463207
      plan_baseline hintset    :
        hint num  1 len 27 text: IGNORE_OPTIM_EMBEDDED_HINTS
        hint num  2 len 37 text: OPTIMIZER_FEATURES_ENABLE('10.2.0.3')
        hint num  3 len 36 text: OPT_PARAM('_always_anti_join' 'off')
        hint num  4 len 36 text: OPT_PARAM('_always_semi_join' 'off')
        hint num  5 len 40 text: OPT_PARAM('_index_join_enabled' 'false')
        hint num  6 len 43 text: OPT_PARAM('_optim_peek_user_binds' 'false')
        hint num  7 len 49 text: OPT_PARAM('_optimizer_skip_scan_enabled' 'false')
        hint num  8 len 39 text: OPT_PARAM('optimizer_index_cost_adj' 1)
        hint num  9 len 40 text: OPT_PARAM('optimizer_index_caching' 100)
        hint num 10 len 10 text: FIRST_ROWS
        hint num 11 len 29 text: OUTLINE_LEAF(@"SEL$EE94F965")
        hint num 12 len 22 text: MERGE(@"SEL$9E43CB6E")
        hint num 13 len 17 text: OUTLINE(@"SEL$4")
        hint num 14 len 24 text: OUTLINE(@"SEL$9E43CB6E")
        hint num 15 len 22 text: MERGE(@"SEL$58A6D7F6")
        hint num 16 len 17 text: OUTLINE(@"SEL$3")
        hint num 17 len 24 text: OUTLINE(@"SEL$58A6D7F6")
        hint num 18 len 15 text: MERGE(@"SEL$1")
        hint num 19 len 17 text: OUTLINE(@"SEL$2")
        hint num 20 len 17 text: OUTLINE(@"SEL$1")
        hint num 21 len 36 text: FULL(@"SEL$EE94F965" "CPGR"@"SEL$1")
        hint num 22 len 153 text: INDEX(@"SEL$EE94F965" "CPGP"@"SEL$1" ("CL_PROVIDER_GROUP_PERIOD"."CPGR_ID" "CL_PROVIDER_GROUP_PERIOD"."CPDE_ID" "CL_PRO
    VIDER_GROUP_PERIOD"."START_DATE"))
        hint num 23 len 77 text: INDEX_RS_ASC(@"SEL$EE94F965" "CPDE"@"SEL$2" ("CL_PROVIDER_DETAIL"."CPDE_ID"))
        hint num 24 len 62 text: INDEX(@"SEL$EE94F965" "CFCO"@"SEL$3" ("FN_ACCOUNT"."CPDE_ID"))
        hint num 25 len 84 text: LEADING(@"SEL$EE94F965" "CPGR"@"SEL$1" "CPGP"@"SEL$1" "CPDE"@"SEL$2" "CFCO"@"SEL$3")
        hint num 26 len 38 text: USE_NL(@"SEL$EE94F965" "CPGP"@"SEL$1")
        hint num 27 len 38 text: USE_NL(@"SEL$EE94F965" "CPDE"@"SEL$2")
        hint num 28 len 38 text: USE_NL(@"SEL$EE94F965" "CFCO"@"SEL$3")
    SPM: generated non-matching plan:
    ----- Explain Plan Dump -----
    ----- Plan Table -----
    ============
    Plan Table
    ============
    ------------------------------------------------------------+-----------------------------------+
    | Id  | Operation                       | Name              | Rows  | Bytes | Cost  | Time      |
    ------------------------------------------------------------+-----------------------------------+
    | 0   | SELECT STATEMENT                |                   |       |       |   179 |           |
    | 1   |  SORT UNIQUE                    |                   |   153 |   11K |   178 |  00:00:01 |
    | 2   |   NESTED LOOPS                  |                   |   153 |   11K |   177 |  00:00:01 |
    | 3   |    NESTED LOOPS                 |                   |   826 |   50K |    11 |  00:00:01 |
    | 4   |     NESTED LOOPS                |                   |   826 |   26K |     3 |  00:00:01 |
    | 5   |      TABLE ACCESS FULL          | CL_PROVIDER_GROUP |   116 |  2668 |     2 |  00:00:01 |
    | 6   |      INDEX RANGE SCAN           | CPGP_UK           |     7 |    63 |     1 |  00:00:01 |
    | 7   |     TABLE ACCESS BY INDEX ROWID | CL_PROVIDER_DETAIL|     1 |    30 |     1 |  00:00:01 |
    | 8   |      INDEX UNIQUE SCAN          | CPDE_PK           |     1 |       |     1 |  00:00:01 |
    | 9   |    TABLE ACCESS BY INDEX ROWID  | FN_ACCOUNT        |     1 |    14 |     1 |  00:00:01 |
    | 10  |     INDEX RANGE SCAN            | FACC_CPDE_FK_I    |    27 |       |     1 |  00:00:01 |
    ------------------------------------------------------------+-----------------------------------+
    Predicate Information:
    6 - access("CPGR"."CPGR_ID"="CPGP"."CPGR_ID")
    8 - access("CPDE"."CPDE_ID"="CPGP"."CPDE_ID")
    9 - filter((UPPER("CPGR"."NAME") LIKE UPPER('%'||:1||'%') OR UPPER("CPDE"."NAME") LIKE UPPER('%'||:2||'%') OR UPPER("CPDE"."ABN") LIKE UPPER(:3||'%')
    OR "CFCO"."ACCT_NO" LIKE UPPER(:4||'%')))
    10 - access("CPDE"."CPDE_ID"="CFCO"."CPDE_ID")
    10 - filter("CFCO"."CPDE_ID" IS NOT NULL)
    Content of other_xml column
    ===========================
      db_version     : 11.2.0.3
      parse_schema   : CARADM
      plan_hash      : 3311216257
      plan_hash_2    : 4009937738
      Outline Data:
      /*+
        BEGIN_OUTLINE_DATA
          IGNORE_OPTIM_EMBEDDED_HINTS
          OPTIMIZER_FEATURES_ENABLE('10.2.0.3')
          DB_VERSION('11.2.0.3')
          OPT_PARAM('_always_anti_join' 'off')
          OPT_PARAM('_always_semi_join' 'off')
          OPT_PARAM('_index_join_enabled' 'false')
          OPT_PARAM('_optim_peek_user_binds' 'false')
          OPT_PARAM('_optimizer_skip_scan_enabled' 'false')
          OPT_PARAM('optimizer_index_cost_adj' 1)
          OPT_PARAM('optimizer_index_caching' 100)
          FIRST_ROWS
          OUTLINE_LEAF(@"SEL$EE94F965")
          MERGE(@"SEL$9E43CB6E")
          OUTLINE(@"SEL$4")
          OUTLINE(@"SEL$9E43CB6E")
          MERGE(@"SEL$58A6D7F6")
          OUTLINE(@"SEL$3")
          OUTLINE(@"SEL$58A6D7F6")
          MERGE(@"SEL$1")
          OUTLINE(@"SEL$2")
          OUTLINE(@"SEL$1")
          FULL(@"SEL$EE94F965" "CPGR"@"SEL$1")
          INDEX(@"SEL$EE94F965" "CPGP"@"SEL$1" ("CL_PROVIDER_GROUP_PERIOD"."CPGR_ID" "CL_PROVIDER_GROUP_PERIOD"."CPDE_ID" "CL_PROVIDER_GROUP_PERIOD"."STA
    RT_DATE"))
          INDEX_RS_ASC(@"SEL$EE94F965" "CPDE"@"SEL$2" ("CL_PROVIDER_DETAIL"."CPDE_ID"))
          INDEX_RS_ASC(@"SEL$EE94F965" "CFCO"@"SEL$3" ("FN_ACCOUNT"."CPDE_ID"))
          LEADING(@"SEL$EE94F965" "CPGR"@"SEL$1" "CPGP"@"SEL$1" "CPDE"@"SEL$2" "CFCO"@"SEL$3")
          USE_NL(@"SEL$EE94F965" "CPGP"@"SEL$1")
          USE_NL(@"SEL$EE94F965" "CPDE"@"SEL$2")
          USE_NL(@"SEL$EE94F965" "CFCO"@"SEL$3")
        END_OUTLINE_DATA
    ------- END SPM Plan Dump -------
    SPM: plan reproducibility round 2 (hinted OFE only)
    SPM: using qksan to reproduce accepted plan, planId = 386463207
    SPM: planId in plan baseline = 386463207, planId of reproduced plan = 4009937738
    ------- START SPM Plan Dump -------
    SPM: failed to reproduce the plan using the following info:
      parse_schema name        : CARADM
      plan_baseline signature  : 17844158604836855983
      plan_baseline plan_id    : 386463207
      plan_baseline hintset    :
        hint num  1 len 37 text: OPTIMIZER_FEATURES_ENABLE('10.2.0.3')
    SPM: generated non-matching plan:
    ----- Explain Plan Dump -----
    ----- Plan Table -----
    ============
    Plan Table
    ============
    ------------------------------------------------------------+-----------------------------------+
    | Id  | Operation                       | Name              | Rows  | Bytes | Cost  | Time      |
    ------------------------------------------------------------+-----------------------------------+
    | 0   | SELECT STATEMENT                |                   |       |       |   179 |           |
    | 1   |  SORT UNIQUE                    |                   |   153 |   11K |   178 |  00:00:01 |
    | 2   |   NESTED LOOPS                  |                   |   153 |   11K |   177 |  00:00:01 |
    | 3   |    NESTED LOOPS                 |                   |   826 |   50K |    11 |  00:00:01 |
    | 4   |     NESTED LOOPS                |                   |   826 |   26K |     3 |  00:00:01 |
    | 5   |      TABLE ACCESS FULL          | CL_PROVIDER_GROUP |   116 |  2668 |     2 |  00:00:01 |
    | 6   |      INDEX RANGE SCAN           | CPGP_UK           |     7 |    63 |     1 |  00:00:01 |
    | 7   |     TABLE ACCESS BY INDEX ROWID | CL_PROVIDER_DETAIL|     1 |    30 |     1 |  00:00:01 |
    | 8   |      INDEX UNIQUE SCAN          | CPDE_PK           |     1 |       |     1 |  00:00:01 |
    | 9   |    TABLE ACCESS BY INDEX ROWID  | FN_ACCOUNT        |     1 |    14 |     1 |  00:00:01 |
    | 10  |     INDEX RANGE SCAN            | FACC_CPDE_FK_I    |    27 |       |     1 |  00:00:01 |
    ------------------------------------------------------------+-----------------------------------+
    Predicate Information:
    6 - access("CPGR"."CPGR_ID"="CPGP"."CPGR_ID")
    8 - access("CPDE"."CPDE_ID"="CPGP"."CPDE_ID")
    9 - filter((UPPER("CPGR"."NAME") LIKE UPPER('%'||:1||'%') OR UPPER("CPDE"."NAME") LIKE UPPER('%'||:2||'%') OR UPPER("CPDE"."ABN") LIKE UPPER(:3||'%')
    OR "CFCO"."ACCT_NO" LIKE UPPER(:4||'%')))
    10 - access("CPDE"."CPDE_ID"="CFCO"."CPDE_ID")
    10 - filter("CFCO"."CPDE_ID" IS NOT NULL)
    Content of other_xml column
    ===========================
      db_version     : 11.2.0.3
      parse_schema   : CARADM
      plan_hash      : 3311216257
      plan_hash_2    : 4009937738
      Outline Data:
      /*+
        BEGIN_OUTLINE_DATA
          IGNORE_OPTIM_EMBEDDED_HINTS
          OPTIMIZER_FEATURES_ENABLE('10.2.0.3')
          DB_VERSION('11.2.0.3')
          OPT_PARAM('optimizer_index_cost_adj' 1)
          OPT_PARAM('optimizer_index_caching' 100)
          FIRST_ROWS
          OUTLINE_LEAF(@"SEL$EE94F965")
          MERGE(@"SEL$9E43CB6E")
          OUTLINE(@"SEL$4")
          OUTLINE(@"SEL$9E43CB6E")
          MERGE(@"SEL$58A6D7F6")
          OUTLINE(@"SEL$3")
          OUTLINE(@"SEL$58A6D7F6")
          MERGE(@"SEL$1")
          OUTLINE(@"SEL$2")
          OUTLINE(@"SEL$1")
          FULL(@"SEL$EE94F965" "CPGR"@"SEL$1")
          INDEX(@"SEL$EE94F965" "CPGP"@"SEL$1" ("CL_PROVIDER_GROUP_PERIOD"."CPGR_ID" "CL_PROVIDER_GROUP_PERIOD"."CPDE_ID" "CL_PROVIDER_GROUP_PERIOD"."STA
    RT_DATE"))
          INDEX_RS_ASC(@"SEL$EE94F965" "CPDE"@"SEL$2" ("CL_PROVIDER_DETAIL"."CPDE_ID"))
          INDEX_RS_ASC(@"SEL$EE94F965" "CFCO"@"SEL$3" ("FN_ACCOUNT"."CPDE_ID"))
          LEADING(@"SEL$EE94F965" "CPGR"@"SEL$1" "CPGP"@"SEL$1" "CPDE"@"SEL$2" "CFCO"@"SEL$3")
          USE_NL(@"SEL$EE94F965" "CPGP"@"SEL$1")
          USE_NL(@"SEL$EE94F965" "CPDE"@"SEL$2")
          USE_NL(@"SEL$EE94F965" "CFCO"@"SEL$3")
        END_OUTLINE_DATA
    ------- END SPM Plan Dump -------
    SPM: couldn't reproduce any enabled+accepted plan so using the cost-based plan, planId = 3838063866
    SPM: kkopmCheckSmbUpdate (enter) xscP=0x9fffffff7f3c8cc8, pmExCtx=0xc000000c8bbade48, ciP=0xc000000c872f95c0, dtCtx=0x6000000000054c30apologies once again for the huge post.

  • What wrong with this sql ?

    what wrong with my sql ?? When i try to run a explain plain against it. I get it that perfectly fine...if the syntax was wrong i wont get the explain plan, then why am i getting invalid number error ??? is it the data ?? i am on 10.2.0.3
    Edited by: S2K on Aug 18, 2009 10:21 AM

    S2K wrote:
    i am sorry i am not able to get what you mean...do you mean i should have it something like this ??
    CASE WHEN tv.var_data_typ_nm = 'Continuous' THEN ROUND(cr.rslt_qty, tmc.rpt_prcsn)
    ELSE cr.rslt_qty END,
    Well, I did not realize column with QTY in the name is stored as string. Then your issue is values stored in cr.rslt_qty - at least one is not numeric. Keep in mind balnk string will fail:
    SQL> select round(' ') from dual
      2  /
    select round(' ') from dual
    ERROR at line 1:
    ORA-01722: invalid number
    SQL> So if you can have blank cr.rslt_qty use LTRIM/RTRIM.
    SY.

  • What is happening in this plan

    Hi Please take a look at the below query and its plan. The Step 9 in the Plan applies the condition (ebill.is_synced_to_orig = 0 OR ebill.is_synced_to_orig IS NULL). but since it is a index scan it only applies is_synced_to_orig = 0 condition. But ideally the other selectivity should also be considered somewhere else right. but I could not see that in the plan.
    Is oracle skipping that condition?? much appreciate if someone can say what is happening in this plan for is_synced_to_orig IS NULL condition. thanks...
    SELECT ebill.ebill_summary_id
    FROM ebill_summary ebill INNER JOIN originator orig
    ON ebill.originator_id = orig.originator_id
    AND (ebill.is_synced_to_orig = 0 OR ebill.is_synced_to_orig IS NULL)
    INNER JOIN entity e
    ON e.entity_id = orig.entity_id
    AND e.entity_type_id = 1
    AND e.entity_id = 1
    LEFT OUTER JOIN te_pmt_task_lock tl
    ON tl.payment_request_id = ebill.ebill_summary_id
    AND tl.te_task_id = 1234
    AND tl.is_expired = 1
    WHERE tl.payment_request_id IS NULL AND ROWNUM <= 1000;
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 56 | 16 (0)| 00:00:01 |
    |* 1 | COUNT STOPKEY | | | | | |
    |* 2 | FILTER | | | | | |
    | 3 | NESTED LOOPS OUTER | | 1 | 56 | 16 (0)| 00:00:01 |
    | 4 | NESTED LOOPS | | 1 | 47 | 2 (0)| 00:00:01 |
    | 5 | NESTED LOOPS | | 1 | 43 | 1 (0)| 00:00:01 |
    |* 6 | TABLE ACCESS BY INDEX ROWID| ENTITY | 1 | 4 | 1 (0)| 00:00:01 |
    |* 7 | INDEX UNIQUE SCAN | ENTITIES_PK | 1 | | 0 (0)| 00:00:01 |
    | 8 | TABLE ACCESS BY INDEX ROWID| EBILL_SUMMARY | 1 | 39 | 0 (0)| 00:00:01 |
    |* 9 | INDEX RANGE SCAN | EBILL_IS_SYNCED_TO_ORIG_IDX | 1 | | 0 (0)| 00:00:01 |
    |* 10 | TABLE ACCESS BY INDEX ROWID | ORIGINATOR | 1 | 4 | 1 (0)| 00:00:01 |
    |* 11 | INDEX RANGE SCAN | ORIGINATOR_ENTITY_IDX | 1 | | 0 (0)| 00:00:01 |
    |* 12 | INDEX RANGE SCAN | TEPMTTSKLCK_TSKEXPRDPYNREQ_ID | 1 | 9 | 14 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    1 - filter(ROWNUM<=1000)
    2 - filter("TL"."PAYMENT_REQUEST_ID" IS NULL)
    6 - filter("E"."ENTITY_TYPE_ID"=1)
    7 - access("E"."ENTITY_ID"=1)
    9 - access("EBILL"."IS_SYNCED_TO_ORIG"=0)
    10 - filter("EBILL"."ORIGINATOR_ID"="ORIG"."ORIGINATOR_ID")
    11 - access("ORIG"."ENTITY_ID"=1)
    12 - access("TL"."TE_TASK_ID"(+)=1234 AND "TL"."IS_EXPIRED"(+)=1 AND
    "TL"."PAYMENT_REQUEST_ID"(+)="EBILL"."EBILL_SUMMARY_ID")

    Well, if the column is declared as NOT NULL and you ask for all rows such that the column = 1 OR it is null then really you are asking for all data where the column = 1 since by definition, there cannot be nulls (the NOT NULL constraint on the column prohibits NULL data from occurring).
    Make sense?
    Now, i'm not saying that's what your issue is, but since i haven't seen what your tables look like ... it's as good a guess as i can muster.

  • Best Practices: What is a best backup plan on BO 4.0

    Hi Experts!
    I work with BO since 2007. I worked a lot with BO XI 3.1 and now with BI 4.0. I always have a question about the way to make a backup: What is a best backup plan on BO 4.0.
    I know de many way to do this, but how I'm a consultant developer and backup usually is not my responsibility, but always I have to advise my clients and users.
    The little summary of ways I know on BI 4.0:
    - Stop the services and do a backup of repository database and FileStore folder (eventually include the TomCat folder and others BO installation folders)
    - Create a job on LCM and a schedule to export a LCMBIAR file
    - Use the Upgrade Management Tool to generate a BIAR file by the command line
    I found that interesting post of Raphael Branger, but his the best option is to use the 360View, but that software I don't know, and the clients usually want to use the SAP solutions, so the preference is use the BO's way to make backup.
    Backup & Recovery in BO 4.0
    Note: I agree with Raphael about the old Import Wizard, I don't know why Upgrade Management Tool don't allow to import a biar file that same version of target. It is terrible.
    Let me make a the big question: What is a best backup plan on BO 4.0?
    I know that this depends of the environment and the many variables, but let us consider the general environment, the standard installation.
    Thanks everybody!

    Thanks Mrinal and Ajay,
    On my experience I always use the full-backup: repository database backup + filestore folder backup (usually I recommend include BO folder installation and TomCat folder too because the custom configurations). That backup is essential, is basic.
    But this backup is not flexible.The usual problems on BO's production enviroment is accidental deletion of some reports or objects of BO. Since BO XI R2 I used the "Import Wizard" to generate BIAR files by the command line, I usually create a BAT file with command line to create thats files, however BO 4 Import Wizard was died, now exists "Upgrade Management Tool", but I can create BIAR files by the command line too. Let's suppose a case that the BO user has deleted a report and that user did notified that deletion after 1 month. We don't need to restore all objects of the full-backup of 1 month ago, with BIAR files, we can restore only that report. Thats is the advantage of using BIAR files.
    So, my strategy is use the full-backup (repository database + BO installation folder) and create BIAR files.
    What do you think about the backup by generating BIAR files?

  • What is the significance of plan version?

    Hi all,
    Pls tell what is the significance of plan version? What will happen if I create some orgunit oin current plan and some org unit in another plan?

    Hi..,
    Plan versions are scenarios in which you can create organizational plans.
    ==>In the plan version which you have flagged as the active plan version, you create your current valid organizational plan. This is also the integration plan version which will be used if integration with Personnel Administration is active.
    ==>You use additional plan versions to create additional organizational plans as planning scenarios.
    But Only one plan version will be active at any time !!!
    As a rule, a plan version contains one organizational structure, that is, one root organizational unit. It is, however, possible to create more than one root organizational unit, that is more than one organizational structure in a plan version.
    For more information on creating plan versions, see the Implementation Guide (IMG), under Personnel Management ® Global Settings in Personnel Management ® Plan Version Maintenance.
    regards,
    sai ramesh

  • What is Apple's official plan for future battery replacement in the Macbook Pro with Retina Display?

    What is Apple's official plan for future battery replacement in the Macbook Pro with Retina display?

    No one here works for Apple nor does Apple visit this message board.  We are all end users like yourself helping each other out. 
    "Official" Apple "replacement" announcements will be listed on their website and possibly on their Knowledge Base website.
    Check the All Programs website too.

  • What does an EXEC SQL stmt do in ABAP? What is the disadvantage of using it

    hi,
    What does an EXEC SQL stmt do in ABAP? What is the disadvantage of using it?
    regards.

    sorry, question resolved.

  • SQL Plan Management - Baseline- Can it be used in another Schema

    Hi,
    I have never implemented, SQL Plan Management -Creating SQL plan baselines.
    I am having a query which is using indexes in one Schema.
    On another Schema in the same DB, the query accesses the SAME TABLE THROUGH SYNONYM. And the plan is very different. And query goes into indefinite execution.
    I have tried hints and other ways but it's simply not using the indexes.
    Anyone having experience with Baselines, can you suggest if I create a Baseline for the plan in SchemaA.
    Then can I use the same plan through Baseline in SchemaB for the same query?
    Please suggest..Thanks..

    Hi Jeneesh,
    Thanks for the reply.
    Problem is that the query has Xquery code inside and it's using the XMLType indexes. That's why it does not seem to be using the XML Indexes even by Hints.
    I have posted the scenario in XMLDB Forum as well:
    Re: Table in Schema1 using XMLIndexes But not in View- Schema2
    But can you think of any harm if I try to create Baseline and tag the query with it.
    So even in other schema if the same query is fired it will use the right Explain Plan.
    I am not able to figure out any other way right now.
    Please suggest..Thanks..

  • Implementing SQL Plan Management on Oracle Database 11.2.0.2

    Environment:
    Oracle Linux 5 update 10 (UEK)
    Oracle GI 11.2.0.2.0 (Oracle ASM 11.2.0.2)
    Oracle Database 11.2.0.2.0 Enterprise Edition with RAC option (3 nodes)
    No PSU applied/CPU July 2013 applied to RDBMS
    Database servicing Siebel CRM 8.1.1.1 Application that uses bind peeking.
    Siebel CRM soon to be version 8.1.1.11
    There are a few bugs for SQL Plan Management (SPM) on 11.2.0.2 (see below).  The slowness and non-peeked binds issues seem very problematic.  I've seen a few bloggers recommend to not use SPM unless your at Oracle Database 12c.  Several of the bugs seemed to be fixed in 11.2.0.3 but we don't have any plans to move to 11.2.0.3 since we'll most likely be at 12.1.0.x in 7 months.  Any recommendation from the community on whether I should capture and use SQL Plan Management with 11.2.0.2?  Why, why not?  If there's other relevant information needed, let me know.
    Bug 9910484 - SQL Plan Management Capture uses excessive space in SYSAUX (Doc ID 9910484.8)
    Affects:
    Product (Component) Oracle Server (Rdbms)
    Range of versions believed to be affected Versions >= 11.1 but BELOW 12.1
    Versions confirmed as being affected
    •11.2.0.2
    •11.2.0.1
    •11.1.0.7
    Platforms affected Generic (all / most platforms affected)
    Fixed:
    •12.1.0.1 (Base Release)
    •11.2.0.3 (Server Patch Set)
    •11.2.0.2 Patch 4 on Windows Platforms
    •11.1.0.7 Patch 41 on Windows Platforms
    Bug 11719151 - SQL Plan Management capture causes slowness (Doc ID 11719151.8)
    Affects:
    Product (Component) Oracle Server (Rdbms)
    Range of versions believed to be affected Versions >= 11.2.0.2 but BELOW 12.1
    Versions confirmed as being affected
    •11.2.0.2
    Platforms affected Generic (all / most platforms affected)
    Fixed:
    •12.1.0.1 (Base Release)
    •11.2.0.3 (Server Patch Set)
    •11.2.0.2 Patch 22 on Windows Platforms
    Bug 9942454 - DBMS_SPM.LOAD_PLANS_FROM_SQLSET gets XML parsing error (Doc ID 9942454.8)
    Affects:
    Product (Component) Oracle Server (Rdbms)
    Range of versions believed to be affected Versions BELOW 12.1
    Versions confirmed as being affected
    •11.2.0.2
    •11.2.0.1
    •11.1.0.7
    Platforms affected Generic (all / most platforms affected)
    Fixed:
    •12.1.0.1 (Base Release)
    •11.2.0.3 (Server Patch Set)
    Bug 12732879 - Execution Plan of Query with non-peeked binds is not reproducible (Doc ID 12732879.8)
    Affects:
    Product (Component) Oracle Server (Rdbms)
    Range of versions believed to be affected Versions >= 9.2 but BELOW 12.1
    Versions confirmed as being affected
    •11.2.0.3
    •11.2.0.2
    •11.1.0.7
    Platforms affected Generic (all / most platforms affected)
    Fixed:
    •12.1.0.1 (Base Release)
    •11.2.0.4 (Future Patch Set)
    Bug 11687175 - High DFS lock handle waits in the database with SPM if FIXED_DATE is set (Doc ID 11687175.8)
    Affects:
    Product (Component) Oracle Server (Rdbms)
    Range of versions believed to be affected Versions >= 11 but BELOW 12.1
    Versions confirmed as being affected
    11.2.0.2
    11.2.0.1
    11.1.0.7
    11.1.0.6
    Platforms affected Generic (all / most platforms affected)
    Fixed:
    12.1.0.1 (Base Release)
    11.2.0.3 (Server Patch Set)
    Bug 13384234  ORA-29981 with select query with database Change notification
    Affects:
    Product (Component) Oracle Server (Rdbms)
    Range of versions believed to be affected Versions BELOW 12.1
    Versions confirmed as being affected
    11.2.0.2
    Platforms affected Generic (all / most platforms affected)
    Fixed:
    11.2.0.4 (Future Patch Set)
    Thanks so much.

    See these MOS Docs
    11.2.0.2 Patch Set - Availability and Known Issues (Doc ID 1179474.1)
    Important Changes to Oracle Database Patch Sets Starting With 11.2.0.2 (Doc ID 1189783.1)
    HTH
    Srini

  • What is the use of planning package in bps

    hi friends,
    what is the use of planning package in bps .
    Thanking u
    suneel.

    Hi Suneel,
    Check the info here:
    http://help.sap.com/saphelp_nw04/helpdata/en/0e/8007dc83d011d3b72e0000e82debc6/content.htm
    Hope this helps...

  • 11g [ SQL PLAN BASELINES ] LOOK UP ISSUE

    Hello everyone,
    Working on 11g R1/windows
    I'm trying to reltrieve some sql plan baselines, but nothing airs. The following is my configuration
    SQL> show parameter compatible
    NAME TYPE VALUE
    compatible string 11.1.0.0.0
    SQL> show parameter optimizer
    NAME TYPE VALUE
    optimizer_capture_sql_plan_baselines boolean TRUE
    optimizer_dynamic_sampling integer 2
    optimizer_features_enable string 11.1.0.6
    optimizer_index_caching integer 0
    optimizer_index_cost_adj integer 100
    optimizer_mode string ALL_ROWS
    optimizer_secure_view_merging boolean TRUE
    optimizer_use_invisible_indexes boolean FALSE
    optimizer_use_pending_statistics boolean FALSE
    optimizer_use_sql_plan_baselines boolean TRUE
    SQL> show parameter statistics
    NAME TYPE VALUE
    optimizer_use_pending_statistics boolean FALSE
    statistics_level string ALL
    timed_os_statistics integer 5
    timed_statistics boolean TRUE
    SQL> SELECT /*+ full(t) */ count(pad) FROM t WHERE n = 42;
    COUNT(PAD)
    1
    SQL> SELECT * FROM table(dbms_xplan.display_cursor);
    PLAN_TABLE_OUTPUT
    SQL_ID 659q28x85bkn7, child number 1
    SELECT /*+ full(t) */ count(pad) FROM t WHERE n = 42
    Plan hash value: 2966233522
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | | | 23 (100)| |
    | 1 | SORT AGGREGATE | | 1 | 505 | | |
    PLAN_TABLE_OUTPUT
    |* 2 | TABLE ACCESS FULL| T | 1 | 505 | 23 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    2 - filter("N"=42)
    Why I'm getting the following result?
    SQL> select count(*) from dba_sql_plan_baselines;
    COUNT(*)
    0
    SQL> SELECT sql_handle, plan_name
    2 FROM dba_sql_plan_baselines;
    no rows selected
    *Normally the view dba_sql_plan_baselines shouldn't be empty, when seeing the following parameter set?
    *optimizer_capture_sql_plan_baselines boolean     TRUE
    statistics_level ALL
    Thank you for your help

    Perhaps, because you executed your statement only once?
    (I assume, you are reading the Christian Antognini's book - in that case you can read about it on page 292)
    Best regards
    Maxim

Maybe you are looking for

  • Disk Error Message in Photoshop 5.0 LE

    Hello,   I scanned an image at 1200 dpi (Windows reports the file size as 165 MB) and tried to open it in Photoshop and got this message: Disk error –36 while reading or writing virtual memory file. Sorry, but this error is fatal. I've tried changing

  • Question about Byte Code

    Hello...can anyone tell me how I write a java program, compile it and get my byte code written into another file?? Thanks in advance!

  • How to drag and drop multi tabs to a new tab group?

    When I go to the new feature Tab Groups (shift+ctrl+E), I make a search then some tabs are highlighted but I would like to drag and drop to a new group the highlighted tabs all together not just one by one. Is it possible doing a multi-drag&drop with

  • Adobe Air and HTML

    I've been able to load a webpage from within my application using code such as the following: var loader:HTMLLoader = new HTMLLoader(); loader.width=300; loader.height=300; var url:URLRequest = new URLRequest("http://..."); url.useCache = false; load

  • SEO Friendly shopping cart

    I am wanting to use a SEO friendly shopping cart that uses search engine automatically generated urls and meta descriptions. It has to be a dreamweaver extension. What are the options I know of webassist ecart and cartweaver. Anything else?