If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > rollfoward with UTC and local time

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-10-10, 19:28
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
rollfoward with UTC and local time

This must be something very simple, but I can't seem to be able to figure it out. Must be Friday after a busy week...


I did a rollforward with UTC and local time. The difference between UTC and local time is 4 hrs on my server:


$ db2 "values current timezone"

1
--------
-40000.


$ date; date -u
Fri Sep 10 18:13:10 EDT 2010
Fri Sep 10 22:13:10 GMT 2010


-- Rollforward using UTC

$ db2 rollforward db test to 2010-09-10-21.58.56.000000 and stop

Rollforward Status

Input database alias = test
Number of nodes have returned status = 1

Node number = 0
Rollforward status = not pending
Next log file to be read =
Log files processed = S0000000.LOG - S0000000.LOG
Last committed transaction = 2010-09-10-21.58.56.000000 UTC

DB20000I The ROLLFORWARD command completed successfully.


-- Rollforward using local time

$ db2 rollforward db test to 2010-09-10-17.58.56.000000 using local time and stop

Rollforward Status

Input database alias = test
Number of nodes have returned status = 1

Node number = 0
Rollforward status = not pending
Next log file to be read =
Log files processed = S0000000.LOG - S0000000.LOG
Last committed transaction = 2010-09-10-17.58.56.000000 Local

DB20000I The ROLLFORWARD command completed successfully.


Everything looks good to me.



But on the customer's system:

$ db2 rollforward db TEST to 2010-09-09-11.00.00.000000 and stop (7am local time)

Rollforward Status

Input database alias = TEST
Number of nodes have returned status = 1

Node number = 0
Rollforward status = not pending
Next log file to be read =
Log files processed = S0018613.LOG - S0018620.LOG
Last committed transaction = 2010-09-09-10.59.55.000000 UTC

DB20000I The ROLLFORWARD command completed successfully.




$ db2 rollforward db TEST to 2010-09-09-11.00.00.000000 USING LOCAL TIME and stop

Rollforward Status

Input database alias = TEST
Number of nodes have returned status = 1

Node number = 0
Rollforward status = not pending
Next log file to be read =
Log files processed = S0018613.LOG - S0018621.LOG
Last committed transaction = 2010-09-09-06.59.55.000000 Local

DB20000I The ROLLFORWARD command completed successfully.


The difference between UTC and local time is also 4hrs on their system as can be seen from the list history output:

Comment: 20100909204754GMT
Start Time: 20100909164448
End Time: 20100909164754


TZ env variable is setup the same on both servers.


DB2 processed an additional log file (normal). What I'm not sure about is why the "Last committed transaction" is displayed as "2010-09-09-06.59.55.000000 Local" and not "2010-09-09-10.59.55.000000 Local"


Any idea?
Reply With Quote
  #2 (permalink)  
Old 09-10-10, 19:37
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
And there were committed transactions after 6:59am local time.
Reply With Quote
  #3 (permalink)  
Old 09-10-10, 20:27
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by db2girl View Post
And there were committed transactions after 6:59am local time.
How do you know that?
Reply With Quote
  #4 (permalink)  
Old 09-11-10, 00:17
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
I saw some table drops taking place after 7am in the history file. I'd have checked the transaction logs if I had them.

But I think I know why db2 didn't process the logs up to the specified time and stopped at 6:59. I'm just not thinking straight today... This was a second restore/rollforward attempt to a PIT (first using UTC and second using local) so db2 created a new log chain after the first one. I'll think about this again in the morning.
Reply With Quote
  #5 (permalink)  
Old 09-15-10, 19:10
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
I'll add some info regarding this situation here. Maybe someone, including myself, will run into a similar situation in the future.
Attached Files
File Type: txt rollforward_GMT_local.txt (5.3 KB, 56 views)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On