Creating an instance using db2icrt

A Db2® instance is an environment in which you store data and run applications. Use the db2icrt command to create an instance.

Before you begin

On Linux® or UNIX operating systems, you must have root user authority.

Note: If the Db2 fault monitor is turned on, the Db2 instance is started automatically when the db2icrt command finishes running. You can stop the instance by using the db2stop command.


To create an instance using db2icrt:

  1. Log in with proper authority.
  2. Run the db2icrt command.
    For example, on Linux or UNIX operating systems:
    DB2DIR/instance/db2icrt -a AuthType -u FencedID InstName
    is the Db2 installation directory.
    • On theAIX® operating system, the default Db2 installation directory is /opt/IBM/db2/V11.5.
    • On Linux operating systems, the default installation directory is /opt/ibm/db2/V11.5.
    -a AuthType (Linux or UNIX)
    Represents the authentication type for the instance. AuthType can be one of SERVER, CLIENT, or SERVER_ENCRYPT. SERVER is the default. This parameter is optional.
    -u FencedID
    Represents the name of the user under which fenced user defined functions (UDFs) and fenced stored procedures will run. This flag is not required if you are creating an instance on a client. Specify the name of the fenced user you created.
    Represents the name of instance. The name of the instance must be the same as the name of the instance owning user. Specify the name of the instance owning user you created. The instance will be created in the instance owning user's home directory.


For example, if you are using server authentication, your fenced user is db2fenc1, and your instance owning user is db2inst1, use the following command to create an instance on an AIX operating system:
/opt/IBM/db2/V11.5/instance/db2icrt -a server -u db2fenc1 db2inst1

What to do next

(Optional) After you create an instance you can configure notification for health monitoring. This task can be performed using the Db2 CLP commands.