Home

 

Create database instances

 

+

Search Tips   |   Advanced Search

 

A database environment with multiple instances provides the flexibility to...

For example, if you need to make changes to one of the instances, you can restart just that instance instead of the whole system. Similarly, if you need to take an instance offline, only the databases that are hosted on that instance are unavailable during the outage, while your other databases are unaffected.


DB2 AIX

An instance called db2inst1 is created during DB2 installation.

  1. Create a group for DB2:

      mkgroup db2iadm1

  2. Create users for DB2:

      mkuser groups=db2iadm1 db2inst2 passwd db2inst2
      mkuser groups=db2iadm1 db2inst3 passwd db2inst3
      mkuser groups=db2iadm1 db2inst4 pass wd db2inst4
      mkuser groups=db2iadm1 db2inst5 passwd db2inst5
      mkuser groups=db2iadm1 db2inst6 passwd db2inst6

  3. Create new DB2 instances:

    Login with root user

      cd /opt/IBM/db2/V9.1/instance
      ./db2icrt -u db2inst2 db2inst2
      ./db2icrt -u db2inst3 db2inst3
      ./db2icrt -u db2inst4 db2inst4
      ./db2icrt -u db2inst5 db2inst5
      ./db2icrt -u db2inst6 db2inst6

  4. Set the port number of the instance:

    Edit the/etc/services file and add the following line:

    db2c_<inst_name> <inst_port>/tcp

  5. Set the communication protocols for the instance:

      db2 update database manager configuration using svcename db2c_<inst_name>
      db2set DB2COMM=tcpip
      db2stop
      db2start

  6. Edit your firewall configuration to allow the new instance to communicate through its listening port.


DB2 Linux

An instance called db2inst1 is created during DB2 installation, along with three users: db2inst1, db2fenc1, and dasusr1.

  1. Create groups for DB2:

      groupadd -g 999 db2iadm1
      groupadd -g 998 db2fadm1
      groupadd -g 997 dasadm1

  2. Create users for DB2:

      useradd -u 1100 -g db2iadm1 -m -d /home/db2inst1 db2inst1 -p passw0rd
      useradd -u 1101 -g db2fadm1 -m -d /home/db2fenc1 db2fenc1 -p passw0rd
      useradd -u 1102 -g dasadm1 -m -d /home/dasadm1 dasusr1 -p passw0rd
      useradd -u 1103 -g db2iadm1 -m -d /home/db2inst2 db2inst2 -p passw0rd
      useradd -u 1104 -g db2iadm1 -m -d /home/db2inst3 db2inst3 -p passw0rd
      useradd -u 1105 -g db2iadm1 -m -d /home/db2inst4 db2inst4 -p passw0rd
      useradd -u 1106 -g db2iadm1 -m -d /home/db2inst5 db2inst5 -p passw0rd
      useradd -u 1107 -g db2iadm1 -m -d /home/db2inst6 db2inst6 -p passw0rd

  3. Create new DB2 instances:

    Login with root user

      cd /opt/ibm/db2/V9.1/instance.
      ./db2icrt -u db2fenc1 db2inst1
      ./db2icrt -u db2fenc1 db2inst2
      ./db2icrt -u db2fenc1 db2inst3
      ./db2icrt -u db2fenc1 db2inst4
      ./db2icrt -u db2fenc1 db2inst5
      ./db2icrt -u db2fenc1 db2inst6

  4. Set the port number of the instance:

    Edit the /etc/services file and add the following line:

    db2c_<inst_name> <inst_port>/tcp

  5. Log in as the database instance and set the communication protocols for the instance:

      su - db2inst1 db2 update database manager configuration using svcename
      db2c_<inst_name>
      db2set DB2COMM=tcpip
      db2stop
      db2start

  6. Edit your firewall configuration to allow the new instance to communicate through its listening port.


Db2 Microsoft Windows

  1. Create an instance by running the following command:

      db2icrt <inst_name> -s ese -u <db2_admin_user>

  2. Set the port number of the instance:

    Edit the C:\WINDOWS\system32\drivers\etc\services file and add the following line:

      db2c_<inst_name> <inst_port>/tcp

  3. Set the communication protocols for the instance:

      db2 update database manager configuration using svcename
      db2c_<inst_name> db2set DB2COMM=npipe,tcpip db2stop db2start

  4. Set the current instance parameter:

      set DB2INSTANCE=<instance name>

  5. Edit your firewall configuration to allow the new instance to communicate through its listening port.


Oracle

Each database is a database instance. Use the Oracle Database Configuration Assistant (DBCA) to create Oracle a new database:

  1. Open the DBCA tool:

    • AIX or Linux:

      1. Change login user to oracle

      2. $ export [[ORACLE_HOME]]=...

      3. $ export PATH=$PATH:$ORACLE_HOME/bin

      4. $ export DISPLAY=<hostname:displaynumber.screennumber>

        where <hostname:displaynumber.screennumber> represents the client system, monitor number, and window number. For example:

        localhost:0.0

      5. $ dbca &

    • Windows:

      1. Click Start

      2. Select Oracle > OraDB10g_Home1 > Configuration and Migration Tools > Database Configuration Assistant

  2. On the Operations page, accept the default option to Create a database and click Next.

  3. On the Database Templates page, accept the General Purpose default option and click Next.

  4. On the Database Identification page, enter LSCONN in the Global Database Name and SID fields and click Next.

  5. On the Management Options page, accept the default option to Configure the database with Enterprise Manager and click Next.

  6. On the Database Credentials page, enter the database password and click Next.

  7. On the Storage Options page, accept the File System storage option and click Next.

  8. On the Database File Locations page, accept the Database File Locations from Template default option and click Next.

  9. On the Recovery Configuration page, accept the Specify Flash Recovery Area default option and click Next.

  10. On the Database Content page, accept the defaults and click Next.

  11. On the Initialization Parameters page, click the Character Sets tab and select the Use Unicode (AL32UTF8) option. Click Next.

  12. On the Database Content page, accept the defaults and click Next.

  13. On the Creation Options page, accept the Create Database default option and click Next.


SQL Server

  1. Run the SQL Server installation wizard. On the Instance Name panel of the installation wizard, select Named instance, and then specify a new instance name in the field.

  2. Edit your firewall configuration to allow the new instance to communicate through its listening port.

Use the same collation that you are using for the feature databases; that is: Latin1_General_BIN

For Authentication mode, use Mixed Mode (Windows Authentication and SQL Server Authentication)

If you receive any warnings or errors from the System Configuration Check dialog, correct them from the SQL Server 2005 instance installation

When you create multiple database instances, install the databases on each instance. If you are using the wizard to install the databases, prepare and run the database wizard once for each instance and if you are using the scripts to install the databases, run the scripts once for each instance.

 

Related tasks

Create databases
Registering the DB2 product license key
Create a dedicated DB2 user
Create databases with the database wizard
Create databases with SQL scripts
Populate the Profiles database
com.ibm.db2.udb.admin.doc/doc/c0004900.htm