This section describes the remaining steps that you have to perform to
get your partitioned database system up and running.
| DB2 provides two environment profiles in the sqllib directory:
In Version 7, these environment profiles can no longer be modified. To modify the DB2 environment in Version 7, first create, then modify the following profiles: sqllib/userprofile and sqllib/usercshrc. These environment profiles will be called after the DB2 environment is initialized. |
| If you are using NIS or NIS+, before you create an instance, there must
be an entry for the instance in the etc/services file. For example, if
you want to create an instance for the user db2inst1, you require
an entry similar to the following:
DB2_db2inst1 60000/tcp |
This section describes how to create an instance using the DB2 Installer program. We recommend that you use DB2 Installer program to create an instance because it will configure the instance automatically for communications.
For information on how to create an instance using the db2icrt command, and configure it for communications, refer to the Administration Guide and the Installation and Configuration Supplement online document.
To create an instance using the DB2 Installer program, perform the following steps:
Step 1. | Log on as a user with root authority on a machine where you installed DB2 Enterprise - Extended Edition (DB2 EEE). |
Step 2. | Enter the /opt/IBMdb2/V7.1/install/db2setup command to start the DB2 Installer program. The DB2 Installer windows opens. |
Step 3. | Select the Create option and press the Enter key. Press the Tab key to change a highlighted option and the Enter key to select or deselect the option you want. For more information on using the DB2 Installer program, or for help with any task you are performing with the DB2 Installer, select the Help option and press the Enter key. |
Step 4. | Select the Create a DB2 Instance option and press the Enter key. |
Step 5. | Fill in all of the fields for the username that you created for the instance owner in Before You Begin. |
Step 6. | Select the OK option and press the Enter key. |
Step 7. | Fill in all of the fields for the username that you created to execute fenced UDFs and stored procedures in Before You Begin. |
Step 8. | Select the OK option and press the Enter key. You are returned to the Create DB2 Services window. |
Step 9. | Select the OK option and press the Enter key. You will receive a warning message that you have not yet created the Administration Server, you can ignore this message. The Summary Report window opens. |
Step 10. | Select the Continue option and press the Enter key. The DB2 Installer program will prompt you to complete this task. When you have completed this task, you are returned to the DB2 Installer window. |
Step 11. | Select the Close option and press the Enter key.
|
This section describes how to create the Administration Server using the DB2 Installer program. If you are planning to use the Control Center to administer your partitioned database system, you require a running Administration Server.
We recommend that you use the DB2 Installer program to create the Administration Server because it will configure the Administration Server automatically for communications. For information on how to create an instance using the dasicrt command, and configure it for communications, refer to the Administration Guide and the Installation and Configuration Supplement online document.
To create the Administration Server using the DB2 Installer program, perform the following steps:
Step 1. | Log on as a user with root authority to a machine where you installed DB2 Enterprise - Extended Edition (DB2 EEE). |
Step 2. | Enter the /opt/IBMdb2/V7.1/install/db2setup command to start the DB2 Installer program. The DB2 Installer windows opens. |
Step 3. | Select the Create option and press the Enter key. |
Step 4. | Select the Create the Administration Server option and press the Enter key. |
Step 5. | Fill in the fields for the username that you created for the Administration Server in Before You Begin. |
Step 6. | Select the OK option and press the Enter key. You are returned to the Create DB2 Services window. |
Step 7. | Select the OK option and press the Enter key. The Summary Report window opens. |
Step 8. | Select the Continue option and press the Enter key. The DB2 Installer program will prompt you to complete this task. When you have completed this task, you are returned to the DB2 Installer window. |
Step 9. | Select the Close option and press the Enter key.
|
The node configuration file (db2nodes.cfg), located in the INSTHOME/sqllib/ directory (where INSTHOME is the home directory of the instance owner) contains configuration information for all the database partition servers that are participating in the instance. There is a db2nodes.cfg file for every multipartition instance. This file contains one entry for each database partition server for a particular DB2 instance. By default, when you create an instance, the db2nodes.cfg file is automatically created and an entry for the workstation where the instance was created is added to the file.
The format of the db2nodes.cfg file is as follows:
nodenum hostname logical port netname
where:
When you want to scale your partitioned database system, you add an entry for each database partition server to the db2nodes.cfg file. The nodenum value that you select for additional database partition servers must be in ascending order, however, gaps can exist in this sequence. You may choose to put a gap between the nodenum values if you plan to add an MLN and wish to keep them logically grouped together in this file.
This entry is required.
This entry is required.
| You can specify the name of a high speed interconnect for the hostname value. This allows the db2start, db2stop, and db2_all commands to use the high speed interconnect for communications. |
If you are not using MLNs and you specify an entry for the netname field (see below), the entry must be set to 0.
If you are using MLNs, the logical port value you specify must start at 0 and continue in ascending order with no gaps (for example, 0,1,2).
Furthermore, if you specify a logical port entry for one database partition server, you must specify a logical port for each database partition server listed in your db2nodes.cfg file.
This field is only optional if you are not using MLNs or a high speed interconnect.
If an entry is specified for this field, all communications between database partition servers (except for communications as a result of the db2start, db2stop, and db2_all commands) are handled through the high speed interconnect.
This parameter is only required if you are using a high speed interconnect for database partition communications.
For example, when you created the DB2 instance db2inst1, on the workstation called workstation1, the db2nodes.cfg file was updated as follows:
0 workstation1 0
If you were not using a clustered environment and wanted to have four database partition servers on one physical workstation called workstation1, you would update the db2nodes.cfg file as follows:
0 workstation1 0 1 workstation1 1 2 workstation1 2 3 workstation1 3
If you want your partitioned database system to contain two physical workstations, called workstation1 and workstation2, you would update the db2nodes.cfg file as follows:
0 workstation1 0 1 workstation2 1
If you want your partitioned database system to contain two physical workstations, called workstation1 and workstation2, and workstation1 is running 3 database partition servers, you would update the db2nodes.cfg file as follows:
0 workstation1 0 1 workstation1 1 2 workstation1 2 3 workstation2 0
If you want your partitioned database system to contain two physical workstations, called workstation1 and workstation2 (with workstation2 running 2 database partition servers), and use a high speed interconnect called switch1 and switch2, you would update the db2nodes.cfg file as follows:
0 workstation1 0 switch1 1 workstation2 0 switch2 2 workstation2 1 switch2
To update the db2nodes.cfg file, perform the following steps:
Step 1. | Log on to the instance as a user with system administrative (SYSADM) authority (by default, the username that you created for the instance owner). For more information, see Working with the System Administrative Group. | ||
Step 2. | Ensure the DB2 instance is stopped by entering the
INSTHOME/sqllib/adm/db2stop command, where
INSTHOME is the home directory of the instance owner.
| ||
Step 3. | Edit the db2nodes.cfg file and add an entry for each database partition server that will participate in your partitioned database system. | ||
Step 4. | Enter the INSTHOME/sqllib/adm/db2start command, where INSTHOME is the home directory of the instance owner. | ||
Step 5. | Log out.
|
For more information on the db2nodes.cfg file, refer to the Administration Guide.
This section describes how to enable communications between the database partition servers that participate in your partitioned database system. Communications between database partition servers is handled by the Fast Communications Manager (FCM). To enable FCM, you must ensure that the port or port range that you reserve in the /etc/services file is available on every workstation in your partitioned database system.
When you created a DB2 instance using the db2setup utility, an entry similar to the following was placed in the /etc/services file:
DB2_instance_name 60000/tcp
where instance_name is the name of the instance that you created.
This entry must be of the form:
DB2_instance_name port_number
where:
| The port 60000 is the default FCM port used for any instance that was created using the db2setup utility. |
For example, if you created an instance called db2inst1, the entry placed in the /etc/services file would be:
DB2_db2inst1 60000/tcp
If you are planning to run multiple logical nodes (MLNs), you must reserve a range of consecutive ports (one for each logical node). The consecutive port range that you reserve must be equal to the number of MLNs on the database partition server that is running the most MLNs in your partitioned database system. To reserve a port range for FCM to use, you will need to add another entry to the /etc/services file that specifies the end of the port range. This entry must be of the format:
DB2_instance_name_END port_number
For example, if you have a database partition server that is running 4 database partitions, you will need to specify 4 consecutive ports as your port range. In our example, the entry in the /etc/services file would be:
DB2_db2inst1 60000/tcp DB2_db2inst1_END 60003/tcp
| You can add a comment that describes these entries using the
# comment identifier. For example:
DB2_db2inst1 60000/tcp # This is an EEE instance DB2_db2inst1_END 60003/tcp # that is running 4 MLNs. |
To enable your partitioned database system for FCM communications, perform the following steps on each machine that will participate in your partitioned database system:
Step 1. | Log on to the workstation where you created a DB2 instance as a user with root authority. |
Step 2. | Open the /etc/services file and verify that the port or port range entries that you have reserved for FCM communications are there. |
Step 3. | Log out. |
Step 4. | Log on to each additional workstation in your partitioned database system and add the same entries to the /etc/services file that you added to the /etc/services file on the workstation where you created the DB2 instance. |
Step 5. | Log out.
|
For more information on FCM communications, refer to the Administration Guide.
In a multipartition instance, each database partition server must have the authority to perform remote commands on all the other database partition servers in the partitioned database system. To do this, you can either create an INSTHOME/.rhosts file (where INSTHOME is the home directory of the instance owner) or an /etc/hosts.equiv file.
If you decide to create an /etc/hosts.equiv file, you will have to create this file on every workstation that participates in your partitioned database system.
If you want to use the INSTHOME/.rhosts file, it should contain entries similar to the following:
workstation1.torolab.ibm.com db2inst1 workstation2.torolab.ibm.com db2inst1 switch01.torolab.ibm.com db2inst1 switch02.torolab.ibm.com db2inst1
For more information about the INSTHOME/.rhosts or the /etc/hosts.equiv file, refer to your operating system's documentation.
You can use the db2ln command to create links for the DB2 files to the /usr/lib directory, and for the include files to the /usr/include directory, for a particular version and release level of DB2 Enterprise - Extended Edition (DB2 EEE). Links can be established for only one version of DB2 on a given system.
You may want to create these links if you are developing or running applications and want to avoid having to specify the full path to the product libraries and include files.
To create links for the DB2 files, perform the following steps:
Step 1. | Log on to each workstation as a user with root authority. |
Step 2. | Enter the following command to create the links for the DB2 files: /opt/IBMdb2/V7.1/cfg/db2ln |
Step 3. | Log out.
|
This section describes how to start and configure the Administration Server. Before you can use the Client Configuration Assistant (CCA) or the Control Center to administer your partitioned database system, you must ensure the Administration Server is started and the db2cclst daemon is running on every system in your partitioned database system.
To enable your partitioned database system so that it can be administered by the CCA or the Control Center, perform the following steps:
Step 1. | Log on the workstation as a user with root authority. |
Step 2. | Open the /etc/services file and verify that the port was reserved for the Administration Server. |
Step 3. | Log out. |
Step 4. | Log on to the workstation with the username that you created for the Administration Server (for example, db2as). |
Step 5. | Enter the following command to start the Administration Server DASINSTHOME/sqllib/bin/db2admin start where DASINSTHOME is the home directory of the Administration Server. |
Step 6. | Enter the following command to start the db2cclst daemon DASINSTHOME/sqllib/bin/db2cclst where DASINSTHOME is the home directory of the Administration Server. |
Step 7. | Ensure that the db2cclst daemon is running by entering the following command: ps -ef | grep db2cclst Error information for the db2cclst daemon is returned to the syslog file. Errors are written to this file, instead of the db2diag.log file, because the daemon runs independent from the instance. |
Step 8. | Log out.
|
For more information, refer to the Administration
Guide.
| You can set up the db2cclst daemon to start when a workstation
is restarted by adding the follow command to the /etc/innitab file.
cl:234:once:DASINSTHOME/sqllib/bin/db2cclst where DASINSTHOME is the home directory of the Administration Server. |
This section describes how to verify that DB2 Enterprise - Extended
Edition (DB2 EEE) is installed and configured correctly by creating the
SAMPLE database on your system, and accessing data from the
database. For the purposes of testing the installation and
configuration of DB2 EEE, you should only create the SAMPLE
database for your instance after you have defined all of the database
partition servers that will participate in your partitioned database
system. If you want to add a database partition server to an instance
where a database has already been created, there are other activities that you
will need to perform. For more information, refer to the Administration Guide.
| To complete the steps in this section, we recommend that you create a
separate file system (for example, /database) on each
physical system that participates in your partitioned database system.
For more information on how to create a file system, refer to your operating system's documentation. |
To verify that you have installed and configured DB2 EEE, perform the following steps:
Step 1. | Log on to the system as a user with system administrative (SYSADM) authority (by default, the username that you created for the instance owner). For more information, see Working with the System Administrative Group. | ||
Step 2. | Enter the following command to create the SAMPLE database: INSTHOME/sqllib/bin/db2sampl path where:
For example, to create the SAMPLE database on the /database file system, enter the following command: INSTHOME/sqllib/bin/db2sampl /database The SAMPLE database is automatically cataloged with the database alias SAMPLE when it is created. | ||
Step 3. | Start the database manager by entering the db2start command. | ||
Step 4. | Enter the following commands to connect to the SAMPLE database, retrieve a list of all the employees that work in department 20, and reset the database connection: db2 connect to sample db2 "select * from staff where dept = 20" db2 connect reset For information about entering DB2 commands, see Entering Commands Using the Command Center or Entering Commands Using the Command Line Processor.
|
This section describes how to install the license key for the DB2
product that you installed.
| Your Proof of Entitlement and License Information booklets identify the products for which you are licensed. |
/opt/IBMdb2/V7.1/cfg/db2licm license_filename
where license_filename is the full pathname and filename for the license file that corresponds to the product you have purchased.
The name of the license file for this product is db2udbeee.lic.
For example, if the CD-ROM is mounted in the /cdrom directory and the name of the license file is db2udbeee.lic, you would enter the following command:
/opt/IBMdb2/V7.1/cfg/db2licm /cdrom/db2/license/db2udbeee.lic
|
You can also use the Control Center to manage and monitor your DB2 licensing agreement and to monitor database usage. To manage licensing using the Control Center, perform the following steps:
|