Plan SPM of locking and detection of new plans

I searched Oracle documentation and wanted to confirm my interpretation on some issues of SPM:

Enabling SPM (giving OPTIMIZER_USE_SQL_PLAN_BASELINES TRUE) does for a database and have captured previously SQL plans, freeze all plans for reruns of the captured SQL statements?


Auto capture plan must always run to see if the optimizer is to come up with new plans for your basic SQL lines? If it was OFF, it seems that new plans for statements in your baseline would be always ignored and you'd be ignorant of new plans.

Thank you

Richard

Enabling SPM (giving OPTIMIZER_USE_SQL_PLAN_BASELINES TRUE) does for a database and have captured previously SQL plans, freeze all plans for reruns of the captured SQL statements?

Yes, depending on how you propose change your plans

Auto capture plan must always run to see if the optimizer is to come up with new plans for your basic SQL lines?

N ° below.

Create a simple table:

SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE    11.2.0.3.0      Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production

SQL> create table t1
  2  as
  3  select rownum col1
  4  from dual
  5  connect by rownum <= 10;

Table created.

SQL>
SQL> create index i1 on t1 (col1);

Index created.

SQL> 

Impose a strange datum plane (so that the optimizer will find an obvious alternative):

SQL> alter session set optimizer_use_sql_plan_baselines = false;

Session altered.

SQL> alter session set optimizer_capture_sql_plan_baselines = false;

Session altered.

SQL> select * from t1 where col1 = 1;

      COL1
----------
         1

SQL> select * from table(dbms_xplan.display_cursor());

PLAN_TABLE_OUTPUT
-----------------------------------------------------------------------------------------
SQL_ID  81qv4d7vkb571, child number 0
-------------------------------------
select * from t1 where col1 = 1

Plan hash value: 1816312439

-------------------------------------------------------------------------
| Id  | Operation        | Name | Rows  | Bytes | Cost (%CPU)| Time     |
-------------------------------------------------------------------------
|   0 | SELECT STATEMENT |      |       |       |     1 (100)|          |
|*  1 |  INDEX RANGE SCAN| I1   |     1 |    13 |     1   (0)| 00:00:01 |
-------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access("COL1"=1)

SQL> select /*+ full (t1) */ * from t1 where col1 = 1;

      COL1
----------
         1

SQL> select * from table(dbms_xplan.display_cursor());

PLAN_TABLE_OUTPUT
-----------------------------------------------------------------------------------------
SQL_ID  2tzbnc6mq1q4z, child number 0
-------------------------------------
select /*+ full (t1) */ * from t1 where col1 = 1

Plan hash value: 3617692013

--------------------------------------------------------------------------
| Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |       |       |     3 (100)|          |
|*  1 |  TABLE ACCESS FULL| T1   |     1 |    13 |     3   (0)| 00:00:01 |
--------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter("COL1"=1)

Force the FULL scan in a reference database:

SQL> declare
  2   l_op pls_integer;
  3  begin
  4   l_op :=
  5   dbms_spm.load_plans_from_cursor_cache
  6   (sql_id          => '2tzbnc6mq1q4z',
  7    plan_hash_value => 3617692013,
  8    sql_text        => 'select * from t1 where col1 = 1');
  9  end;
 10  /

PL/SQL procedure successfully completed.

SQL> select to_char(signature) sig, plan_name, created, enabled, accepted
  2  from   dba_sql_plan_baselines
  3  where  signature = (select distinct to_char(exact_matching_signature)
  4                      from   v$sql
  5                      where  sql_id = '81qv4d7vkb571');

SIG                          PLAN_NAME                      CREATED                             ENA ACC
---------------------------- ------------------------------ ----------------------------------- ---
9005682359107037619          SQL_PLAN_7tynwchv97admdbd90e8e 16-JUL-12 05.24.11.000000 PM        YES YES

SQL> 

Prove that the base line is used:

SQL> alter session set optimizer_use_sql_plan_baselines = true;

Session altered.

