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 > Sequential ID no longer Sequential

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-04-05, 15:31
bunzo bunzo is offline
Registered User
 
Join Date: Apr 2005
Posts: 28
Sequential ID no longer Sequential

I have a DB2 v72 database that is fed by IBM's Tivoli monitoring application. There are multiple tables in this db. One table - endpoints - records each endpoint identified. Each endpoint is assigned an EID. This field is an integer and is set to increment sequentially (identity=yes). The EID is the key that links to other tables.

The first 200 endpoints have a sequential EID that starts from 1, then there is a gap of about 400. We then have sequential numbers up until around 1800. At this point, it has become much more sporadic where maybe a few numbers are actually sequential before seeing another gap. Some gaps are huge. My endpoint table contains 2025 records but the EID number is above 548,000.

At this point, I believe this may be causing network issues or the result of network issues but am unfamiliar with the logfiles and do not know how to display them.

How can I start to identify what is causing this?
Reply With Quote
  #2 (permalink)  
Old 10-04-05, 15:54
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
If I was to hazard a guess, you have defined a cache value on the identiry column. Every time the database is stopped, either manually or automatically when no one is connected, the cache is lost. Then when the DB is started again the new start value is the last value that was cached, thus making your gaps.

If you want to eliminate the gaps from occurring this way, remove the cache for the identity column.

Andy
Reply With Quote
  #3 (permalink)  
Old 10-04-05, 16:33
bunzo bunzo is offline
Registered User
 
Join Date: Apr 2005
Posts: 28
Quote:
Originally Posted by ARWinner
If I was to hazard a guess, you have defined a cache value on the identiry column. Every time the database is stopped, either manually or automatically when no one is connected, the cache is lost. Then when the DB is started again the new start value is the last value that was cached, thus making your gaps.

If you want to eliminate the gaps from occurring this way, remove the cache for the identity column.

Andy
Would be nice if I did that, but as far as I can tell, nothing has been changed in the table. It was created by the Tivoli install process. I don't know how to define a cache value on an identity column and the original gap (+400) occurred before anyone even opened the database in DB2 (Control Center). I had attached to it via Microsoft Access up until then. Can't alter anything that way.

I try to schedule a nightly backup but it fails, indicating the db is always in use so as far as I can tell, it's never stopped unless the server is rebooted.
Reply With Quote
  #4 (permalink)  
Old 10-04-05, 16:43
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
I am sorry I cannot be of further help. The cache issue is the only thing I have seen to cause the gaps. You can use db2look to get the definition of the table. You can also look in the catalog tables for the cache value (I do not know where it is in V7.x).

Andy
Reply With Quote
  #5 (permalink)  
Old 10-04-05, 17:06
bunzo bunzo is offline
Registered User
 
Join Date: Apr 2005
Posts: 28
Quote:
Originally Posted by ARWinner
I am sorry I cannot be of further help. The cache issue is the only thing I have seen to cause the gaps. You can use db2look to get the definition of the table. You can also look in the catalog tables for the cache value (I do not know where it is in V7.x).

Andy

What parameters would I use with db2look and what would I look for to identify the cache issue?
Reply With Quote
  #6 (permalink)  
Old 10-05-05, 07:47
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
db2look -d dbname -z <schema name> -t <table name> -x -e

The Identity stuff should be obvious.

Andy
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