On OS/2, Windows 95, or Windows NT Systems:
If you are a user that belongs to the Administrators group, you can create additional DB2 instances using the db2icrt command. Run the db2icrt command at a command prompt. The command syntax is:
db2icrt instance_name
where instance_name is a string up to eight alphanumeric
characters long. Refer to the Appendix D. "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 DB2INSTPROF before entering the
db2icrt command. See Chapter 39. "Controlling Your DB2 Environment" for further information.
|
Note: | On Windows 95 only, for each additional instance you need to assign a
different memory location to which the system will allocate shared
memory. The memory location assigned to the default instance, DB2, is
90000000.
Use the DB2DBMSADDR registry value to assign a different value from the range 80000000 to BFFFFFFF. So, if one instance were at 80000000, the next address must be at least 83000000. For example: db2set db2dbmsaddr=A0000000 -i instance_name where instance_name is the name of the additional instance. |
On UNIX Systems:
The user ID of the instance owner, and a group that is the system administration group are associated with every instance. These are assigned during the process of creating the instance. One user ID can be used for only one DB2 Instance. That user ID is also referred to as the instance owner.
Also, each instance owner must have a unique home directory. All of the files necessary to run the database 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 your data stored in the 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 user ID is also important. The primary group of the instance owner user ID automatically becomes the system administration group for the database instance and gains administration authority. (Administration authority allows users to start, stop, or change the database instance.) Other user IDs, that are members of the primary group of the Instance user ID, also gain this level of authority. For this reason, you may want to assign the instance owner ID to a primary group that is reserved for the administration of database instances. (Also make sure that you assign a primary group to the instance owner user ID; otherwise, the system default primary group will be used.)
If you already have a group that you want to make the system administration 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 administration authority on the database instance, add them to the group that is assigned as the system administration 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.
You can use the DB2 Installer or the db2icrt command to create an instance. See "Installing Additional Products and Creating Additional Instances" to create DB2 Instances using the DB2 Installer. The DB2 Installer is available for AIX, HP-UX and Solaris operating systems.
You can also create additional DB2 instances using the db2icrt command as follows:
DB2DIR/instance/db2icrt -u FencedID InstName
where Instname is a string up to eight alphanumeric characters
long (refer to the Appendix D. "Naming Rules" for more information about naming rules) and
where | DB2DIR | = /usr/lpp/db2_05_00 | on AIX |
|
| = /opt/IBMdb2/V5.0 | on HP-UX or Solaris |
Note: | To create instances on SINIX, SCO OpenServer and Silicon Graphics IRIX operating systems, see "Creating an Instance of the Product". |
The syntax of the db2icrt command is:
where:
Notes:
Note: | FencedID may not be root or bin. |
If a server product is installed, the syntax is:
db2icrt -u FencedID InstName
Examples:
db2icrt -u db2fenc1 db2inst1
db2icrt -u db2inst1 db2inst1
db2icrt db2inst1
When an instance is created, its name is also added to the list of instances on the system.
The db2icrt command creates the INSTHOME/sqllib
directory, where INSTHOME is the home of the instance owner.
![]() |
You should not create files or directories under INSTHOME/sqllib directory other than those created by DB2 products. This avoids a potential loss of data if an instance is deleted. There is one exception. If your system supports fenced User Defined Functions and fenced Stored Procedures, put the fenced User Defined Functions and the fenced Stored Procedures applications in the INSTHOME/sqllib/function directory.
|