Solved

db2 snapshot timestamp explanation

Posted on 2010-08-30
3
1,095 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
3 Comments
 
LVL 37

Accepted Solution

by:
momi_sabag earned 500 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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

809 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