Configuring for a Db2 database in HADR

Configure Db2 for generating Dynamic Workload Console reports when Db2 is configured for HADR

You can optionally configure Db2 in HADR configuration so that you can connect to the secondary database if the primary database becomes unreachable.

To configure Db2 for generating reports when Db2 is configured for HADR, perform the following steps

  1. Stop WebSphere Application Server Liberty, as described in Application server - starting and stopping.
  2. Browse to the following paths, depending on your operating system:
    On UNIX operating systems
    TWA_home/usr/servers/engineServer/configDropins/templates
    On Windows operating systems
    TWA_home\usr\servers\engineServer\configDropins\templates
  3. Copy the datasource.xml file to a working location and edit it by adding the following strings:
    
    <variable name="db.clientRerouteAlternateServerName" value="secondary_database"/>
    <variable name="db.clientRerouteAlternatePortNumber" value="secondary_database_port_number"/>
  4. You also need to add the call to the above variables. To perform this operation, modify the string:
    <jndiEntry value="jdbc:db2://${db.serverName}:${db.portNumber}/${db.databaseName}" jndiName="db.url"/>
    as follows:
    :clientRerouteAlternateServerName=${db.clientRerouteAlternateServerName};clientRerouteAlternatePortNumber=${db.clientRerouteAlternatePortNumber};"
    . The resulting string must be as follows:
    <jndiEntry value="jdbc:db2://${db.serverName}:${db.portNumber}/${db.databaseName}:clientRerouteAlternateServerName=${db.clientRerouteAlternateServerName};clientRerouteAlternatePortNumber=${db.clientRerouteAlternatePortNumber};" jndiName="db.url"/>
  5. Copy the edited file to the following paths:
    On UNIX operating systems
    TWA_DATA_DIR/usr/servers/engineServer/configDropins/overrides
    On Windows operating systems
    TWA_home\usr\servers\engineServer\configDropins\overrides
  6. Start WebSphere Application Server Liberty, as described in Application server - starting and stopping.

You have now configured your Db2database in HADR.

For more information about HADR configuration, see An active-active high availability scenario. For more information about templates, see Configuring IBM Workload Scheduler using templates.