Create multiple database instances
Create multiple instances of a database for a more versatile database environment.
Before starting
This is an optional procedure. If you need to have only one database instance (or, in Oracle terminology, one database), you can skip this task.(Windows™ only) Complete the following steps for each instance that you plan to create:
- Create a new user and add it to the Administrators and DB2ADMNS groups.
- Remove the user account from the Users group.
- In the Local Security Policy utility, add these rights to the new user:
- Act as part of the operating system
- Adjust memory quotas|Increase quotas for a process
- Create a token object
- Debug programs
- Lock pages in memory
- Log on as a service
- Replace a process level token
Note: The new account uses the local system as the domain.
About this task
A database environment with multiple instances provides the flexibility to tune an instance for a particular configuration, use different instances for development and production, restrict access to sensitive information, and optimize the database manager configuration for each instance. For example, if you need to make changes to one of the instances, you can restart just that instance instead of the whole system. Similarly, if you need to take an instance offline, only the databases that are hosted on that instance are unavailable during the outage, while your other databases are unaffected.DB2 only. If you are hosting IBM DB2 on a single 32-bit system, you should create multiple DB2 instances. A single DB2 instance on a 32-bit system can manage a maximum of 2 GB of data in memory and this can become a constraint when you install multiple IBM Connections applications. At a minimum, create two DB2 instances when you are installing all the applications, but also consider creating separate instances for the Activities and Communities databases because they are usually the most memory-intensive databases. Ideally, you would install one DB2 instance per IBM Connections application. If you are hosting DB2 on a 64-bit system, you do not need to create multiple instances, provided the system has sufficient RAM.
Multiple instances require additional system resources.
To create multiple instances of a database...
Choose your database type:
- DB2
Notes:
- For each instance that you want to create, log in as the instance owner before creating the instance.
- Use the DB2 Command Line Processor to enter commands.
- After creating the instance, add the instance to the user environment variable. The instance is then visible in the DB2 Control Center.
- AIX :
An instance called db2inst1 is created during DB2 installation.
- Create a group for DB2:
mkgroup db2iadm1
- Create a user for DB2:
mkuser groups=db2iadm1 db2instNwhere db2instN is the name of a user. DB2 prompts you to enter a password for the user. Repeat this step to create enough users to match the number of database instances.
- Create DB2 instances:
Login with root user and go to /opt/IBM/db2/V9.5/instance.
./db2icrt -u db2instN db2instNwhere db2instN is the name of a user and also the name of an instance. Repeat this step to create enough instances to match the number of databases.
- Set the port number of the instance:
Edit the/etc/services file and add the following line:
db2c_<instance_name> <instance_port>/tcpwhere <instance_name> is the name of the instance and <instance_port> is the port number of that instance. Repeat this step for each instance.
- Set the communication protocols for the instance:
db2 update database manager configuration using svcename db2c_<instance_name> db2set DB2COMM=tcpip db2stop db2startRepeat this step for each instance.
- Edit your firewall configuration to allow the new instances to communicate through their listening ports.
Linux™: An instance called db2inst1 is created during DB2 installation, along with three users: db2inst1, db2fenc1, and dasusr1.
- Create groups for DB2:
groupadd -g 999 db2iadm1 groupadd -g 998 db2fadm1 groupadd -g 997 dasadm1
Create users for DB2 in the db2iadm1 group:
useradd -u 1100 -g db2iadm1 -m -d /home/db2instN db2instN -p db2instXwhere db2instN is the name of a user and db2instX is the password for that user. Create enough users to match the number of database instances.
Create the db2fenc1 user for DB2 in the db2fadm1 group:
useradd -u 1101 -g db2fadm1 -m -d /home/db2fenc1 db2fenc1 -p db2instX
Create the dasusr1 user for DB2 in the dasadm1 group:
useradd -u 1102 -g dasadm1 -m -d /home/dasadm1 dasusr1 -p db2instX
Create new DB2 instances:
Login with root user and go to /opt/ibm/db2/V9.5/instance.
./db2icrt -u db2fenc1 db2instN
Create enough instances to match the number of databases.
Set the port number of the instance:
Edit the /etc/services file and add the following line:
db2c_<instance_name> <instance_port>/tcpwhere <instance_name> is the name of the instance and <instance_port> is the port number of that instance. Repeat this step for each instance.
Log in as the database instance and set the communication protocols for the instance:
su - db2instN db2 update database manager configuration using svcename db2c_<instance_name> db2set DB2COMM=tcpip db2stop db2startRepeat this step for each instance.
Edit your firewall configuration to allow the new instances to communicate through their listening ports.
Microsoft™ Windows:
- Create an instance...
db2icrt <instance_name> -s ese -u <db2_admin_user>
where <instance_name> is the name of the instance and <db2_admin_user> is the user account for that instance.
- Set the port number of the instance:
Edit the C:\WINDOWS\system32\drivers\etc\services file and add the following line:
db2c_<instance_name> <instance_port>/tcp
- Set the current instance parameter:
set DB2INSTANCE=<instance_name>
- Set the communication protocols for the instance:
db2 update database manager configuration using svcename db2c_<instance_name> db2set DB2COMM=npipe,tcpip db2stop db2start
- Edit your firewall configuration to allow the new instances to communicate through their listening ports.
Oracle: Each database is a database instance.
Use the Oracle Database Configuration Assistant (DBCA) to create Oracle a new database:
- Open the DBCA tool:
- AIX or Linux:
- Change login user to oracle
- $ export [ [ORACLE_HOME]]=...
- $ export PATH=$PATH:$ORACLE_HOME/bin
- $ export DISPLAY=<hostname:displaynumber.screennumber>
Note: where <hostname:displaynumber.screennumber> represents the client system, monitor number, and window number. For example: localhost:0.0
- $ dbca &
- Windows:
- Click Start
- Select Oracle -> <Oracle_home_name> -> Configuration and Migration Tools -> Database Configuration Assistant.
where <Oracle_home_name> is the Oracle home on your system. For example: OraDB10g_Home1.
- On the Operations page, accept the default option to Create a database and click Next.
- On the Database Templates page, accept the General Purpose default option and click Next.
- On the Database Identification page, enter LSCONN in the Global Database Name and SID fields and click Next.
- On the Management Options page, accept the default option to Configure the database with Enterprise Manager and click Next.
- On the Database Credentials page, enter the database password and click Next.
- On the Storage Options page, accept the File System storage option and click Next.
- On the Database File Locations page, accept the Database File Locations from Template default option and click Next.
- On the Recovery Configuration page, accept the Specify Flash Recovery Area default option and click Next.
- On the Database Content page, accept the defaults and click Next.
- On the Initialization Parameters page, click the Character Sets tab and select the Use Unicode (AL32UTF8) option. Click Next.
- On the Database Content page, accept the defaults and click Next.
- On the Creation Options page, accept the Create Database default option and click Next.
SQL Server
- Run the SQL Server installation wizard. On the Instance Name panel of the installation wizard, select Named instance, and then specify a new instance name in the field.
- Edit your firewall configuration to allow the new instances to communicate through their listening ports.
Notes:
- Use the same collation that you are using for the application databases; that is: Latin1_General_BIN
- For Authentication mode, use Mixed Mode (Windows Authentication and SQL Server Authentication)
- If you receive any warnings or errors from the System Configuration Check dialog, correct them from the SQL Server 2005 instance installation
For more information, go to the Microsoft SQL Server Developer Center web site to view the SQL Server documentation:
What to do next
When you create multiple database instances, install the databases on each instance. If you are using the database wizard to install the databases, prepare and run the database wizard once for each instance and if you are using the scripts to install the databases, run the scripts once for each instance.
Parent topic
Create databases
Related tasks
Registering the DB2 product license key
Create a dedicated DB2 user
Create databases with the database wizard
Create databases with SQL scripts
Enable NO FILE SYSTEM CACHING for DB2 on System zRelated reference
http://publib.boulder.ibm.com/infocenter/db2luw/v9/topic/com.ibm.db2.udb.admin.doc/doc/c0004900.htm![]()