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.
Note: This command is not available for a
non-root installation of DB2 database
products.
Authorization
Root user authority is required
on Linux and UNIX operating systems or Local Administrator
authority on Windows operating
systems.
Command syntax
- For Linux and UNIX operating systems
(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:
- If the instance type is not specified
with -s, the default instance type created
is the highest type listed in InstType that DB2 copy
is licensed to create.
- When creating client instances, -u FencedID is
not a valid option.
- 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.
- 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 Windows operating
systems
(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:
- If
the instance type is not specified with -s,
the default instance type created is the highest type listed in InstType that DB2 copy
is licensed to create.
Command parameters
- For 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.
- -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 Enterprise Server Edition or DB2 Advanced Enterprise
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 Workgroup Server Edition, DB2 Express® 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,IBM Data Server Runtime Client,
and DB2 Connect Personal Edition.
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 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, IBM Data Server Runtime Client,
and DB2 Connect Personal Edition.
- 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 DB2 Workgroup Server Edition, DB2 Express Edition or DB2 Express-C,
and DB2 Connect Enterprise
Edition.
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 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
- 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.
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.
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.
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.
- 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.
- To
create a DB2 pureScale instance
with multiple netnames on cluster caching facility 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,host1.domain.com-ib1
-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 with multiple netnames 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.
Usage notes
- The instance user must exist on all hosts
with the same UID, GID, group name, and home directory path. The same
rule applies for the fenced user. After the db2icrt command
is successfully run, the DB2 installer
will set up SSH for the instance user across hosts.
- When using the db2icrt command, the name of
the instance must match the name of an existing user.
- You can have only one instance per DB2 pureScale environment.
- When creating DB2 instances,
consider the following restrictions:
- If existing IDs are used to create DB2 instances,
make sure that the IDs are not locked and do not have passwords expired.
- You can also use the db2isetup command to create
and update DB2 instances
and add multiple hosts with a graphical interface.
- If you are using the su command instead of
the login command to become the root user, you
must issue the su command with the - option
to indicate that the process environment is to be set as if you had
logged in to the system with the login command.
- You must not source the DB2 instance
environment for the root user. Running db2icrt when
you sourced the DB2 instance
environment is not supported.
- If you have previously created a DB2 pureScale instance
and have dropped it, you cannot re-create it using the -instance_shared_dev parameter
specification since the DB2 cluster file system might
already have been created. To specify the previously created shared
file system:
- If the existing GPFS shared
file system was created and managed by DB2 pureScale Feature,
the -instance_shared_dev parameter and the -instance_shared_dir parameter
should not be used.
- If the existing GPFS shared
file system was not created and managed by DB2 pureScale Feature,
use the -instance_shared_dir parameter.
On AIX 6.1 (or higher), when running this command
from a shared DB2 copy
in a system workload partition (WPAR) global environment, this command
must be run as the root user. WPAR is not
supported in a DB2 pureScale environment.
- For
the /var directory memory requirements, see topic
"Disk and memory requirements".