1832592 Members
3230 Online
110043 Solutions
New Discussion

Time change !!

 
rveri
Super Advisor

Time change !!

Hi All,

The current time in the system is 10 minute faster than the actual time.

# date
Thu Jun 8 02:28:58 CDT 2006
#

How to set the time.
(i)Any Precaution to take,
Oracle is running in the system.
(ii) If any reboot required.

Thanks,
14 REPLIES 14
Warren_9
Honored Contributor

Re: Time change !!

hi,

before change the system time, i think you must shutdown the database and related application running on the server.

to change the time, simply run the command "date MMDDhhmmYY" to change the time or using SAM.

no reboot is require to change the time.

GOOD LUCK!!

Warren_9
Honored Contributor

Re: Time change !!

hi,

before change the system time, i think you must shutdown the database and related application running on the server.

to change the time, simply run the command "date MMDDhhmmYY" or using SAM.

no reboot is require to change the time.

GOOD LUCK!!

inventsekar_1
Respected Contributor

Re: Time change !!

from man date:

===================================================================

date [-u] [mmddhhmm[[cc]yy]]

Set the HP-UX system clock to the date and time
specified. You require the superuser privilege.

If you include the -u option, the specified date and time
is assumed to be in Coordinated Universal Time (UTC).

The numeric argument is interpreted left to right in
two-digit pairs as follows:

mm Month number [01-12].
dd Day number in the month [01-31].
hh Hour number (24-hour system) [00-23].
mm Minute number [00-59].
cc Century minus one [19-20].
yy Last two digits of the year number [70-99, 00-
37 (1970-1999, 2000-2037)]. If omitted, the
current year is used.

If you attempt to set the date backwards, date generates
the warning,

do you really want to run time backwards?[yes/no]

Type yes or the equivalent for your locale to set the
clock backwards; anything else to cancel the command.

When date is used to set the date, a pair of date change
records is written to the file /var/adm/wtmps.

(XPG4 only.) No warning is generated if date is set
backwards.
===================================================================
i)Any Precaution to take: i dont know exactly.wait for others responses.
[i think no need to take any precaution]
ii)reboot not required.
Be Tomorrow, Today.
inventsekar_1
Respected Contributor

Re: Time change !!

u need to be super user to change the time. so i assume u r a super user.

simple way is thru sam
1. run the command sam
2. select the last "sam area"--- Time
3. then third option-->System time

change the time
Be Tomorrow, Today.
john korterman
Honored Contributor

Re: Time change !!

Hi,

if you are running hpux newer than 11.00, you can slow the time gradually over a period, e.g.:
# date -a -60

which will - over a period - subtract 60 seconds from the system time.
It is difficult to say when the period is over, as you get the prompt back immediately after executing the command:
60 seconds can probably be dealt with in app. 10-15 minutes.
Try and execute the command a few times with this interval - and be patient.
The advantage is of course that you do not have to think about the database, users etc.

regards,
John K.
it would be nice if you always got a second chance
spex
Honored Contributor

Re: Time change !!

If you have an NTP server you'd like to sync to, you could do:

/usr/sbin/ntpdate

cron this command to sync on a regular basis.

As a precaution, I would first shutdown Oracle.
Bill Hassell
Honored Contributor

Re: Time change !!

All your systems should be running NTP. Computers are not designed to be accurate clocks and they will all have inaccurate time. NTP can bring all your systems (Unix, PCs, network appliances, smart UPS battery backup, etc) to within a fraction of one second accuracy. DO NOT change your time backwards until all applications have been shutdown. Many databases and supporting programs depend on date/time values that are always unique. Setting the time backwards will mean potentially duplicate time values. NTP is standard on HP-UX and most other Unix flavors. PCs that are in a domain will use the domain controller's time value and depending on the version of the domain controller's OS, NTP may be available, but certainly an NTP client can be added.


Bill Hassell, sysadmin
TwoProc
Honored Contributor

Re: Time change !!

While we're on the subject...

I've always wondered, how does "daylight savings" time affect do this? Does it do it slowly, or does it just suddenly flop it over at 2:00 AM? Is it automatic - not ntp, but does the "clock" program on HPUX automatically change for DST? Or will it just update then next time I request a date change? I just realized some weeks ago that I could be exposed b/c of databases being open and running during the switch on and off of daylight savings time...
We are the people our parents warned us about --Jimmy Buffett
Rick Garland
Honored Contributor

Re: Time change !!

Here is a URL that will get you started on NTP. Has the HOWTO, the FAQ, etc.

Also has list/links to public time servers to can point to for accurate time.

As stated, computers are not time pieces. They will sync to a standard timepiece (atomic clock) but without the sync they should not be relied on for keeping accurate time.

As to when the time changes (1 forward or backward) the definition changes as well.

Example, PDT becomes PST
Rick Garland
Honored Contributor

Re: Time change !!

Forgot the URL - here it is.

http://www.eecis.udel.edu
Bill Hassell
Honored Contributor

Re: Time change !!

HP-UX never changes time for Daylight Saving. What you saw was the translation of GMT (more accurate UTC or Zulu time). The translation uses a table (/usr/lib/tztab) and an environment variable $TZ. The GMT time is translated by the time library calls so it appears that the computer is in a particular timezone. Now any program that runs, say every second checking the time, will see the time jump forward or backward.

Modern databases use sequence numbers for transactions but some DBAs and developers may store the current time and then use it as an indexed pointer. Most programmers will account for such situations but some do not. One solution is to run the databases and middleware in TZ=GMT0 and design the middleware to perform database-to-user dates to their timezone. HP-UX is somewhat unique in that 50 users can each have their own timezone. man environ


Bill Hassell, sysadmin
TwoProc
Honored Contributor

Re: Time change !!

Thanks Bill!
We are the people our parents warned us about --Jimmy Buffett
doug hosking
Esteemed Contributor

Re: Time change !!

Another way to think of what Bill said is that internal to HP-UX, time is maintained mostly as the number of seconds since midnight (GMT) Jan 1, 1970. The concept of minutes, hours, months, days, years, leap years, DST or not, etc. does not exist in most of the HP-UX code. It's (mostly) when that time is converted into human readable format by the C runtime library (libc) or equivalent code that these concepts apply. The beauty of this is that knowledge of DST rules changes, etc. can be isolated to a very small section of the system's code, and that different users on the system can even have different time zones set at the same time, so that, for example, a user logged in from Germany and a user logged in from Canada could each see time displayed in the time zone most natural to them.

Raj D.
Honored Contributor

Re: Time change !!

Hi you can also use SAM to change the time , make sure the applications are down before changing, Good luck,

hth,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "