Creating of DB2 Instance


Prequisite: Ensure that the Proper users are created
The Groups are Created
The Home Directory of the Instance owner is set

Steps to Create an DB2 instance

1) Login to the server as root or any user under which db2 was installed
2) Execute the db2icrt command within DB2DIR/instance/db2icrt
On Linux and UNIX operating systems, this utility is located in the DB2DIR/instance directory,
where DB2DIR represents the installation location where the current version of the DB2 database system is installed.
3) Run the db2icrt command. For example, on Linux or UNIX operating systems:
DB2DIR/instance/db2icrt -a AuthType -u FencedID InstName
DB2DIR :is the DB2 installation directory.
-a AuthType – AuthType can be one of SERVER, CLIENT, or SERVER_ENCRYPT. SERVER is the default.
-u FencedID – Fenced user defined functions (UDFs) and fenced stored procedures will run.
InstName – Represents the name of instance. The name of the instance must be the same as the name of the instance owning user.

The instance will be created in the instance owning user’s home directory.

[root@mercury instance]# cd /opt/ibm/db2/V9.1/instance/[root@mercury instance]# ls -ltr db2icrt
-r-xr–r– 1 root root 8120 Nov 6 2007 db2icrt

[root@mercury instance]# ./db2icrt -u db2fenc1 db2inst1
DBI1070I Program db2icrt completed successfully.

If you want to assign a port along with the Instance creation we can give the ” -p” option along with the port no

It will also add the Port entries in /etc/services

[root@mercury instance]# ./db2icrt -u db2fenc1 -p 50000 db2inst1
DBI1070I Program db2icrt completed successfully.

4) Check if the instance has been created , use db2ilist command

[db2inst1@mercury instance]# db2ilist

5) Check the directory structure where the db2 instance
On UNIX operating systems, the instance directory is located in the INSTHOME/sqllib directory,
where INSTHOME is the home directory of the instance owner.

On Windows operating systems, the instance directory is located in the /sqllib sub-directory, in the directory where DB2 UDB was installed.

[root@mercury ~]# cd /home/db2inst1[[root@mercury db2inst1]# pwd

[root@mercury db2inst1]# ls -l
drwxrwxr-x 3 db2inst1 db2grp1 4096 May 23 08:58 db2inst1
drwxrwsr-t 15 db2inst1 db2grp1 4096 May 23 20:29 sqllib


6) Instance is created

Leave a Reply

Your email address will not be published. Required fields are marked *