Cooperative: Another way to install DB2 V8.1 on the UNIX platform
Author: Philip Nelson Taken: IDUG Journal in January 2004
This document describes how to install and configure DB2 Version 8.1 on the UNIX platform without using the "DB2Setup" command ("DB2 Quick Beginnings" manual). Why not use standard methods? At least two good reasons:
The "DB2Setup" utility in Version 8.1 requires an X window environment because the utility is a graphical, Java-based application. You may not want to just install X on the database server because you want to install the database. Or you can install remote database software for clients using SSH (Secure Shell) command line interface. This allows X, but the speed is very slow. The "DB2Setup" utility will handle the squares of the installation. Therefore, if you want to install a slightly different components, or for a installation utility, you can't use "db2setup". This is especially in the Linux environment, as this environment is not all published using the Red Hat Package Manager (RPM) installation system.
Although the installation process described here is much more complicated, this approach provides a certain degree of flexibility, which is not possible when using "db2setup". This method also brought another benefit, which is to allow us to inspect the working principle of DB2 foundation. In this article, we will focus on installing DB2 V8.1 Personal Edition on Linux. The Linux distribution here has both mandrake 9 (RPM), and DEBIAN "Woody". However, to convert these installation instructions for use in other UNIX platforms or other versions of DB2, it is also quite easy. And if you are using Microsoft Windows, what will it? I think you will definitely ask such questions. If so, the standard graphical installer is no alternative.
Software Installation
The first task for installing DB2 for UNIX systems is to install system software. There are two options here:
If we have an RPM-based Linux system (or want to use standard installation utilities on other platforms), and we like to use the "DB2_INSTALL" command. If we do not have RPM-based Linux systems (or want to use non-standard installation tools on other platforms), or you need non-English version of the system, you must manually install each DB2 package.
Use "db2_install"
"DB2_INSTALL" script is located under the root of the installation medium ("DB2Setup" in the same directory). This is a text-based installation process for installing a set of standard (pure English) components. Enter the following line to run the script from its location:
./db2_install
This script first detects the type of operating system and then runs a "DB2_INSTALL" specific to the operating system from the directory DB2 /
As mentioned earlier, if we want to use a non-standard installation utility, or if you want to install a non-English version, you must manually install each package. All installed packages are stored in the operating system-specific directory (for example, DB2 / Linux). For all languages, most packages are standard, but there are three sets of unique language versions: Control Center Help, Java Help and Product Messages. The package file format of these packages is:
IBM_DB2CHXX81-8.1.0-0.I386.0-0.I386.0-0.I386.RPM: Product Messages
Where XX is a language code (for example, EN represents English, ES represents Spanish, and so on. If you are using a standard RPM installation utility, use a standard RPM installation command (rpm -uvh rpmfile) to install the language-independent package and one of the language-specific packages. If you want to install on a non-RPM Linux system (for example, Debian), use the "Alien" command to convert the RPM to the Debian package. This process may take a long time, so a wise practice is to convert only those wanted to install (ie, not converting all language files). The easiest way is to copy the package you want to install to a temporary directory, then run the following script:
#! / bin / bashcd / for f in /temp/directory/*.rpmdoalien -d $ fdone
This will generate a set of .deb (debian installation) files, then you can use these files with the following command:
DPKG -I FileName.deb
Although all files can be used directly to convert and install all files (by specifying an additional -i option in the above scripts), but more secure is to convert all files first, then manually install each file. Once this process is completely tested, it is believed that there is no error in the process of converting. Rpm to a .deb format, the entire process can run automatically.
This ends the installation of the system software.
Configure the database server
Once the system software is installed, we need to perform a large number of configuration tasks, which are usually done by "DB2Setup" in "behind the scenes":
Create an instance and manage the server user ID. Create an instance and management server. Create a link to the DB2 shared library. Automatically start the instance when the system is started.
In this article, we assume that the system software has been installed in the standard installation directory and wants to create an instance DB2Inst1 and a management server.
Create user ID
We use the following standard operating system command to create user ID and its related group: GroupAdd DB2GRP1GROUPADM1USERADDD -G DB2GRP1 -M -D / HOME / DB2IST1 -P Password DB2INST1USERADD -G DB2FGRP1 -M -D / Home / DB2FENC1 -P Password DB2FENC1USERADD -G Dasadm1 -M -D / Home / Dasusr1 -P Password Dasusr1
Of course, we will not set the password as a significant content like "Password" (or "IBMDB2", or other similar content).
Create an instance
First we use the following command to create a management server instance:
/opt/ibm/db2/v8.1/instance/dascrt -u dasusr1
The following command will then create DB2Inst1:
/opt/ibm/db2/v8.1/instance/db2icrt -u db2fenc1 db2inst1
This command has some optional parameters. In particular, the -a option allows us to specify a authentication mechanism different from the default "server".
Create a shared library link
This step produces links to the DB2 shared library in the standard library path, allowing these DB2 shared libraries available within the system. If you have an early version of DB2 on the server, you should be careful in this step because this step will replace the link to the earlier version. These links are mainly used for application development. But we found that if these links are not set correctly, we will encounter problems associated with certain supplied software. We also specifically discover that unless these links are set, it is not as effective as in normal conditions. To set the library link, you can use the following command:
/opt/ibm/db2/v8.1/cfg/db2ln
Arrange an automatic instance start
Compared with the early versions of DB2, the process of automatically launching the DB2 instance in the system has changed. Previously by running a script called /etc/rc.db2 using inittabs, starting an instance as required. Not like this now. Instead, it is now running a daemon named "DB2 Fault Monitor Coordinator" (DB2FMCD) from inittab: The following line should be placed at the bottom of / etc / inittab:
FMC: 2345: Respawn: /opt/ibm/db2/v8.1/bi n / db2fmcd # DB2 Fault Monitor Coordinator
This does not start any instance. To launch an instance, you must run the following command as the DB2 instance owner to set the instance variable of each DB2 instance:
DB2SET DB2AUTOSTART = YES
This completes the basic configuration of the DB2 server. If you don't want just because you want to start a newly created instance, restart your computer, then just start a new instance from the command line using "DB2Start".
Conclude
We have already seen that there is still no graphics tool, or even the standard package manager, can still be installed on the UNIX platform. While achieving the place where DB2 is not available in standard installation is available, we have to inspect the internal working principle of the DB2 installation process, and in the past, we can only be mistaken.
Page
About author