This discussion is archived
4 Replies Latest reply: Feb 1, 2013 2:43 AM by oelk0 RSS

Q: XE11 on Linux and SYSDATE

oelk0 Newbie
Currently Being Moderated
Hello,

does Oracle Express Edition 11 query the system date only on startup or scheduled again and again?
Or is there a need to create a scheduled job to query the system date?

Best regards
Achim Klausmann
  • 1. Re: Q: XE11 on Linux and SYSDATE
    AndyPol Expert
    Currently Being Moderated
    oracle always use current system date.
    You can check it query sysdate:

    select to_char(sysdate, 'dd/mm/yyyy hh24:mi') from dual

    Edited by: AndyPol on 2013-01-31 14:47
  • 2. Re: Q: XE11 on Linux and SYSDATE
    oelk0 Newbie
    Currently Being Moderated
    Hello,

    when does oracle use the current system date?
    only on startup or again and again?

    today i had system with correct system time and date, but
    a backup function with expdp created a file with date 2012, not 2013.
    the date is in the filename, created with sysdate ( i did not wrote the package)

    So i tried 'ntpdate de.pool.ntp.org' to sync the time and restarted the dbms
    service oracle-xe restart

    Then i had a correct backuped file.

    Best regards
  • 3. Re: Q: XE11 on Linux and SYSDATE
    clcarter Expert
    Currently Being Moderated
    The database sysdate and systimestamp calls the OS time routines to get the current time from the host clock.

    Try removing the CMOS battery from the machine, unplug it from AC power ... wait an hour or two and see what happens.

    If system time is not in sync with "clock time", sysdate won't have the correct time either. ntp (Network Time Protocol) will slew the system clock until it matches, see http://en.wikipedia.org/wiki/Network_Time_Protocol

    And of course, if the host ntp daemon is not running system time can drift and vary quite a bit from "true" time.
  • 4. Re: Q: XE11 on Linux and SYSDATE
    oelk0 Newbie
    Currently Being Moderated
    clcarter wrote:
    The database sysdate and systimestamp calls the OS time routines to get the current time from the host clock.

    Try removing the CMOS battery from the machine, unplug it from AC power ... wait an hour or two and see what happens.

    If system time is not in sync with "clock time", sysdate won't have the correct time either. ntp (Network Time Protocol) will slew the system clock until it matches, see http://en.wikipedia.org/wiki/Network_Time_Protocol

    And of course, if the host ntp daemon is not running system time can drift and vary quite a bit from "true" time.
    This mean to me: the database queries date/time only on database-startup, a time drift would not detected by the database.

    I asume the last database startup the server had wrong date/time, which has been correted at a later time.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points