Re: Source for tim=nnnnn in 10046 trace

From: Yong Huang <yong321_at_yahoo.com>
Date: Sat, 24 Aug 2013 10:40:45 -0700 (PDT)
Message-ID: <1377366045.35334.YahooMailNeo_at_web184806.mail.gq1.yahoo.com>



Raj,
You're almost there. Your trace file shows:
  • 2013-08-23 15:24:25.823

But your calculation uses sysdate:

------------------begin cut------------------
with x as (select 1377285865823053 as t, (1377285865823053/1e6) as t1 from dual) select t tim_micro, t1 tim_sec, sysdate curr_sysdate, sysdate-(t1/86400) derived_sysdate from x;

          TIM_MICRO              TIM_SEC CURR_SYSDATE DERIVED_SYSDATE

-------------------- -------------------- --------------------- ---------------------

  1377285865823053    1377285865.823053 08/23/2013 15:29:42  12/31/1969 20:05:16

something doesn't match up,

tim is neither time from epoch, not it is from last system reboot on my system or why bother ? even if i factor GMT it is still off by over 5 minutes.

------------------end cut------------------

You just need to change your sysdate to 2013-08-23 15:24:25.823. For example:

SQL> with x as (select 1377285865823053 as t, (1377285865823053/1e6) as t1 from dual)
  2  select t tim_micro, t1 tim_sec, '2013-08-23 15:24:25' curr_sysdate, to_date('2013-08-23 15:24:25','yyyy-mm-dd hh24:mi:ss')-(t1/86400)
  3  derived_sysdate
  4  from x;

           TIM_MICRO              TIM_SEC CURR_SYSDATE        DERIVED_SYSDATE

-------------------- -------------------- ------------------- -------------------
    1377285865823053    1377285865.823053 2013-08-23 15:24:25 1969-12-31 19:59:59

The derived sysdate is the epoch.

By the way, beginning with Oracle 11g, Oracle on Linux (and probably on UNIX) uses times() instead of gettimeofday().

Yong Huang

--
http://www.freelists.org/webpage/oracle-l
Received on Sat Aug 24 2013 - 19:40:45 CEST

Original text of this message