IBM Support

Index build fails on HDR primary with errors 242 and 113

Troubleshooting


Problem

You execute two CREATE INDEX statements on the primary of a HDR (high-availability replication) pair. The second statement fails with errors 242 and 113.

Symptom

You execute two CREATE INDEX statements on one table of an HDR primary, as in the following example:


CREATE INDEX tab1_idx1 ON tab1(col1);
CREATE INDEX tab1_idx2 ON tab1(col2);

The first CREATE INDEX succeeds but he second statement fails with the following errors:


242: Could not open database table (bill.tab1).

  113: ISAM error:  the file is locked.

Cause

This is expected behavior. The first CREATE INDEX statement maintains a lock on the table until the index pages are shipped to the secondary.

Diagnosing The Problem

The online log file will have a record for the first index shipped to the secondary:

07:57:32 DR: Sending index testdb:"bill".tab1#tab1_idx1 : Started
07:57:33 DR: Sending index testdb:"bill".tab1#tab1_idx1 : Completed.

These records will be absent from the online log when LOG_INDEX_BUILDS is enabled.

Resolving The Problem

Enable LOG_INDEX_BUILDS using one of the following methods:

  • Edit the configuration file as follows and recycle the IDS instance

    LOG_INDEX_BUILDS 1
  • Set the value dynamically

    onmode -wf LOG_INDEX_BUILDS=1 (instance scope)

    onmode -wm LOG_INDEX_BUILDS=1 (session scope)
[{"Product":{"code":"SSB2ML","label":"Informix Dynamic Server"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Not Applicable","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"11.5","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

More support for:
Informix Dynamic Server

Software version:
11.5

Document number:
411579

Modified date:
01 June 2022

UID

swg21454595