473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

DB2 & System Dates

People,

I have an ESE 8.2.2 database running on win2k server [sp4]. I need to
do some system testing that requires I reset the dates back a couple of
years then progressivily move it forward to current date.

The last time I tried this the database got very upset and the date
functions such as DAYOFWEEK_ISO, YEAR, WEEK, QUARTER etc got all
screwed up and failed. I subsequently had to completely drop the
database, recreate from scratch and reload all of the data. Not a
pleasant task.

Can anyone please suggest a way that I can reset the system date either
forwards or backwards without corrupting or upsetting the database.

Thanks.

Nov 12 '05 #1
2 3944
Moving dates forward isn't a problem. That's what happens when db2 is
shut down for a while then restarted.

Move date forward: Stop the instance, change the date, restart the
instance. (Stop the instance as insurance that the database is stopped.)

Moving backwards is a different issue. Recovery information is kept by
db2 that gets very unhappy when time regresses. Many, many years ago,
this was a problem in the Fall when the clocks were moved backwards at
the end of the Summer's Daylight Savings Time. I even remember
instrucions to shut down for an hour to prevent timestamp overlaps in
the logs.

The safest approach may be to export your data, change the clock (with
the instance down), define a new database, then import your data. All
clock movement from this point should be forward which should not be a
problem.

Do any of your tables have dates or timestamps in them? if so, what are
you going to do when you initially move the clock back a couple of years?

Phil Sherman
p175 wrote:
People,

I have an ESE 8.2.2 database running on win2k server [sp4]. I need to
do some system testing that requires I reset the dates back a couple of
years then progressivily move it forward to current date.

The last time I tried this the database got very upset and the date
functions such as DAYOFWEEK_ISO, YEAR, WEEK, QUARTER etc got all
screwed up and failed. I subsequently had to completely drop the
database, recreate from scratch and reload all of the data. Not a
pleasant task.

Can anyone please suggest a way that I can reset the system date either
forwards or backwards without corrupting or upsetting the database.

Thanks.

Nov 12 '05 #2
Phil Sherman wrote:
Moving dates forward isn't a problem. That's what happens when db2 is
shut down for a while then restarted.

Move date forward: Stop the instance, change the date, restart the
instance. (Stop the instance as insurance that the database is stopped.)

Moving backwards is a different issue. Recovery information is kept by
db2 that gets very unhappy when time regresses. Many, many years ago,
this was a problem in the Fall when the clocks were moved backwards at
the end of the Summer's Daylight Savings Time. I even remember
instrucions to shut down for an hour to prevent timestamp overlaps in
the logs.

The safest approach may be to export your data, change the clock (with
the instance down), define a new database, then import your data. All
clock movement from this point should be forward which should not be a
problem.

Do any of your tables have dates or timestamps in them? if so, what are
you going to do when you initially move the clock back a couple of years?

Phil Sherman
p175 wrote:
People,

I have an ESE 8.2.2 database running on win2k server [sp4]. I need to
do some system testing that requires I reset the dates back a couple of
years then progressivily move it forward to current date.

The last time I tried this the database got very upset and the date
functions such as DAYOFWEEK_ISO, YEAR, WEEK, QUARTER etc got all
screwed up and failed. I subsequently had to completely drop the
database, recreate from scratch and reload all of the data. Not a
pleasant task.

Can anyone please suggest a way that I can reset the system date either
forwards or backwards without corrupting or upsetting the database.

Thanks.

Can't comment on the DB2 internals, but routine resolution goes by
timestamp. If you create any procedure or function and then roll back
time you will not see the routine until "it's time" :-).

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Massimo Fiorentino | last post by:
Hello there! I am a bit of a newbee into the mySQL world and I have a question regarding switching from one DB to another. I have for a couple of years used a very simple CMS-system created by...
0
by: Angelos Karantzalis | last post by:
Hi y'all, here's a tricky one: I've written a wrapper around a Com Interop-generated assembly in C#. It's called SDEHandler & implements a previously defined interface, so that I can use it as a...
0
by: Maxim Kazitov | last post by:
Hi, Does anybody know how to generate (sql2comega.exe) wrapper DLL for System tables (for example for sysobjects) ? -- Thanks, Maxim
1
by: Ashkan Daie | last post by:
Hi All, When trying to install a performance counter via InstallUtil I get the following exception: Creating performance counter category Enterprise Library Caching. An exception occurred...
4
by: nhmark64 | last post by:
Hi, Does System.Collections.Generic.Queue not have a Synchronized method because it is already in effect synchronized, or is the Synchronized functionality missing from...
0
by: WhiteWizard | last post by:
Here’s the situation: I am writing a C# Windows application using VS 2003. I have built a user control, and it has a Tab Control on it with (currently) 2 tab pages, and the whole thing sits...
2
by: Bill Nguyen | last post by:
I'm using .Net framework 1.4 and having problem sending mail with System.Web.mail. Got error System.Web.HttpException: Could not access CDO.Message object. What do I need to do to get thru this?...
1
by: muzilli | last post by:
Howdy all, somebody used in the past the library System.Resources for internationalization purpose? I would like to develop an application multi-lingual (english and french) and I´m thinking...
8
by: Ollie Riches | last post by:
I'm looking into a production issue related to a windows service and System.Timers.Timer. The background is the windows service uses a System.Timers.Timer to periodically poll a directory location...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.