SQL> select * from t1 where col1 = 1;

      COL1
----------
         1

SQL> select * from table(dbms_xplan.display_cursor());

PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------
SQL_ID  81qv4d7vkb571, child number 3

An uncaught error happened in prepare_sql_statement : ORA-01403: no data found

NOTE: cannot fetch plan for SQL_ID: 81qv4d7vkb571, CHILD_NUMBER: 3
      Please verify value of SQL_ID and CHILD_NUMBER;
      It could also be that the plan is no longer in cursor cache (check v$sql_plan)

8 rows selected.

SQL> select * from t1 where col1 = 1;

      COL1
----------
         1

SQL> select * from table(dbms_xplan.display_cursor());

PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------
SQL_ID  81qv4d7vkb571, child number 3
-------------------------------------
select * from t1 where col1 = 1

Plan hash value: 3617692013

--------------------------------------------------------------------------
| Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |       |       |     3 (100)|          |
|*  1 |  TABLE ACCESS FULL| T1   |     3 |    39 |     3   (0)| 00:00:01 |
--------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter("COL1"=1)

Note
-----
   - SQL plan baseline SQL_PLAN_7tynwchv97admdbd90e8e used for this statement

22 rows selected.

SQL> 

And we will check if the other sensitive no accepted plan was captured as an alternative at the time of the analysis even if the capture is turned off.

SQL> select to_char(signature) sig, plan_name, created, enabled, accepted
  2  from   dba_sql_plan_baselines
  3  where  signature = (select distinct to_char(exact_matching_signature)
  4                      from   v$sql
  5                      where  sql_id = '81qv4d7vkb571');

SIG                          PLAN_NAME                      CREATED                             ENA ACC
---------------------------- ------------------------------ ----------------------------------- ---
9005682359107037619          SQL_PLAN_7tynwchv97admdbd90e8e 16-JUL-12 05.24.11.000000 PM        YES YES
9005682359107037619          SQL_PLAN_7tynwchv97adm3218f475 16-JUL-12 05.24.55.000000 PM        YES NO

SQL> 

Tags: Database

