Enabling reads on standby

You can enable the reads on standby feature on your HADR standby database by using the DB2_HADR_ROS registry variable.

About this task

For full documentation, see Enabling reads on standby.

Important:
  • The reads on standby feature should be enabled prior to starting HADR.
  • You cannot use automatic client reroute (ACR) if you enable reads on standby.

Procedure

Note: If your deployment uses the restricted-v2 SCC, commands that require switching users or elevated privileges are not supported. Perform all steps as the Db2 instance user within the container. For details, see Deploying Db2 or Db2 Warehouse with non-root deployment. For more information, see Deploying Db2 or Db2 Warehouse with non-root deployment.

  1. Exec into the Db2® pod and switch to the database instance owner:
    oc exec -it c-db2oltp-primary-db2u-0 -- bash
    su - db2inst1
    
  2. Use the db2set command to enable reads on standby:
    db2set DB2_HADR_ROS=ON
  3. Restart the Db2 or Db2 Warehouse database.
    db2stop
    ipclean -a
    db2start