On OS/2 and Windows 32-bit operating systems:
The command syntax to create an instance is:
db2icrt instance_name
where instance_name is an alphanumeric string up to eight
characters long. See Appendix C. Naming Rules for more information about valid names.
![]() |
You can change the location of the instance directory from
DB2PATH using the DB2INSTPROF environment variable.
You require write access for the instance directory. If you want the
directories created in a path other than DB2PATH, you have to set the
DB2INSTPROF environment variable before entering the
db2icrt command. See Chapter 15. Controlling Your DB2 Environment for further information.
|
On UNIX operating systems:
The instance owner and the group that is the System Administrative (SYSADM) group are associated with every instance. The instance owner and the SYSADM group are assigned during the process of creating the instance. One user ID can be used for only one instance. That user ID is also referred to as the instance owner.
Each instance owner must have a unique home directory. All of the files necessary to run the instance are created in the home directory of the instance owner's user ID. If it becomes necessary to remove the instance owner's user ID from the system, you could potentially lose files associated with the instance and lose access to data stored in this instance. For this reason, it is recommended that you dedicate an instance owner user ID to be used exclusively to run DB2.
The primary group of the instance owner is also important. This primary group automatically becomes the system administrative group for the instance and gains SYSADM authority over the instance. Other user IDs that are members of the primary group of the instance owner also gain this level of authority. For this reason, you may want to assign the instance owner's user ID to a primary group that is reserved for the administration of instances. (Also make sure that you assign a primary group to the instance owner user ID; otherwise, the system-default primary group is used.)
If you already have a group that you want to make the system administrative group for the instance, you can simply assign this group as the primary group when you create the instance owner user ID. To give other users administrative authority on the instance, add them to the group that is assigned as the system administrative group.
To separate SYSADM authority between instances, ensure that each instance owner user ID uses a different primary group. However, if you choose to have common SYSADM authority over multiple instances, you can use the same primary group for multiple instances.
To create a DB2 instance, use the db2icrt command as follows:
DB2DIR/instance/db2icrt instance_name
|
| where DB2DIR | = /usr/lpp/db2_05_00 | on AIX |
|
|
| = /opt/IBMdb2/V5.0 | HP-UX, SCO UnixWare 7, Solaris, or SGI IRIX |
|
|
| = /usr/IBMdb2/V2.1 | on SCO OpenServer |
|
|
| = /opt/IBMdb2/V2.1 | on SINIX |
and where instance_name is an alphanumeric string up to eight characters long (refer to the Appendix C. Naming Rules for more information about naming rules).
For example, to create an instance, enter the following command:
db2icrt db2inst1
The db2icrt command creates the INSTHOME/sqllib directory, where INSTHOME is the home directory of the instance owner.