DB2 10.5 for Linux, UNIX, and Windows

db2icrt - Create instance command

Create a DB2® instance, including a DB2 pureScale® instance. This command can also be used to create an initial DB2 member and cluster caching facility as part of the creation of the DB2 pureScale instance.

On Linux and UNIX operating systems, db2icrt is located in DB2DIR/instance , where DB2DIR represents the installation directory in which the DB2 database system is installed. On Windows operating systems, db2icrt is located in DB2PATH\bin, where DB2PATH is the directory where the DB2 copy is installed.

The db2icrt command creates a DB2 instance in the home directory of the instance owner. You can create only one DB2 pureScale instance per DB2 pureScale environment.

Authorization

Root user or non-root user authority is required on Linux and UNIX operating systems. Local Administrator authority is required on Windows operating systems.

Command syntax

For root installation on Linux and UNIX operating systems
Read syntax diagramSkip visual syntax diagram
                                            (1)     
                              .-DefaultType-----.   
>>-db2icrt--+-----+--+-----+--+--s-| InstType |-+--------------->
            +- -h-+  '- -d-'                        
            '- -?-'                                 

>--+---------------+--+---------------+------------------------->
   '- -a--AuthType-'  '- -p--PortName-'   

>--+-------------------+--+-----------------------------+------->
   |               (2) |  +-| DB2 pureScale options |---+   
   '- -u--FencedID-----'  '-| DB2 Text Search options |-'   

>--InstName----------------------------------------------------><

InstType

|--+-dsf--------+-----------------------------------------------|
   +-ese--------+   
   +-wse--------+   
   +-standalone-+   
   '-client-----'   

DB2 pureScale options

                                                     .-,--------------------.                           
       (3)                                           V                      |                           
|-- -m------MemberHostName-- -mnet--MemberNetname(1)---+------------------+-+-+---------------------+-->
                                                       '-MemberNetname(i)-'   '-,--MemberNetname(n)-'   

                                               .-,----------------.                       
        (4)                                    V                  |                       
>-- -cf------CFHostName-- -cfnet--CFNetname(1)---+--------------+-+-+-----------------+-->
                                                 '-CFNetname(i)-'   '-,--CFNetname(n)-'   

>--+- -instance_shared_dev--Shared_Device_Path_for_Instance--+----------------------------------------------+-+-->
   |                                                         '- -instance_shared_mount--Shared_Mounting_Dir-' |   
   '- -instance_shared_dir--Shared_Directory_for_Instance-----------------------------------------------------'   

>--+---------------------------------------+-------------------->
   '- -tbdev--Shared_device_for_tiebreaker-'   

>-- -i--db2sshidName--------------------------------------------|

DB2 Text Search options

|-- -j--"TEXT_SEARCH-+-------------------------+-"--------------|
                     +-,ServiceName------------+     
                     +-,ServiceName,PortNumber-+     
                     '-,PortNumber-------------'     

Notes:
  1. If the instance type is not specified with -s, the default instance type that is created for the server image is the DB2 Enterprise Server Edition (ese) instance type. The default instance type for the other images (DB2 Express® Server Edition, and DB2 Connect™) are the DB2 Workgroup Server Edition (wse) instance type.
  2. When creating client instances, -u FencedID is not a valid option.
  3. The MemberHostName:MemberNetname format has been deprecated for the -m option, and might be discontinued in the future. The new format, with both -m and -mnet options, is required for IPv6 support with DB2 pureScale Feature.
  4. The CFHostName:CFNetames format has been deprecated for the -cf option, and might be discontinued in the future. The new format, with both -cf and -cfnet options, is required for IPv6 support with DB2 pureScale Feature.
For a non-root thin server instance on Linux and AIX® operating systems
Read syntax diagramSkip visual syntax diagram
>>-db2icrt--+-----+--+-----+-----------------------------------><
            '- -d-'  +- -h-+   
                     '- -?-'   

For root installation on Windows operating systems
Read syntax diagramSkip visual syntax diagram
                                             (1)     
                               .-DefaultType-----.   
>>-db2icrt--+-----+--InstName--+--s-| InstType |-+-------------->
            '- -?-'                                  

