How to find the current SQL

Dear All,
My testing engineers are checking the application from front end, i have to find the current SQL (What SQL queries are used in the application) statements in the back end.
Please let me know how to find the current executing SQL stements.
Thanks in advance
Mahi

You need to join this query with one more table - v$sqlstats. There are many statistics in particular cpu_time, elapsed_time etc stored in that table for each sql statement.
You can join v$sqlstats by sql_id until you have multiple child cursors for single statement.
Or you can just join to v$sql and get statistics from there and in this latter case you include child_number column to distinguish child cursors from each other.
Best Regards,
Alex

Similar Messages

  • How to Find the Current Instance Id in Oracle 10g

    Hi,
    how to find the current instance id in oracle 10g studio,
    I have the below code :
    if (InstanceScreenFlow.processInstance.id.id.indexOf(text : ins.id) < 0) {
    /// do something
    it is saying that "'processInstance' is not a function"
    Thanks,
    Brijesh Kumar Singh.

    Why not just pass in the "id" predefined variable into your screenflow? Once you do that you'll be able to refer to it as "id.id" anywhere inside your screenflow.
    Dan

  • How to find the current state in web dynpro

    Hi,
       Can any one tell me how to find the current state of system (idle /not idle).
    Thanks,
    Krishna..

    Please explain further.  I don't understand how you are expecting to test for idle.  If ABAP code is being executed, then you know that the application is not idle. Only a server event could trigger code execution. Only a timedTrigger would be able to tell you that a certain amount of time has passed without activitity - although the event of the timer itself will be a server event that constitutes activity.

  • How to find the current line in the table control in module pool ?

    How to find the current line in the table control in module pool ?
    This is an urgent requirement? please do help me.

    refer to this example
    REPORT demo_dynpro_tabcont_loop_at.
    CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
    DATA: cols LIKE LINE OF flights-cols,
    lines TYPE i.
    DATA: ok_code TYPE sy-ucomm,
          save_ok TYPE sy-ucomm.
    DATA: itab TYPE TABLE OF demo_conn.
          TABLES demo_conn.
    SELECT * FROM spfli INTO CORRESPONDING FIELDS OF TABLE itab.
    LOOP AT flights-cols INTO cols WHERE index GT 2.
      cols-screen-input = '0'.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDLOOP.
    CALL SCREEN 100.
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'SCREEN_100'.
    DESCRIBE TABLE itab LINES lines.
    flights-lines = lines.
    ENDMODULE.
    MODULE cancel INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    MODULE read_table_control INPUT.
      MODIFY itab FROM demo_conn INDEX<b> flights-current_line.</b>
    ENDMODULE.
    MODULE user_command_0100 INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
      CASE save_ok.
        WHEN 'TOGGLE'.
          LOOP AT flights-cols INTO cols WHERE index GT 2.
            IF  cols-screen-input = '0'.
              cols-screen-input = '1'.
            ELSEIF  cols-screen-input = '1'.
              cols-screen-input = '0'.
          ENDIF.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDLOOP.
        WHEN 'SORT_UP'.
          READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
          IF sy-subrc = 0.
            SORT itab STABLE BY (cols-screen-name+10) ASCENDING.
            cols-selected = ' '.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDIF.
        WHEN 'SORT_DOWN'.
          READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
          IF sy-subrc = 0.
            SORT itab STABLE BY (cols-screen-name+10) DESCENDING.
            cols-selected = ' '.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDIF.
        WHEN 'DELETE'.
          READ TABLE flights-cols INTO cols
                                  WITH KEY screen-input = '1'.
          IF sy-subrc = 0.
            LOOP AT itab INTO demo_conn WHERE mark = 'X'.
              DELETE itab.
    ENDLOOP.
          ENDIF.
    ENDCASE.
    ENDMODULE.

  • Find the current sql which is running against database

    Hi,
    How to find out the current sql which is running against database?

    Hi,
    You can use V$SESSION_LONG_OPS and V$SQL to get the long running(6 seconds or above) queries. You need to join these two views to get the SQL text.
    V$SESSION_LONGOPS : Will give you the long running SQL ID.
    V$SQL : Will give you the text of query against the SQL ID.
    Refere the below link for more details:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2092.htm#REFRN30227
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2113.htm#REFRN30246
    Cheers,

  • How to find the backend  SQL query of the JSP page in OIC

    Does anybody how the best way to find the backend SQL QUERY of OIV JSP page?

    How To Generate Trace Files in in HTML/JSP (using Profile Option)
    •     • Note: This requires proper responsibility to set SQL Initialization statement using Profile option.      
         Step 1.     Login to the desired Form application.     
         Step 2.     Select +Profile >> System ('Find System Profile Values' screen will pop up)     
         Step 3.     Check 'User' and Type in the Username (in which the account for that user will be trace)     
         Step 4.     Type 'Initialization%' in the Profile box and Hit 'Find' (Click here for preview.)     
         Step 5.     In the User box, type the following statement and Hit 'Save' (Click here for preview)
         BEGIN FND_CTL.FND_SESS_CTL('','','TRUE','TRUE','','ALTER SESSION SET TRACEFILE_IDENTIFIER = TESTING MAX_DUMP_FILE_SIZE = 5000000 EVENTS ='||''''||' 10046 TRACE NAME CONTEXT FOREVER, LEVEL 12'||'''');END;     
         Note:     specify any name you like to identify your trace, in this case, testing is the end name on the trace. You can also specify the amount of data allowable to be in the trace, in this case, 5000000 is the amount set. Make sure you hit 'Save' afterwards.[Quotes in the statement are all 'Single' quotes.]
              specifying TRACEFILE_IDENTIFIER value is mandatory when setting up the trace using the above profile option value
         Step 6.     Login to HTML / JSP page with username/password and start your flow. (Everything you do once login to HTML / JSP will get trace.)     
         Step 7.     Logout of HTML / JSP application once you completed with your flow.      
         Step 8.     Go back to the Profile option in the Form application and delete the Initialization SQL statement, and Hit 'Save'.     
         Step 9.     Log in to the database server or login server and retrieve your trace file.
         Identify and retrieve the trace file using the tracefile_identifier specified in Step 5.
         In this case the tracefile_identifier is “TESTING”. (Click here for Trace file locations) *     
         Note:     If you need to regenerate your trace or tracing a new flow, then repeat Step 1 to Step 8. To avoid self-confusion, choose a different name for your trace identifier everytime you set to trace.     
         Step 10.     See TKPROF section on how to format trace file into readable text.
         Trace Options Definition
         No Trace          Tracing is not activated
         Activities will not get traced.
         Regular Trace
         (Level 1)          Contains SQL, execution statistics, and execution plan.
         Provides execution path, row counts as well as produces smallest flat file.
         Trace with Binds
         (Level 4)          Regular Trace plus value supplied to SQL statement via local variables.
         Trace with Waits
         (Level 8)          Regular Trace plus database operation timings that the SQL waited to have done in order to complete, i.e. disk access.
         Trace with Binds and Waits
         (Level 12)          Regular trace with both waits and binds information.
         Contains the most complete information and will produce the largest trace file.
    ****Send me an email to [email protected],I will share the document with you.

  • How to find the current iTunes Library

    Hello,
    somehow, opening iTunes the last time I came to a previous iTunes Library and do not find the current one, where much more songs and downloads are in.
    Searching in Windows also did not help. How could I get back to the current one, as everytime opening iTunes the previous shows up.
    Does anybody know?
    Thx

    The only way is to search in Windows and look at the Size & Date Modified fields.
    Are you searching ALL your hard drives, even external ones?
    Are your Windows Explorer folder options set to hide system folders? Hide file extensions? You will need to uncheck both those options for the search to be useful.

  • How to find the current running jobs.

    Hi All,
    Can u please tell me how can i find the current running jobs in oracle.
    OS : windows
    DB VERSION: 10.2.0.1
    Thanks,
    srini...

    Don't think so..
    For the running jobs ( the ones in flight right now..)
    if you used the scheduler
    select owner , job_name , running_instance, session_id from all_scheduler_running_jobs
    order by owner , job_name
    If you used dbms_job ( you really should the scheduler ...)
    select job, instance, sid from dba_jobs_running
    order by instance, job
    /

  • How to find the current users logged in.

    Hi,
    I have a problem in finding the current users logged into the database and the operations they are doing.
    If u know pls help me........
    Thanks.
    K.Vijay Choudary Reddy.

    hi vijay,
    this is the OracleAS Portal Content Management forum. Please post your database related question in the Database Forum:
    General Database Discussions
    thanks,
    christian

  • InfoPath 2013: How to find the current file name?

    Hello,
    Is there any way to find the file name in the rule formulas when an existing xml file in a sharepoint form library is being edited in InfoPath? I am looking for a function that returns the current file name that is being edited.
    Thank you,

    Hi,
    According to your post, my understanding is that you want to get the current file name in the InfoPath form.
    Here is a similar thread for you to take a look at:
    http://social.technet.microsoft.com/Forums/en-US/a24f01d5-744c-4b75-b30d-3295311ab054/how-do-i-find-the-file-name-of-the-currently-open-infopath-form?forum=sharepointcustomizationlegacy
    Best Regards
    Dennis Guo
    TechNet Community Support

  • How to find the existing sql server backup plan/schedule is there a script for that?

    Friends,
    Is there a easy way to find out in SQLServer (for All DB's) what is the current backup plan/schedule ? is there a script for that?
    Thanks,
    Karthikeyan Jothi

    To check the database backup 
    Select
    SERVERPROPERTY('ServerName'),
    db.name,
    CONVERT(VARCHAR(10), b.backup_start_date, 103) + + convert(VARCHAR(8), b.backup_start_date, 14) backup_start_date,
    CONVERT(VARCHAR(10), b.backup_finish_date, 103) + + convert(VARCHAR(8), b.backup_finish_date, 14) backup_finish_date,
    case
    when (DATEDIFF(hour, b.backup_start_date, getdate())<24)then 'Success'
    when (DATEDIFF(hour, b.backup_start_date, getdate())>=24)then 'Failed'
    end Status,
    DATEDIFF(hh, b.backup_finish_date, GETDATE())BackupAgeInHours,
    (b.backup_size/1024/1024/1024 )BackupSize,
    case b.[type]
    WHEN 'D' THEN 'Full'
    WHEN 'I' THEN 'Differential'
    WHEN 'L' THEN 'Transaction Log'
    END Type,
    ISNULL(STR(ABS(DATEDIFF(day, GetDate(),(Backup_finish_date)))), 'NEVER')DaysSinceLastBackup
    FROM sys.sysdatabases db
    Left OUTER JOIN (SELECT * , ROW_NUMBER() OVER(PARTITION BY database_name ORDER BY backup_finish_date DESC) AS RNUM
    FROM msdb.dbo.backupset) b ON b.database_name = db.name AND RNUM = 1
    where dbid<>2
    OR
    SELECT
    DISTINCT
    a.Name AS DatabaseName ,
    CONVERT(SYSNAME, DATABASEPROPERTYEX(a.name, 'Recovery')) RecoveryModel ,
    COALESCE(( SELECT CONVERT(VARCHAR(12), MAX(backup_finish_date), 101)
    FROM msdb.dbo.backupset
    WHERE database_name = a.name
    AND type = 'd'
    AND is_copy_only = '0'
    ), 'No Full') AS 'Full' ,
    COALESCE(( SELECT CONVERT(VARCHAR(12), MAX(backup_finish_date), 101)
    FROM msdb.dbo.backupset
    WHERE database_name = a.name
    AND type = 'i'
    AND is_copy_only = '0'
    ), 'No Diff') AS 'Diff' ,
    COALESCE(( SELECT CONVERT(VARCHAR(20), MAX(backup_finish_date), 120)
    FROM msdb.dbo.backupset
    WHERE database_name = a.name
    AND type = 'l'
    ), 'No Log') AS 'LastLog' ,
    COALESCE(( SELECT CONVERT(VARCHAR(20), backup_finish_date, 120)
    FROM ( SELECT ROW_NUMBER() OVER ( ORDER BY backup_finish_date DESC ) AS 'rownum' ,
    backup_finish_date
    FROM msdb.dbo.backupset
    WHERE database_name = a.name
    AND type = 'l'
    ) withrownum
    WHERE rownum = 2
    ), 'No Log') AS 'LastLog2'
    FROM sys.databases a
    LEFT OUTER JOIN msdb.dbo.backupset b ON b.database_name = a.name
    WHERE a.name <> 'tempdb'
    AND a.state_desc = 'online'
    GROUP BY a.Name ,
    a.compatibility_level
    ORDER BY a.name
    To check the schedule you can try the below script
    https://gallery.technet.microsoft.com/SQL-Jobs-Complete-eabe0050
    --Prashanth

  • How to find the main sql

    Hi all,
    I'm working on a 11.2 Oracle Enterprise database.
    I need a query to find the top 10 queries of my database. Please could you help me?
    Best regards
    dbajug

    moreajays wrote:
    Hi,
    AWR will give you all historic sql details
    @?/rdbms/admin/awrsqrpt.sql
    To know current top CPU queries you can use below sql
    col sql_text for a80
    set pages 200
    set line 900
    col PROGRAM for a20
    col MACHINE for a20
    col CPU 9999999999
    alter session set nls_date_format='dd-mon-yyyy hh24:mi:ss';
    col event for a40
    select *
    from (select /*+ rule */
    sa.sql_id,
    sa.CPU_TIME "CPU",
    s.sid "SID",
    s.serial# "SERIAL",
    s.program "PROGRAM",
    s.machine "MACHINE",
    sa.SQL_TEXT "SQL_TEXT",
    vp.spid,
    sw.event,
    s.logon_time,
    s.last_call_et / 60,
    s.username,
    s.status
    from v$sqlarea sa, v$session s, v$process vp, v$session_wait sw
    where sa.address = s.sql_address
    and sw.sid = s.sid
    and s.paddr = vp.addr
    order by CPU_TIME desc)
    where rownum < 10;Thanks,
    Ajay More
    http://www.moreajays.com
    Hey? This query is not going to help.
    Your join condition sa.address = s.sql_address will exclude all SQLs that are not the most recently executed by a session.
    And you are listing the same SQL several times if it is executed by multiple sessions, but taking no account of the number of times it was executed.
    You need to run something much simpler. Perhapsselect sql_text,executions,disk_reads,buffer_gets,cpu_time,elapsed time from v$sql order by....;run it several times, sorting it on each of the projected columns.

  • How  to find the current item is new

    I create a item ,and diaplay "new" .so I want to know which table I can find the
    "new" identifier. if anyone konw this please contract me .my Email :[email protected]

    If you are referring to where to find the new image itself, that is in the middle tier in the images directory. You can access it by adding /images/new.gif to your base portal URL.
    If you are looking for how to add the new icon to a region, edit the region settings by clicking the pencil in the region heading and go to the attributes tab. Double-click the "new item" in the left selector box to move it to the right selector box then hit Apply and OK.
    If you are looking for the logic where it is displayed, there is a setting on the page group level that determines how many days to display the New icon. The portal then dynamically uses the modify date of the item to determine if the new icon should be rendered. You can query the item views yourself if you want to create your own New logic.
    Rgds/Mark M.

  • How to find the current CAN BUS Utilization in Labview?

    Hi,
    I want to detact the Current CAN BUS utilization. Can any body suggest for that?

    This question would probably be better suited at the Automotive Networks section.
    http://forums.ni.com/t5/Automotive-and-Embedded-Networks/bd-p/30
    Even so I've never seen a LabVIEW implmenetation for NI-CAN or XNET that actual measured bus load.  Which is a little odd because the test panels in MAX have this feature.  For me I usually put another node on the bus and measure it this way as a test.  But if I wanted to know what it is from a VI the best that I know of is you can calculate it.  There is a VI burried that does the math for you.
    This VI can calculate how long it will take to transmit a frame, and how many frames per second can be sent.  Using this information you can calclate bus load of your actual messages.
    <LabVIEW>\examples\CompactRIO\Module Specific\NI 985x\cRIO CAN Periodic Transmit\CAN Rate Calculator.vi
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • How to find the current version for MQ series JMS adapter in PI 7.0

    Hi,
    Please anybody has the idea to find the JMS version on PI 7.0.
    Thank you.

    Hi,
    Ask BASIS person to check the JMS driver which is installed on XI through visual admin.
    Thnx
    Chirag

Maybe you are looking for