Explain plan before and after ??

is there a way to find out what sql plan was before and what sqlp plan is right now ?
i know we can look at dba_hist_sql_plan but not sure how to put it all togeather...
i am on 10.2.0.3
i have a sql that running slow right now, i have the sql_id for it now...looks like its runing
slow and last week it was fine...need to know what the explain plan was last week ??

If you are lincenced to use AWR and history tables, you can do this
SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_AWR('&SQL_ID')); ---to get the SQL execution plan as it was run from history
For the current one, you know how to get it
SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR('&SQL_ID'));
SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY('&SQL_ID'));
You can also query dba_hist_sql_plan and format the results.

Similar Messages

  • Why there is implicit commit before and after executing DDL Statements

    Hi Guys,
    Please let me know why there is implicit commit before and after executing DDL Statements ?
    Regards,
    sushmita

    Helyos wrote:
    This is because Oracle has design it like this.Come on Helyos, that's a bit of a weak answer. :)
    The reason is that it makes no sense to update the structure of the database whilst there is outstanding data updates that have not been committed.
    Imagine having a column that is VARCHAR2(50) that currently only has data that is up to 20 characters in size.
    Someone (person A) decides that it would make sense to alter the table and reduce the size of the column to varchar2(20) instead.
    Before they do that, someone else (person B) has inserted data that is 30 characters in size, but not yet committed it.
    As far as person B is concerned that insert statement has been successful as they received no error, and they are continuing on with their process until they reach a suitable point to commit.
    Person A then attempts to alter the database to make it varchar2(20).
    If the database allowed that to happen then the column would be varchar2(20) and the uncommitted data would no longer fit, even though the insert was successful. When is Person B going to find out about this? It would be wrong to tell them when they try and commit, because all their transactions were successful, so why should a commit fail.
    In this case, because it's two different people, then the database will recognise there is uncommitted transactions on that table and not let person B alter it.
    If it was just one person doing both things in the same session, then the data would be automatically committed, the alter statement executed and the person informed that they can't alter the database because there is (now) data exceeding the size they want to set it to.
    It makes perfect sense to have the database in a data consistent state before any alterations are made to it, hence why a commit is issued beforehand.
    Here's something I wrote the other day on the subject...
    DDL's issue a commit before carrying out the actual action
    As long as the DDL is syntactically ok (i.e. the parser is happy with it) then the commit is issued, even if the actual DDL cannot be executed for another reason.
    Example...
    We have a table with some data in it...
    SQL> create table xtest as select rownum rn from dual;
    Table created.
    SQL> select * from xtest;
            RN
             1We then delete the data but don't commit (demonstrated by the fact we can roll it back)
    SQL> delete from xtest;
    1 row deleted.
    SQL> select * from xtest;
    no rows selected
    SQL> rollback;
    Rollback complete.
    SQL> select * from xtest;
            RN
             1
    SQL> delete from xtest;
    1 row deleted.
    SQL> select * from xtest;
    no rows selectedSo now our data is deleted, but not committed, what if we issue a DDL that is syntactically incorrect...
    SQL> alter tab xtest blah;
    alter tab xtest blah
    ERROR at line 1:
    ORA-00940: invalid ALTER command
    SQL> rollback;
    Rollback complete.
    SQL> select * from xtest;
            RN
             1... the data can still be rolled back. This is because the parser was not happy with the syntax of the DDL statement.
    So let's delete the data again, without committing it, and issue a DDL that is syntactically correct, but cannot execute for another reason (i.e. the database object it refers to doesn't exist)...
    SQL> delete from xtest;
    1 row deleted.
    SQL> select * from xtest;
    no rows selected
    SQL> truncate table bob;
    truncate table bob
    ERROR at line 1:
    ORA-00942: table or view does not exist
    SQL> rollback;
    Rollback complete.
    SQL> select * from xtest;
    no rows selectedSo, there we have it. Just because the statement was syntactically correct, the deletion of the data was committed, even though the DDL couldn't be performed.
    This makes sense really, because if we are planning on altering the definition of the database where the data is stored, it can only really take place if the database is in a state where the data is where it should be rather than being in limbo. For example, imagine the confusion if you updated some data on a column and then altered that columns datatype to be a different size e.g. reducing a varchar2 column from 50 character down to 20 characters. If you had data that you'd just updated to larger than 20 characters whereas previously there wasn't, then the alter table command would not know about it, would alter the column size and then the data wouldn't be valid to fit whereas the update statement at the time didn't fail.
    Example...
    We have a table that only allows 20 characters in a column. If we try and insert more into that column we get an error for our insert statement as expected...
    SQL> create table xtest (x varchar2(20));
    Table created.
    SQL> insert into xtest values ('012345678901234567890123456789');
    insert into xtest values ('012345678901234567890123456789')
    ERROR at line 1:
    ORA-12899: value too large for column "SCOTT"."XTEST"."X" (actual: 30, maximum: 20)Now if our table allowed more characters our insert statement is successful. As far as our "application" goes we believe, nay, we have been told by the database, we have successfully inserted our data...
    SQL> alter table xtest modify (x varchar2(50));
    Table altered.
    SQL> insert into xtest values ('012345678901234567890123456789');
    1 row created.Now if we tried to alter our database column back to 20 characters and it didn't automatically commit the data beforehand then it would be happy to alter the column, but then when the data was committed it wouldn't fit. However the database has already told us that the data was inserted, so it can't go back on that now.
    Instead we can see that the data is committed first because the alter command returns an error telling us that the data in the table is too big, and also we cannot rollback the insert after the attempted alter statement...
    SQL> alter table xtest modify (x varchar2(20));
    alter table xtest modify (x varchar2(20))
    ERROR at line 1:
    ORA-01441: cannot decrease column length because some value is too big
    SQL> rollback;
    Rollback complete.
    SQL> select * from xtest;
    X
    012345678901234567890123456789
    SQL>Obviously, because a commit statement is for the existing session, if we had tried to alter the table column from another session we would have got
    SQL> alter table xtest modify (x varchar2(20));
    alter table xtest modify (x varchar2(20))
    ERROR at line 1:
    ORA-00054: resource busy and acquire with NOWAIT specified
    SQL>... which is basically saying that we can't alter the table because someone else is using it and they haven't committed their data yet.
    Once the other session has committed the data we get the expected error...
    ORA-01441: cannot decrease column length because some value is too bigHope that explains it

  • What are Before and After Images ?

    Hello Masters,
    Best wishes to all.
    For the past one week I've learnt many concepts from SDN, got all my doubts clarified.
    On the same roll, I have one more question
    What are Before and After Images ?
    Where do we come across these terms ?
    Could you please explain with an example ?
    I always thank my replies in points 
    Thanks in advance...

    <b>Hai</b>....
    <u><b>Before and After Images:</b></u>
    This Term is Used in the " Change Log "....
    Change Log is one of the Table used in ODS....
    That means the Changes in Running Request in ODS....
    Example:
    If you Enter the Request to " New Table" after activation the Request will be Deleted From the Table, You can see that in Change log......
    <i><b>Assign Points If It Halps</b></i>....
    <u><b>BalajeeKannan</b></u>

  • Before and After View

    When I'm in my Develop module and I look at some of my edited photos my before and after view is not showing.  Sometime I see the original for a second then it resorts to the edited.  Now this is happening to some of my collection cause in some collection they are working just fine.  Can some explain to me what is happing.
    thanks

    That's not it. I'm not sure what your talking about or we are talking about two different things. All the files in the collection are before and after are the same this is evident on some other folder in the collection.
    I think I figure out the problem
    Go to the History located  on the left side of your canvas, above the Copy and Paste buttons.  You should see Preset, Snapshot, History and Collection.  They should have a + beside to expand.  Go to History (this is a list of all you edits you made on the image) Go to the bottom where it says import of the file. This is the start point of your file.
    Right mouse click on the import xxxx xxxx file ( or how ever you saved your file name). Highlight "Copy History Step Settings to Before."
    There you go your good to go
    I don't know how to do this on all the images with this problem in the folder all at once.  I just do it individually.

  • Bug: Before and After Margins Layout with section starting in right page

    Hi,
    I am using the Spanish version of Pages 09. I have observed that when I start a new section, I have no problems setting the layout margins (right, left, before, after) of this section.
    But if a set that the new section must start in a right page, then the "before" and "after" margins of the layout doesn't work.
    Is this the same in English versions of Pages?
    Regards,

    I see what you are saying.
    The problem is Pages seems to have a memory of how you arrived at that layout.
    When I construct the pages, it is correct.
    I am trying to find out what is interacting in your layout to cause this to happen. It is like there is a hidden inaccessible layout break on the blank inserted page.
    I have been tearing my hair out trying to work out what triggers it off. As I experimented with the combinations of settings in Facing pages, Section layouts and which page it starts on, it erratically switches back and forth.
    This is why I gave up on Pages years ago as a serious layout tool. It has too many of these raw, poorly thought out interactions. I use a lot of different applications and none of them, that I can think of, have so many of these mind twisting raw oddities. Odd for a supposed user friendly application.
    All the rest are pretty literal, you apply the settings and end up with a logical result of those settings. If the result is not what you wanted it is a matter of tracking what is interacting with what and straightening it out. Pages has the annoying "design" of inexplicably greying out functions for no stated reason, that prevents correction. Or hiding the access to the tools to those settings. You can only get to some of them if you have explicitly done something to make them possible. The rules as to what that "something" is, are not apparent nor in most cases explained in the User Guide or the User Interface.
    There may be a "reason" why the function is greyed out but it is not revealed to the user without an enormous amount of detective work and as in this case my sleuthing abilities are failing me completely. I might try it again tomorrow after a rest (it is very late here). Either way it is a huge time waster.
    This is fundamentally bad User Interface design and what I have railed against since Apple changed shifts, bringing in the OSX programmers who never really got the polished UI of the original Mac OS and have been cooking with Fanta* ever since.
    Peter
    * This is an anecdote originally told by Peter Russell-Clarke, a well known and creative Australian chef back in the 70's. He was berated in the street by a woman who told him that his recipe for +Duck à l'orange+ was "disgusting". When he cross examined her, he found she didn't eat fresh fruit so had made the orange sauce with Fanta.
    I use this to try and get the message over to clients when they insist on "substituting" material because "what's the difference". The trouble with people who can't tell the difference is that they rarely ever do, no matter how carefully it is demonstrated to them.

  • When exporting XML files, I get forced line breaks before and after my xmltag

    hi everybody,
    as I said, i do a javascritp that exports xml files. First I clean up my text by removing every invisible characters with app.findpreferences. Nevertheless, my xml files is almost well formed beacause i got before and after each xmltag a forced line break. Somebody could explain to me why ?
    I don't use prettyIndent and prettyPrinting .
    Best regards
    Américo Pinto

    hi everybody,
    as I said, i do a javascritp that exports xml files. First I clean up my text by removing every invisible characters with app.findpreferences. Nevertheless, my xml files is almost well formed beacause i got before and after each xmltag a forced line break. Somebody could explain to me why ?
    I don't use prettyIndent and prettyPrinting .
    Best regards
    Américo Pinto

  • I am trying to delete pages I have crated in numbers, but can only see them in print preview. Without print preview I do not see them. How can I delete these pages, but keep others before and after?

    I am trying to delete pages I have crated in numbers, but can only see them in print preview. Without print preview I do not see them. How can I delete these pages, but keep others before and after?

    Hi Crushed,
    Numbers doesn't have pages. It has a canvas that holds objects such as tables and charts.
    Drag the objects from the bottom of the canvas onto the white space above. That will reduce the number of "pages" (sheets of paper) that will print.
    Regards,
    Ian.

  • My ipod touch is stuck on the apple logo and after a while a white screen comes up and it restarts and the same thing all over agan. this happened to me before and after a while it turns on but why does it keep on doing this?

    my ipod touch is stuck on the apple logo and after a while a white screen comes up and it restarts and the same thing all over agan. this happened to me before and after a while it turns on but why does it keep on doing this?

    Try connecting the iPod Touch to your computer and restore it.  http://support.apple.com/kb/HT1414

  • How do I add a before and after transition to a standalone clip in the second or other than primary stack?

    New to FCPX on a project this weekend. I have gotten reasonably comfortable with the basic features but one thing that I CANNOT figure out, is how (what used to be) selecting a track in the timeline to activate it to apply a transition.  I need to select a video clip which stands alone in the stack which is positioned above the primary track and add a blend transition before and after the clip. I have set the opacity to blend with the images in the primary track below but the beginning and end of the clip in the second stack do not fall at the transition points in the lower track which should not matter anyway.  I can’t find it in Help or the third party tutorials that I purchased and completed.  Thanks for your help!

    Tom gave you the answer.  As a follow-on you can then use the Cross Dissolve transition on your newly converted connected clip.  This transition will allow it to dissolve smoothly into the video below it.  Note that the Fade to Black transition will take both that clip and the video below it to black which would probably be undesirable. Use Cross Dissolve instead.  Best wishes.
    stephen

  • GREP: How can I place a (for example) "*" before and after bold text with GREP?

    Hi there.
    I have a string of text as such:
    I want to use GREP to insert a "*" (asterisk) before and after each bold part. Can I do that with GREP?
    (if asterisk is a problem, I can use a different character)
    Any help would be appreciated.

    Hi Schmaltzkopf,
    try this:
    Have fun

  • What is the best app for before and after photos for my Mac?

    I am looking for a program or app for my mac so i can put pictures up side by side.... like before and after photos.  Any suggestions?

    best cheap solutions. 
    acorn
    https://itunes.apple.com/us/app/acorn-4-image-editor-for-humans/id634108295?mt=1 2
    pixelmator
    http://www.pixelmator.com/
    Fotor (my fave) and FREE
    https://itunes.apple.com/us/app/fotor-photo-editor/id503039729?mt=12
    FXphoto studio
    https://itunes.apple.com/us/app/fx-photo-studio-pro-effects/id312506856?mt=8

  • Hi, Just switched from CS6 to PS CC. I am used to using ACR in CS6 with it's preview checkbox in the upper  right-hand corner. I do not see that checkbox in PS CC. I see that they have added side-by-side, right and left and top and bottom before and after

    Hi,
    Just switched from CS6 to PS CC. I am very comfortable using ACR in previous versions. I liked to use the preview checkbox located in the upper right-hand corner to see before and afters. That checkbox is no longer in my version of PS CC. I see that they have side-by-side, top and bottom and right and left before and after options in the lower right-hand corner in this version. Is there anyway to get that legacy preview checkbox back so that I can use it?

    Hi Warunicorn,
    Thank you very much. I just could not find it on my own. I will have more questions as I get into it.
    Jim

  • Data Loading(Before and After Image)

    I heard that a datasource which has both "Before and After Image " ,then the data can be sent directly to the infocube or from the DSO to the Infocube but where as
    If a datasource supports after image then first it has to be loaded to the DSO and then to the Infocube ,
    My question is how to know the image types of the datasource ?

    Hi Ravi,
    Check in ROOSOURCE tables in ECC. You can find the behvariaour options in DELTA field, so based on this table we can say will it support Cube/ODS.
        Delta Only Via Full Upload (ODS or InfoPackage Selection)
    A    ALE Update Pointer (Master Data)
    ABR    Complete Delta with Deletion Flag Via Delta Queue(Cube-Comp)
    ABR1    Like Method 'ABR' But Serialization Only by Requests
    ADD    Additive Extraction Via Extracto (e.g. LIS Info Structures)
    ADDD    Like 'ADD' But Via Delta Queue (Cube-Compatible)
    AIE    After-Images Via Extractor (FI-GL/AP/AR)
    AIED    After-Images with Deletion Flag Via Extractor (FI-GL/AP/AR)
    AIM    After-Images Via Delta Queue (e.g. FI-AP/AR)
    AIMD    After-Images with Deletion Flag Via Delta Queue (e.g. BtB)
    CUBE    InfoCube Extraction
    D    Unspecific Delta Via Delta Queue (Not ODS-Compatible)
    E    Unspecific Delta Via Extractor (Not ODS-Compatible)
    FIL0    Delta Via File Import with After-Images
    FIL1    Delta Via File Import with Delta Images
    NEWD    Only New Records (Inserts) Via Delta Queue (Cube-Compatible)
    NEWE    Only New Records (Inserts) Via Extractor (Cube-Compatible)
    O  
    ODS    ODS Extraction
    X    Delta Unspecified (Do Not Use!)

  • Repairing permissions before and after updating software

    What is the reason to repair permissions before and after updating software? This may sound like a stupid question to many of you, but I am new to computers and I am trying to learn how and why of some of the things of my PowerBook. I installed some updates without repairing permissions. Did I install some software updates the wrong way? Thank you.

    This is a topic which will draw as many emphatic for and against responses as overnight shut down or not, defrag or not, optimise or not, and so on.
    I agree with Neil. I believe that OS X has progressed sufficiently that repair permissions has become redundant and so I do not do it on any regular basis.
    Some folk may refer you to an Apple Support Article 303602. That Article in its 4 May 2006 version, titled "Top 10 Tips to Keep Your Mac in Top Form" suggested Repair Permissions should be done "after upgrading or installing new software". The Article was however revised on 15 May 2006 to be titled "Top Tips to Keep Your Mac in Top Form" and the item on Repair Permissions [along with two other recommended maintenance tips] was removed. It is my view that the conclusion to be drawn here is that Apple no longer considers Repair Permissions to be a required maintenance procedure.
    Many users have adopted a "Repair Permissions" mantra for a cure-all over several years. I dropped it sometime in 10.3.
    But, to each his own.
    HTH
    TiPB 867   Mac OS X (10.4.6)  

  • How do I create a form that will give a report that summarises before and after data on the same graph?

    I have a number questions that I want to know the average of all the before and after data to compare them, how do I set this up in a form in FormsCentral?  Here is an example of what I want to do - the green bar is "before" and blue is "after"

    This isn't something that you can set up in FormsCentral. It's possible to something similar with a form you create in Acrobat and use with FormsCentral, but there is no sort of built-in graphing control. The bar graph could be implemented with some JavaScript that controls annotations or fields (buttons) and perhaps some text fields.

Maybe you are looking for

  • Printing on an HP Laserjet 5M through a Windows XP PC

    Hi, At our office we're running 10.3 and 10.4, as well as Windows XP. The XP computers are hooked up to the printer (HP Laserjet 5M & HP Deskjet 820 Cxi For Windows). Now, I've gotten my Mac (running 10.4) to actually see and communicate with the pri

  • Upload a doc into SAP and then FAX it

    Hi I'm looking for a method of uploading a doc into SAP and then FAX it to a customer. What currently happens is this: 1.  SAP creates a document, which is saved to a UNIX directory as a text file. 2.  An external process takes this file, uses the in

  • Difference between BAPI and BADI

    Hi, Can anyone explain the difference between BAPI and BADI?

  • Crystal Reports prompting for creds when viewed from BO 4

    The environment: Business Objects Enterprise 4, sp2 patch 8 SAP ECC 6.0, kernel 701, sup. pkg. lvl 137 This is a new BOE 4 installation on a test system.  The BOE installation has been configured to use Windows AD authentication with SSO.  When I run

  • Include a structure in a TYPES declaration

    Hii I have a structure BISEG i need to declare an internal tabel with that structure BISEG + some additional fields i did like below please advise if this correct TYPES begin of types ty_itab                      include type BISEG