>--+------------------------+--+-------------------+------------>
   '- -u--UserName,Password-'  '- -p--InstProfPath-'   

>--+---------------+--+-----------------------------+----------->
   '- -h--HostName-'  '-| DB2 Text Search options |-'   

>--+-------------------------+---------------------------------><
   '- -r--FirstPort,LastPort-'   

InstType

|--+-dsf--------+-----------------------------------------------|
   +-ese--------+   
   +-wse--------+   
   +-standalone-+   
   '-client-----'   

DB2 Text Search options

|-- -j--"TEXT_SEARCH-+-------------------------+-"--------------|
                     +-,ServiceName------------+     
                     +-,ServiceName,PortNumber-+     
                     '-,PortNumber-------------'     

Notes:
  1. If the instance type is not specified with -s, the default instance type is the DB2 Workgroup Server Edition (wse) instance type regardless of the product editions.

Command parameters

For root installation on Linux and UNIX operating systems
-?
Displays the usage information.
-h
Displays the usage information.
-d
Turns on debug mode. Saves the trace file with default name in /tmp as db2icrt.trc.ProcessID. Use this option only when instructed by DB2 database support
-a AuthType
Specifies the authentication type (SERVER, CLIENT, or SERVER_ENCRYPT) for the instance. The default is SERVER.
-j "TEXT_SEARCH"
Configures the DB2 Text Search server with generated default values for service name and TCP/IP port number. This parameter cannot be used if the instance type is client.
-j "TEXT_SEARCH,servicename"

Configures the DB2 Text Search server with the provided service name and an automatically generated port number. If the service name has a port number assigned in the services file, it uses the assigned port number.

-j "TEXT_SEARCH,servicename,portnumber"

Configures the DB2 Text Search server with the provided service name and port number.

-j "TEXT_SEARCH,portnumber"

Configures the DB2 Text Search server with a default service name and the provided port number. Valid port numbers must be within the 1024 - 65535 range.

-p <TCP/IP PortName>
Specifies the TCP/IP port name or number used by the instance. This option also configures the database manager configuration parameter SVCENAME for the DB2 instance.
-m MemberHostName:NetName1
Specifies the host to set up as a DB2 member during instance creation. This parameter is mandatory in a DB2 pureScale environment. Only one DB2 member can be set up by the db2icrt command. Additional DB2 members can be added with the db2iupdt -add command.The NetName1 syntax is deprecated and might be discontinued in a future release. Use the -mnet parameter instead.

The MemberHostName should be the canonical host name (for example, the output of 'hostname' command run on a local host). The NetName1 value specified here must belong to the same subnet as specified in the -cf parameter.

-mnet MemberNetName
This parameter replaces the deprecated :NetName1 syntax of the -m MemberHostName:NetName1 parameter. Specifies the cluster interconnect netname, which is the hostname of the interconnect used for high speed communication between members and cluster caching facilities (also referred to as CF) in a DB2 pureScale instance.

The MemberNetName must belong to one of the same subnets specified in the -cf parameter, and must correspond to a cluster interconnect netname (for example, db2_<hostname_ib0).

-cf CFHostName:NetName2
Specifies the host to set up as a cluster caching facility (also referred to as CF) during instance creation. This parameter is mandatory in a DB2 pureScale environment. Only one CF can be set up by the db2icrt command. Additional CFs can be added by using the db2iupdt -add command. The NetName2 syntax is deprecated and might be discontinued in a future release. Use the -cfnet parameter instead.
-cfnet CFNetName
This parameter replaces the deprecated :NetName2 syntax of the -cf CFHostName:NetName2 parameter. Specifies the cluster interconnect netname, which is the hostname of the interconnect used for high speed communication between members and CFs in a DB2 pureScale instance.

The CFNetName must belong to the same subnet as specified in the -m parameter, and must correspond to a cluster interconnect netname (for example, db2_<hostname_ib0>).

-instance_shared_dev Shared_Device_Path_for_Instance
Specifies a shared disk device path required to set up a DB2 pureScale instance to hold instance shared files and default database path. For example, /dev/hdisk1. The shared directory must be accessible on all the hosts for the DB2 pureScale instance. The value of this option cannot have the same value as the -tbdev option.

