Data difference between DBA_HIST_SQLSTAT and DBA_HIST_ACTIVE_SESS_HISTORY

HI,
I ran a query on a database few times which had different execution plan (basically first I ran with index and later without index).
I tried to cross verify the data from DBA_HIST_SQLSTAT and DBA_HIST_ACTIVE_SESS_HISTORY for that particular query and found there were two different SQL ID for same SQL statement. Ideally if execution plan changes then only the plan hash value or hash value changes but in this scenario we have two different SQL ID with different Plan hash value or hash value.
I need to understand why do we have this data difference?
==================================================================================================
SQL> select snap_id,instance_number,sample_time,session_id,module,sql_plan_hash_value from dba_hist_active_sess_history where sql_id='9zgyc24gzsgpz';
SNAP_ID INSTANCE_NUMBER SAMPLE_TIME SESSION_ID MODULE SQL_PLAN_HASH_VALUE
9478 2 07-JAN-11 13.09.11.540 503 SQL*Plus 2290340548
9478 2 07-JAN-11 13.23.42.616 514 SQL*Plus 3778028574
9478 2 07-JAN-11 13.25.12.735 514 SQL*Plus 3778028574
9478 2 07-JAN-11 13.25.22.746 514 SQL*Plus 3778028574
9478 2 07-JAN-11 13.25.32.759 514 SQL*Plus 3778028574
9478 2 07-JAN-11 13.25.42.770 514 SQL*Plus 3778028574
9478 2 07-JAN-11 13.25.52.782 514 SQL*Plus 3778028574
9478 2 07-JAN-11 13.26.02.795 514 SQL*Plus 3778028574
9478 2 07-JAN-11 13.26.12.811 514 SQL*Plus 3778028574
9478 2 07-JAN-11 13.26.22.823 514 SQL*Plus 3778028574
SQL> select snap_id,sql_id,plan_hash_value from dba_hist_sqlstat where sql_id='9zgyc24gzsgpz' ;
SNAP_ID SQL_ID PLAN_HASH_VALUE
9478 9zgyc24gzsgpz 2290340548
==================================================================================================
Thanks
Devendra

Hi,
DBA_HIST_ACTIVE_SESS_HISTORY is a sampling of the sampling already done in ASH, however data used for AWR "snapshots" is completely separate and works just like Statspack did, so it can capture all SQL in the shared pool at the time of the snapshot if you tell it to - it is not limited to just the SQL sampled by ASH. Also AWR does not capture every statement executed in the interval,even if the statement was not aged out from V$SQL.
DBA_HIST_ACTIVE_SESS_HISTORY displays the history of the contents of the in-memory active session history of recent system activity, DBA_HIST_SQLSTAT displays historical information about SQL statistics
Regards,
Ugur

