Is there a way to PL/SQL to force Oracle to re-evaluate the implementation plan

In a packaged procedure, I have sturctured of code like this:
for rec1 in cursor1
loop
  -- do some calculations
  for rec2 in cursor2(cursor_params)
  loop
    -- do more stuff
  end loop;
end loop;
The problem is that the first time through the outer loop, that he is on an implementation plan for the cursor from inside. But the plan, with what happens isn't the best plan for later iterations of the loop. I want to do is something like this:
for rec1 in cursor1
loop
  -- do some calculations
  if rec1.column1 != prev_column1
  then
    -- forget previously calculated cursor2 execution plan
  end if;
  for rec2 in cursor2(cursor_params)
  loop
    -- do more stuff
  end loop;
end loop;

http://prutser.WordPress.com/2009/04/19/flushing-a-cursor-out-of-the-library-cache/

Tags: Database

Similar Questions

  • Is there a way to open a new window with a site when the House on Firefox setting has several Web sites?

    When you work in Firefox, is there a way to open a new window with a site when the House on Firefox setting has several Web sites?

    Firefox always opens a new window with the home page (s), you must use shift + left click on a link (bookmark) to open a page in a new window or just rip an existing tab by dragging the tab slightly downwards to open the tab in a new window.

  • In excel 2003, is there a way to keep your custom headers and customer footers to the same size as the page at 100% or 76% or 50%.

    In excel 2003, is there a way to keep your custom headers and customer footers to the same size as the page at 100% or 76% or 50%.

    Hello Terri Haineman,

    Thank you for visiting the Microsoft answers community.

    The question you've posted in Office-related and would be better suited to the office community. Please visit the link below to find a community that will provide the best support.
    http://www.Microsoft.com/Office/Community/en-us/default.mspx?DG=Microsoft.public.Excel.misc&lang=en&CR=us
    Chris.H
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Menu to transfer the photos on my memory card does not appear, is there another way I can do?... Without using the usb cord...

    Menu to transfer the photos on my memory card does not appear, is there another way I can do?... Without using the usb cord... He lost. :/

    The following steps may be worth a try:

    Insert your memory card into your Media Player...

    Reach... Start / computer...

    What is the memory card show as a drive letter? (if your Media Player)
    has several slots, there will be several "hard drives" listed... the
    SD card will be one of them)

    If_Yes_right click on the drive letter correct and in the menu... Choose...
    Open... now you should see the directory of the memory card or to explore.

    From there you should be able to drag and drop or copy and paste the
    files in a folder on your hard drive.

    Also... the following items may be worth a visit:

    Windows Vista-
    Troubleshoot AutoPlay
    http://Windows.Microsoft.com/en-us/Windows-Vista/Troubleshoot-AutoPlay-problems

    Windows Vista-
    How to change the auto run settings
    http://Windows.Microsoft.com/en-us/Windows-Vista/Change-AutoPlay-settings

    Windows Vista-
    AutoPlay: Frequently asked questions
    http://Windows.Microsoft.com/en-us/Windows-Vista/AutoPlay-frequently-asked-questions

  • When you print an image in Windows Photo Viewer, is there a way to do that is to ensure 'fit picture to the frame' * not * checked by default?

    Just as the title says:

    When you print an image in Windows Photo Viewer, is there a way to do that is to ensure 'fit picture to the frame' * not * checked by default?

    Hello

    It is normal in the Windows Photo Viewer Photo to adapt to the frame is checked.

    Print a photo

    http://Windows.Microsoft.com/en-us/Windows7/print-a-picture

  • Is there a way to tell if a virtual machine was created using the LSI or BusLogic SCSI device?

    Is there a way to tell if a virtual machine was created using the LSI or BusLogic SCSI device?

    No worries, you can try going to the virtual machine and looking for an online .vmx file such as - scsi0.virtualDev = "free".

    I shot on a vmware workstation VM, don't know if it's exactly the same vmware server, but is worth a visit.

    • Kyle

  • I'm using firefox 5.0 & I use a master password. Whenever I open firefox, it asks the password. It happened not in previous versions. Is there a way to stop popping up everytime, rather than turn off the password

    I'm using firefox 5.0 & I use a master password. Whenever I open firefox, it asks the password. It didn't happen in the previous versions of firefox. I don't want to disable my master password. Is there a way to stop what is happening each time? Is this a bug in the new version.

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions of the origin of the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > appearance/themes).

  • Is there a way to convert my wav files to mp3 files in the player and music library.

    I copied some old vinyl to my computer and saved as wav files. I would like to convert thm into mp3 files to save space. When I had Vista I believe that there is a tab in the media player that will allow me to edit the files from wav to mp3 files. Is there a way to do this in Windows 7.

    To copy the old LP's to a PC, I would use Audacity (more the Lame encoder) because it will only convert but also, before we do, you can use it to clean your wav files.

    Audacity is a complete audio editing software (free) so you can get rid of all unwanted sounds like the rumble of Platinum, clicking on (starting from scratch) etc. using the various filters included with the software. RIP with firstly, Audiograbber as freeware

    Google for their web pages, both work with the Lame mp3 encoder.

    See you soon,.

    Jerry

  • Is there a way to make a long audio clip that consists of the individual audio clips?

    My calendar contains 6 audio and video clips.  I need to make adjustments to the audio.  Is there a way to consolidate all 6 audio clips in a long clip that could be included on a new track, and then make the necessary adjustments to the audio project?

    Nest audio.  Pressing F1 in PP to learn how.

  • Is there a way that Captivate 8 swf format can take focus when the html page loading?

    I am trying to create a project to 8 Captivate user can navigate using the keyboard or the PlayBar. I added buttons to slides with Page Up and Page Down shortcut keys, but the keyboard commands do not work until the user gave focus to the swf file by clicking in it, is there a way for the swf file take the focus automatically when loading? I tried changing the setting wmode to "opaque", but has not made a difference.

    Or are there keys or key combinations that will work even if the SWF is not developed?

    -Stuart

    Captivate has already an update script to throw. You can try adding the onload of body. Add the script to the head section

    then add the function in the body:

  • Is there a way to find your license key in your photoshop on the computer program?

    I can't find my license key is there a way to find it in the program itself?

    Hi Carpentier,

    Please visit the link below to find the serial number.

    Quickly find your serial number

    Let us know if it helps.

    ~ Mohit

  • Is there a way to prevent Gift Voucher e-mail to go to the Spam folder?

    Whenever I have send an email to someone with a gift voucher or Code of reduction in generated emails the system, they always end up in the folder of Spam from GMail, Yahoo, etc..

    Is there a way to prevent e-mails from being marked as Spam with this system?

    You must check the 'From' email address and make sure it is a valid emial address. If it is hosted on the outside to ensure that you have the setup of SPF record correctly. More information on that can be found here http://forums.adobe.com/docs/DOC-2001

    See you soon,.

    Mario %-)

  • SQLT profile SQL "Glue" not how don't eliminate the inefficient Plan hash value?

    I have a strange problem. I have used many times before SQLT not only assign a SQL profile for a specific query, but also for the force_match of other issues with different literal values. It has always worked in the past. I run the following script:

    START coe_xfr_sql_profile.sql <sql_id> <plan_hash_value>
    

    I take the generated script and modify the following (line #9) to force the game.

    DBMS_SQLTUNE.IMPORT_SQL_PROFILE (
    sql_text    => sql_txt,
    profile     => h,
    name        => 'some_name',
    description => 'some description'||:signature||' '||:signaturef||'',
    category    => 'DEFAULT',
    validate    => TRUE,
    replace     => TRUE,
    force_match => TRUE /* TRUE:FORCE (match even when different literals in SQL). FALSE:EXACT (similar to CURSOR_SHARING) */ );
    DBMS_LOB.FREETEMPORARY(sql_txt);
    END;
    /
    

    When I run the script, I can see the profile is assigned to the specified SQL_ID, but not for those with a different literal values (example: LIKE "< some_value >"). I know that we should use bind variables here and that will be recommended for the developer. The difference between the two plans, however, is huge (+ 30 minutes instead of milliseconds) and the impact on our production database is very noticeable when multiple users are doing the same. When I take a look at the different SQL_ID, they all use the exact same ineffective regime. Since I can't make the SQL profile on all of the SQL_ID, is there a way to eliminate the inefficient system of restraint? I used forced for several times and this is the first time, it didn't work. Help is greatly appreciated. Thank you.

    Have you checked the FORCE_MATCH_SIGNATURE of the SQL statements in question in V$ SQL?

    If they are not all the same, the FORCE_MATCH cannot help.

    Why they may not have the same thing?

    For example, if they use links AND literals.

    E.g. literals only:

    set serveroutput on
    declare
    l_sig NUMBER;
    begin
    l_sig := dbms_sqltune.sqltext_to_signature('select * from t1 where col1 = 1',TRUE);
    dbms_output.put_line(l_sig);
    end;
    /
    anonymous block completed
    109606082837927916
    
    declare
    l_sig NUMBER;
    begin
    l_sig := dbms_sqltune.sqltext_to_signature('select * from t1 where col1 = 2',TRUE);
    dbms_output.put_line(l_sig);
    end;
    /
    anonymous block completed
    109606082837927916
    

    But if you use bind AND literals:

    declare
    l_sig NUMBER;
    begin
    l_sig := dbms_sqltune.sqltext_to_signature('select * from t1 where col1 = 1 and col2 = :1',TRUE);
    dbms_output.put_line(l_sig);
    end;
    /
    anonymous block completed
    16455499341945681140
    
    declare
    l_sig NUMBER;
    begin
    l_sig := dbms_sqltune.sqltext_to_signature('select * from t1 where col1 = 2 and col2 = :1',TRUE);
    dbms_output.put_line(l_sig);
    end;
    /
    anonymous block completed
    13278767079226598822
    

    Unfortunately...

  • Is there a way to automatically fill bookmarks and folders of bookmarks in the toolbar and menu for a consistent view?

    The separate group of bookmarks in Firefox in the toolbar, Menu and does not sort, I always found it cumbersome to use and manage. The search for bookmarks often means I have to open each one to find a specific bookmark. I am aware of the show all bookmarks in bookmarks option > drop-down Menu (but isn't in the bookmarks bar). I know how to copy the bookmarks and folders etc. but it is hard to do every time I have bookmark. And if I add a new bookmark folder and want a consistent view, I need to copy this folder in the Menu or eitherToolbar and copy the new bookmarks in the toolbar or the Menu as well.

    Is there an add-on or option or other alterative that exists to provide that kind of capability?

    If not, maybe an adding future functionality to Firefox to eventually change the vision presented in the bookmarks bar and Bookmarks Menu so that they match and can be activated by a new option of FireFox "change the bookmark view show merged Bookmarks Toolbar + Bookmarks Menu bookmarks and folders of bookmarks in the toolbar and menu.

    Thank you very much!

    After a few edits, I found a way to accomplish what I want, and fortunately, it can be done in the application of Firefox without needing an add-on.

    I simply copy the bookmarks unordered top-level in the top-level bookmarks toolbar and the bookmarks Menu of top-level. This, combined with the convention to add all new bookmarks in the folders under Unsorted Bookmarks or Unsorted Bookmarks, provides the unified content bookmark I want across all views bookmark 3 (Unsorted, Menu, Toolbar).

    From the library page (grown by selecting from the menu of Firefox bookmarks bar > show all bookmarks), if I select Unsorted Bookmarks, copy and paste into the bookmarks toolbar and paste in the Menu bookmarks, this is what I want. I actually created a symbolic/reference/shortcut link to Unsorted Bookmarks the other two favorite places can be found.

    With Unsorted Bookmarks in the bookmarks toolbars and bookmarks Menu, any add/remove bookmarks or add/delete records or restructuring of the bookmarks under Unsorted Bookmarks directory tree is also immediately reflected in all 3 of the possible locations of bookmark (Unsorted, toolbar, Menu).

    The design and implementation of bookmarks supports this simple solution, so Bravo for designers and coders for built-in extensibility / generality which support this approach. And thanks for the posters for giving me some background and history on the bookmarks in Firefox, motivation me digging to find this solution which is quite simple and elegant.

    Thank you!

  • Is there a way to create a smart playlist without several songs from the same album?

    I would like to create a smart playlist without several songs of his same albums.  Is this possible?

    Timo,

    Unfortunately not.

    Smart playlist logic analyzes each song individually and includes those who correspond to rules.  There is no way to write a rule that depends on other songs in the same album.

Maybe you are looking for

  • Can I use RAID0 on Satego X 200-21 L?

    Hello everyone I have a question. I can create a RAID0 on my Satego X 200-21 L and if so how? Thank you in advance.

  • Cannot install the Trusted Platform Module Driver / software

    I am not able to install the driver of the TPM secure and so I'm not able to install the TPM software... I have a satellite u200, and it's on my tools and utitilities cd. Installation always says "Trusted Platform Module not found" someone at - it th

  • ARE THERE WINDOWS 8 TO 8.1 UPGRADE FEES?

    I received an email saying that I can get a free update of Windows 8 to 8.1 now I just see that if you download the upgrade through Windows there are a load of HP. It is a HP computer brand new so I thought that maybe it's a promotion at HP and I wan

  • My windows will not update, I get a 80072ee2 error code?

    My windows will not update, I get a 80072ee2 error code? I run Vista, and I know there have been some problems with updates in the past, would be Vista the reason why I'm getting this error? See you soon Kim

  • HP CQ58 - 351SQ WIN7 drivers please help

    Hello I need assistance with my new laptop CQ58-351SQ. I managed to install the version of Windows 7 Professional 32-bit. I need the VGA drivers for the device below: PCI\VEN_1002 & DEV_9809 & SUBSYS_1885103C & REV_00PCI\VEN_1002 & DEV_9809 & SUBSYS_