Similar Questions

  • Help! I HAVE WINDOWS XP AND I HAVE LOCKED AND FORGET THE NEW PASSWORD I DID FOR THE ADMINISTRATIVE OPTION.

    I NEED TO GET IN AND WE TRIED ALL COMBINATIONS AND IT DOES NOT OPEN. I NEED OF THIS DESPERATELY THAT I HAVE TO PAY THE BILLS. Help! PLEASE, I BEG YOU!

    IS THERE A WAY I CAN GET AROUND MY PASSWORD.

    I ME REALLY STUPID SENSE!

    Start the computer in safe mode and log on to the built-in account named administrator .  You will need to know the password, if any, for this account.  Once, go to Panel > user accounts and change the password for your regular account. Boulder computer Maven
    Most Microsoft Valuable Professional

  • My photography plan has expired during the first month, I can't update and make a new payment, what should I do?

    My photography plan has expired during the first month, I can't update and make a new payment, what should I do?

    You can also make reference to: FAQ: what should I do if I have a subscription, but my application acts as if I had a trial?

  • Cannot lock and send data to an Excel add-in planning application

    Hi all

    One of our customers uses Essbase 7.1 version and planning 4.0.1

    The question is when one of their user tries to lock and send data to an application of addin planning Excel Gets the following error:

    "You don't have sufficient access to perform a lock on this database"

    But he is able to lock and send through a form web planning without any problem.

    The user belongs to a group that was supplied with some filter access that the planning application and write permission is given for this filter. The filter has been created from the side planning and was rejected.

    Also in excel, under Essbase-> Options-> tab Mode, the "Update Mode" option is not checked.

    Can someone help me on this topic.

    Thank you
    Raja

    Hello

    What is a recent thing? I guess they use these versions for some time? If it's a recent thing then I would start by looking at what has recently changed on the server.

    One of our clients had a problem with a version a little older (3.3 planning and Essbase 6.5.4.2) where each user had 2 filters in Essbase. "User1" was the filter of planning and "User1_" was the Essbase filter for the same user. Whenever an update of the planning was made he re - create the Essbase filter such as users could not run calc scripts or perform locking and send in Excel.

    We had to use a script MaxL to replace the underscore (essbase) filter with the filter of planning and which meant that users can write to Essbase.

    I may be the line of underscores and no line underscore filter the worng way round, it was a long time ago!

    Hope this helps
    Stuart Game
    www.Analitica.co.uk

  • I'm locked out of my new iPad and I don't own a computer. How to reset the password

    IM locked out of my new iPad. How to reset the password with a computer?

    You do not have. You must either find a friend or a member of the family with a computer, you can use or make an appointment at the Genius Bar at your local Apple store.

  • I don't have access to my new iphone 6 its locked and none of my accounts icloud help I need to reset my phone

    help please

    If do not own you the Apple ID used to lock, but you are the original owner of the iPhone, and his receipt to a physical Store.

    If do not own you the Apple ID used to lock and you are not owner of the original iPhone, you must contact that person or the one who put the lock.

    (139834)

  • I had the iphone, it's locked and connected with icloud access code. I don't know password and icloud account. How to reset the iphone as a new one.

    got the iphone 6s unfortunately while walking. It is the access code locked and on the audit, it is connected with icloud. But I do not know icloud account. How can I reset this phone like any other?

    You can not.   You must contact the previous owner and ask him to remove this iPhone in the devices list. Otherwise, your iPhone will be a useless brick.

    Find my iPhone Activation Lock: a mechanism of extraction of the previous owner - Apple Support

  • Computer keeps locking and go to the Login screen

    I am running Windows Home Premium Service Pack 2. My computer keeps locking and return to the login screen. I went on the screen savers and I'm not using a screen saver and so I have not activated in him back on, return to the login screen is not checked. I tried everything I know to do and I am now at a loss. It becomes very annoying. What I'm missing here? Thank you.

    Hello

    Check the settings in the Control Panel - Power Options - upper left "require a password on Wakeup"
    If new game that will put you in the opening session after a sleep screen.

    Check these institutions:

    Troubleshooting Windows Vista sleep and extended
    http://www.computerperformance.co.UK/Vista/vista_hibernate.htm

    How to troubleshoot performance problems with sleep, hibernation and resume in Windows Vista
    http://support.Microsoft.com/kb/950686

    May need to reset all to default power settings and then place back as you prefer.

    How to solve a problem of Mode for Vista and find a Solution
    http://www.Vistax64.com/tutorials/63567-power-options-sleep-mode-problems.html

    How to enable and disable Hibernation - you can try to disable and re-enable the it. http://www.Vistax64.com/tutorials/165508-hibernation-enable-disable.html

    How to restore the default power in Vista (and then go back and change as you wish)
    http://www.Vistax64.com/tutorials/198047-power-plan-restore-default-settings.html

    Panel configuration-Device Manager - look at the settings for the network card, WiFi, Modem power management.
    and other devices. (Double click on the device and the power management tab)

    May need to reset all to default power settings and then place back as you prefer.

    I hope this helps and happy holidays!

    Rob - bicycle - Mark Twain said it is good.

  • I get startup repair screen when I try to boot my laptop from dell inspirion windows 7, I run the scan and detects any errors. When I ran repair usb key received the error 0x400110020000100A

    I get startup repair screen when I try to boot my laptop Dell Inspiron windows 7, I run the scan and detects any errors. So, I tried to use a USB repair for a laptop Dell Latitude Windows 7 pro and I still can't the computer to start. Tried to restore to the factory settings, can not. I have no image, backups, all missing, restore points?

    After that I tried to launch the USB repair I got 0x400110020000100A error code and I received error (0x8007027E) indicating the device will not start without a reboot.

    Anyone know how to fix this?

    Any advice would be greatly appreciated. I'm not computer illiterate, but am not pro either. Just use them not program them or even understand all languages!

    ____________________________________________________________________________________________________________

    Dell Inspiron laptop about 4-5 years.

    Running windows 7 Home Edition.

    Does not start little matter what I tried.

    If I remember correctly, I looked in MS-DOS mode and noticed that it said something like "x: win...» "that seemed strange to me because I thought that it should say"c: victory... "but as I said I am not a computer wiz so if anyone can help me, I would appreciate it.

    I'm about to rip the hair off my head with my laptop. My latitude was blue planned, surprisingly I fixed it (don't ask how, you couldn't tell). Then my dell inspiron would not start right after my dell latitude fell out of my truck and landed on the sidewalk, wanted to kill the person, the screen is broken. I can use it but it is very difficult, see a mosquito net and not perfectly clear, works well. lol someone knows somewhere or that would install a new screen for a reasonable price? I live in the Boston area.

    Back to the laptop won't start not, when I ran repair USB key received the error 0x400110020000100A

    Hello

    Thank you for the update on the issue. I appreciate your time and effort in resolving this issue.

    You can try the following methods and check if it helps.

    Method 1:

    You can use the Bootrec.exe tool in the Windows recovery environment (Windows RE) to troubleshoot and repair the following items in Windows Vista or Windows 7:

    • A master boot record (MBR)
    • A boot sector
    • A Boot Configuration data (BCD) store

    Note: When you are troubleshooting startup issues by using the Windows RE, you should first try the Startup Repair option in the System Recovery Options dialog box. If the Startup Repair option does not resolve the problem, or if you must troubleshoot more steps manually, use the Bootrec.exe

    Use the Bootrec.exe tool in the Windows recovery environment to troubleshoot and repair startup issues in Windows

    http://support.Microsoft.com/kb/927392

    If the problem persists, proceed to method 2.

    Method 2:

    Please follow these steps:

    1. Tool command prompt open in the mode of the Windows recovery environment .
    2. You will see X:\Sources
    3. Type chkdsk c:\ at the flashing prompt to launch the utility Chkdsk. replace c:\ with the letter of the drive that you want to run the Chkdsk utility. If the hard drive is d:\, then type that instead.
    4. After the "chkdsk c:\. "insert \f command to fix errors on the disk volume or the \r to recover bad sectors and then press ENTER.
    5. Restart the computer once the chkdsk command has completed.

    Note: Running chkdsk on the drive if bad sectors are found on the hard drive, it attempts to repair this sector, if all available on which data may be lost.

    For more information: Please refer to the section of the additional If you can not boot into Windows at all stages in the following link.

    Resolve stop (blue screen) error in Windows 7

    http://Windows.Microsoft.com/en-in/Windows7/resolving-stop-blue-screen-errors-in-Windows-7

    Hope this information is useful. If the problem still persists, please post back for further assistance, we will be happy to help you.

  • ISAM speed application issues since update to windows machines 7 (the opportunistic locking and SMB)

    I have a client system that runs an ISAM application, which worked OK on the SBS 2011 machine and windows XP SP3 machines

    The client has since upgraded its workstation to windows 7 x 64 workstations and ISAM application provider recommends that disable us opportunistic locking and also SMB v2 (e.g. force the workstation to communicate via SMB v1)

    We followed the steps described in the various sections of Microsoft KB (2696547 & 296264), and as a result still having very slow network performance.

    Then we found another reference external from the Microsoft site on disabling SMB digital signing, due to the use of SMB v1, and how that can sort out the problem with the speed of network problems.

    The customer had it since and it has improved performance, but it's still not at the same speed, as it was on Windows XP clients.

    is there a way to force windows 7 and SBS 2011 to use SMB 1 protocol and completely disable SMB 2, or we should create a new Member Server to use this ISAM application for sharing files.

    the application is integrated in the line of business customers to change with a huge expense, but the seller request said that intend it to upgrade applications to use some form of plan of database in the future, but it is at least 12 to 18 months away.

    Hello Paul,

    Thanks for posting your query in Microsoft Community.

    I understand that you have issues with Windows 7 and SBS 2011 uses SMB 1 protocols and completely disable SMB 2. So I would advice to follow the link below to post your query in the TechNet forums, because they have more expertise on this issue.

    TechNet forums

    http://social.technet.Microsoft.com/forums/Windows/en-us/home?Forum=w7itpronetworking

    I hope this helps. Otherwise, feel free to write us again and we will be happy to help you.

    Thank you

  • iPhone 6s more not to alert when it is locked and off

    When it is locked and off, my iPhone will not alert sound.  It will be if I unlock and screen is on, but will not otherwise.  Calls went through with the sound, but not with the texts.  I have made sure that the do not disturb settings are turned off and that the ringer is enabled and volume is completely upward.  Someone knows how to fix?  It was like that with IOS 9.3.3 and just updated to 9.3.4 and still no change

    Have you ever tried to force reboot the phone by holding down the button sleep and home for 10 seconds, until the Apple logo comes back again? You won't lose data, but it can clear some problems after installing new software.

  • Plugin check detects not new version of Flash

    Plugin check reports Adobe Flash Player 18.0.0.209 is vulnerable and the action is "update now".

    After you install 18.0.0.232 twice and firefox closed and opened several times, checking the plugin fails to detect the new version and still says 'vulnerable' - 'update now '.

    Thank you...

    Checked again this morning and it was fixed or perhaps restarting the pc is necessary.

  • I can't access my iMac, is locked and the keyboard will not connect. Magic mouse works OK. What should I do?

    Hello, how can I access my iMac that is locked and the keyboard will not match (new batteries and LED is blinckin). The Magic Mouse works OK. What should I do?

    Buy or borrow a USB keyboard and connect you with that. Once logged in go to your bluetooth preferences and pair it with the keyboard.

  • I broke my external hard drive and now it locked and disassembled?

    I just have a lot of questions here. After trying many things I found in a deeper hole.

    I use an external hard drive, it's a Seagate Backup Plus 1 TB external hard drive. It is formatted and partitioned, I did using the steps for me the Web of Seagate site, when I got it.

    I entered the hole, I'm right now because I had backup problems near the top of my photos of Lyve on my external drive. I think the reason why they would not return, it was because my drive was in offline mode in the "Status" section in Lyve, despite the fact that disk utility says the status of the disk is online. I researched and found out that this can happen if a.) the storage is full or b.) the wifi connection is bad or a connection is not available. When I opened my Seagate dashboard, I discovered that my drive was full, so I thought that was the reason. This made no sense to me because there was no way that I had somehow already packed 1 TB, I had saved only once and it is brand new. However, I deleted a ton of pictures I put in 'Lyve Import' and then allowed the trash. (I must have accidentally imported them several times, so the photos doubled several times or something because altogether they are 50 GB, 1 TB not...) That seemed to be the source because then my drive had 938 GB free!... But my drive was always in offline mode.

    So I refreshed, rebooted, unplugged and replugged, returned Wi - Fi works for Seagate Lyve and my computer. But my drive was still offline even though disk utility always says that it is online.

    Now, I'm still trying to find out why, it's that my drive has been appearing offline in Lyve when I used different Wi - Fi connections in different places and they all worked well, and I have lots of storage. One of the reasons is that the partition on my drive has still pictures of Lyve copied import, I had deleted, because there is almost no storage on this score somehow, I suspect. As you can see in the second photo, the score says he has only 16 MB of available space, and I somehow used GB 999. If it is the same as before, I don't know how to access this partition, and then delete them. It is a copy of all of these photos of Lyve Import? However...

    NOW, currently the main problem that prevents me from continuing to investigate on the previous question is: I had encrypted my external hard drive some time ago. After having annoyed having to enter a password long so many times because of the reopening and that to solve the problem 'offline', I've deciphered this hard drive clicking in the Finder by clicking Decrypt. I entered the password to do this, and have decrypted AFAIK because the password has been accepted. But now my drive says that it is locked and disassembled? What? It is shaded in the left sidebar of disk utility. It does not appear as a device plugged into the Finder. It's as if he is not yet here, but I can still access Lyve. From what I understand, my disc encryption would protect its ' content with a password. Decryption, it would mean that I wouldn't have to type a password to access? Seriously worried that I screwed to the top of something because I did not understand what the consequences would be here. In addition, why my player not appear when the score indicates the status of the disk is online?

    I have included pictures of both the disk and partition information, and what they look like now in disk utility. Previously, from what I remember, in the information section of my car he had about 948 GB available, was mounted and he said it was a logical Partition encrypted, if it is of no use. It does not display this information now because it is locked, correct? I did not delete anything?

    As you can tell, I didn't know what I was doing the same in the first place - and now, I'm stumped. Please bear with me on this because all of this formatting and partitioning, and editing and similar is confusing me, only knowledge I had performed since the steps provided in the forums or on Seagate and Lyve directions on their website. I really don't understand what that means anyway - I wasn't trying to screw around things just... Any help would be GREATLY appreciated.

    ^ Note that this is what my Finder looks like now despite the fact that my external hard drive is connected. He always used to display the full drive Center 'FAVORITES' and 'TAGS' as a device that is currently connected, with the option to display its "table of contents or eject it.

    Update - I managed to solve this problem using this forum:

    How decrypt external hard drive, so it can be re-partitioned

    Make it wiped my drive, but given that I had pictures about it as I have copies on my computer, which was not serious.

    Good luck to everyone

  • Activate both drag the lock and drag three fingers

    I tried to activate the TWO drag the lock AND three sliding your finger on my new MacBook Air shape some time and have not been able to do.

    I have an older MacBook Air and an older iMac and on these two computers, it works (it didn't come pre-loaded with El Capitan, they have been 'improved' to El Capitan).  On both I can drag a window using both drag lock AND drag three fingers.  However, I am unable to do it on this new computer.   Is the any way to implement?

    Any ideas?

    Hi Joel,

    Options to drag in El Capitan are discussed in this resource:

    OS X El Capitan: mouse & Trackpad pane accessibility preferences
    https://support.Apple.com/kb/PH21509?viewlocale=en_US&locale=en_US

    The trackpad options

    Allow drag

    Check the box to be able to drag items.

    To set sliding options, click on the context menu, and then choose an option:

    without slide-Lock: double-tap an item, and drag it without lifting the finger after the second tap. dragging stops immediately when you remove your finger.

    Drag lock: double-tap an item, and drag it without lifting the finger after the second tap. dragging continues when you remove your finger and stops only when you type once the trackpad.

    three fingers slide: move an element with three fingers. dragging stops immediately when you lift your fingers.

    Take care

Maybe you are looking for

  • Recent open maintains up to 0

    I recently installed at El Capitan and don't know if that's why my problem happens or not.  But, I miss not having recently used files displayed in the Pages and Numbers.  I go into preferences and set it, but when I later check it is set to 0.  Plea

  • 36 IO error trying to play a video file

    After you have copied 20 video files from one external hard drive to another, I'm not able to access or read all copied files

  • Adding several fields of a background without lag thread

    Basically I have a thread that reminds an interface method that traverses a vector of objects, and then creates a custom manager and adds that the Manager on the screen. I have about 10 custom handlers that I add to the screen and there is always a l

  • Error path favorite of Politica SRM IBM DS5100

    Buenos dias,Primero nuestro stage explico:We have a con BladeCenter 6 blades connected, cada con blade knew propio ESX 4.0.Pass back CFUNA DS5100 IBM SANCada Blade(servidor ESX) has 4 rutas acceso a una LUNEl problema:Storage Manager IBM en we have s

  • Reg: Display ID Incident created in Siebel on OPA

    Hi all I have a requirement where we capture a certain incident (say a person reports an incident) takeover.Once the user submits the OPA interview where incidents details are captured, a web service call is made and these values are passed to Siebel