Similar Messages

  • Functional and data differences between W_GL_BALANCE_F and W_GL_OTHER_F

    Hi:
    Can some explain what the functional and data-source differences are between W_GL_BALANCE_F and W_GL_OTHER_F? Both seem to group by GROUP_ACCOUNT_NUM.
    Thanks.

    That is not possible; all transaction in GL Other will end up in GL Balance.
    The two tables are essentially having the same data but at different grain. Two main differences:
    - GL Other have individual journal transactions; GL Balance have them summarized to the account level.
    - GL Other is truly additive since its just individual journal transactions. i.e. you can just sum() any number of transactions and wont double count a trx; GL Balance is a monthly snapshot table. i.e. it provides account balance for all accounts for every month end, so you can never add two snapshots.

  • End date difference between Outlook and mobile

    When I use Outlook to create an all day event from 20 June to 22 June, then use Nokia PC Suite to Synchronise with my mobile, the mobile shows a memo in the Calendar from 20 June to 21 June :-( This 'one day less in the Nokia Memo' stays when I edit dates either in the mobile or in outlook and sychronise again.
    When I create a Memo in the mobile, then Synchronise it with Outlook, the problem does not appear. Also, changing dates in Outlook of an event originally created in the mobile, is working perfectly.
    The problem also does not appear if 'all day event' is not checked in Outlook.
    I use
    Windows XP build 2600 Service Pack 1
    Microsoft Outlook 2002 (10.5109.4219) SP-2
    Nokia PC Suite Version 6.80.22
    Nokia 9103 V 04.61 08-02-06 RM-161
    An IRDa connection

    When I have "31st December 2006" in the database, the
    webapp displays "30th December 2006" and so on.
    I don't understand this one-day difference?????
    Does anyone has some clue of why I get this?Because there is a lot of code between 'database' and 'webapp displays'.
    That of course also assumes that you really do have the date that you think in the database. (Not knowing db2 I can only note that most other databases do not store dates. They store timestampes, which is different.)

  • Date difference between Java and db2

    Hello,
    I am quite puzzled. I have the following environment:
    -iseries DB2
    -Jdk 1.5
    -Hibernate 3 (jpa)
    -Tomcat 5.5
    When I have "31st December 2006" in the database, the webapp displays "30th December 2006" and so on.
    I don't understand this one-day difference?????
    Does anyone has some clue of why I get this?
    Thanks in advance,
    Julien.
    PS: The fields are typed java.util.Date

    When I have "31st December 2006" in the database, the
    webapp displays "30th December 2006" and so on.
    I don't understand this one-day difference?????
    Does anyone has some clue of why I get this?Because there is a lot of code between 'database' and 'webapp displays'.
    That of course also assumes that you really do have the date that you think in the database. (Not knowing db2 I can only note that most other databases do not store dates. They store timestampes, which is different.)

  • SNP planned order availability date difference between APO and ECC

    Hi,
    I have observed that SNP Planned order availability date is not matching between APO and ECC. Details are as follows.
    I ran SNP Optimizer with bucket offset of 0.5. After publishing the optimizer created planned orders to ECC, only start date is matching.
    Example:
    I am using PDS as a source of supply.
    Fixed production activity in SNP PDS is 1 day.
    GR processing time: 3 day
    After running optimizer planned order is created with dates explained below.
    Start date/time: 09.05.2011 00:00:00
    End date/time: 12.05.2011 23:59:59
    Availability date: 16.05.2011 00:00:00
    Because of bucket offset defined as 0.5 optimizer planned order availability is start of next monday.
    After publishing this planned order to ECC dates on the planned order is as follows.
    Start date: 09.05.2011
    End date: 09.05.2011
    Availability date: 12.05.2011
    I have not maintained any scheduling margin key in ECC. Also if I dont define the GR processing time, planned dates between APO and ECC always match. Can anyone explain the impact of GR time on the availability date.
    Regards,
    Venkat

    Hi Venkadesh,
    What's "state stamp"? Do you mean different time zone?
    note : 645597  mentioned by Nandha is very helpful:
    In standard, CCR will use duedate - "the available date of the output product".
    Nandha's words "In SAP APO, if the receipt date of the primary product deviates from the
    end date of the last activity of the order, the receipt date
    always identifies this as inconsistent. You cannot rectify
    inconsistencies of this type by using CCR."
    I guess in your PDS or PPM, the output product is not assigned to the End of the last activity. Someone changed it?
    Please CIF the PDS or PPM again.
    If you really want to apply a note, please use note 815509 as you're using planned order,
    and system will use order end  date in CCR instead.
    GR time is always considered. BR/Tiemin

  • Date difference between j2mewtk and j2se

    In j2mewtk, I have
    DateField aDateField = new DateField("Date", DateField.DATE);
    // ...I pick March 27, 2002 on the UI for aDateField
    long j2meLongDate = aDateField.getTime();
    then I pass j2meLongDate to a server side program, which is running in j2se environment, and I do
    Date date = new Date(j2meLongDate);
    System.out.println(date);
    // print out March 26, 2002 !!!!
    Can somebody tell me why and how to solve the problem?
    Thanks,
    -John

    I think you have a problem with the timezones; there are different in both sides.
    Try to set them with the system property user.timezone. You can do it either inside the code (System.setProperty("user.timezone") )or in the command line (-Duser.timezone=...)
    Ana

  • Difference between 0FI_AP_30 and 0FI_AP_4 Data source

    HI,
    What is the difference between 0FI_AP_30 and 0FI_AP_4 Data source.
    Thanks in advance

    Hi,
    In addition to above differences. Below is the functional difference between 0FI_AP_30 & 0FI_AP_4:
    0FI_AP_4 gives you accounts payable line items in your report. Here GL account shows the balances of particular types of  vendors/payables to which that particular GL account is been assigned.
    And If subledger is activated in ECC, then by using 0FI_AP_30 you can get the break up of that particular GL balance according to vendors.
    To make use of datasource 0FI_AP_30, subledger accounting must be activated in ECC.
    Regards,
    Pradip

  • Date difference between Requsition apporval and Po approval in Oracle apps

    My requirement is that l need to get the number of date difference between requisition apporval date(requisition) and po approval date (purchase) excluding holidays how to do it ?
    Thanks in advance..

    One PO could be generated from multiple requisitions. In that case, which requisition would you like to consider?
    One requisition could be converted into multiple POs. In that case, which PO would you like to consider?
    Assuming, there is a one-to-one relationship between your POs and requisitions:
    Link a PO to the corresponding requisition by joining po_distributions_all.req_distribution_id with po_req_distributions_all.requisition_id
    Once you have found the 2 records, get the approved_date from po_headers_all and po_requisition_headers_all
    Then go to bom_calendar_dates for those dates and find the difference between seq_num. That is what you are looking for.
    Sandeep Gandhi

  • Differences between archiving and inactivating a qualitative lookup within the Data Admin toolkit.

    Hi,
    Can you please let me know what could be the difference between archiving and Inactivating the Qualitative Lookup in Data Admin Tool Kit.
    Thanks,
    Rohini M

    When you inactive or archive something it is no longer available for selection.   The difference between inactive and archive is that inactive items will still appear available for searching purposes while archive items will not.  
    So lets say you have the following:
    List A
       - Item 1
       - Item 2
    List Items
    If you were to inactivate Item 1, end users would no longer see it available for selection when using the qualitative extended attribute.  However when they search for specs based on the extended attribute they would still be able to select Item 1 so they could find objects that used that value. If you were to archive Item 1, end users should no longer see it available for selection anywhere - including searching.
    Lists
    If you were to inactive or archive the entire List A, you would no longer see it available for selection when setting up qualitative lookup extended attributes.   I don't think there is anywhere you can search for extended attributes by lookup list currently out of the box so these would act similar.  If there was a place to search for extended attributes by lookup list then it would follow the same rules as above.

  • What is the difference between olap and data warehouse..?

    Hi All,
    Is their any difference between olap and data warehouse..? Please let me know your knowledge about these. Thank you..
    ------------------------------------------------------------------------ Please mark it as complete, if you get the solution with this reply. TQ.

    A data warehouse is a database containing data that usually represents the business history of an organization. This historical data is used for analysis. Data in a data warehouse is organized to support analysis rather than to process real-time transactions
    as in online transaction processing systems (OLTP).
    OLAP technology enables data warehouses to be used effectively for online analysis, providing rapid responses to iterative complex analytical queries. OLAP's multidimensional data model and data aggregation techniques organize and summarize large amounts
    of data so it can be evaluated quickly using online analysis and graphical tools.
    Reference:
    http://technet.microsoft.com/en-us/library/aa197903(v=sql.80).aspx
    http://stackoverflow.com/questions/18916682/data-warehouse-vs-olap-cube
    If this post answers your query, please click "Mark As Answer" or "Vote as Helpful".

  • Difference between passive and active data connection mode for  FTP

    Hi,
    Does any body have the idea of passive and active data connection mode for the transport protocol FTP.
    I have one server with FTP, I have to pick the data from this FTP to XI.
    What is the difference between active and passive data connection? Does XI supports both the connections?
    Thanks & Regards
    Katta Mohan Reddy

    Hi
    According to SAP Note - 821267
    Q: Does the File Adapter support active data connections when connecting to an FTP server?
    A: Up to and including SP14, the File Adapter exclusively uses passive data connections. Starting with SP15, active connections will be available.
    Difference between active and passive,
    You can definitely refer to the site mentioned by Suraj
    cheers
    Sameer

  • Difference between GUI_UPLOAD and WS_UPLOAD

    Hi,
    Please make me clear about the difference between GUI_UPLOAD and WS_UPLOAD. In which cases we need to use these modules...??
    Thanks,
    Satish

    I would suggest to always use the GUI_UPLOAD.  I say this because this is the function module which is used in the GUI_UPLOAD method of the class CL_GUI_FRONTEND_SERVICES.   Really, you should probably use the class/method instead of the function module.
      data: filename type string.
      filename = p_file.
      call method cl_gui_frontend_services=>gui_upload
             exporting
                  filename                = filename
                  filetype                = 'ASC'
             changing
                  data_tab                = iflatf
             exceptions
                  file_open_error         = 1
                  file_read_error         = 2
                  no_batch                = 3
                  gui_refuse_filetransfer = 4
                  no_authority            = 6
                  unknown_error           = 7
                  bad_data_format         = 8
                  unknown_dp_error        = 12
                  access_denied           = 13
                  others                  = 17.
    Regards,
    Rich Heilman

  • Difference between char and varchar, also the difference between varchar2

    Hi,
    Can anyone explain me the difference between char and varchar, and also the difference between varchar and varchar2...

    Varchar2 is variable width character data type, so if you define column with width 20 and insert only one character to tis column only, one character will be stored in database. Char is not variable width so when you define column with width 20 and insert one character to this column it will be right padded with 19 spaces to desired length, so you will store 20 characters in the dattabase (follow the example 1). Varchar data type from Oracle 9i is automaticlly promoted to varchar2 (follow example 2)
    Example 1:
    SQL> create table tchar(text1 char(10), text2 varchar2(10))
    2 /
    Table created.
    SQL> insert into tchar values('krystian','krystian')
    2 /
    1 row created.
    SQL> select text1, length(text1), text2, length(text2)
    2 from tchar
    3 /
    TEXT1 LENGTH(TEXT1) TEXT2 LENGTH(TEXT2)
    krystian 10 krystian 8
    Example 2:
    create table tvarchar(text varchar(10))
    SQL> select table_name,column_name,data_type
    2 from user_tab_columns
    3 where table_name = 'TVARCHAR'
    4 /
    TABLE_NAME COLUMN_NAME DATA_TYPE
    TVARCHAR TEXT VARCHAR2
    Best Regards
    Krystian Zieja / mob

  • What is difference between abstraction and encapsulation ?

    Hi,
    I am trying to figure out the difference between abstraction and encapsulation but confused.
    Both are used for data hiding then what is the exact difference ?
    Thanks.

    Tushar-Patel wrote:
    I am trying to figure out the difference between abstraction and encapsulation but confused.
    Both are used for data hiding then what is the exact difference ?This is the picture I have:
    When you encapsulate something you get an inside and an outside. The outside is the abstraction. It describes how the encapsulated entity behaves viewed from the outside. This is also called the type. Hidden inside is the implementation. It holds detail information about how the type's behaviour is accomplished.
    It's a very simplified picture but I think it's quite accurate and it works for me.

  • What is difference between modify and update i am using

    hi
    what is difference between mofify and update
    my requiremen is to have three condition checkec while mofifying or updating from a internal table
    the three fields are
    cus no
    status
    date these all are primary key in the database table
    so which sould i use modify or update
    there might be entry already existing in database table or new entry to be created if already existin it should check on the primary keys and updatat if not it should add a record
    pls suggest whihc to use and how to implement the check on teh threee primary key
    like if modify ztable from table it_test
    now where condition ? can be used or not with modify? and if yes how
    if not should i use update will update create a new entry if no entry is there and please give syntex
    regards
    Arora

    Hi Nishant Arora,
    Modify: It works in performing two actions.
    They are: Insert + Update.
    For Example If a record that is exited in database, so you are modifying that record, it updates that particular record.
    Similarly, If the is not existed in the database, you are modifying it, it inserts a new record.
    Update: Update means just it updates the status, I mean it only updates the record. It doesn't inserts any new record if that particular record is not present in the database.
    These are the cases you need to write these statements.
    Syntaxes: :
    Go through this links please.,
    http://help.sap.com/saphelp_nw04/helpdata/en/e7/968aa8b2384dd9835f91e7f8470064/content.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb35eb358411d1829f0000e829fbfe/content.htm
    Reward points if useful
    Cheers,
    Swamy Kunche
    Edited by: Swamy Kunche on Jun 11, 2008 2:41 PM

Maybe you are looking for

  • Problem connecting only iFolder client

    Hi everyone, I begn with iFolder 3.8 and I've a problem with connecting the client. For information, I've 3 separate iFolder servers, two of them work perfectly ! So, on one, I can't connect the Windows Client, I've an error "iFolder can't connect, p

  • Buss system error

    hi experts this is murali. i am very new to xi and i am learning myslef own. i created the technical system and buss system in SLD correctly. i designed a file to file scenario in IR and activated. its all ok. in configuration in ID i created a new s

  • I have a ipad 4th generTion and the photostream is 201KB, how do I clear it. Help plz..!!!!!!!!

    I have a ipad 4th generTion and the photostream is 201KB, how do I clear it. Help plz..!!!!!!!!

  • Funds Availability Check on Shopping Carts

    We turned on funds availability a few months ago and are now hitting a road block with the new fiscal year.  I'm hoping someone else came across this situation and has a resolution. A user creates a cart in FY 08 and puts it on hold.  They wait for t

  • Portal not working properly in Firefox browser

    Hi, Portlets are displaying widely across the browser and getting horizontal scroll bar in Mozilla firefox browser. If refreshing the browser for few times its get adjusted. everything work fine in IE and portal doesn't have horizontal scroll bar awa