Oracle dictionary view 2 find the queries run and it's execution time

Hi All,
I s there any oracle dictionary view which captures the queries being run by users on the database and time taken to execute those queries?
We need to find out the OS user not the database user since we have to identify the users who are executing long running queries.
We require this basically to monitor the long running queries on the database.
Thanks in Advance

Hi,
welcome to the forum!
Oracle doesn't store information about individual executions of SQL queries (that would've been too expensive), but you can find cumulative query execution stats in V$SQL. If you are interested in queries by a specific OS user, then Active Session History can help you (provided you have the Diagnostic Pack License).
Best regards,
Nikolay

Similar Messages

  • Finding the long running queries

    Hello, I am able to find the long running queries in my database as below.
    SQL> select sid,serial#
    2 from v$session_longops
    3 where time_remaining > 0
    4 order by time_remaining desc;
    SID SERIAL#
    1100 4411
    1383 3912
    1295 2493
    SQL>
    With this info, i want to find out what sql code related to these (SID,SERIAL#). The SQL code comes from v$sqlarea. But i am not able to join v$session_longops with v$sqlarea. Any help is highly appreciated.
    Here is my database version.
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE 10.2.0.4.0 Production
    TNS for Linux: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production

    Thank you!!!
    select     
    A.SID ,
    A.SERIAL# ,
    A.OPNAME ,
    A.TARGET ,
    A.TARGET_DESC,
    A.SOFAR ,
    A.TOTALWORK ,
    A.UNITS ,
    A.START_TIME ,
    A.LAST_UPDATE_TIME ,
    A.ELAPSED_SECONDS ,
    A.CONTEXT ,
    A.MESSAGE ,
    A.USERNAME ,
    B.sql_fulltext
    from     v$session_longops a,
    v$sqlarea b
    where a.sql_id = b.sql_id
    and     time_remaining > 0
    order by time_remaining desc

  • Often I will leave my office and return to find the fan running at max speed and the computer is unresponsive

    I also have a MacPro3,1 (2009) I believe and just started experiencing similar issues as described here.
    I have scheduled sleep and start cycles and often I will leave my office and return to find the fan running at max speed and the computer is unresponsive or I find the computer booted in to disk utility mode.
    I also often loose ethernet connectivity and have to try renewing DHCP lease several times before it will finally work.
    Has anyone found solutions for this. I have looked at the console errors right before shutdown and don't really see anything fishy. Here are the last couple of lines before it looks like it shutdown.
    12/4/14 10:08:37.447 PM xpcproxy[5066]: assertion failed: 13F34: xpcproxy + 3438 [D559FC96-E6B1-363A-B850-C7AC9734F210]: 0x2
    12/4/14 10:08:58.145 PM mds[38]: (Normal) ImportServer: Ignoring blacklisted Spotlight importer plugin:/Developer/Applications/Xcode.app/Contents/Library/Spotlight/SourceCode. mdimporter uuid:548A3091-3C5D-498A-A329-B532A6C896BB version:1085
    12/4/14 10:08:58.193 PM mds[38]: (Normal) ImportServer: Ignoring blacklisted Spotlight importer plugin:/Developer/Applications/Xcode.app/Contents/Library/Spotlight/SourceCode. mdimporter uuid:548A3091-3C5D-498A-A329-B532A6C896BB version:1085
    12/4/14 10:08:58.235 PM mds[38]: (Normal) ImportServer: Ignoring blacklisted Spotlight importer plugin:/Developer/Applications/Xcode.app/Contents/Library/Spotlight/SourceCode. mdimporter uuid:548A3091-3C5D-498A-A329-B532A6C896BB version:1085
    12/4/14 10:08:58.269 PM mds[38]: (Normal) ImportServer: Ignoring blacklisted Spotlight importer plugin:/Developer/Applications/Xcode.app/Contents/Library/Spotlight/SourceCode. mdimporter uuid:548A3091-3C5D-498A-A329-B532A6C896BB version:1085
    12/4/14 10:08:58.301 PM mds[38]: (Normal) ImportServer: Ignoring blacklisted Spotlight importer plugin:/Developer/Applications/Xcode.app/Contents/Library/Spotlight/SourceCode. mdimporter uuid:548A3091-3C5D-498A-A329-B532A6C896BB version:1085
    12/4/14 10:08:58.662 PM mds[38]: (Normal) ImportServer: Ignoring blacklisted Spotlight importer plugin:/Developer/Applications/Xcode.app/Contents/Library/Spotlight/SourceCode. mdimporter uuid:548A3091-3C5D-498A-A329-B532A6C896BB version:1085
    12/4/14 10:09:57.998 PM mds[38]: (Normal) ImportServer: Ignoring blacklisted Spotlight importer plugin:/Developer/Applications/Xcode.app/Contents/Library/Spotlight/SourceCode. mdimporter uuid:548A3091-3C5D-498A-A329-B532A6C896BB version:1085
    12/4/14 10:09:58.142 PM mds[38]: (Normal) ImportServer: Ignoring blacklisted Spotlight importer plugin:/Developer/Applications/Xcode.app/Contents/Library/Spotlight/SourceCode. mdimporter uuid:548A3091-3C5D-498A-A329-B532A6C896BB version:1085
    12/4/14 10:10:30.000 PM kernel[0]: PM notification timeout (pid 1514, Messages)
    12/4/14 10:10:31.129 PM mDNSResponder[39]: DHCPWakeTime: SCDynamicStoreCopyDHCPInfo index 0 failed CFDateRef start 0000000000000000 CFDataRef lease 0000000000000000 CFDataGetLength(lease) 0
    Any help would be greatly appreciated.
    <Re-Titled By Host>

    Mac Pro early 2009 is Mac Pro4,1, anyway, I think you need to boot into recovery mode, launch Disk Utility, then select startup volume and run repair disk.
    Xcode is the latest one, by the way?

  • Queries running and taking time...

    Dear All,
    My database is 11gR2 RAC on Linux.
    Frequently I see the following queries running and consuming database resources.
    SELECT DECODE(NVL(:B2 , 0), 2, (DBMS_LOB.GETLENGTH(:B1 )/3)*2, DBMS_LOB.GETLENGTH(:B1 ))FROM DUAL;
    I don't know if some log tables needs to truncate.
    Kindly help on this.
    Regards, Imran

    misterimran wrote:
    Dear All,
    My database is 11gR2 RAC on Linux.
    Frequently I see the following queries running and consuming database resources.
    SELECT DECODE(NVL(:B2 , 0), 2, (DBMS_LOB.GETLENGTH(:B1 )/3)*2, DBMS_LOB.GETLENGTH(:B1 ))FROM DUAL;Find the code executing this line. If the select is being called from a PL/SQL routine IF logic will probably be slightly more efficient than an unnecessary select from DUAL. The overhead is slight but builds up if done over and over again.
    If this is being done in a loop make sure the bind values are chaning inside the loop. If the bind values are the same for every execution there is no reason to do this more than once.

  • Query to find the long running concurrent requests morethan 2 hours

    Can any one please provide the " Query to find the long running concurrent requests which are running more than 2 hours"

    You need to find the different between the current time/date and FND_CONCURRENT_REQUESTS.ACTUAL_START_DATE for the running requests.
    More details can be found in the following notes:
    Note: 187504.1 - bde_request.sql - Process and Session info for one Concurrent Request (11.5)
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=187504.1
    Note: 134035.1 - ANALYZEREQ.SQL - Detailed Analysis of One Concurrent Request (Release 11 and up)
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=134035.1
    Note: 751438.1 - How To Check List , Start And End Dates Of A Parent Concurrent Request And All Childs
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=751438.1

  • All the queries running by user

    Hi,
    Is there a way we can get all the queries run by different users on database?

    You can check using V$SESSION & V$SQLAREA
    as
    select a.sid, a.serial#, b.sql_text from v$session a, v$sqlarea b where a.sql_address=b.address and a.username='USERNAME';for all the users you can exclude where clause for username as
    select a.sid, a.serial#, b.sql_text from v$session a, v$sqlarea b where a.sql_address=b.address;here you can find for each and every user by mentioning the username.
    Edited by: CKPT on Dec 7, 2010 10:15 PM

  • How do I find the image name and media_link for an ubuntu image in the Gallery?

    I am trying to create VM using Python API.  
    I have a custom Linux image:
    image_name = 'cloudN-Azure-20150205-os-2015-02-05'
    media_link = 'https://portalvhds10ssz63zgvb9g.blob.core.windows.net/vhds/cloudN-Azure-20150205-os-2015-02-05.vhd'
    When I used this image to create VM, it failed.
    I would like to use the ubuntu 1204 image in the Gallery.
    How do I specify the image_name and media_link in my Python code?  Basically, where and how do I find the image name and media_link for an image in the Azure image Gallery?
    Thanks in advance...

    hi sir,
    Did you try to use "List OS Image"? we can get the property form the results:
    result = sms.list_os_images()
    for image in result:
    print('Name: ' + image.name)
    print('Label: ' + image.label)
    print('OS: ' + image.os)
    print('Category: ' + image.category)
    print('Description: ' + image.description)
    print('Location: ' + image.location)
    print('Affinity group: ' + image.affinity_group)
    print('Media link: ' + image.media_link)
    print('')
    Please try it. Any questions or it doesn't work, please let me know.
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • From which table I can find the "Class type" and "Class" of the material?

    From which table I can find the "Class type" and "Class" of the material?
    Thanks in advance for the answers....

    Hi,
    try following table
    KSSK     Material number to class     
    KLAS     Class description     
    KSML     Characteristic name     
    CABN/CABNT     Characteristic name description     
    CAWN/CAWNT     Characteristic name
    [http://www.sap-img.com/materials/classification-view-of-material-master.htm]
    [http://wiki.sdn.sap.com/wiki/display/ERPLO/FrequentlyUsedTables]
    Regards
    kailas Ugale

  • How to find the column name and table name with a value

    Hi All
    How to find the column name and table name with "Value".
    For Example i have value named "Srikkanth" This value will be stored in one table and in one column i we dont know the table how to find the table name and column name
    Any help is highly appricatable
    Thanks & Regards
    Srikkanth.M

    2 solutions by Michaels (the latter is 11g upwards only)...
    michaels>  var val varchar2(5)
    michaels>  exec :val := 'as'
    PL/SQL procedure successfully completed.
    michaels>  select distinct substr (:val, 1, 11) "Searchword",
                    substr (table_name, 1, 14) "Table",
                    substr (t.column_value.getstringval (), 1, 50) "Column/Value"
               from cols,
                    table
                       (xmlsequence
                           (dbms_xmlgen.getxmltype ('select ' || column_name
                                                    || ' from ' || table_name
                                                    || ' where upper('
                                                    || column_name
                                                    || ') like upper(''%' || :val
                                                    || '%'')'
                                                   ).extract ('ROWSET/ROW/*')
                       ) t
    --        where table_name in ('EMPLOYEES', 'JOB_HISTORY', 'DEPARTMENTS')
           order by "Table"or
    SQL> select table_name,
           column_name,
           :search_string search_string,
           result
      from cols,
           xmltable(('ora:view("'||table_name||'")/ROW/'||column_name||'[ora:contains(text(),"%'|| :search_string || '%") > 0]')
           columns result varchar2(10) path '.'
    where table_name in ('EMP', 'DEPT')
    TABLE_NAME           COLUMN_NAME          SEARCH_STRING        RESULT   
    DEPT                 DNAME                ES                   RESEARCH 
    DEPT                 DNAME                ES                   SALES    
    EMP                  ENAME                ES                   JONES    
    EMP                  ENAME                ES                   JAMES    
    EMP                  JOB                  ES                   SALESMAN 
    EMP                  JOB                  ES                   SALESMAN 
    EMP                  JOB                  ES                   SALESMAN 
    EMP                  JOB                  ES                   PRESIDENT
    EMP                  JOB                  ES                   SALESMAN 
    9 rows selected.

  • [iPhone] Place a custom view below the status bar and above the navbar

    Hello,
    How can I add a custom view between the status bar and the UINavigationBar?
    The Myspace App does this so I know it can be done. It has a custom bar between the status bar and the navigation bar which displays the myspace logo and a logout link. I would like to do something similar w/ my app.
    Thank you

    You can move the tabs to the lower position just above the browsing area without using an extension with code in userChrome.css as basically you only need to give the Tab bar a higher -moz-box-ordinal-group value (most toolbars have a default -moz-box-ordinal-group:1 to show them in DOM order).
    *[[/questions/997353]] How can I put the Tabs back below the navigation bar?
    You can look at the Classic Theme Restorer extension to restore some functionality that was lost with the arrival of the Australis style in Firefox 29.
    *Classic Theme Restorer: https://addons.mozilla.org/firefox/addon/classicthemerestorer/
    *You can check out the settings of the CTR extension via its Options/Preferences button on the "Firefox/Tools > Add-ons > Extensions" page.
    *You can find extra toolbar buttons and more toolbar settings in Customize (3-bar Firefox menu button > Customize)
    See also:
    *https://support.mozilla.org/kb/how-to-make-new-firefox-look-like-old-firefox
    *https://support.mozilla.org/kb/common-questions-after-updating-to-new-firefox
    *https://support.mozilla.org/kb/learn-more-about-the-design-of-new-firefox
    *http://forums.mozillazine.org/viewtopic.php?f=38&t=2824649

  • Where to find the migration reports and errors

    i am using Oracle SQL developer 3.0 for migrating MS SQL 2008 to oracle using migration wizard,after clicking on finish the tool throws the null as error window and asked me to look into migration reports. where should i find the migration reports and errors
    KK
    Edited by: 860986 on May 25, 2011 9:33 PM

    Log into the SQL Developer Migration repository and you get the list of Migration Projects.
    Click on the project you're interested into and on the right side you get a pane with Status, Summary, Analysis...
    The Summary pane shows you how many objects SQL Dev migrated.
    You also have Capture isues showing you the issued during the capture phase as well as Conversation Issues etc.

  • I would like to find the object change and to move

    Thank you very much, but
    Sayfaları, tek tek sayfalarını bakacak bu script belgede (3, 5, 7, ...) işlem yok
    I would like to object all page (height and width of the rectangle is known, the text frame) to move to find and replace
    The height and width of a rectangle with known or find text frame, changing the height and width, to move to a point
    I'm glad I sent you edit scprit
    var findX, findY, changeX, changeY, moveX, moveY;
    var diyalogWindow = app.dialogs.add({name:"RECTANGLE oR TEXT FRAME", canCancel:true});
    with(diyalogWindow){
      with(dialogColumns.add()){
    with(borderPanels.add()){
    with(dialogColumns.add()) {
    staticTexts.add({staticLabel:"FİND X"});
                         findX = textEditboxes.add({editContents: "10"});
                        staticTexts.add({staticLabel:"FİND Y"});
                          findY = textEditboxes.add({editContents: "10"});
    with(dialogColumns.add()) {
         staticTexts.add({staticLabel:"CHANGE X"});
                          changeX = textEditboxes.add({editContents: "50"});
                          staticTexts.add({staticLabel:"CHANGE Y"});
                          changeY = textEditboxes.add({editContents: "60"});
             with(dialogColumns.add()) {
         staticTexts.add({staticLabel:"MOVE X"});
                          moveX = textEditboxes.add({editContents: "100"});
                          staticTexts.add({staticLabel:"MOVE Y"});
                          moveY = textEditboxes.add({editContents: "10"});
    if(diyalogWindow.show() == 1) {
    var myDocument=app.activeDocument;
    var p;
    for(p=0; p < myDocument.selection.length; ++p) {
            myDocument.selection[p].move([changeX.editContents,changeY.editContents]); // ................... how contined ???

    https://forums.adobe.com/message/6714843#6714843
    this script
    app.selection  .paragraphs.everyItem (). spaceAfter = 1
    its make spaceafter = 1
    but how make
    1
    2
    3
    4
    5
    Each click, I get a continuous increase
    2014-09-04 12:14 GMT+03:00 vandy88 <[email protected]>:
        I would like to find the object change and to move  created by vandy88
    <https://forums.adobe.com/people/vandy88> in InDesign Scripting - View
    the full discussion <https://forums.adobe.com/message/6700008#6700008>

  • Help find the Last run date from previous month

    Hi all
    I am stuck trying to find the Last Run Date from the previous month.
    select distinct(date_ran) from TABLE X where date_ran like '%/11-%' order by date_ran desc gives
    "03/30/11-06:19
    "03/25/11-03:01
    "03/24/11-03:00
    "03/23/11-03:00
    "03/22/11-03:00
    "03/21/11-03:00
    "03/18/11-03:00
    "03/17/11-00:00
    "03/16/11-06:31
    "02/15/11-07:42
    "02/15/11-06:00
    "02/14/11-08:19
    Here the result I am trying to acheive is 02/15/11-07:42 ;Note the column date_ran is a VARCHAR2(255) and not a TIMESTAMP
    I tried
    select ADD_MONTHS(to_date(max(date_ran), 'MM/DD/YYYY-HH24:MI'),-1)
    from daily_tests_a
    where date_ran like '%/11-%'
    order by date_ran desc
    which returns 2/28/0011 6:19:00 AM and that is not the result I am looking for
    Regards
    SMK

    Welcome to the forum!
    user2931503 wrote:
    Hi all
    I am stuck trying to find the Last Run Date from the previous month.
    select distinct(date_ran) from TABLE X where date_ran like '%/11-%' order by date_ran desc gives
    "03/30/11-06:19
    "03/25/11-03:01
    "03/24/11-03:00
    "03/23/11-03:00
    "03/22/11-03:00
    "03/21/11-03:00
    "03/18/11-03:00
    "03/17/11-00:00
    "03/16/11-06:31
    "02/15/11-07:42
    "02/15/11-06:00
    "02/14/11-08:19
    Here the result I am trying to acheive is 02/15/11-07:42 ;Note the column date_ran is a VARCHAR2(255) and not a TIMESTAMPThat's a very bad idea. Points in time should always be stored in DATE (or maybe TIMESTAMP) columns. If not, you're going to waste resources converting them to DATEs whenever you need them to behave like DATEs, and risk run-time errors because of bad data.
    Normally, the "previous" month means the month before the current month. In April, the previous month is March.
    By "previous" month, do you mean the 2nd latest month in the table? That is, this data contains data from February and March, 2011; March 2011 is the latest of those months, February 2011 is the next-to-last, and so is that why you want a date from February?
    I tried
    select ADD_MONTHS(to_date(max(date_ran), 'MM/DD/YYYY-HH24:MI'),-1)
    from daily_tests_a
    where date_ran like '%/11-%'
    order by date_ran desc
    which returns 2/28/0011 6:19:00 AM and that is not the result I am looking for
    Regards
    SMKTry this:
    WITH   got_real_date   AS
         SELECT     TO_DATE ( SUBSTR (date_ran, 1, 14)
                   , 'MM/DD/RR-HH24:MI'
                   )     AS real_date
         FROM     table_x
    --     WHERE     ...     -- If you need any filtering, put it here
    SELECT     TO_CHAR ( MAX (real_date)
              , 'MM/DD/RR-HH24:MI'
              )     AS last_date
    FROM    got_month_num
    WHERE     real_date     < (
                               SELECT  TRUNC (MAX (real_date), 'MONTH')
                         FROM    got_real_date
    ;Edited by: Frank Kulash on Apr 5, 2011 3:59 PM

  • How to find the cpu cost and i/o cost  by a query

    I have a query that give the cpu utilization for a session.
    select s.name, m.value from v$statname s, v$mystat m
    where s.statistic# = m.statistic#
    and name = 'CPU used by this session';
    But how do you find the cpu cost and i/o cost by a query?

    Sounds like you want to use TRACE.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/sqltrace.htm#PFGRF01020

  • Please help me to find the sample code and schema for GetDBDateTime.zip fil

    Please help me to find the GetDBDateTime.zip and Guest_Book.zip files.
    Tks!

    Does this Help?
    http://www.oracle.com/technology/sample_code/products/ias/files/psp/GetDBDateTime/Readme.html
    Did you install Oracle9iAS ?

Maybe you are looking for

  • FIREFOX wont load. I get this error message.Firefox profile cannot be loaded. It may be missing or inaccessible

    FIREFOX wont load. It just started yesterday. I get this error message."Firefox profile cannot be loaded. It may be missing or inaccessible"

  • Advantages of using prepared statement..... ?

    can anyone please tell me that what r the advantages of using prepared statements. for eg in case if statement object is executed inside a for loop where query is executed multiple times the sql query is compiled outside loop and therefore compilatio

  • Oracle BPM directory database

    Hi, IHAC that has a custom application to manage their users and roles. They are using Oracle BPM and they want to keep creating, managing and authenticating user with that application, that is not a LDAP. How can I syncronize the creation/updating/d

  • CRM analytics report

    HI Friends, Iam developing report on Executive day contact, so i need to know about the field "NEXT CONTACT DATE" in crm. Ie. the reference field in BW. Please if known post it. Thank u

  • IPhoto vs. Aperture

    I am interested in purchasing one or both. What are the differernces? I can't seem to find any answers on this and I live 150 miles from a Apple retail store. Please and thanks! Lundgren5