When the -instance_shared_dev parameter is specified, the DB2 installer creates a DB2 cluster file system.

The -instance_shared_dev parameter and the -instance_shared_dir parameter are mutually exclusive.

-instance_shared_mount Shared_Mounting_Dir
Specifies the mount point for a new IBM® General Parallel File System ( GPFS™) file system. The specified path must be a new and empty path that is not nested inside an existing GPFS file system.
-instance_shared_dir Shared_Directory_for_Instance
Specifies a directory in a shared file system (GPFS) required to set up a DB2 pureScale instance to hold instance shared files and default database path. For example, /sharedfs. The disk must be accessible on all the hosts for the DB2 pureScale instance. The value of this option cannot have the same value as the -tbdev option or the installation path.

When the -instance_shared_dir parameter is specified, the DB2 installer uses a user-managed file system. The user-managed file system must available on all hosts, and must be a GPFS file system.

The -instance_shared_dir parameter and the -instance_shared_dev parameter are mutually exclusive.

-tbdev Shared_device_for_tiebreaker
Specifies a shared device path for a device that will act as a tiebreaker in the DB2 pureScale environment to ensure that the integrity of the data is maintained. The value of this option cannot have the same value as either the -instance_shared_dev option or the -instance_shared_dir option. This option is required when the DB2 cluster services tiebreaker is created for the first time. The disk device should not have any file system associated with it. This option is invalid if a DB2 cluster services Peer Domain already exists.
Note: When you are creating a DB2 pureScale instance in a virtual machine (VM), you do not need to specify a tiebreaker disk. If you do not want to specify a tiebreaker disk, you must use inputas the tiebreaker disk option value.
-i db2sshidName
Specifies the non-root user ID required to use a secure shell (SSH) network protocol between hosts. The user ID specified must be a user without special privileges. Valid only for a DB2 managed GPFS file system.
-s InstType
Specifies the type of instance to create. Use the -s option only when you are creating an instance other than the default associated with the installed product from which you are running db2icrt. Valid values are:
dsf
Used to create a DB2 pureScale instance for a DB2 database server with local and remote clients. This option is the default instance type for the IBM DB2 pureScale Feature.
ese
Used to create an instance for a database server with local and remote clients. This option is the default instance type for DB2 Advanced Enterprise Server Edition, DB2 Advanced Workgroup Server Edition, DB2 Enterprise Server Edition, or DB2 Workgroup Server Edition.
wse
Used to create an instance for a database server with local and remote clients. This option is the default instance type for DB2 Express Server Edition or DB2 Express-C, and DB2 Connect Enterprise Edition.
standalone
Used to create an instance for a database server with local clients.
client
Used to create an instance for a client. This option is the default instance type for IBM Data Server Client, andIBM Data Server Runtime Client.

DB2 database products support their default instance types and the instance types lower than their default ones. For instance, DB2 Enterprise Server Edition supports the instance types of ese, wse, standalone, and client.

-u Fenced ID
Specifies the name of the user ID under which fenced user-defined functions and fenced stored procedures will run. The -u option is required if you are not creating a client instance.
InstName
Specifies the name of the instance which is also the name of an existing user in the operating system. The instance name must be the last argument of the db2icrt command.
For a non-root thin server instance on Linux and AIX operating systems
-d
Enters debug mode, for use by DB2 database support.
-h | -?
Displays the usage information.
For root installation on Windows operating systems
InstName
Specifies the name of the instance.
-s InstType
Specifies the type of instance to create. Currently, there are four kinds of DB2 instance types. Valid values are:
client
Used to create an instance for a client. This option is the default instance type for IBM Data Server Client, and IBM Data Server Runtime Client.
standalone
Used to create an instance for a database server with local clients.
ese
Used to create an instance for a database server with local and remote clients with partitioned database environment support. The
-s ese -u Username, Password
options have to be used with db2icrt to create the ESE instance type and a partitioned database environment instance.
wse
Used to create an instance for a database server with local and remote clients. This option is the default instance type for all DB2 Editions for Windows platform.

