Strange ...
Posted in 2012
On AIX 6.1 with IDS 11.70 and USEOSTIME 0, one instance suddenly reported times 7 hours off from the (correct) OS clock, while a second instance started from the same script on the same box was fine; the TZ variable appeared unchanged. Suggestions were to check/set TZ, look for missing or corrupted system timezone files (possibly surfacing after the DST change), set USEOSTIME 1, and bounce the instance. IBM support explained the engine simply uses time()/localtime(), so the cause is almost certainly an OS/environment timezone mismatch (e.g. TZ set in some shells but /etc/localtime used elsewhere). No confirmed fix or outcome is recorded in the thread.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: General Discussion
IDS 11.70.fc3xc Aix 6.1.0 USEOSTIME=0 For some reason the time on my system and database are all of a sudden 7 hours off. The OS time is correct, and the database is incorrect... Not sure exactly when this happened, but it's been in the last couple of days. Have to restore my online log .. and we just changed backup servers ... Has anyone seen this before ... thanks ... Peter Logan Senior Database Administrator Phone: 616/878-8309
One additional piece of information ... I have a second instance on this box ... we reboot the servers on Sat. night ... this instance comes up in the same script as the other instance ... and the time is correct here ... So I have one instance with the wrong time .. and another with the right time ... Peter Logan Senior Database Administrator Phone: 616/878-8309 From: "Peter_Logan@spartanstores.com" <Peter_Logan@spartanstores.com> To: ids@iiug.org, Date: 11/13/2012 11:09 AM Subject: Strange ... [28812] Sent by: ids-bounces@iiug.org IDS 11.70.fc3xc Aix 6.1.0 USEOSTIME=0 For some reason the time on my system and database are all of a sudden 7 hours off. The OS time is correct, and the database is incorrect... Not sure exactly when this happened, but it's been in the last couple of days. Have to restore my online log .. and we just changed backup servers .... Has anyone seen this before ... thanks ... Peter Logan Senior Database Administrator Phone: 616/878-8309 ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.
Hmm, never saw this one before, no. I was told that with USEOSTIME 0 the server retrieves system time periodically but keeps track of the time itself in-between pings. WIth USEOSTIME 1 every call to CURRENT or TODAY calls the system's gettimeofday() function to get the exact time. I always set USEOSTIME to 1 just because it is the only way to get sub-second times from CURRENT YEAR TO FRACTION. The default is only 0 because once-upon-a-time SCO XENIX was the most popular OS used with Informix and its gettimeofday() function was very expensive. AFAIK all currently existing OS's gettimeofday() calls are dirt cheap. That rant over, the only thing I can think of is that either the server was started with TZ unset or set to the wrong timezone or your system's timezone files are out-of-date, missing, or corrupted and the problem manifested when daylight savings time ended two weeks ago. Is it possible that someone cleaned up the filesystems and accidentally deleted the timezone database files? Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Tue, Nov 13, 2012 at 11:08 AM, Peter_Logan@spartanstores.com < Peter_Logan@spartanstores.com> wrote: > IDS 11.70.fc3xc > Aix 6.1.0 > > USEOSTIME=0 > > For some reason the time on my system and database are all of a sudden 7 > hours off. The OS time is correct, and the database is incorrect... > > Not sure exactly when this happened, but it's been in the last couple of > days. Have to restore my online log .. and we just changed backup servers > .... > > Has anyone seen this before ... thanks ... > > Peter Logan > Senior Database Administrator > Phone: 616/878-8309 > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --14dae9340747e24dce04ce62c101
Did somebody change your TZ environment variable? env | grep TZ -----Original Message----- From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of Peter_Logan@spartanstores.com Sent: Tuesday, November 13, 2012 10:09 AM To: ids@iiug.org Subject: Strange ... [28812] IDS 11.70.fc3xc Aix 6.1.0 USEOSTIME=0 For some reason the time on my system and database are all of a sudden 7 hours off. The OS time is correct, and the database is incorrect... Not sure exactly when this happened, but it's been in the last couple of days. Have to restore my online log .. and we just changed backup servers .... Has anyone seen this before ... thanks ... Peter Logan Senior Database Administrator Phone: 616/878-8309 ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.
Curiouser and curiouser! Then I'm completely stumped. Can you bounce it and see what happens? Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Tue, Nov 13, 2012 at 11:12 AM, Peter_Logan@spartanstores.com < Peter_Logan@spartanstores.com> wrote: > One additional piece of information ... > > I have a second instance on this box ... we reboot the servers on Sat. > night ... this instance comes up in the same script as the other instance > .... and the time is correct here ... > > So I have one instance with the wrong time .. and another with the right > time ... > > Peter Logan > Senior Database Administrator > Phone: 616/878-8309 > > From: "Peter_Logan@spartanstores.com" <Peter_Logan@spartanstores.com> > To: ids@iiug.org, > Date: 11/13/2012 11:09 AM > Subject: Strange ... [28812] > Sent by: ids-bounces@iiug.org > > IDS 11.70.fc3xc > Aix 6.1.0 > > USEOSTIME=0 > > For some reason the time on my system and database are all of a sudden 7 > hours off. The OS time is correct, and the database is incorrect... > > Not sure exactly when this happened, but it's been in the last couple of > days. Have to restore my online log .. and we just changed backup servers > ..... > > Has anyone seen this before ... thanks ... > > Peter Logan > Senior Database Administrator > Phone: 616/878-8309 > > > > ******************************************************************************* > > Forum Note: Use "Reply" to post a response in the discussion forum. > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --90e6ba614774ecdc9904ce62cb95
Nope ... just checked back through my logs and all was fine when the DB was started on the weekend .. Been running some scripts for IBM to figure out work load for a potential IWA implementation .. going to make sure something there isn't doing something .. Peter Logan Senior Database Administrator Phone: 616/878-8309 From: "Art Kagel" <art.kagel@gmail.com> To: ids@iiug.org, Date: 11/13/2012 11:18 AM Subject: Re: Strange ... [28814] Sent by: ids-bounces@iiug.org Hmm, never saw this one before, no. I was told that with USEOSTIME 0 the server retrieves system time periodically but keeps track of the time itself in-between pings. WIth USEOSTIME 1 every call to CURRENT or TODAY calls the system's gettimeofday() function to get the exact time. I always set USEOSTIME to 1 just because it is the only way to get sub-second times from CURRENT YEAR TO FRACTION. The default is only 0 because once-upon-a-time SCO XENIX was the most popular OS used with Informix and its gettimeofday() function was very expensive. AFAIK all currently existing OS's gettimeofday() calls are dirt cheap. That rant over, the only thing I can think of is that either the server was started with TZ unset or set to the wrong timezone or your system's timezone files are out-of-date, missing, or corrupted and the problem manifested when daylight savings time ended two weeks ago. Is it possible that someone cleaned up the filesystems and accidentally deleted the timezone database files? Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Tue, Nov 13, 2012 at 11:08 AM, Peter_Logan@spartanstores.com < Peter_Logan@spartanstores.com> wrote: > IDS 11.70.fc3xc > Aix 6.1.0 > > USEOSTIME=0 > > For some reason the time on my system and database are all of a sudden 7 > hours off. The OS time is correct, and the database is incorrect... > > Not sure exactly when this happened, but it's been in the last couple of > days. Have to restore my online log .. and we just changed backup servers > .... > > Has anyone seen this before ... thanks ... > > Peter Logan > Senior Database Administrator > Phone: 616/878-8309 > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --14dae9340747e24dce04ce62c101 ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.
I have to wait until this evening .... Peter Logan Senior Database Administrator Phone: 616/878-8309 From: "Art Kagel" <art.kagel@gmail.com> To: ids@iiug.org, Date: 11/13/2012 11:53 AM Subject: Re: Strange ... [28816] Sent by: ids-bounces@iiug.org Curiouser and curiouser! Then I'm completely stumped. Can you bounce it and see what happens? Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Tue, Nov 13, 2012 at 11:12 AM, Peter_Logan@spartanstores.com < Peter_Logan@spartanstores.com> wrote: > One additional piece of information ... > > I have a second instance on this box ... we reboot the servers on Sat. > night ... this instance comes up in the same script as the other instance > .... and the time is correct here ... > > So I have one instance with the wrong time .. and another with the right > time ... > > Peter Logan > Senior Database Administrator > Phone: 616/878-8309 > > From: "Peter_Logan@spartanstores.com" <Peter_Logan@spartanstores.com> > To: ids@iiug.org, > Date: 11/13/2012 11:09 AM > Subject: Strange ... [28812] > Sent by: ids-bounces@iiug.org > > IDS 11.70.fc3xc > Aix 6.1.0 > > USEOSTIME=0 > > For some reason the time on my system and database are all of a sudden 7 > hours off. The OS time is correct, and the database is incorrect... > > Not sure exactly when this happened, but it's been in the last couple of > days. Have to restore my online log .. and we just changed backup servers > ..... > > Has anyone seen this before ... thanks ... > > Peter Logan > Senior Database Administrator > Phone: 616/878-8309 > > > > ******************************************************************************* > > Forum Note: Use "Reply" to post a response in the discussion forum. > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --90e6ba614774ecdc9904ce62cb95 ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.
Original Post: IDS 11.70.fc3xc Aix 6.1.0 USEOSTIME=0 For some reason the time on my system and database are all of a sudden 7 hours off. The OS time is correct, and the database is incorrect... Not sure exactly when this happened, but it's been in the last couple of days. Have to restore my online log .. and we just changed backup servers ... Has anyone seen this before ... thanks ... Peter Logan Senior Database Administrator Phone: 616/878-8309 Response: Well, when you say the "database is incorrect" I'm not sure what you mean. Are you saying that messages going into the MSGPATH file are off by 7 hours, or are they ok but if you do a select current from systables where tabid = 1 that's 7 hours off, or more likely both? In the case of how the engine gets the time it uses when it goes out into MSGPATH file, it calles the OS library call time(), then uses what's returned from that to call localtime() to get the time into some sort of time zone set format. We then just use the tm->tm_hour, tm->tm_min, and tm->tm_sec prepended to the rest of the string. When you select current when USOSTIME is turned off (so set to 0 like you are doing it) it does do basically the same thing. So it would seem what has to be happening is the localtime() call the server is doing after the time() call is getting a bad timezone setting somehow. It would seem odd that that would change on the fly after the server was up...so it would sort of seem to me to be more likely that the time the server was reporting would have to be incorrect since it was bounced. But regardless, the server is reporting the time values it's getting from the return of localtime() and I'm not sure what all could be configured on the AIX side that could be used to control how localtime() behaves other then the TZ env variable. I had a customer run into something similar on a linux box, and it was determined the box was misconfigured...TZ was set in some shells, and not in others, so that then /etc/localtime (or maybe it was /etc/timezone) was used for other shells/processes and the 2 didn't match so the time being reported by various programs was off 1 way or another based on which of those 2 ways it was determining the time zone. Not sure if AIX has something like that, but basically it would seem like it would have to be some OS issue or env issue that somehow affects how localtime() formats time, and it's different between the 2 instances. Jacques Renaut IBM Informix Advanced Support APD Team