Creating multiple DB2 database instances on AIX

Procedure

Attention:
  • For each instance that you want to create, log in as the instance owner before you create the instance.
  • Use the DB2® command line processor to enter commands.
  • After you create the instance, add the instance to the user environment variable.
  • An instance that is called db2inst1 is created during DB2® installation.
To create DB2 database instances on AIX, follow these steps:
  1. Create a group for DB2®:mkgroup db2iadm1
  2. Create a user for DB2®:mkuser groups=db2iadm1 db2instN, where db2instN is the name of a user. DB2® prompts you to enter a password for the user. Repeat this step to create enough users to match the number of database instances.
  3. To create DB2® instances, log in with root user and go to /opt/ibm/db2/V11.1/instance.
    ./db2icrt -u db2instN db2instN
    Where db2instN is the name of a user and also the name of an instance. Repeat this step to create enough instances to match the number of databases.
  4. To set the port number of the instance, edit the /etc/services file and add the following line:
    db2c_instance_name instance_port/tcp where instance_name is the name of the instance and instance_port is the port number of that instance. Repeat this step for each instance.
  5. Set the communication protocols for the instance:
    db2 update database manager configuration using svcename db2c_instance_name
    db2set DB2COMM=tcpip
    db2stop
    db2start
    Repeat this step for each instance.
  6. Edit your firewall configuration to allow the new instances to communicate through their listening ports.