Linux

Updating database configurations in a cloned environment

You need to change the host name of the cloned database server so that you do not have two databases with the same host name. DB2 stores the host name in various places. Follow the instructions below to update the host names.

About this task

Follow the appropriate guidelines and instructions to change host names for your particular database version. Here is an example of updating the host name on a DB2 version 9.7 database. This procedure is based on a technote that supports DB2 versions up to 9.7, Changing hostname of the DB2 server.
Note: These steps might not be complete or might not be accurate for newer database versions such as DB2 version 10.1 or DB2 version 10.5.

Procedure

Complete the following steps on the DB2 server:
  1. Log on as the dasadm user and stop the DB2 Administration Server (DAS):
    db2admin stop
  2. Log on as the instance owner and stop the DB2 instance:
    db2stop
  3. Change the host name to a new host name.
  4. Log on as the ROOT user and update the DB2SYSTEM registry variable in the instance home directory with the new host name:
    db2iset -g DB2SYSTEM=new_hostname
  5. Open the DB2_instance_home/sqllib/db2nodes.cfg file, where db2_instance_home is the name of the DB2 instance.
  6. Update the old host name that is in the file to the new host name.
  7. Run the following command to list the old host name that is cataloged:
    db2 list admin node directory show detail

    If there are no Admin Node Directory entries then you can skip step 8 and 9. No entries means that you have not started the Control Center. The Admin Node Directory will update the next time that the Control Center is started, based on the old host name.

  8. Run the following command to uncatalog the old host name:
    db2 uncatalog node nodename
    Where nodename is the node that you want to uncatalog.
  9. Run the following command to catalog the Admin Node with the new host name:
    db2 catalog admin tcpip node nodename remote new_hostname system port_number
    where:
    • nodename can be any name that is 8 characters or less. The name does not relate directly to the host name.
    • new_hostname is the new host name that you created.
    • port_number is the same port number that you used previously.
  10. Run the following command to update the admin configuration file with the new host name.
    db2 update admin cfg using DB2SYSTEM new_hostname   
    db2 update admin cfg using SMTP_SERVER new_hostname
  11. Log on as the dasadm user and restart the DB2 Administration Server (DAS):
    db2admin start 
  12. Log on as the instance owner and start the DB2 instance:
    db2start
  13. In Control Center, find the old host name under the "All Systems" folder. Right-click the folder and select Remove.
  14. In Control Center, add the new host name:
    1. Right-click the All Systems folder and select Add.
    2. Click Discover to locate the new host name that you created.