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 > Type 1 to Type 2 index conversion options

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-15-05, 05:09
ggnanaraj ggnanaraj is offline
Registered User
 
Join Date: Aug 2002
Location: Chennai, India
Posts: 171
Type 1 to Type 2 index conversion options

DB2 UDB v7.2

When migration of v7.2 database to v8, the indexes still exist as a type 1 index in v8.

We can convert the indexes to type 2 by a REORG of Index with CONVERT option. However, the question is whether dropping all indexes on the table and recreating them would create type 2 indexes or type 1 indexes?

Ofcourse, if type 1 indexes already exist in V8 then any new index will be a type 1 index again.

TIA.
Reply With Quote
  #2 (permalink)  
Old 12-15-05, 20:36
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
From the manual:
"All indexes created by DB2 prior to Version 8 are type-1 indexes. All indexes created by Version 8 are Type 2 indexes, except when you create an index on a table that already has a type 1 index. In this case the new index will also be of type 1."
My interpretation is that if you drop all the indexes on a table, and then recreate them, they will be type-2. However, if you have a primary key, you must drop it in order to drop the unique index.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390

Last edited by Marcus_A; 12-15-05 at 20:41.
Reply With Quote
  #3 (permalink)  
Old 12-16-05, 16:48
dollar489 dollar489 is offline
Registered User
 
Join Date: Sep 2002
Posts: 456
Dropping all the indexes and then recreating will accomplish the task. But I will recommend CONVERT, I have used it many times for conversion and you dont' have to worry about primary key or data corruption.
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