DB2 Advanced Enterprise Server Edition, DB2 Advanced Workgroup Server Edition, DB2 Enterprise Server Edition, DB2 Workgroup Server Edition support ese instance types and the instance types lower than ese. For instance, DB2 Enterprise Server Edition supports the instance types of ese, wse, standalone, and client.

The other editions supports wse instance type and the instance types lower than wse.

-u Username, Password
Specifies the account name and password for the DB2 service. This option is required when creating a partitioned database instance.
-p InstProfPath
Specifies the instance profile path.
-h HostName
Overrides the default TCP/IP host name if there is more than one for the current machine. The TCP/IP host name is used when creating the default database partition (database partition 0). This option is only valid for partitioned database instances.
-r PortRange
Specifies a range of TCP/IP ports to be used by the partitioned database instance when running in MPP mode. For example, -r 50000,50007. The services file of the local machine will be updated with the following entries if this option is specified:
DB2_InstName          baseport/tcp
DB2_InstName_END      endport/tcp
/j "TEXT_SEARCH"
Configures the DB2 Text Search server with generated default values for service name and TCP/IP port number. This parameter cannot be used if the instance type is client.
/j "TEXT_SEARCH,servicename"

Configures the DB2 Text Search server with the provided service name and an automatically generated port number. If the service name has a port number assigned in the services file, it uses the assigned port number.

/j "TEXT_SEARCH,servicename,portnumber"

Configures the DB2 Text Search server with the provided service name and port number.

/j "TEXT_SEARCH,portnumber"

Configures the DB2 Text Search server with a default service name and the provided port number. Valid port numbers must be within the 1024 - 65535 range.

-?
Displays usage information.

Examples

  1. To create a DB2 pureScale instance for the instance owner db2sdin1 and fenced user db2sdfe1, run the following command:
    DB2DIR/instance/db2icrt 
       -cf host1.domain.com -cfnet host1.domain.com-ib0 
       -m host2.domain.com -mnet host2.domain.com-ib0
       -instance_shared_dev /dev/hdisk1 
       -tbdev /dev/hdisk2 
       -u db2sdfe1 
       db2sdin1
    where DB2DIR represents the installation location of your DB2 copy. The DB2 pureScale instance db2sdin1 will have a CF on host1, and a member on host2. This command also uses /dev/hdisk1 to create a shared file system to store instance shared files and sets up /dev/hdisk2 as the shared device path for the tiebreaker.
  2. To create a DB2 Enterprise Server Edition instance for the user ID db2inst1, run the following command:
    DB2DIR/instance/db2icrt -s ese -u db2fenc1 db2inst1
    where DB2DIR represents the installation location of your DB2 copy.
  3. To create a DB2 pureScale instance that uses an existing file system (GPFS) managed by the DB2 product for the instance owner db2sdin1 and the fenced user db2sdfe1, run the following command:
    DB2DIR/instance/db2icrt 
       -cf host1.domain.com -cfnet host1.domain.com-ib0 
       -m host2.domain.com -mnet host2.domain.com-ib0
       -tbdev /dev/hdisk2 
       -u db2sdfe1 
       db2sdin1
    where DB2DIR represents the installation location of your DB2 copy.
  4. To create a DB2 pureScale instance with an existing user-managed GPFS file system (/gpfs_shared_dir) for the instance owner db2sdin1 and the fenced user db2sdfe1, run the following command:
    DB2DIR/instance/db2icrt 
       -cf host1.domain.com -cfnet host1.domain.com-ib0 
       -m host2.domain.com -mnet host2.domain.com-ib0
       -instance_shared_dir /gpfs_shared_dir
       -tbdev /dev/hdisk2 
       -u db2sdfe1 
       db2sdin1
    where DB2DIR represents the installation location of your DB2 copy.
  5. On an AIX machine, to create an instance for the user ID db2inst1, issue the following command:
    On a client machine:
    DB2DIR/instance/db2icrt db2inst1
    On a server machine:
    DB2DIR/instance/db2icrt -u db2fenc1 db2inst1
    where db2fenc1 is the user ID under which fenced user-defined functions and fenced stored procedures will run.

Usage notes