What execution plan was used?

Hi there
How can I find out what execution plan was used for an SQL when it was executed as part of the batch-process at night? 10gR2 on ASM, RHEL 5.8 64bit.
Best regards

Are you using the enterprise edition?  Are you licensed to use the AWR?  If so, assuming that the query ran long enough to be captured in an AWR snapshot (which seems likely if you're asking this question), DBA_HIST_SQL_PLAN will have the plan information and DBA_HIST_SQLSTAT will tell you the plan_hash_value (or values) that were used for a particular SQL_ID in a particular SNAP_ID.  DBA_HIST_SNAPSHOT will tell you what SNAP_ID (or set of snap_id's) corresponds to whatever time period you are interested in.
Justin

Similar Messages

  • How to tell what recovery point was used for restore

    Is there a way to determine what recovery point was used for a restore after the restore was started.

    The question comes from the experience of having a package installed but not being able to build it from the same PKGBUILD (due to nontrivial issues). The package must have been built successfully by *a* build system, so ideally one would want to replicate that build. The relevant differences I could think of are the compiler flags and to a lesser extent the hardware build platform.
    You should describe these supposedly non-trivial issues. I've never experienced what you describe in my years using Arch, nor have I ever heard it suggested that the famously vanilla Arch packages are built using some sort of unconventional compiler flags. I have heard multiple developers say using highly modified CPU optimizations and modified linking and such are mostly pointless, however. So I'd bet a week's pay that the build system uses vanilla GCC with the default settings. Why would the thing that actually builds Arch Linux be the one part of the Arch ecosystem that doesn't abide by the Arch standards? Why would only some packages have library linking problems and such when all packages are built on the same machine against the same library versions---and thus the conditions resulting in a failed build would be identical to those in a successful build? I could be wrong, but I think you're on the wrong track. The quickest way to find out is to describe what the real problem is, not what you imagine the solution to be.

  • Unable to get the execution plan when using dbms_sqltune (11gR2)

    Hi,
    Database version: 11gR2
    I have a user A that is granted privileges to execute dbms_sqltune.
    I can create a task, excute it and run the report.
    But, when I run the report I get the following error:
    SQL> show user
    USER is "A"
    SQL> set long 10000 longchunksize 10000 linesize 200 pagesize 000
    select dbms_sqltune.report_tuning_task(task_name => 'MYTEST') from dual;SQL>
    GENERAL INFORMATION SECTION
    Tuning Task Name : MYTEST
    Tuning Task Owner : A
    Workload Type : Single SQL Statement
    Scope : COMPREHENSIVE
    Time Limit(seconds): 1800
    Completion Status : COMPLETED
    Started at : 05/15/2013 11:53:22
    Completed at : 05/15/2013 11:53:23
    Schema Name: SYSMAN
    SQL ID : gjm43un5cy843
    SQL Text : SELECT SUM(USED), SUM(TOTAL) FROM (SELECT /*+ ORDERED */
    SUM(D.BYTES)/(1024*1024)-MAX(S.BYTES) USED,
    SUM(D.BYTES)/(1024*1024) TOTAL FROM (SELECT TABLESPACE_NAME,
    SUM(BYTES)/(1024*1024) BYTES FROM (SELECT /*+ ORDERED USE_NL(obj
    tab) */ DISTINCT TS.NAME FROM SYS.OBJ$ OBJ, SYS.TAB$ TAB,
    SYS.TS$ TS WHERE OBJ.OWNER# = USERENV('SCHEMAID') AND OBJ.OBJ# =
    TAB.OBJ# AND TAB.TS# = TS.TS# AND BITAND(TAB.PROPERTY,1) = 0 AND
    BITAND(TAB.PROPERTY,4194400) = 0) TN, DBA_FREE_SPACE SP WHERE
    SP.TABLESPACE_NAME = TN.NAME GROUP BY SP.TABLESPACE_NAME) S,
    DBA_DATA_FILES D WHERE D.TABLESPACE_NAME = S.TABLESPACE_NAME
    GROUP BY D.TABLESPACE_NAME)
    ERRORS SECTION
    - ORA-00942: table or view does not exist
    SQL>
    It seems there a missing privileg for dislaying the execution plan.
    As a workaround, this is solved by granting select any dictionay (which I don't want) to the user A.
    Does someone have an idea about what privilege is missing?
    Kind Regards.

    Hi,
    SELECT ANY DICTIONARY system privilege provides access to SYS schema objects only => which you are using as workaround
    SELECT_CATALOG_ROLE provides access to all SYS views only.==> Safe option
    SQL> grant SELECT ANY DICTIONARY to test;
    Grant succeeded.
    SQL> conn test/test
    Connected.
    SQL> select count(*) from  sys.obj$;
      COUNT(*)
         13284
    SQL> conn /as sysdba
    Connected.
    SQL> revoke SELECT ANY DICTIONARY from test;
    Revoke succeeded.
    SQL> grant SELECT_CATALOG_ROLE to test;
    Grant succeeded.
    SQL> conn test/test
    Connected.
    SQL> select count(*) from  sys.obj$;
    select count(*) from  sys.obj$
    ERROR at line 1:
    ORA-00942: table or view does not existHTH

  • Bad execution plans when using parameters, subquery and partition by

    We have an issue with the following...
    We have this table:
    CREATE TABLE dbo.Test (
    Dt date NOT NULL,
    Nm int NOT NULL,
    CONSTRAINT PK_Test PRIMARY KEY CLUSTERED (Dt)
    This table can have data but it will not matter for this topic.
    Consider this query (thanks Tom Phillips for simplifying my question):
    declare @date as date = '2013-01-01'
    select *
    from (
    select Dt,
    row_number() over (partition by Dt order by Nm desc) a
    from Test
    where Dt = @date
    ) x
    go
    This query generates an execution plan with a clustered seek.
    Our queries however needs the parameter outside of the sub-query:
    declare @date as date = '2013-01-01'
    select *
    from (
    select Dt,
    row_number() over (partition by Dt order by Nm desc) a
    from Test
    ) x
    where Dt = @date
    go
    The query plan now does a scan followed by a filter on the date.
    This is extremely inefficient.
    This query plan is the same if you change the subquery into a CTE or a view (which is what we use).
    We have this kind of setup all over the place and the only way to generate a good plan is if we use dynamic sql to select data from our views.
    Is there any kind of solution for this?
    We have tested this (with the same result) on SQL 2008R2, 2012 SP1, 2014 CU1.
    Any help is appreciated.

    Hi Tom,
    Parameter sniffing is a different problem. A query plan is made based on the value which may be really off in the data distribution. We do have this problem as well e.g. when searching for today's data when the statistics think the table only has yesterday's
    data (a problem we have a lot involves the lack of sufficient amount of buckets in statistics objects).
    This problem is different.
    - It doesn't matter what the parameter value is.
    - You can reproduce this example with a fresh table. I.e. without statistics.
    - No matter what the distribution of data (or even if the statistics are correct), there is absolutely no case possible (in my example) where doing a scan followed by a filter should have better results than doing a seek.
    - You can't change the behavior with hints like "option(recompile)" or "optimize for".
    This problem has to do with the specific combination of "partition by" and the filter being done outside of the immediate query. Try it out, play with the code, e.g. move the where clause inside the subquery. You'll see what I mean.
    Thanks for responding.
    Michel

  • My childs ipod touch is missing, someone tried to reset the password around the same time it "Vanished" is there a way to track what WIFI network was used to make this attempt?    We think it was taken at her school and any small info would help!

    Trying to find my daughters ipod touch,  the last we saw it was around thursday and strangly I recieved an email that the apple id was attempting to be changed and or reset...this was not by me or my wife and my daughter is 7 so i dont think it was her...we think it may have been taken at her school but not sure so what i was wondering was is there a way to pinpiont the wifi network that was used to make this attempt??      If it is then it will be a huge help,              This was a gift from "santa" and finding would really make us happy!!    Thanks for any and all help!!

    Trying to find my daughters ipod touch,  the last we saw it was around thursday and strangly I recieved an email that the apple id was attempting to be changed and or reset...this was not by me or my wife and my daughter is 7 so i dont think it was her...we think it may have been taken at her school but not sure so what i was wondering was is there a way to pinpiont the wifi network that was used to make this attempt??      If it is then it will be a huge help,              This was a gift from "santa" and finding would really make us happy!!    Thanks for any and all help!!

  • What if HANA was used to process Large Hadron Collider (LHC) Data?

    What if you want to record and analyse the data about the particles which are accelerating at 99.99% speed of light?
    Watch this video on how data are collected and processed at LHC
    Please Download following presentation which provides more insight on Information System which was used in LHC
    https://cms-docdb.cern.ch/cgi-bin/PublicDocDB/RetrieveFile?docid=6057&version=4&filename=CHEP-2012-Lucas-Taylor-CMS-Information-Systems-final.pdfhttps://csc.web.cern.ch/CSC/2013/iCSC2013/Right_menu_items/Handouts/Per_lecture_pdf_files/07_Lecture_07-Grid-Interpretation-1_slide_per_page.pdf
    https://cms-docdb.cern.ch/cgi-bin/PublicDocDB/RetrieveFile?docid=6057&version=4&filename=CHEP-2012-Lucas-Taylor-CMS-Information-Systems-final.pdf
    To know more about LHC visit following links
    https://www.youtube.com/watch?v=Nqp43FPx414
    http://home.web.cern.ch/about/computing/processing-what-record
    http://en.wikipedia.org/wiki/Large_Hadron_Collider
    https://csc.web.cern.ch/CSC/2013/iCSC2013/Right_menu_items/Handouts/Handouts.htm
    https://cms-docdb.cern.ch/cgi-bin/PublicDocDB/ListBy?topicid=187
    http://cds.cern.ch/record/922757/files/lhcc-2006-001.pdf
    About Grid Computing
    http://en.wikipedia.org/wiki/Grid_computing

    Thanks Thomas,
    infact SAP is working with Helix nebula. who is researching on use of cloud technologies for LHC Data processing. Using HANA for processing data generated from LHC can help scientists in taking faster decision which can save cost of infrastructure perhaps.
    CERN-LHC Use Case | Helix Nebula
    http://www.helix-nebula.eu/the-partnership
    I found POC done by Michelle Gary which is i think may be helpful.
    Physics Analysis in SAP HANA -- Simple PoC
    Regards,
    Pratik

  • Find out what Apple ID was used to install an app

    I've passed an iPad on to my boss and it seems I've left an app on there that keeps asking for my personal Apple ID for update purposes. Of course he's only come to me with this question when he's gone to do an update because there's 20 apps in the queue for update. So I don't know which app it is that is calling for my details so I can delete and reinstall using his ID.
    Is there any way of determining what ID was used to install apps on a device? There are way too many apps now installed to delete and reinstall them all.

    Thanks to Meg and rbrylawski for their comments above.
    Ggross7 wrote:
    You didn't answer his question. Please read the question before posting an answer. 
    Actually, this is incorrect, as my second post above does answer the question.

  • Is there a way to know what apple id was used to purchase songs?

    I backed up my songs and in order to play them I need to log in with the apple id that was used to purchase them and I don't remember it. Is there any way to figure it out?

    If the songs are in your computer's iTunes library then you should be to see the account that bought them - see my reply on your earlier post : https://discussions.apple.com/message/23450213#23450213
    If they aren't in your iTunes library then if you try to add them (File > Add To Library), and their account isn't already authorised, then are you prompted to authorise it ?

  • HT1311 How can I find out, what Apple ID was used for an App I recently purchased?

    I have several Apple IDs and used one of these to purchase Apple Pages. Now I'd like to use the same Apple ID to complete another purchase but just can't figure out what Apple ID I used last time...

    The apps in the Apps section of your computer's iTunes library will show all of the apps that you downloaded on it and/or copied form your devices. But if I select one of the apps in the Apps section (in my library in iTunes, not Finder) in there and do get-info, then on the bottom half of the Summary tab on the popup that you I get I see :
    With the 'Apple ID' field showing the account id that I downloaded it with

  • How to find out if SQL execution plan is changed proactively using job/grid

    Hello,
    Can you help me on How to find out if SQL execution plan is changed proactively using job/grid control?
    Thank you..
    -

    The answers so far are supposed to show ways how to see that a plan changed after the fact - that is not really proactive but that was the question.
    A way to see a plan change proactively would be to create a SQL Plan Baseline for the SQL statement with the 'good old' plan and then watch DBA_SQL_PLAN_BASELINES for new rows with that SQL_HANDLE which would indicate that a new execution plan was computed - although not yet used.
    Kind regards
    Uwe Hesse
    "Don't believe it, test it!"
    http://uhesse.com

  • HT201250 How do I find out what portable drive was the drive I used for Time Machine Backup?

    Hi, I have 10.7.4 and need to figure out what drive I was using for Time Machine Backup.  I have three drives and I have connected each of them to my macbook pro, but I get an error, "Time Machine Error, The backup disk is not available" when I hit the time machine icon on the top of the screen and the "backup delayed" prompt.  If I try Back up Now I get message, "Time Machine could not complete the backup.  Back up disk is not available."  I am trying to figure out what the time machine back up would actually look like as a file on the drives but I don't see a folder/file name Time Machine.  If I enter Time Machine I can see in the far right column, in purple, the last back up date (Sept. 12, 2012), but when I hit it nothing happens.  In the Time Machine preference box the select disk has, in red and to the right, "Delayed" with an "i" within a circle, and the option indicates, "Next backup: when disk is connected."
    I know I have a years worth of backups on one of the three drives, but I can't figure out how the heck to find them or how to determine what was the last drive I used for the backups within Time Machine.  Help please.

    Hi, I have 10.7.4 and need to figure out what drive I was using for Time Machine Backup.  I have three drives and I have connected each of them to my macbook pro, but I get an error, "Time Machine Error, The backup disk is not available" when I hit the time machine icon on the top of the screen and the "backup delayed" prompt.  If I try Back up Now I get message, "Time Machine could not complete the backup.  Back up disk is not available."  I am trying to figure out what the time machine back up would actually look like as a file on the drives but I don't see a folder/file name Time Machine.  If I enter Time Machine I can see in the far right column, in purple, the last back up date (Sept. 12, 2012), but when I hit it nothing happens.  In the Time Machine preference box the select disk has, in red and to the right, "Delayed" with an "i" within a circle, and the option indicates, "Next backup: when disk is connected."
    I know I have a years worth of backups on one of the three drives, but I can't figure out how the heck to find them or how to determine what was the last drive I used for the backups within Time Machine.  Help please.

  • Does anyone know what software was used for Mac Welcome Video?

    As you may remember when you turned your mac on for the first time, a ver neat welcome video played with upbeat music. Well I just wanted to know if anybody knew what program(s) was used to make it. If you know or have any idea please tell me. Thanks!

    Hi and welcome to discussions. I tried to find something about it, but was not successful. I would guess though that this has been made using some of Apple's own software, everything else would not really make sense. And there actually is one tool in the portfolio capable of creating something like that: Motion. So, as an educated guess, I would say that's the one.

  • What was used here?

    I was wondering what Adobe product was used to make the graphic on this page?..... http://direct.adobe.com/v?xlWcHcnEcccTHnH
    Was it created from a product or created by a graphic artist freehand?

    Yes, as we see in many cases the lines between vector and raster are blurred. (Speaking metaphorically) This could well have started out as photographic (raster) and been traced in illustrator (Vector). Not so much the entire image because it looks to be a collage of subjects. If I were tasked with reverse engineering this image I would use a combo of both Photoshop and Illustrator as I saw fit, which best utilized my level of current experience. There may be hundreds of ways to create a piece like this, from hand drawn marker comps which could be scanned, traced and touched up, to using a tablet in nothing more then Illustrator, but when creating I find it best to stick with what tools you are most effective with. My best guess is its final end user file format was illustrator. (but perhaps I'm just Illustratorcentric)

  • How to force a execution plan

    Hello ,
    I am working on oracle 11g R2 on AIX.
    One query was performing good around 20 sec. but suddenly it took more then 15 min.
    We check that the sql executoin plan changes , it showing that order of operation changed like order of using indexes is different.
    Now the new plan is not good.
    we want to force the old plan of sql to use in future.
    I read about sql plan management , it shows a manual method to create baseline and evolve the all plan. In one texample we found that
    first query execution plan was created using with out index and then with index So, second plan was good and accepted.
    But in this case we do not need to change any thing ,query is performing bad may be becasue changes order of operation ..
    One other way to use hint , but for this we need to change sqls , which is not possiable in production now.
    The issue is
    For this we need to run the sql again and oracle may not create plan like old one.So we will not be having old good plan to accept.
    All 2 execution plan are already in cache .
    I am looking for a way using that we can set sql plan hash value ( of good plan) or any other id of that sql plan to force to use that plan only.
    any idea how to do it ..

    Stored Outlines are deprecated.
    OP:
    To fix a specific plan you have two choices:
    1. SQL Plan Baselines - assuming the "good" plan is in AWR still then the steps are along the lines of load old plan from AWR into sql tuning set using DBMS_SQLTUNE.SELECT_WORKLOAD_REPOSITORY and DBMS_SQLTUNE.LOAD_SQLSET then load plans from sqlset into sql plan baseline using DBMS_SPM.LOAD_PLANS_FROM_SQLSET.
    2. Using SQL Profiles to fix the outline hints - so similar to a stored outline but using the sql profile mechanism - using the coe_xfr_sql_profile.sql script, part of an approach in Oracle support doc id 215187.1
    But +1 for Nikolay's recommendation of understanding whether there is a root cause to this problem instability (plan instability being "normal", but flip flopping between "good" and "bad" being a problem). Cardinality feedback is an obvious possible influence, different peeked binds another, stat changes, etc.

  • I'm stuck at the activation stage! I don't have the original sim card and I don't know what carrier it was originally on! How can I get into my phone?

    I was wondering if there was any way of accessing my iPhone 4 without a micro sim card. I am currently at the activating section, and after it tells you to find WIFI, it says to enter a sim card. I bought this iPhone off of my friend and he took out his original sim card! I dont know what carrier he was using. Is there any way I can access the phone just to play music on it for now?

    Buy a H20 Wireless micro SIM card off eBay for $.99. You can activate the phone/SIM from their website. H2O uses AT&Ts network.    
    17" 2.2GHz i7 Quad-Core MacBook Pro  8G RAM  750G HD + OCZ Vertex 3 SSD Boot HD 
    Got problems with your Apple iDevice-like iPhone, iPad or iPod touch? Try Troubleshooting 101
     In Memory of Steve Jobs 

Maybe you are looking for

  • IPod touch 4th gen not recognized by iTunes 10.7 64-bit, but any solutions I found online do not work.

    Everywhere I've looked here has not worked. I have recently gotten a windows 7 laptop and downloaded iTunes, but my iTunes will not recognize my iPod. Here are some of the things I've done: - Verified AMDS is installed - Reinstalled iTunes and Quickt

  • I need to re-load the elements 10 to my computer. How do I go about doing that?

    I had my computer repaired and windows 7 loaded but I no longer have my elements 10-- can I re-download?Downloading, Installing, Setting Up

  • Want to revert to 7.7

    I just downloaded 8.0 and want to go back to 7.7. I have deleted the application from the folder and re-downloaded and installed 7.7 but I am getting a message that says: "The file iTunes Library cannot be created because it was created by a newer ve

  • I lost Appleworks in a crash

    I got a new hard drive this last weekend. Didn't lose anything because I actually had everything backed up. Amazing. I have had to reload all my programs, obviously. Problem I have is that I have alot of documents in appleworks .cwk form. My disk for

  • Skype getting connected..what is the best way to set up

    I have wireless laptops using my verizon fios internet. I have used Skype for chatting with family in military overseas..i started having a lot of problems with staying connected as time went on..what is a good setting for incoming and outgoing optio