Solved

db2 snapshot timestamp explanation

Posted on 2010-08-30
3
1,104 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 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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

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…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

736 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