The version I tested was the IBM DB2 Universal Database for Linux, Version 5.2. (Version 6.1 is now available.) It consisted of the following products:
DB2 was developed under the 5.1 Red Hat distribution, but should work under any distribution with the following prerequisites.
The installation process was relatively straightforward. You need to install with superuser privileges. First, mount the CD-ROM and change to the directory where it is mounted. Then enter the command ./db2setup to start the installer program. I recommend using the -d flag, which will generate a trace file called /tmp/db2setup.trc, which you can examine in case anything goes wrong. A db2setup.log file will also be generated in either case. My first attempt failed because the installation program assumed that /usr/sbin was in my superuser path. This might not be the case if you log in as a normal user and issue the su command. You can fix this by temporarily adding this directory to your path. Under bash, for example, you would issue the command:
export PATH=$PATH:/usr/sbinThe db2setup program is a menu-driven ncurses-type install. You should decided before hand which components you plan on installing, depending on whether you are installing a database server or just a client.
The simplest situation is when the client and server are both installed locally. You need to log on to the system as the user you created when you made a DB2 instance during the installation. This is most likely db2inst1, if you accepted the defaults. Move to the /home/db2inst1/sqllib directory and execute the . db2profile script if you are using a bash or pdksh shell. If you are using csh, then execute .db2cshrc. This will set up some environmental variables. You can append this script to your .profile file to run automatically upon login. If you haven't created a sample database during the install process, move to the /home/db2inst1/sqllib/misc directory and execute ./db2sampl, which will create a test database called ``sample''. This can take a few minutes. Now you're ready to connect to the database and interact with it. One way to do this is to use the Command Line Processor. You can do this in Command Line Mode simply by prefacing all your commands with db2. An advantage to using this mode is you remain in your shell. You can also enter the Interactive Input Mode, by entering the db2. For example, in the Command Line Mode enter db2 connect to sample. If everything is configured correctly, you should see this on your console:
Database Connection Information Database server = DB2/LINUX 5.2.0 SQL authorization ID = DB2INST1 Local database alias = SAMPLE
If your client is connected to the server over TCP/IP, you can use a Java applet from your browser to access the database. To do so, you need to use the Command Line Processor to catalog the remote node for the client. After that, you can open the applet in your browser by selecting Open Page from the File Menu and choosing /home/db2inst1/java/prime/db2webcc.htm.
I've tried to provide enough information to get you started. One of the best things about this database is the huge amount of information IBM provides in the on-line books as well as at their web site. There were a few features not available in the 5.2 beta I tested, and these were documented in README.linux. Support from the big-name database providers removes yet another barrier to the widespread use of Linux in corporations, and DB2 on Linux looks like a winner.
John Kacur (jkacur@acm.org) has a B.A. in Fine Arts. After two years studying Russian in the Ukraine and another two years teaching English in Germany, John returned to Canada to pursue a second degree in Computer Science.