Enabling reads on standby

You can enable the reads on standby feature on your High Availability and Disaster Recovery (HADR) standby database using the DB2_HADR_ROS registry variable.

Before you begin

It is recommended that database configuration parameter logindexbuild be set to ON. This will prevent a performance impact from query access plans avoiding any invalid indexes.

It is also recommended that you use a virtual IP when you have reads on standby enabled. Client reroute does not differentiate between writable databases (primary and standard databases) and read-only databases (standby databases). Configuring client reroute between the primary and standby might route applications to the database on which they are not intended to be run.

About this task

You cannot use automatic client reroute (ACR) if you enable reads on standby.

Procedure

  1. Set the DB2_HADR_ROS registry variable to ON.
  2. Set up and initialize the primary and standby databases for HADR.

Results

Your standby database is now considered an active standby, meaning that it will accept read-only workloads.

What to do next

You can now utilize your standby database as you see fit, such as configuring some of your read-only workload to run on it.

To enable your applications to maintain access to your standby database, follow the steps described in the Continuous access to Read on Standby databases using Virtual IP addresses white paper.