Issue of SQL Plan Management

Hello

I have a question concerning the presence of 'Accepted' indicator (values or NOT) that is displayed by the function dbms_xplan.display_sql_plan_baseline.

It is my understanding of the documentation of Oracle SQL plan does not become part of a plan SQL database until it is accepted by the process of evolution or manual loading in the base line. How is it possible to have a plan to be part of a reference that is not accepted? If the dbms_xplan.display_sql_plan_baseline function is used to display more than plans that are in a reference database and that are only in the story?


Thanks for your thoughts on this.

Richard

PS. I use Oracle 11.1.0.7

Welcome to the forum!
>
How is it possible to have a plan to be part of a reference that is not accepted? If the dbms_xplan.display_sql_plan_baseline function is used to display more than plans that are in a reference database and that are only in the story?
>
View code that you use to call the function and the result you get.

Depending on how you call the function, and what plans are available, you will get different results. For example
>
plan_name
Name of plan. It identifies a specific plan. Value default NULL means that all the plans associated with identified SQL statement are explained and displayed
>
You specify this setting? If this isn't the case, then all THE plans could include plans that have not been accepted.

Section 15.5 display SQL Plan baseline in the Performance Tuning Guide contains an example of this and displays two plans: an accepted and the other not.
http://docs.Oracle.com/CD/E11882_01/server.112/e16638/optplanmgmt.htm

It's really the history display that includes all plans.

Tags: Database

