1 Reply Latest reply: Sep 2, 2013 7:49 PM by Hussein Sawwan-Oracle RSS

    Query cpu time process frmweb

    e2c6e90a-48de-4493-9c98-ebd260dc0602

      Hi!

       

      know how to get the time it takes to run a process "frmweb" through a sql query?

       

      for example

       

      top output

       

      CPU TTY    PID USERNAME PRI NI   SIZE    RES STATE    TIME %WCPU  %CPU COMMAND                                                                                                    7   ?    1446 apppro   154 20   176M 43152K sleep    70:34 14.63 14.61 frmweb                                                                          
      7   ?    6396 apppro   154 20   154M 20844K sleep    0:06 16.53 12.84 frmweb                                                                                             
      0   ?    1713 apppro   154 20   177M 44920K sleep    1:59  9.13  9.11 frmweb


      QUERY

       

       

      select s.username as "DB User", s.osuser as "OS User", s.process APPPROC, p.spid DBPROC, s.sid SID, s.serial# as "Serial #", s.terminal Terminal, s.status Status, (s.last_call_et /60) as "Mins. Corriendo", "Time CPU", s.program as "Program", s.action as "Action", s.client_identifier as "Cliente" , s.module as "Modulo",s.sql_hash_value from  v$session s, v$process p where s.type = 'USER' and s.paddr = p.addr and s.program like 'frmweb%' and (s.last_call_et /60) > 60

      order by s.status, "Mins. Corriendo" desc, "DB User";

       

      Expected output of query

       

      DB User   Os User  APPROC  DBPROC   SID  Terminal   Status     Min. corriendo  Time CPU  Program  Action  Client    Module   SQL_HASH_VALUE
      apps        apppro    1446          1287         305                 ACTIVE   247.08             70:34          frmweb    SQLAP EJAZZ  SQLAP  0

       

      Thanks.