1. Problem summary
I have a problem with DBMS SCHEDULERs time it is 1 hour late since DST changing 2 weeks ago. If I create a job and set the date & time the startdate is 1 hour later than system time. Everything was working fine before DST change for 2 weeks since then our jobs have a delay of 1 hour. We are running an oracle 10g database with a windows server 2003 OS.
I have seen almost all posts on google regarding this issue and most of them talked about using a Region and Timezone in the startdate would fix the issue but we were already using a Timezone and Region for our Scheduler jobs so that didn't help me.
2. What I have tried
I tried to verify all the timezone settings on the OS and Database level.
The Windows Server 2003 Timezone
Time Zone: (GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna
DBTIMEZONE is set to: +00:00
SESSIONTIMEZONE is set to: +02:00
SCHEDULER DEFAULT_TIMEZONE
select * from dba_scheduler_global_attribute where attribute_name ='DEFAULT_TIMEZONE';
Europe/Berlin
here I checked the time on os and database level
Time on the windows server 2003 OS of the database is correct
C:\Documents and Settings\xx>time The current time is: 13:08:15.71
systimestamp is correct
SYSTIMESTAMP: 11-APR-21 01.09.00.280000 PM +02:00
currenttimestamp is correct
CURRENTTIMESTAMP: 11-APR-21 01.10.13.249000 PM +02:00
DBMS_SCHEDULER.STIME IS NOT CORRECT (1h late)
STIME: 11-APR-2021 12:18:08.358000 PM +01:00 Europe/Berlin
Then I tried to schedule a job like this:
BEGIN DBMS_SCHEDULER.CREATE_JOB (
job_name => 'thoops.testjob',
job_type => 'PLSQL_BLOCK',
job_action => 'BEGIN DBMS_STATS.GATHER_TABLE_STATS(''THOOPS'', ''GC_BLOBU''); END;',
start_date => TO_DATE('10-APR-2021 01:00','DD-MON-YYYY HH24:MI'),
repeat_interval => 'FREQ=DAILY',
end_date => TO_DATE('30-APR-2021 01:00','DD-MON-YYYY HH24:MI'),
enabled => TRUE,
comments => 'scheduler debug job');
END;
then I did change the start_date like this.
BEGIN
DBMS_SCHEDULER.SET_ATTRIBUTE (
name => 'TESTJOB',
attribute => 'start_date',
value => TO_TIMESTAMP ('11.04.2021 14:30:00', 'DD.MM.YYYY HH24:MI:SS.FF') AT TIME ZONE
'Europe/Berlin'); END;
when I check the start_date for my testjob then it's 1hour late:
SELECT start_date, next_run_date FROM dba_scheduler_jobs WHERE JOB_NAME = 'YBATESTJOB';
start_date: 11.04.21 15:30:00.000000000 EUROPE/BERLIN
next_run_date: 11.04.21 15:30:00.000000000 EUROPE/BERLIN
when I change the start_date to systimestamp then it works:
select systimestamp from dual; 11.04.21 14:00:40.577000000 +02:00
BEGIN
DBMS_SCHEDULER.SET_ATTRIBUTE (
name => 'TESTJOB',
attribute => 'start_date',
value => SYSTIMESTAMP AT TIME ZONE 'Europe/Berlin');
END;
SELECT start_date, next_run_date FROM dba_scheduler_jobs WHERE JOB_NAME = 'YBATESTJOB';
start_date: 11.04.21 14:01:42.342000000 EUROPE/BERLIN
next_run_date: 12.04.21 14:01:42.300000000 EUROPE/BERLININ
I am really confused and don't know how to fix this
I tried to fix the DBMS scheduler time but I don't know how.. can you please help me out here because I have read though all possible posts with this issue and I couldn't find a solution.
thank you in advance. best regards Sonny