Replicate an index to an HDR secondary database server

If index page logging is enabled, index replication to the HDR secondary database server occurs automatically (see Index page logging). If index page logging is disabled, and an index on an HDR secondary database server becomes corrupted and must be rebuilt, you can either:
  • Manually replicate the index from the primary server to the secondary server.
  • Let the secondary server automatically replicate the index if you enabled the secondary server to do this.

To enable the secondary database server to automatically replicate the index, either:

  • Set onmode -d idxauto to on.
  • Set the value of the DRIDXAUTO configuration parameter to 1.

After you set either of these values, when one of the threads on the secondary database server detects a corrupted index, the index is automatically replicated to the secondary database server. Restarting index replication can take up to the amount of time specified in seconds in the DRTIMEOUT configuration parameter.

Sometimes, you might want to replicate an index manually, for example, when you want to postpone index repair because the table is locked. If you want to be able to manually replicate an index on the HDR secondary server, turn off the automatic replication feature.

To turn off the automatic index replication feature, either:
  • Set onmode -d idxauto to off.
  • Set the DRIDXAUTO configuration parameter to 0.

If onmode -d idxauto is set to off or DRIDXAUTO is set to 0 and the secondary server detects a corrupted index, you can manually replicate an index on the HDR secondary server by issuing an onmode -d index command in the following format.onmode -d index database:[ownername].table#index

For example:onmode -d index cash_db:user_dx.table_12#index_z

In the case of a fragmented index with one corrupted fragment, the onmode -d idxauto option only transfers the single affected fragment, whereas the onmode -d index option transfers the whole index.
Important: When turning the automatic index replication feature on or off, you can use either the onmode command or the DRIDXAUTO configuration parameter. If you use the onmode command, you are not required to stop and restart the database server. When you use the DRIDXAUTO parameter, the database server is restarted with the setting you specify. The onmode command does not change the DRIDXAUTO value. If you use the onmode command, you must manually change the value of DRIDXAUTO.

The online.log file produced by the secondary server contains information about any replicated index.