Re: Daylight Savings and Redo Logs

From: Jay Mehta <jvmehta_at_mra.ffx.mobil.com>
Date: 1996/04/02
Message-ID: <4jrdvo$jd9_at_dlsn31.dal.mobil.com>#1/1


Timo Haatainen <Timo.Haatainen_at_ttgroup.fi> wrote:
>Jay Mehta wrote:
>>
>> I don't know what Oracle does when clock is moved back, but cron on HP/UX
>> uses the first occurence of time, and ignores the second. For example, if
>> you have a job scheduled at 1.30 AM, then it would be executed only once
>> at the first occurence of 1.30 AM.
>
>Are you sure about that? Finland changes back to normal time on last Sunday of
>October at 3:59:59 AM (DST) and clock is turned back one hour to be 3:00 AM (normal
>time). So, if I have crontab-entry
>
>30 * * * * do_something
>
>will this execute only at 3:30 AM DST? Not at 3:30 AM normal time?
>

No, commands that are scheduled to run every hour (wildcard or * value in the hour field) are scheduled every hour. For example, a crontab entry 30 * * * * doesn't refer to an ambigious time during the day the clock is moved back. An ambigious time refers to an hour and minute that occurs twice in the same day because of a daylight savings time. In the case when you have 30 * * * * as crontab entry, cron doesn't ignore the second occurence of 3.30 AM. It executes the command for both occurences of 3.30 AM.

But the commands that scheduled to run during ambiguous time, not using wild card or * in the hour field of crontab entry are adjusted. For example, a cron entry 30 3 * * * refers to an non-ambigious time on the day the clock is moved back. Here you have specifically requested to have command executed at 3.30 AM. In this case, cron executes only at the first occurence of 3.30 AM.

Now let's look at what would happen during spring. When clock is moved one hour ahead, we have a non-existent time. If a command is specified to execute at non-existent time, it's executed after one hour provided such an adjustment would not conflict with another time specified to run the command. There is a very good explanation of the effect of daylight savings time in HP/UX manual. Here is an example I found in man on HP/UX system:

crontab                In Fall (USA EST)     In Spring (USA EST)

* 1 * * *  Job_1        1.00                    1.00
* 2 * * *  Job_2        2.00                    3.00
* 3 * * *  Job_3        3.00                    3.00
* 4 * * *  Job_4        4.00                    4.00
* * * * *  hour_job     1.00                    1.00
                        2.00                    
                        2.00            
                        3.00                    3.00
                        4.00                    4.00
* 2,3,4 * * * job_5     2.00
                        3.00                    3.00
                        4.00                    4.00

Jay Mehta
DBA/Oracle Received on Tue Apr 02 1996 - 00:00:00 CEST

Original text of this message