Home » SQL & PL/SQL » SQL & PL/SQL » Oracle Trace
Oracle Trace [message #20483] Tue, 28 May 2002 10:32 Go to next message
Wesley McCammon
Messages: 1
Registered: May 2002
Junior Member
In the trace file the tim= "field" appears to be the timestamp of when the sql statement was loaded. Can anyone tell me how to convert the timestamp to a "real" time. It actually appears to be the number of microseconds (in 1/100ths), if so, the number of microseconds that has elapsed since what?
PARSING IN CURSOR #1 len=25 dep=0 uid=5 oct=3 lid=5 tim=3926055392 hv=482474662 ad='1fb7c01c'
select * from mydogtable
END OF STMT
PARSE #1:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=3926055392
EXEC #1:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=3926055392
FETCH #1:c=0,e=0,p=0,cr=1,cu=2,mis=0,r=1,dep=0,og=4,tim=3926055392
FETCH #1:c=0,e=0,p=0,cr=1,cu=0,mis=0,r=1,dep=0,og=4,tim=3926055392
STAT #1 id=1 cnt=2 pid=0 pos=0 obj=33687 op='TABLE ACCESS FULL MYDOGTABLE '

Thank you.
Re: Oracle Trace [message #20484 is a reply to message #20483] Tue, 28 May 2002 12:38 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
I believe it's just a counter. Sticking the trace file through tkprok would give a meaningful metric (assuming you have TIMED_STATISTICS=true).

SELECT hsecs FROM v$timer;

23439300

begin
DBMS_OUTPUT.put_line (DBMS_UTILITY.get_time);
end;
/
23438849

set serveroutput on;

DECLARE
   timing   PLS_INTEGER;
   x        PLS_INTEGER;
BEGIN
   timing := DBMS_UTILITY.get_time;

   FOR i IN 1 .. 100000
   LOOP
      x := i;
   END LOOP;

   DBMS_OUTPUT.put_line ('hundredths of a sec = ' || TO_CHAR (DBMS_UTILITY.get_time - timing) );
END;
/
hundredths of a sec = 17

declare
t number;
i number := 1;
begin
SELECT hsecs INTO t FROM v$timer; 
while i < 1000000 loop
i := i + 1;
end loop;

  SELECT (hsecs - t) INTO t FROM v$timer; 
  DBMS_OUTPUT.PUT_LINE ( 'hundredths of a sec = ' || t); 
end;
/
hundredths of a sec = 17
Previous Topic: Oracle 600 message
Next Topic: search for the first occurrence of a number in a given string
Goto Forum:
  


Current Time: Fri Mar 29 02:06:56 CDT 2024