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 > What exactly is a database snapshot?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-14-08, 08:40
mitait mitait is offline
Registered User
 
Join Date: Mar 2004
Location: Finland
Posts: 22
What exactly is a database snapshot?

Ok, this is most likely a really stupid guestion... but I have been trying to search all documents and internet about information what the data returned by a snapshot (database or any other) actually means.

Everywhere it is said that a snapshot gives back the data at the moment when the snapshot it taken. Ok nice, but what does that exacly mean then? Does it mean that it returns only the data related to actions happening on a database on the exact same moment the snapshot is taken... I guess not since then the numbers would be close to zero almost every time.

In many places I have seen a mention that the data returned by snapshot would be a running sum kind of data... so it is collected to some hidden place and the number there will be given back to me when I ask. Ok that makes sense. But in that case I would expect that these number would grow and grow... now however I can get varying values when I run snapshots weekly. So it can not be this also or at least if it is then something is resetting the counter at some point... but at least I don't do that intentionally.

We are running db2 udb 8.1.15 on windows 2003. We take off-line backups every friday and I take snapshots every sunday... but now please someone tell me... what does it actually mean when database snapshot last sunday says there is 5126 direct reads or lock_wait_time is 827... SINCE WHEN?

It is nice to have much information, but it is less usufull if you have no idea how it is collected...
Reply With Quote
  #2 (permalink)  
Old 07-14-08, 09:11
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by mitait
We take off-line backups every friday and I take snapshots every sunday... but now please someone tell me... what does it actually mean when database snapshot last sunday says there is 5126 direct reads or lock_wait_time is 827... SINCE WHEN?
In your situation the cumulative counters would contain data from no earlier than Friday. The cumulative counters are reset when the database is deactivated, which is the case if you take an offline backup.

You can see the time when the counters were reset on the database snapshot:
Code:
First database connect timestamp           = 07/11/2008 09:40:51.732151
Last reset timestamp                       =
Last backup timestamp                      = 07/13/2008 22:00:05.000000
Snapshot timestamp                         = 07/14/2008 09:00:04.592647
I guess it would be the latest of the two highlighted timestamps.
Reply With Quote
  #3 (permalink)  
Old 07-14-08, 09:15
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
You have all the right ideas about snapshots. The cumulative counters are from the time the database is activated and continues to increase until it is deactivated. Databases are activated either by having a connection to an inactivated DB or explicitly by the ACTIVATE DATABASE command. They are deactivated by either the last connection being disconnected or explicitly by the DEACTIVATE DATABASE command. When you take the offline backup, you have to do that to an inactive database. That is why your snapshot counters seem to reset.

Andy
Reply With Quote
  #4 (permalink)  
Old 07-15-08, 01:46
mitait mitait is offline
Registered User
 
Join Date: Mar 2004
Location: Finland
Posts: 22
Thanks a lot guys! I was thinking it must be something like this, but knowing it is much more usefull. I guess I will move the snapshots to be taken prior to backups so that I get the action between the backups... that will make much more sense than just having the snapshot information from weekends only (when nobody is working). Thanks again.
Reply With Quote
  #5 (permalink)  
Old 07-15-08, 07:13
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
I'm not sure what useful information can be obtained from snapshots taken once a week. Even if you see 827 (or may be 827000) ms of lock wait time, you wouldn't know whether it all happened on Monday morning during peak user load or on Sunday afternoon at the time of the weekly batch run, so that information will be useless for diagnostic purposes.
Reply With Quote
  #6 (permalink)  
Old 07-15-08, 10:14
mitait mitait is offline
Registered User
 
Join Date: Mar 2004
Location: Finland
Posts: 22
Mostly I was thinking to get some usage statistics and bufferpools ratios etc. But even so your point is very valid and I may need to think it a little more how to get the kind of information I want.

The database is used for data warehousing. So the daytime use is the "real" use of the database as nighttime is the time for updating. So in weekly results these two get mixed and that does not exactly tell much then as you mentioned. Well maybe I should think about collecting information only during the daytime (or separately for day and night) and maybe for only some selected days...

I agree that for example lock_wait_time does not tell much
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