0

How I can rebuild index in DB2 9.7 LUW. Is there any rebuild utility for index or I have to recreate index.

Regards,

Masheed

Masheed
  • 35
  • 3
  • 13

2 Answers2

2

You can use REORG command to recreate ALL INDEXES on a table like this:

REORG INDEXES ALL FOR TABLE table1 ALLOW WRITE ACCESS CLEANUP ALL RECLAIM EXTENTS
ramazan polat
  • 7,111
  • 1
  • 48
  • 76
0

There is no index rebuild utility in DB2 for Linux, UNIX and Windows. You just have to drop / recreate the index.

Ian Bjorhovde
  • 10,916
  • 1
  • 28
  • 25
  • What about `REORG`? (http://www-01.ibm.com/support/knowledgecenter/SSEPGG_9.7.0/com.ibm.db2.luw.admin.perf.doc/doc/c0005407.html?lang=en) – mustaccio Jul 06 '14 at 15:52
  • 1
    You can't use `REORG` for a *single* index unless you have a range-partitioned table; you can only use it for *all* indexes on a table, which is not what I think the OP was asking for. – Ian Bjorhovde Jul 06 '14 at 23:30
  • Actually you can, REORG INDEX command does that (http://www-01.ibm.com/support/knowledgecenter/SSEPGG_9.7.0/com.ibm.db2.luw.admin.cmd.doc/doc/r0001966.html?cp=SSEPGG_9.7.0%2F3-6-2-4-96) – ramazan polat Sep 01 '14 at 06:46
  • 1
    @RamazanPOLAT As I mentioned in my previous comment, `REORG INDEX` can only be used to reorg a single index when you have a partitioned table. (and the page you link to says exactly this). – Ian Bjorhovde Sep 02 '14 at 15:06