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 > db2 statistics problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-21-10, 06:57
ravichandrapratap ravichandrapratap is offline
Registered User
 
Join Date: Dec 2010
Posts: 75
db2 statistics problem

db2 "runstats on table db2inst1.books"
SQL2314W Some statistics are in an inconsistent state. The newly collected
"TABLE" statistics are inconsistent with the existing "INDEX" statistics.
SQLSTATE=01650



can anybody explain the procedure, by which i can get my table into consistent state.
Reply With Quote
  #2 (permalink)  
Old 12-21-10, 07:55
Mathew_paul Mathew_paul is offline
Registered User
 
Join Date: Oct 2007
Posts: 200
its a warning message
SQL2314W Some statistics are in an inconsistent state. The newly
collected "<object1>" statistics are inconsistent with the
existing "<object2>" statistics.

Explanation:

Possible causes of this warning include the following.

1. Issuing RUNSTATS on the table only may result in a situation where
the table level statistics are inconsistent with the already existing
index level statistics. Likewise, issuing RUNSTATS for indexes only
or during index creation may leave table level statistics in an
inconsistent state. For example, if index level statistics are
collected on a particular table and later a significant number of
rows is deleted from this table, issuing RUNSTATS on the table only
may end up with the table cardinality less than FIRSTKEYCARD which is
an inconsistent state.
2. If a RUNSTATS is issued with the ALLOW WRITE ACCESS option when many
inserts, updates, or deletes are occurring concurrently, then
inconsistencies may occur because of table changes between the time
that table and index statistics are collected.
3. If a RUNSTATS is issued with the TABLESAMPLE option, then an
excessively low sample size may cause statistics to be inaccurately
extrapolated, resulting in inconsistencies. The chance of inaccurate
extrapolation is higher for SYSTEM sampling than for BERNOULLI
sampling.

User response:

1. Issue a RUNSTATS to collect both table level and index level
statistics.
2. Collect statistics when inserts, updates, and deletes are minimal or
not occurring at all. Or, if concurrent inserts, updates, and deletes
are not essential, issue a RUNSTATS with the ALLOW READ ACCESS
option.
3. Increase the sample size, or, if RUNSTATS was issued with TABLESAMPLE
SYSTEM, use the TABLESAMPLE BERNOULLI option instead.

sqlcode: 2314

sqlstate: 01650

regds
Paul
Reply With Quote
  #3 (permalink)  
Old 12-21-10, 07:56
nvk@vhv nvk@vhv is offline
Registered User
 
Join Date: Jan 2010
Posts: 294
For those who can't use the search-function:
Runstats warning
Reply With Quote
  #4 (permalink)  
Old 12-21-10, 12:17
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
I would suggest these options for any runstats:

db2 "runstats on table db2inst1.books with distribution on key columns and detailed indexes all"

The error above is a warning that you can ignore.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #5 (permalink)  
Old 12-22-10, 00:09
ravichandrapratap ravichandrapratap is offline
Registered User
 
Join Date: Dec 2010
Posts: 75
thanks so much marcus
Reply With Quote
  #6 (permalink)  
Old 12-22-10, 00:09
ravichandrapratap ravichandrapratap is offline
Registered User
 
Join Date: Dec 2010
Posts: 75
thanks so much mathew
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