Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: daylight savings and universal coordinated time
Gerardo Odorizzi wrote:
> > Does Oracle7/8 know about daylight savings time and/or > universal coordinated time. > > We have a customer where the database is running on a > VMS server that is in standard time. However the > client PC's are in daylight savings time. The customer > wants the timestamps stored in standard time and > excepts the client applications (I assume through > SQL*Net) to be able to retrieve the standard time dates > and times, and convert them to daylight savings time. > > I see nothing in any documentation or the Oracle Web > site that discusses this topic. > > I don't believe that Oracle handles this, but, I need > confirmation of this for my customer.
I asked Oracle support (Finland) about time zones and day light saving
time
and the answer I got is following:
There is a development request made about this problem (Bug 156629) for
our developers.
ENH: INIT.ORA PARAMETER TO SPECIFY THE TIME-ZONE A DATABASE IS UNDER
In the distributed environment it is essential to be able to comprare
time
for multiple databases. The application developer needs to be able
to tell what timezone a database is in so he can compare apples with
apples.
An init.ora parameter will allow them to query from v$parameter for the
information.
The following example is for replication environments. Would it help you ?
REM
connect repadmin/repadmin
execute dbms_repcat.suspend_master_activity('SCOTT');
REM
REM and replicate the column to the other tables using the REM other tables using the DBMS_REPCAT.ALTER_MASTER_REPOBJECT REM procedure. The following adds a date column to SCOTT's DEPTtable.
execute
dbms_repcat.alter_master_repobject('SCOTT','DEPT','TABLE','ALTER
TABLE SCOTT.DEPT ADD (LAST_UPDATE DATE)', 'Changed ' || SYSDATE || '
by
' || USER, FALSE);
REM
REM (3) Confirm the STATUS of the object of the replication schema
REM by querying the DBA_REPOBJECT view. REM Check for ERROR or INVALID status.REM
select oname, status from dba_repobject where oname = 'DEPT';
REM
REM SQL> execute dbms_repcat.alter_master_ repobject(sname=>'scott', REM oname=>'emp',type =>'table',DDL_TEXT =>NULL); REM REM If the pl/sql procedure successfuly completes, it will REM VALIDate the object again.REM
REM Disable replication for your session REM so that you will not fire the $RT trigger and put REM entries into the deferred queue.REM
desc scott.dept;
execute dbms_reputil.replication_off;
update scott.dept set last_update=trunc(SYSDATE);
commit;
REM
execute dbms_reputil.replication_on;
REM
connect repadmin/repadmin
desc scott.dept;
execute dbms_reputil.replication_off;
update scott.dept set last_update=trunc(SYSDATE);
commit;
execute dbms_reputil.replication_on;
REM
REM We will create a database trigger on the MASTER DEFINITION SITE REM that will populate the LAST_UPDATE column of the DEPT table REM column of the DEPT table with the current date and timestamp using REM sysdate. We should only fire the trigger when the changes to the REM table are being made by the LOCAL transaction. REM
REM
connect repadmin/repadmin
create trigger SCOTT.DEPT_CONFLICT
before
insert or update
on SCOTT.DEPT
for each row
begin
IF DBMS_REPUTIL.FROM_REMOTE = FALSE then
:NEW.LAST_UPDATE := SYSDATE;
END IF;
end;
/
REM
execute
dbms_repcat.create_master_repobject('SCOTT','DEPT_CONFLICT','TRIGGER');
REM
REM (3) Now create a column group and define column(s) within the group. REM An asterisk (*) indicates all columns will be used as part REM all columns will be used as part of the column group. REM
execute
dbms_repcat.make_column_group('SCOTT','DEPT','DEPT_UPDATE_CG','*');
REM
execute
dbms_repcat.add_update_resolution('SCOTT','DEPT','DEPT_UPDATE_CG',1,'LAT
EST TIMESTAMP', 'LAST_UPDATE');
REM
REM This regenerates the triggers and procedures REM to include the conflict resolution.REM
execute
dbms_repcat.generate_replication_support('SCOTT','DEPT','TABLE');
REM
execute dbms_repcat.resume_master_activity('SCOTT');
REM
select * from dba_repcat;
REM
REM If status is NORMAL you are now ready to perform some REM DML on the DEPT table and test the LATEST TIMESTAMP REM conflict resolution routine. The most recent update to the row REM will resolve the conflict. Consider standardizing your timestamping REM prompt mechanism by converting the timestamp to Greenwich Mean Time REM (GMT). This will allow you to accomodate multi time zonemasters..
![]() |
![]() |