Operating System - HP-UX
1834156 Members
2254 Online
110064 Solutions
New Discussion

change system time backward

 
SOLVED
Go to solution
Bing Wong
Frequent Advisor

change system time backward

The time on my HPUX server is 23 minutes ahead. I heard that resetting time and date backward is not recommended.

I have Oracle DB and Lawson application running.

Your advices are appreciated!
Bing
6 REPLIES 6
DCE
Honored Contributor
Solution

Re: change system time backward

Your apps will probably be very confused if you set the time backwards while they are running.

The safest way to correct the time backward is to boot into single user mode (no apps running) and change the time with set_parms.

After the server reboots, you should use ntp (you can configure via sam if you are unfamilar with it) to keep you server time in sync with the other systems on your network.

Steven E. Protter
Exalted Contributor

Re: change system time backward

Shalom Bing,

Yes Bing, turning back the clock on oracle will cause an immediate and damaging database crash.

You are well advised not to do it.

What you can do is configure ntp to point to a valid internal or external (firewall permitting) time source.

What ntp does is run the clock more slowly than normal, but just slightly until its in sync with its time source.

Its easy to configure ntp, just modify /etc/ntp.conf

/sbin/init.d/xntpd start

Will start up the daemon.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
A. Clay Stephenson
Acclaimed Contributor

Re: change system time backward

In this case with a live database (unless you can shutdown for 23 or more minutes), your best bet is to do a "date -a -1380" which will gradually adjust (slew) time backwards by 23 minutes. If you try to do an instantaneous backward adjustment (a step adjustment) then database transaction 100 can occur before transaction 99 -- something that becomes very difficult to explain to a customer/user. The data -a -seconds command slow down the clock ticks until the "real" time catches up. Man date for details.
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: change system time backward

Even if you shutdown, unless you wait 23 minutes before the system is back up the you still have the risk that transactions will appear out of order. In this mode you should set the system date and then start the database. Because it is difficult to find an unplanned shutdown window on most systems, I suggest slewing the clock. It will take a while to complete before your clock is accurate but during that transition, at least all the transactions will be consistent.
If it ain't broke, I can fix that.
Bill Hassell
Honored Contributor

Re: change system time backward

Note that 23 minutes is a LONG time to adjust witout affecting the applications. Don't expect the system to reach the correct time for many hours (using the date -a command). If you have other servers in your organizatin, all of them should be using NTP for accurate time sync.


Bill Hassell, sysadmin
Bing Wong
Frequent Advisor

Re: change system time backward

Thank you all for responding. I will let you know what it goes.

Bing