I want to know when a sql-query was excuted in DBA_HIST_SQL_PLAN !!

Hi, all.
I want to know when a sql query wqas excuted in past 3 month.
select * from DBA_HIST_SQL_PLAN
where plan_hash_value='1844343569'
is working?
The plan_hash_value is from v$sql_plan of current instance.
There ware 3times database shutdown/startup.
When a oracle instance is initiated, is the plan_hash_value of the same query changing?
Thanks in advance.

You can't go back 3 months unless your retention period is set to that length of time.
select retention from DBA_HIST_WR_CONTROL;
If you want to retain data for longer then you need to modify you snapshots settings, but this can impact your DB if it grows too large.
BEGIN
DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS( retention => 100800);
END;
Then you could get the details out by using something like
select a.SNAP_ID, begin_interval_time, end_interval_time, SQL_ID, PLAN_HASH_VALUE,VERSION_COUNT, FETCHES_TOTAL, EXECUTIONS_DELTA , EXECUTIONS_TOTAL
from DBA_HIST_SQLSTAT a, DBA_HIST_SNAPSHOT b
where b.snap_id=a.snap_id
and b.instance_number=a.instance_number
and sql_id='&sql_id'
;

Similar Messages

  • I want to know when we issue truncate table statement in oracle .

    i want to know when we issue truncate table statement in oracle .No log will be write in redo log .But we can recover data using flashback or scn.I want to know where is the actually truncate table statement log is stored in oracle database.Please explain me in detail step by step .

    Hi,
    I have truncated table after that i have restored that data.See below the example.I want to know from where it's restored.
    From which log file it's restored.
    create table mytab (n number, x varchar2(90), d date);
    alter table mytab enable row movement;
    Table altered.
    SQL> insert into mytab values (1,'Monsters of Folk',sysdate);
    1 row created.
    SQL> insert into mytab values (2,'The Frames',sysdate-1/24);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select CURRENT_SCN from v$database;
    CURRENT_SCN
    972383
    SQL> select * from mytab;
    N
    X
    D
    1
    Monsters of Folk
    30-DEC-12
    2
    The Frames
    30-DEC-12
    N
    X
    D
    SQL> set lines 10000
    SQL> /
    N X D
    1 Monsters of Folk 30-DEC-12
    2 The Frames 30-DEC-12
    SQL> select to_char(sysdate,'yyyymmdd hh24:mi:ss') from dual;
    TO_CHAR(SYSDATE,'
    20121230 09:29:24
    SQL> set timing on
    SQL> truncate table mytab;
    Table truncated.
    Elapsed: 00:00:15.75
    SQL> select * from mytab as of timestamp TO_TIMESTAMP('20121230 09:29:24','yyyymmdd hh24:mi:ss');
    N X D
    1 Monsters of Folk 30-DEC-12
    2 The Frames 30-DEC-12
    Elapsed: 00:00:00.28
    SQL> insert into mytab select * from mytab as of timestamp TO_TIMESTAMP('20121230 09:29:24','yyyymmdd hh24:mi:ss');
    2 rows created.
    Elapsed: 00:00:00.01
    SQL>

  • I want to know when I am eligible for an upgrade?

    I want to know when I am eligible for an upgrade?

        Hi RJ1950. I'm delighted that you're looking into your upgrade. It's an exciting time waiting for a new phone! Both tikibar1 and jimfitzgerald were right, you can log into My Verizon http://bit.ly/xB4iTc and see your phone's upgrade eligibility from the home screen under the usage section. Is there something I can help with while you look into your upgrade?
    Thank you
    JenniferH_VZW
    Please follow us on Twitter @vzwsupport

  • I want to know when my plan is done

    I want to know when my plan is up and I want to change my minutes

    You should be able to login to My Verizon and there is a link for contract end date.  You can also change the minutes on your plan at any time, without extending your contract.  You have the choice to backdate the change to the beginning of the current billing cycle (if you are nearing your limit), doing it today or doing it at the start of the next billing cycle.  Doing it today is often a bad idea because of the complex pro-ration rules....

  • Hello!   I am the bigest fan of APPLE!!! And i want to know when you lansate iPhone 6! My parents promised  me to buy One for me at my birthday!! Hello from romanian,Radu!    APPLE is the BEST!!!!!

    Hello!
    I am the bigest fan of APPLE!!! And i want to know when you lansate iPhone 6! My parents promised
    me to buy One for me at my birthday!! Hello from romanian,Radu!
      APPLE is the BEST!!!!!

    Sorry, no one here will have any knowledge of future iPhones.

  • Hi i want to know when ios 5 gonna be out   cos i have alot of rumor is gonna be the 10, Hi i want to know when ios 5 gonna be out   cos i have alot of rumor is gonna be the 10

    hi i want to know when ios 5 gonna be out i have alot of rumor not everybody telling the trew

    October 12 per the announcement by Apple on the October 4th Keynote. Is that true enough for you?

  • How to numberformat when using sql:query alogn with c:forEach JSTL tags

    Is there anyway to format the numeric values returned from the database when using <sql:query> alogn with <c:forEach> tags
    Here is my jsp code
    <sql:query..../>
    <c:forEach var="row" items="${queryResults.rows}">
    <tr>
    <td><c:out value="${row.COL1}" /></td>
    <td><c:out value="${row.COL2}" /></td>
    </tr>
    </c:forEach>
    Col1 values are numeric without any formats Eg: 1000, 10000, 1000000 etc.
    how can i format them to 1,000 , 10,1000 , 100,000 etc

    It is polite to mention what your answer was. These posts are not just here for you to ask questions, but to be used as a resource for other people to find answers. Saying "I solved it" with no details helps noone.
    I presume you discovered the JSTL <fmt:formatNumber> tag?

  • Hello, I just wanted to know when an update would be available for my mac mini server os x lion to resolve the issues regarding my m-audio fastrack pro usb audio interface (no midi messages recognized)

    Hello, I just wanted to know when an update would be available for my mac mini server os x lion to resolve the issues regarding my m-audio fastrack pro usb audio interface (no midi messages recognized)

    Have you reported your problems to Apple?
    BugReporter
    <http://bugreporter.apple.com>
    Free ADC (Apple Developer Connection) account needed for BugReporter.
    Anyone can get a free account at:
    <http://developer.apple.com/programs/register/>
    And/Or
    Mac OS X Feedback<http://www.apple.com/feedback/macosx.html>

  • Hi, I just want to know when will be available the new ipod touch

    Hi, I just want to know when will be available the new ipod touch

    October, as had been said here already literally dozens of times, and stated on Apple's web pages and in the Apple Store quite clearly. If you're asking for a specific date, then again as has been said here multiple times, Apple has not yet announced a specific release date.
    Regards.

  • I just want to know when can i buy my iphone 5 in china mainland......why china always been ignored...

    i just want to know when can i buy my iphone 5 in china mainland......why china always been ignored...

    Ask your government and the wireless providers what is the holdup.
    Apple is ready to sell but has not yet gotten approval.

  • I just want to know when the new ipod touch 5th generation will come out

    i just want to know when the new ipod touch 5th generation will come out

    Apple has not announced any new iPod models. When they do, we'll all find out at the same time, I would guess, since the announcement will be prominent on every Apple-related web site and will probalby be posted in multiple threads in these forums.
    Forum Tip: Since you're new here, you've probably not discovered the Search feature available on every Communities page, but next time, it might save you time (and everyone else from having to answer the same question multiple times) if you search a couple of ways for a topic, both in the relevant forums and in the Apple Knowledge Base before you post a question.
    Regards.

  • How can i check when a given query was run

    how can i check when a given query was run ( i mean the timestamp ) from forms
    I am trying to run the query depending on when it was last run

    Hello,
    I'm not sure to really understand your need, but if you want to refresh the data blocks regularly, you can use a timer that would execute_query on the block every elapsed period of time.
    Anyway, there is no "timestamp" of this kind, so that you would store the information somewhere in memory on in a table, from a PRE-SELECT or POST-SELECT trigger for instance.
    Francois

  • How do you date and time stamp iCal entries?  We share an event calendar and need to know when a new event was entered into iCal.

    How do you date and time stamp iCal entries?  We share an event calendar and need to know when a new event was entered into iCal.

    BKBK,
    Thank you for your response. That does adequately cover the
    client-originated sessions, but still leaves the ability I am
    looking for unavailable.
    It did serve to definitively answer my most pressing
    question, however, with this statement:
    Note: ColdFusion cannot create a session if an initiator
    application uses a SendGatewayMessage method to start an
    interaction with a client, such as an SMS user. In this case, the
    sending code must keep track (for example, in a database) of the
    messages it sends and their destinations. When a response event
    arrives, it can look up the origniatorID to determine whether it
    was in response to an outgoing message.
    I will play around with the Application scope to see if there
    might be a workable solution there.
    RLS

  • Is it possible to know when the sim card was removed from iPhone after been stolen?

    My iphone got stolen and I could see that my ipad got trouble with itunes and icloud. Is it possible to know when the sim card was removed from iphone?

    no,

  • I want to know when my servlet completes its execution

    sir, i want to exactly know when my servlet completes its exacution. is there any way to find the servlet completion time please help me.
    iam waiting for ur kind answer and suggestions......
    thanks in advance.

    kumaranramuvr wrote:
    sir, i want to exactly know when my servlet completes its exacution. Why would you like to know? Also, by "execution" do you only mean service(), doGet(), doPost() methods?
    As said by BalusC, service() method is executed for every incoming request. Based on the HTTP method of the incoming request (either POST or GET), either doPost() or doGet() are invoked.
    Also, servlet is multi-threaded, meaning, for every new request a new servlet thread is created to process that request, unless you are implementing SingleThreadModel interface.

Maybe you are looking for