Solved

db2 snapshot timestamp explanation

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 (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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now