How to use IDXACTIVATE to build index online

Lars Erik Nes

New Member

I added a new index to a small table (500 recs) and since the db was online this index was added not-active. I need to active it without stopping the db.
I found this in the knowledgebase

"proutil sports2000 -C idxactivate useindex cust-num recs 500 refresh 10"

But can i use this since my index contains 2 fields ?
This is the index i added

ADD INDEX "iActiveLineType" ON "servline"
AREA "Index Area"

What will the correct idxactive statement be ??


Rob Fitzpatrick Sponsor
The "recs 500" isn't helpful if you have only 500 records. It will just force the entire operation to be one transaction for no good reason.

The number of fields in the "useindex" index isn't important. What is important:
  • it must be active;
  • it must not be a word index;
  • it is preferable if it is unique, otherwise the table will be locked during the build.
In your case the last point may not be a problem as the table is so small.

I am not clear on what you are attempting to do, given the wording. I assume the definition you showed is part of the new index you have added, but not all of it. I don't see the INACTIVE keyword.

As for the syntax, it can be found here:

proutil db-name -C idxactivate [owner-name.]table-name.index-name
[useindex index-name][recs n][refresh t]
[ tenant tenant-name | group group-name |
partition partition-name | composite initial ]

where "table-name.index-name" is the new inactive index you have just added and "useindex index-name" specifies the existing index on that table that proutil will use to locate the records.