Similar Questions

  • SQL PLAN Management

    In Oracle 11 g, I want to use sql plan management to achieve stability of the regime. My problem is that I don't know what all the plans, users can run, then I put

    OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES=TRUE

    But then sysaux tablespace keeps growing. I started with 2GB and now I have SYSAUX tablespace of 12GB. Is there anyway to say that only plans in certain parsing schema are automatically captured and no recursive statements to data dictionary etc. are captured. I am only interested in sql plans run by my program and not those sql statements internally generated by Oracle. I want all of this to be automatic, that’s why I set above parameter to TRUE. If that is not the right approach, what other options I have.

    The simple answer is probably that if you want to capture base lines of sql plan for a subset of users or programs, and then set the parameter to the level of the system to false and use a logon trigger to true for sessions with the subset of attributes you have defined.

    However, depending on the exact version of 11 g, there are a number of bugs affecting both the performance and the storage of the basic mechanism worth overlap Oracel version with lists of related bugs in the support Web site.

    Also double check on the occupants of the tablespace SYSAUX because the base lines are not the only thing in there that can use a significant amount of space.

  • SQL Plan Management vs. cursors

    Hello

    We have recently implemented SQL Plan Management in our Production environment after two weeks of testing in development.

    Wouldn't you know, we proceeded to six questions which lasted much longer (, instead of less than a minute).

    The common denominator of these queries is that they are used as part of a loop of slider and make the use of bind variables. All other queries (and we talk about hundreds) was fine. The data has not changed for relevant queries.

    Is there a 'problem' with SPM and sliders/bind variable that anyone could have heard?

    Mark

    When you say SQL Plan Management, do you mean Plan SQL schedules?

    Baselines work by locking in a sql statement to a particular regime.

    The only problem that come to mind is that the referenced plan is not suited for all bind variable values.

    The first thing to look at would be the execution plans and they are in the base line, etc. - see DBMS_XPLAN. DISPLAY_AWR, also cross references to ash.
    Keep an eye on other features such as feedback of the cardinality.

    On 11.2.0.2, one thing to watch is a big SPM and recursive merge instructions involved. There is a patch, but it's usually pretty obvious if you are affected by this bug, for example
    http://OraStory.WordPress.com/2011/03/01/SQL-baseline-capture-BU/

  • SQL Plan Management - tips from the real world?

    Hi all

    I was wondering if anyone had any practice with SQL Plan Management in 11 GR 2? Specifically, we seek to implement this in an environment of Exadata.

    After reading the manual, I have a few questions:

    -Is it possible to stop the plan history to consume barrel loads of space SYSAUX? I know that:

    + "A weekly background process measures the total space occupied by the SQL Management database, and when the set limit is exceeded, the process will generate a warning in the alerts log" +

    That's great, but it does not stop the limit being exceeded, so I was wondering whether or not there was this ability?

    -How long it tends to take for the SQL plans to 'navigate' automatically? If the optimizer sees a new plan for a statement and it is good, how much time is the period of 'prove' before it implements the SQL plan? (I suspect it's as my asking ' how long is a piece of string? ', but it's a worth a try)

    -Has a significant performance impact whenever it collects all the plans at first?

    -I guess if I decide that it is not for us, I can change the setting optimizer_use_sql_plan_baselines and following the instructions in MOS 790039.1 to abandon the repository? It is not all the additional measures "clean"?

    Mark

    This google might be directed to some interesting things:

    kerry osborne management plan

    See the links in the Enkitec doc.

  • SQL plan management unpack error

    Hi all

    Facing a problem in SQL Plan Management.

    Packed dba_sql_plan_baselines table in table called "test_baseline_14july" and exported from the source schema.

    Subsequently imported the same table in the target, now when the following error unpacking based m

    SQL > DECLARE
    number of my_plans;
    BEGIN
    my_plans: = DBMS_SPM. UNPACK_STGTAB_BASELINE (table_name = > 'test_baseline_14july');
    END;
    /

    ORA-06502: PL/SQL: digital error or value
    ORA-06512: at "SYS." DBMS_SMB', line 1024
    ORA-06512: at "SYS." DBMS_SPM', line 2933
    ORA-06512: at line 5


    The source DB: 11.2.0.2
    Destination DB: 11.1.0.6

    Let me know what is the problem?

    Thanks in advance!

    All it seems a little weird. You can think of to raise a ticket with the Support of Oracle.

    In the source database, can you show the output of

    SELECT * FROM v$version;
    SELECT * FROM dba_sql_plan_baselines;
    SELECT * FROM test_baseline_15july_2;
    

    In the destination database, can you show the output of

    SELECT * FROM v$version;
    SELECT * FROM test_baseline_15july_2;
    
  • SQL Plan Management (11.2.0.1)

    Hi guys,.

    I do a few tests as below.
    I tried to keep the plan SQL in the database. (when the table has no indexes, doing full analysis)
    However, after I create the index. It is not recovering the original plan, I put it in the base line. It uses a scan interval.

    Can advise what did I do wrong?

    Thank you!



    SQL > show parameter OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES;

    VALUE OF TYPE NAME
    ------------------------------------ ----------- ------------------------------
    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) user.user: = i;
    8 l_tab (l_tab.last) .description: = "Description for" | I have;
    9 END OF THE LOOP;
    10
    FORALL i IN... l_tab.first 11 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 (waterfall of the USER 'SPM_TEST_TAB' = > 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
    ----------------------------------------------------------
    Hash value of plan: 3128910679

    ----------------------------------------------------------------------------------
    | ID | Operation | Name | Lines | 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 |
    ----------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):
    ---------------------------------------------------

    1 - filter ("ID" = 99)


    Statistics
    ----------------------------------------------------------
    26 the recursive calls
    5 db block Gets
    Gets 49 consistent
    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 back and forth to and from the 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 AS "EXPLAIN % ';

    SQL_ID SQL_TEXT
    ------------- --------------------------------------------------------------------------------------
    gat6z1bc6nc2d description SELECT 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.
    Loading plans: 1

    PL/SQL procedure successfully completed.

    SQL > SELECT sql_handle, plan_name, activated, 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 VAC
    ------------------------------ ------------------------------ --- ---
    SYS_SQL_7b76323ad90440b9 SQL_PLAN_7qxjk7bch8h5tb65c37c8 YES YES

    SQL >
    SQL > ALTER SYSTEM SHARED_POOL RAS;

    Modified system.

    SQL >
    SQL > CREATE INDEX spm_test_tab_idx ON spm_test_tab (id);

    The index is created.

    SQL > EXEC DBMS_STATS.gather_table_stats (waterfall of the USER 'SPM_TEST_TAB' = > 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
    ----------------------------------------------------------
    Hash value of plan: 2792204123

    ------------------------------------------------------------------------------------------------
    | ID | Operation | Name | Lines | 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 |
    ------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):
    ---------------------------------------------------

    2 - access ("ID" = 99)


    Statistics
    ----------------------------------------------------------
    recursive calls of 1072
    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 back and forth to and from the client
    18 sorts (memory)
    0 sorts (disk)
    1 rows processed



    SQL > set autotrace off;
    SQL > SELECT sql_handle, plan_name, activated, accepted
    2 FROM dba_sql_plan_baselines
    3;

    SQL_HANDLE PLAN_NAME ENA VAC
    ------------------------------ ------------------------------ --- ---
    SYS_SQL_7b76323ad90440b9 SQL_PLAN_7qxjk7bch8h5tb65c37c8 YES YES

    However, after I create the index. It is not recovering the original plan, I put it in the base line. It uses a scan interval.

    Oracle optimizer choose the new plan because he thinks that the new plan is better as compared to existing full table scan plan.
    If you want to use only by optimzer exisitng you can plan make it FIXED in SQL_PLAN_BASELINE.

  • Use Microsoft SQL Server Management Studio 2008 home

    I am a student in learning SQL. I have downloaded Microsoft SQL Server Management Studio 2008 as is the SQL software used in class. When I click on Connect, it is said that it can not connect. I chose the following options.

    Server type: the database engine
    Server name: (local)

    Authentication: Windows authentication

    What should I do?

    Hello

    Thanks for posting your query in Microsoft Community.

    According to the description, the problem is related to the installation of Microsoft® SQL Server® 2008 Management Studio Express to the point 8.1 of Windows, I suggest you to ask your question in the following link, because they have more expertise on this issue:

    http://social.msdn.Microsoft.com/forums/SQLServer/en-us/1cceeaf9-78EC-44ef-AAF8-b9965830f5c6/install-SQL-Server-2014-CTP1-on-Windows-81

    I hope this helps.

  • How SQL Server Management Studio instore in Windows 8 app once deleted accidentally

    The SSMS app was accidentally deleted when shortcut app on the screen. Now using search, can't find SSMS app. How in-store?

    Thank you!

    Hello

    If you uninstall an application, you can re - install your applications in Windows store. To open your applications follow these steps.

    a. open store Windows.

    b. right-click on the top of the window.

    c. click on your applications and install SQL Server Management Studio App.

    Hope this information helps. Answer the post with an up-to-date issue report to help you further.

  • How to export a .sql file, I created from Oracle Application Express of SQL Server Management 2012?

    Hello

    I was wondering if you could help me.

    I'm trying to find out how to export a .sql file, I created from Oracle Application Express of SQL Server Management 2012? I'm not very technical, but it seems that the Oracle code does not work with SQL Management Studio when I drag the file inside.

    I need the database Oracle express and its data to enter in SQL Management Studio, so any help would be much appreciated!

    Thank you.

    Hello

    Your question is beyond the scope of this community.

    Please repost your question in the SQL Server TechNet Forums.

    https://social.technet.Microsoft.com/forums/SQLServer/en-us/home?category=SQLServer

    See you soon.

  • SQL server management studio 2008 Express intall error

    When you try to install SQL server management studio Express 2008 I get this error:

    TITLE: Default the SQL Server installation program.
    ------------------------------

    Setup of SQL Server encountered the following error:

    Invoke or BeginInvoke cannot be called on a control until the window handle has been created...

    ------------------------------
    BUTTONS:

    Ok
    ------------------------------

    Berfore I installed visual studio 2010 ultimate and Setup install with visual studio, sql server 2008 and I have windows xp servicr pack 3.

    ASK THE QUESTION IN THE SQL SERVER FORUM:
    http://social.msdn.Microsoft.com/forums/en/category/SQLServer

  • Copy of database SQL from SQL 2005 using SQL Server Management Studio 2008

    I made a backup of the database and tried to do a cover but I don't know where is the database restored too.

    I connected the old PC to SQL with the new using SQL 2008 Management Studio.

    Hello

    Your question is beyond the scope of this community.

    Please repost your question in the SQL Server TechNet Forums.

    https://social.technet.Microsoft.com/forums/SQLServer/en-us/home?category=SQLServer

    "The MSDN SQL Server Forums.

    https://social.msdn.Microsoft.com/forums/SQLServer/en-us/home?category=SQLServer

    TechNet forums:

    https://social.technet.Microsoft.com/forums/en-us/home

    MSDN forums:

    https://social.msdn.Microsoft.com/forums/en-us/home

    See you soon.

  • SQL Server Management Studio and SQL Azure

    Hello:

    I want to test SQL Azure - before be recommended to a customer.

    The last time I performed a test of SQL Azure - I couldn't use SQL Server Management Studio to:

    • Create tables with table designer
    • Add - or remove - the columns of the tables with table designer
    • Create diagrams

    You know, the basic things you need to do to build, manage a database. Then... I told my customer that they would be better to stay with SQL Server, until Microsoft up to speed with SSMS.

    Now I heard the new SSMS versions allow the use of designer tables and diagrams with SQL Azure. My questions are:

    1. Is it true that newer versions of SSMS for use of the table Design and diagramming with SQL Azure?
    2. If Yes, what version of SSMS and what version of SQL Azure?

    Thanks in advance - MM

    Hello

    Post your request in the forum for better support.

    SQL Azure

    Thank you.

  • Installation of SQL Server Management StudioExpress

    I try to install SQL Server Management Studio Express a module of MS SQL Server 2005 on a Windows 7 operating system. But I'm a guest of failure error saying that the program could not be installed because of an existing program. Can you please advise on what to do.

    Hello

    Your question is beyond the scope of these forums.

    Please ask this question in the following forums.

    Category of the SQL Server:

    http://social.technet.Microsoft.com/forums/en-us/category/SQLServer

    Concerning

  • A SQL server management studio 2012 error: PERCENTILE_DISC function is not allowed in the current compatibility mode. It can only in mode 110 or higher.

    Our company just upgraded to SQL Server Management Studio 2012 and it has been very useful because I needed to use the percentile for the code I wrote. As a first step, the function did not work because I set the compatibility mode 110 level. After that I did, the function worked. However, now it does not work yet, and I get the same error:

    The PERCENTILE_DISC function is not allowed in the current compatibility mode. It can only in mode 110 or higher.

    I went to the properties of database section, then options and noticed that the compatibility mode has not changed, it is set to "SQL Server 2012 (110). I even used the following code to see if that would help at all even if the compatibility mode is already on this mode:

    ALTER DATABASE Analytics
    SET COMPATIBILITY_LEVEL = 110 
    

    Someone already had this problem or knows if I need to change something in the properties of database for this function work? Is this just a bug in the new version?

    Hello

    I suggest you post this question in the SQL Server 2012 TechNet Forums: http://social.technet.microsoft.com/Forums/en-us/category/sqlserver

    Thank you.

  • Window of the query editor with Microsoft SQL Server Management Studio DO NOT scroll

    In my view, that it is a question more of a Microsoft SQL Server Management Studio number... apologies if you think I might be in the wrong place of Windows...

    When you work in Microsoft SQL Server Management Studio, my cursor is common in my part of the query editor window. When I try using my scroll wheel it to review some SQL code, instead the scroll on my mouse wheel is controlling the pane objects in the Solution Explorer window and NOT the glass query editor.
    Some of our partners appear to be well with their ability to scroll using the mouse scroll wheel while others seem to be in the same boat I am, and nobody here seems to know why it is.
    I hope for some comments and I am hopeful for an answer. Thanks in advance.
    PSULionRP

    Hello

    The question you posted would be better suited to the TechNet community. Please visit the link below to find a community that will provide the support you want.

    http://social.technet.Microsoft.com/forums/Gu-in/sqldatawarehousing/threads

    Hope this information helps.

Maybe you are looking for