DB2 - Problem description
Problem IC74708 | Status: Closed |
ALTER TABLE OPERATION AGAINST MDC TABLE MISTAKENLY MARKS MATCHING INDEX AS UNIQUE THOUGH IT CONTAINS DUPLICATE KEYS. | |
product: | |
DB2 FOR LUW / DB2FORLUW / 950 - DB2 | |
Problem description: | |
An ALTER TABLE operation against an MDC table which defines a primary key or unique constraint can mistakenly mark a matching existing index as unique although it contains duplicated keys. Once the index is mistakenly marked as unique, queries against the table can return incorrect results. You can find potentially affected index(s) by querying the system catalogs with the following query: select TABSCHEMA, TABNAME, CONSTNAME, TYPE from SYSCAT.TABCONST where (TYPE = 'P' or TYPE = 'U') and (TABSCHEMA, TABNAME) in ( select T.TABSCHEMA, T.TABNAME from SYSCAT.INDEXES I, SYSCAT.TABLES T where I.MADE_UNIQUE = 'Y' and I.TABNAME = T.TABNAME and I.TABSCHEMA = T.TABSCHEMA and T.CLUSTERED ='Y' ) | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * All * **************************************************************** * PROBLEM DESCRIPTION: * * ALTER TABLE OPERATION AGAINST MDC TABLE MISTAKENLY MARKS * * MATCHING INDEX AS UNIQUE THOUGH IT CONTAINS DUPLICATE KEYS. * **************************************************************** * RECOMMENDATION: * * Upgrade to DB2 LUW Version 9.5 Fix Pack 8 * **************************************************************** | |
Local Fix: | |
Drop the primary key or unique constraint and verify uniqueness by selecting the GROUP BY index key columns along with columns with the following property: HAVING COUNT(*) > 1. Note that this query will not return correct values if the invalid unique constraint is still on the table; it must be dropped first. There must not be a unique index on the table when the uniqueness of the rows is being checked, regardless of whether the index is used or not. | |
available fix packs: | |
DB2 Version 9.5 Fix Pack 8 for Linux, UNIX, and Windows | |
Solution | |
Problem was first fixed in Version 9.5 Fix Pack 8 | |
Workaround | |
see LOCAL FIX | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 25.02.2011 05.07.2011 05.07.2011 |
Problem solved at the following versions (IBM BugInfos) | |
9.5.FP8 | |
Problem solved according to the fixlist(s) of the following version(s) | |
9.5.0.8 |