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 > alter an index in db2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-11-09, 06:41
srilata83 srilata83 is offline
Registered User
 
Join Date: Aug 2009
Posts: 6
alter an index in db2

Hi,

I have to alter an index by adding two columns into it.

My table contains data and according to the requiremnet the data must be preserved.
So i am dropping the index and creating the index with two new columns.
Is that enough?But do i need to do anything with data????

Please suggest me.

Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 08-11-09, 08:46
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Dropping the index and creating the new one is the way to go. It will not affect the data at all.

Andy
Reply With Quote
  #3 (permalink)  
Old 08-11-09, 13:27
ibm_db2_rocks ibm_db2_rocks is offline
Registered User
 
Join Date: Aug 2009
Posts: 8
Agree with Andy.. but also make sure that you do RUNSTAT after altering indexes.
Reply With Quote
  #4 (permalink)  
Old 08-11-09, 14:14
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
And after RUNSTATS, you will need to rebind all static SQL and packages.

Andy
Reply With Quote
  #5 (permalink)  
Old 08-13-09, 06:20
dr_te_z dr_te_z is offline
Registered User
 
Join Date: Jan 2009
Location: Zoetermeer, Holland
Posts: 555
Quote:
Originally Posted by ARWinner
you will need to rebind all static SQL and packages
and don't forget to flush your package cache....
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