?
Solved

db2 snapshot timestamp explanation

Posted on 2010-08-30
3
Medium Priority
?
1,114 Views
Last Modified: 2012-05-10
Hi All,

If i scheduled snapshot through crontab at every 15 minutes as ,
db2 get snapshot for all on  <dbname> |
gzip -9 > $DIR/snapshot_all_<dbname>_$(date +%Y_%m_%d_%H_%M).out.gz

then as output i got following files,
snapshot_PRDDB_2010_08_16_14_15.out
snapshot_PRDDB_2010_08_16_14_30.out
snapshot_PRDDB_2010_08_16_14_45.out

If I open 2nd file i.e. snapshot_PRDDB_2010_08_16_14_30.out then I got following value
Snapshot timestamp                         = 08/16/2010 14:30:02.182330
What does this timestamp mean,
SQL's logged in this snapshot executed from 14:15 to 14:30  OR  14:30 to 14:45 ?
If anyone has Idea please help me on this.
0
Comment
Question by:harsha_james
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 37

Accepted Solution

by:
momi_sabag earned 2000 total points
ID: 33557436
it means the snapshot contains data from 14:15 to 14:30
if you took the snapshot at 14:30, how can it contain data from 14:30 to 14:45?
look at the last updated date of the file,
that is set by the operating system and it should give you the answer
0
 
LVL 4

Expert Comment

by:gmarino
ID: 33558472
DB2 Snapshots are cumulative aggregations showing the activity starting from either:
"First database connect timestamp" OR "Last reset timestamp" whichever is later.

If you wanted a snapshot to show you the activity for a 15 minute interval, you would need to do the following (using an id with appropriate rights):

db2 reset monitor all
sleep 900    ## 900 seconds = 15 minutes
db2 get snapshot for all on db_name

You can still use your snapshots that you took using the script you showed us in your question.  You would just have to open 2 snapshot files and do some subtraction to get just what happened in the last 15 minutes.  

Keep in mind that SOME of the monitor elements are NOT cumulative - instead they represent the value at the time the snapshot was taken - for example: "Locks held currently".


Let me show you 2 examples of snapshots.  Look at the entries I marked with "<<---" and do the time math.

This one shows a snapshot containing over 3 days of collected data:

First database connect timestamp           = 08/26/2010 17:45:23.268096 <<---
Last reset timestamp                       =
Last backup timestamp                      = 08/29/2010 21:14:02.000000
Snapshot timestamp                         = 08/30/2010 09:42:09.309278  <<---


This shows a snapshot containing 4 minutes and 32 seconds of collected data:

First database connect timestamp           = 08/26/2010 17:45:23.268096
Last reset timestamp                       = 08/30/2010 09:43:20.237385 <<---
Last backup timestamp                      = 08/29/2010 21:14:02.000000
Snapshot timestamp                         = 08/30/2010 09:47:52.899658 <<---


Hope that helps.  Too bad you already gave out the points (but I'm a nice guy)...

- Greg
0
 

Author Comment

by:harsha_james
ID: 33564533
Hi Greg,
Wonderful Explanation on Snapshots, Thank you very much for your efforts.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses
Course of the Month8 days, 10 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question