Revision History | ||
---|---|---|
Revision 2.0 | 2007-07-15 | Revised by: idmh |
Complete revision of document to cover DB2 Express-C 9 and new Linux distrubution levels | ||
Revision 2.0.1 | 2007-08-22 | Revised by: idmh |
Minor update to include instance restart instructions for Ubuntu 7.04 |
This HOWTO is intended for anyone interested in installing and using IBM DB2® Express-C 9 on a Linux® distribution. The goal is to include as many distributions as possible, on both 32–bit and 64–bit architectures, however both hardware and time resources are constrained, so if you come across a distribution/architecture combination that isn't covered in here or if you encounter a problem that isn't addressed, send a note to db2howto@gmail.com and I'll try to help verify or resolve your issue and add the information here.
The information found in this document is based on personal experiences installing and configuring IBM DB2 9 Express-C.
No liability for the contents of this document is accepted. Use the concepts, examples and information at your own risk. There may be errors and inaccuracies that could be damaging to your system. Proceed with caution, and, although it is highly unlikely that accidents will happen because of following advice or procedures described in this document, the author does not take any responsibility for any damage claimed to be caused by this document.
All copyrights are held by their by their respective owners, unless specifically noted otherwise. Use of a term in this document should not be regarded as affecting the validity of any trademark or service mark. Naming of particular products or brands should not be seen as endorsements.
This HOWTO is not official IBM documentation, and cannot be construed as such. IBM accepts no responsibility, liability or coverage for the material or instructions contained in this HOWTO. The views expressed in this document are those of the author, and not IBM Corporation.
Copyright (c) 2007 IBM Corporation.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with the Invariant Sections being "Disclaimer" and "About the Authors". This document is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without ebaseven the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. A copy of the license is included in the section entitled "GNU Free Documentation License".
Ian Hakes is the current owner and maintainer of this HOWTO. Please send all suggestions for improvement, criticisms or questions to db2howto@gmail.com.
As always, big thanks to Dan Scott, who continues to be an invaluable resource to both myself and the open source community at large.
I'd also to thank: Rav Ahuja, Boris Bialek, Jason Chan, Ryan Chase, Irina Delidjakova, Leon Katsnelson, and Darin McBride for their support, input and patience while putting this document together.
Most of all, I must thank my wife and children for allowing me to spend weeknights and weekends on my laptop and test machines getting this document together. I couldn't have done it without their love and support.
Ian Hakes, has worked for IBM DB2 since 1999. Currently, he is involved in technical marketing for the DB2 Express-C product, developing technical documentation and evangelizing DB2 Express-C. Before that, he was the technical team lead for the DB2 Information Development department, and the writer responsible for the DB2 SQL Reference manual. His free time is spent mainly typing on computers, thinking about how much nicer it would be to watch a movie or to be sailing.
In March of 2006, IBM made a strategic decision to release their best of breed DB2 database as freely available software. It is important to realize that the DB2 Express-C edition is a gratis, "free as in beer" software product, meaning that, although the source code is not distributed as part of the product, this edition of DB2 is freely useable and full featured, not "crippled" in any way.
A number of other large enterprise class databases have also opted to release versions of their software, but DB2 Express-C is the only one that places no restrictions on the size or number of the databases that can be created. The one restriction to using DB2 Express-C is that it can only be run on systems with 2 physical CPUs and 4 GB of RAM. Since the majority of developers and small businesses run systems within these specifications, DB2 Express-C makes a great choice for developers and business applications. In this HOWTO, all testing and discussions are based on machines that fall within these system specifications.
With DB2 Express-C, you get a free, low maintenance database application that is easy to install and run, with a number of powerful features, as well as performance typically found in much more expensive enterprise-level database software.
Feature-wise, what's included in the DB2 Express-C download is impressive. To start with, you get the same database engine code as the full enterprise-level database server, with no connection restrictions. Also included is the full suite of commmand line and graphical user tools to help adminster databases and develop database applications. You also get autonomic maintenance features, along with development APIs and drivers for C/C++, Java, PHP, Perl and Ruby on Rails.
The cherry on top is the inclusion of IBM's new pureXML™ hybrid technology that allows you to store XML data natively inside the database, without any shredding or decomposition of the data. This is a feature that is typically an add-on to the other editions of DB2 9, and IBM is giving it to users of the Express-C edition completely free of charge. Sometimes it's good to be the little guy.
There are three architecture choices available for Linux: the 32-bit version, the 64-bit version, and the PowerPC version, giving you the option of using the best hardware you have available for your DB2 installation.
Prerequisites are the hardware and software elements needed on your system before you can install and use DB2 Express-C 9. This section covers:
Take into account the disk space requirements before you install and configure DB2 on your distribution:
Table 1. Disk space requirements
Install type | Description | Required disk space |
---|---|---|
Typical | DB2 is installed with most features and functionality, including graphical tools such as the Control Center. | 460 to 560 MB |
Compact | DB2 is installed with basic features and functionality, but without the graphical tools. | 380 to 460 MB |
Custom | This option allows you to select the features and functionality that you want to install. | 320 to 820 MB |
It's important to allocate enough disk space for the software, along with the product documentation (if desired) and the databases you create.
In DB2 9, product documentation is accessed through the DB2 Information Center, either via the web, or as a local system installation. To install this locally requires at least 100 MB when installing the core English language files. Additional space is required for other additional languages. If disk space is an issue, you can configure DB2 to access the Information Center from the Web. More detail about this is provided in Installing the DB2 Information Center.
We recommend that you should allocate a minimum of 512 MB of RAM for DB2 Express-C 9, and additional memory should be allocated for other software and communication processes. When determining memory requirements, consider the following points:
For a list of all the distributions that are officially supported, as well as the latest information about kernels, libraries, integrated cluster environments, and papers, visit the DB2 for Linux validation web site listed in Resources.
Depending on your DB2 requirements, you may be required to install additional software packages for DB2 to function properly. Make sure that these software packages are installed prior to using DB2.
X Window System software, capable of rendering a graphical window manager (KDE, Gnome, etc.). You will need this if you want to use the DB2 graphical installer, or any of the DB2 graphical tools.
A web browser, to view topics in the DB2 Information Center.
If you are using NIS or NIS+ for security authentication on your system, you must create DB2 user accounts before installing DB2.
Additional packages, as outlined in the following table:
Table 2. Package requirements
Package name | RPM name | Description |
---|---|---|
compat-libstdc++ | compat-libstdc++ | Required by 64-bit architectures only. Required for backwards compatibility with standard C++ libraries used by DB2. |
nfs-utils | nfs-utils (version 1.0 or later) | Network File System support package. It allows access for local files to remote machines. Required for systems utilizing NFS mounted drives. |
rpm -qa compat-libstdc++* |
To install these packages on Red Hat Linux, use the Red Hat Linux installation CDs and the rpm command, or the up2date utility. For example, to install the compat-libstdc++ package from the Red Hat Linux CD, mount the Red Hat Linux CD #4, and enter this command as root:
rpm -ivh /mnt/cdrom/RedHat/RPMS/compat-libstdc++-296-2.96-132.7.2.i386.rpm |
up2date compat-libstdc++ |
To install these packages on SUSE Linux, you can also use rpm or use the handy YaST (Yet another Setup Tool) utility. For example, to install nfs-utils on SLES 9 using YaST:
Log on as root
From the YaST Control Center, select Software -> Software Management, then use the search "nfs-utils" to find the appropriate packages.
After verifying that your system meets the basic requirements, you should plan your installation by considering installation methods and the creation of users and groups:
After downloading and extracting the tar.gz file, the file tree looks like this:
exp/ -| disk1/ -| db2_install (* command line installation script *) db2setup (* GUI installation launcher *) installFixPack (* not applicable for Express-C *) db2/ -| (* installation and licensing files *) doc/ -| (* install instructions and release notes *) |
You can use three methods to install DB2:
db2setup utility
db2_install utility
a DB2 response file
The db2setup command starts the DB2 Launchpad, a graphical tool that configures and organizes the DB2 installation. It lays down the DB2 filesets, creates and configures DB2 instances, users and groups, communications, the administration database used by the DB2 Tools, and sets up notification processes. The DB2 Launchpad also allows you to create a response file for replicating a particular setup to other systems.
Using db2setup is the best method for less experienced users, because most of the configuration is automatically performed during the installation. As mentioned previously, you require an X Window System capable of rendering a graphical user interface to use db2setup successfully.
The db2_install command script installs all DB2 packages on your Linux system. This method is reliable and commonly used by expert users for installing DB2 on larger, more complex systems. However, tasks such as setting up users and groups, creating instances, tools catalog database creation, and notification setup need to be performed manually after the installation is completed.
One limitation to db2_install is that it only installs user assistance (like help, messages, and tool interfaces) in English, whereas db2setup supports the installation of additional languages. Also, a db2_install installation can take longer (because of the higher number of manual configuration tasks); it requires a higher level of knowledge and skill, and it cannot be used to create response files.
A response file can be created using the DB2 Setup Wizard or by editing an existing DB2 response (.rsp) file. It allows you to install DB2 across multiple machines with consistent installation and configuration settings. A response file installation is fast, because it bypasses the graphical wizard configuration. Another advantage of using a response file instead of the db2_install command is that it creates a Database Administration Server (DAS) on each machine, while with db2_install the DAS must be created manually after installation.
There is a sample response file (db2exp.rsp) included on the installation image that can be modified and used to install DB2, configure users, create instances, set up notification, create the tools catalog, and configure a large number of database management parameters. This is the quickest installation method if you already have all the information you need. Unlike db2setup, the response file installation is not interactive, and it takes longer to prepare the response file initially.
DB2 requires user IDs and groups for database authentication. This section discusses these IDs and groups and how to create them.
DB2 requires a minimum of three users and groups: an instance owner, a fenced user, and the Database Administration Server (DAS) user. You may use the default names provided by the setup utilities, or specify your own user and group names. For example, consider the following default user IDs and group names produced by the DB2 Setup Launchpad:
Table 3. Default user IDs and group names
Required user |
User name |
Group name |
Description |
---|---|---|---|
Instance owner | db2inst1 | db2grp1 | Administers a DB2 instance |
Fenced user | db2fenc1 | db2fgrp1 | Responsible for executing "fenced" user defined functions, such as JDFs and stored procedures. |
DAS user | dasusr1 | dasadm1 | Administers the DB2 Administration Server |
You must have root authority to create users and groups. There are three ways to create a DB2 user ID:
DB2 Launchpad: the DB2 Launchpad installation creates all of the required users and groups for you during installation. The default users and groups that get created are displayed in the table above. This method also gives you the option to specify your own user and group names.
Response file: Users can also be created during a response file installation if you specify user and group information in the response file. For example, consider the following entries in a response file that create the three required users and groups for DB2:
* DAS user DAS_USERNAME = dasusr1 DAS_GROUP_NAME = dasadm1 DAS_HOME_DIRECTORY = /home/dasusr1 DAS_PASSWORD = ****** * Instance-owning user inst1.NAME = db2inst1 inst1.GROUP_NAME = db2grp1 inst1.HOME_DIRECTORY = /db2home/db2inst1 inst1.PASSWORD = ****** inst1.AUTOSTART = YES inst1.AUTHENTICATION = SERVER inst1.SVCENAME = db2c_db2inst1 inst1.PORT_NUMBER = 50001 inst1.FCM_PORT_NUMBER = 60000 inst1.MAX_LOGICAL_NODES = 4 * Fenced user nst1.FENCED_USERNAME = db2fenc1 inst1.FENCED_GROUP_NAME = db2fgrp1 inst1.FENCED_HOME_DIRECTORY = /db2home/db2fenc1 inst1.FENCED_PASSWORD = ****** |
Manually using command line. To use this method, follow these steps:
Log on to your machine as root.
Create groups for the instance owner, the fenced user and the DAS user by using these commands:
groupadd db2grp1 groupadd db2fgrp1 groupadd dasadm1 |
Create a user that belongs to each group and specify the home directory. For example, you can choose to place all home directories in /db2home by entering these commands:
useradd -g db2grp1 -m -d /db2home/db2inst1 db2inst1 -p password1 useradd -g db2fgrp1 -m -d /db2home/db2fenc1 db2fenc1 -p password2 useradd -g dasadm1 -m -d /db2home/dasusr1 dasusr1 -p password3 |
To enable existing system users to act as DB2 instance administrators, you must make a few modifications to the existing user accounts:
Add your user to the db2grp1 group. The SYSADM_GROUP database manager configuration parameter controls who has that level of access for all databases in that instance. You can determine what group is set as the SYSADM group by entering:
db2 get dbm cfg | grep SYSADM_GROUP |
By default, DB2 sets this as the db2grp1 group. To add the user to the SYSADM group, modify the /etc/groups file (as root), adding the user account ID to the line for the DB2 system admin group. For example:
db2grp1:x:102:jackc,ellenp,frankj |
Update the user's profile by adding the following lines to the .bashrc file in the home directory
# The following three lines have been added by the DB2 SYSADM. if [ -f /home/frankj/sqllib/db2profile ]; then . /home/frankj/sqllib/db2profile fi |
After installation, if you wish to grant or revoke access to databases (or other objects), use the "User and Groups" section of the Control Center or the GRANT and REVOKE SQL statements. If you want to see an example, by default the SAMPLE database grants a number of privileges to "PUBLIC".
This chapter covers a typical setup scenario for installing DB2 Express-C on a 32-bit Linux system, using the db2setup installation method.
Ensure that your system meets the software, memory, and disk requirements outlined in Section 5.
You require root authority to perform the installation.
The DB2 Setup Launchpad is a graphical installer. You must have X Window System software capable of rendering a graphical user interface for the DB2 Setup Launchpad to run on your machine.
To install DB2 Express-C 9:
Log on to the system as a user with root authority.
If you are installing from a CD or DVD, enter the command to mount the DB2 installation media. For example,
mount /media/cdrom |
cd /tmp tar zxf db2exc_912_LNX_x86.tar.gz |
Change to the install directory. For the CD/DVD install:
cd /media/cdrom/exp/disk1 |
cd /tmp/exp/disk1 |
Run the db2setup command.
./db2setup |
When the IBM DB2 Setup Launchpad opens, select "Install a Product".
Select the "Install New" button in the main window.
When the Welcome to the DB2 Setup wizard window appears, click "Next".
Read the license agreement and select the "Accept" button if you accept the terms (the "Decline" button is selected by default). Click "Next".
Make your choice and click "Next". (The remainder of these instructions are based on the Custom installation option).
On the Select the installation action window, choose the "Install DB2 Express on this computer" radio button. You can also choose to save your installations settings in a response file by selecting "Save your settings in a response file". You should choose this option if you plan to install DB2, with these same settings, on other computers in your environment.
Choose the DB2 elements you want on the Select the features to install window. You can preview each component by selecting it and reading the corresponding description in the Description section.
You can also choose where to install the DB2 program files. By default for a first time installation, this location is /opt/ibm/db2/V9.1/ Once you have decided what features you want to install and the destination, click "Next".
Select what languages you want installed for the messages and user interface on your computer in the Languages window. English is always installed, regardless of other language choices. Click "Next".
In the Specify the location of the DB2 Information Center window, select how you want to access the DB2 Information Center. The DB2 Information Center contains documentation for DB2 and other related DB2 products. The "On the IBM Web site" button is selected by default. By choosing this option, DB2 is configured to access documentation on the Web using your browser. If you have a copy of the DB2 Information Center installed elsewhere on an intranet server, you can choose the "On the following intranet server" button. Specify the values in the Host name and Port number text fields (the default value for the port number is 51000). Click the "Help" button for more information, otherwise click "Next".
Fill out the information for the user that will administer the DB2 Administration Server in the Set user information for the DB2 Administration Server window. Select either the "New user" button, or the "Existing user" button. The Password and Confirm password text boxes are outlined in red indicating required fields that must be filled in for the installation to continue. If you choose to create a new user, a user account will be created (including a home directory) on your Linux system. Click "Next".
If you want to create a new basic DB2 instance to store your database, then select the "Create a DB2 instance" button on the Set up a DB2 instance window. Otherwise, select the "Defer this task until after installation is complete" button. If you select this second option, you will need to create a new instance after the installation by using the db2icrt command. Click "Help" for more information, otherwise click "Next".
If you create a new instance, fill out the information for the DB2 instance owner on the Set user information for the DB2 instance owner window. Select either the "New user" button, or the "Existing user" button. The Password and Confirm password text boxes are outlined in red indicating required fields that must be filled in for the installation to continue. Again, if you choose to create a new user, a user account will be created (including a home directory) on your Linux system. Click "Next".
Fill out the information for the DB2 fenced user on the Set user information for the fenced user window. Select either the "New user" button, or the "Existing user" button. The Password and Confirm password text boxes are outlined in red indicating required fields that must be filled in for the installation to continue. For more information on fenced users, and how fenced users relate to fenced and non-fenced user-defined functions (UDFs) and stored procedures, click "Help". Otherwise, click "Next" to continue.
Configure the DB2 instance for TCP/IP communications on the Configure instance IP communication and startup window. You may either accept the default values found in the Service name and Port number fields, or select your own. If you want to configure the instance properties at a later time, select the "Do not configure at this time" button. This service name and port are added to the services file for the system, typically found in /etc/services.
You can also choose whether to start up this instance at system startup. This is recommended if you are planning on running your system as a DB2 server. Click "Next".
On the Prepare the DB2 tools catalog window, select the "Prepare the DB2 tools catalog" button if you want to use the Task Center or Task Scheduler. This option creates a local database that stores task metadata. If you do not have this task repository, the scheduler will not function. If you want to create a DB2 tools catalog after you finish the installation, select the "Do not prepare the DB2 tools catalog" button. You can create the DB2 tools catalog later manually by using the CREATE TOOLS CATALOG command. Click "Next".
If you decide to create a DB2 tools catalog, you can specify which instance, database, and schema in which to store the DB2 tools catalog. The DB2 tools catalog will be placed in the home directory of the instance owner. Click "Next".
Specify a notification mail server and contact list on the Set up notifications window. This allows DB2 to notify administrators if a database requires attention. Either create a new contact list that is stored locally, or use an existing global contact list that resides on a remote DB2 server. Use an available SMTP server that will accept an unauthenticated SMTP message for e-mail notifications. You may also choose to skip this step; DB2 will still record all administration notifications in the log files. Click "Next".
On the Start copying files window, review the installation settings, and then click "Finish" to complete the installation. The Current settings panel provides a summary of your installation and configuration settings.
Before proceeding, please ensure that you have read Section 5 and Section 6.
These installation notes are based on a single-partition installation using the 2.6.9-55.0.2 EL kernel.
The installation on Red Hat Enterprise Linux 4 completed successfully, with no problems getting the GUI installer working, and no errors during the install. This smooth installation isn't surprising, given that RHEL 4 is an officially supported platform for DB2.
Basic test results (see Section 21 for more details) were successful.
However, I found that after a reboot, the DB2 instance was not being restarted automatically, so clients could not connect to the database. To correct this problem, execute this command as the instance owner:
db2set DB2AUTOSTART=YES |
Also, to allow DB2 access through the iptables-based firewall (which is enabled by default), it was necessary to modify the iptables firewall ruleset, which is kept in the /etc/sysconfig/iptables file. If you have enabled your firewall (using the iptables service), and you want to enable external connectivity to your DB2 server, you must open up TCP and UDP access to ports 523 and TCP access to any DB2 service ports. To make this work, add these rules to the iptablesfile (anywhere amongst the -j ACCEPT rules):
-A RH-Firewall-1-INPUT -p udp -m udp --dport 523 -j ACCEPT -A RH-Firewall-1-INPUT -p tcp -m tcp --dport 523 -j ACCEPT -A RH-Firewall-1-INPUT -p tcp -m tcp --dport 50000 -j ACCEPT |
You can use db2 get dbm cfg | grep SVCENAME to retrieve the service names and then check the /etc/services for the equivalent port values to open on your firewall.
Before proceeding, please ensure that you have read Section 5 and Section 6.
Note that IBM does not officially support this distribution for DB2 9. Any problems you encounter using this distribution must be replicated on a supported distribution before IBM Support can help you resolve the issue. See the DB2 Linux validation website in Section 22.
These installation notes are based on a single-partition 32-bit installation using the 2.6.18-1.2849.fc6 kernel.
The only installation error encountered was found when launching the ./db2setup command. The screen displayed this error:
ERROR: The following library files could not be loaded by db2langdir in /tmp/exp/disk1/db2/linux/install/../bin libstdc++.so.5 libstdc++.so.5 Check the following web site for the up-to-date system requirements of IBM DB2 Version 9.1: http://www.ibm.com/software/data/db2/udb/sysreqs.html Aborting the current installation ... |
yum -y install compat-libstdc++-33 |
Test results (see Section 21 for more details) were successful, except the Configuration Assistant was very slow when launched from the DB2 Control Center. I eventually had to kill the process and it returned a DB2JAVIT : RC = 143 return code.
One strange effect encountered was that DB2 windows were not showing up when launching the Java-based GUI tools (and other windows were missing window decoration); however, logging off and then back in again solved the problem.
To inherit the DB2 instance environment from another home directory, create databases, dynamically load the DB2 libraries, and other tasks, I found that I had to either disable SELinux or modify the default SELinux policies. You can disable SELinux at run-time by running the following command as root:
# /usr/sbin/setenforce 0 |
SELINUX=disabled |
If you have enabled your firewall (using the iptables service), and you want to enable external connectivity to your DB2 server, you must open up ports 523 and any DB2 service ports (use db2 get dbm cfg | grep SVCENAME to retrieve the service names and check /etc/services for the equivalent port values) in your firewall.
Before proceeding, please ensure that you have read Section 5 and Section 6.
Note that IBM does not officially support this distribution for DB2 9. Any problems you encounter using this distribution must be replicated on a supported distribution before IBM Support can help you resolve the issue.
These installation notes are based on a single-partition 32-bit installation using the 2.6.21-1.3228.fc7 kernel.
The only installation error encountered was found when launching the ./db2setup command. The screen displayed this error:
ERROR: The following library files could not be loaded by db2langdir in /tmp/exp/disk1/db2/linux/install/../bin libstdc++.so.5 libstdc++.so.5 Check the following web site for the up-to-date system requirements of IBM DB2 Version 9.1: http://www.ibm.com/software/data/db2/udb/sysreqs.html Aborting the current installation ... |
yum -y install compat-libstdc++-33 |
Basic test results (see Section 21 for more details) were successful.
However, I found that after a reboot, the DB2 instance was not being restarted automatically, so clients could not connect to the database. To correct this problem, execute this command as the instance owner:
db2set DB2AUTOSTART=YES |
Also, to allow DB2 access through the iptables-based firewall (which is enabled by default), it was necessary to modify the iptables firewall ruleset, which is kept in the /etc/sysconfig/iptables file. If you have enabled your firewall (using the iptables service), and you want to enable external connectivity to your DB2 server, you must open up TCP and UDP access to ports 523 and TCP access to any DB2 service ports. To make this work, add these rules to the iptablesfile (anywhere amongst the -j ACCEPT rules):
-A RH-Firewall-1-INPUT -p udp -m udp --dport 523 -j ACCEPT -A RH-Firewall-1-INPUT -p tcp -m tcp --dport 523 -j ACCEPT -A RH-Firewall-1-INPUT -p tcp -m tcp --dport 50000 -j ACCEPT |
You can use db2 get dbm cfg | grep SVCENAME to retrieve the service names and then check the /etc/services for the equivalent port values to open on your firewall.
Before proceeding, please ensure that you have read Section 5 and Section 6.
Note that IBM does not officially support this distribution for DB2 9. Any problems you encounter using this distribution must be replicated on a supported distribution before IBM Support can help you resolve the issue.
These installation notes are based on a single-partition installation using the 2.6.18.2-34-default kernel.
The installation on OpenSUSE 10.2 completed successfully, with no problems getting the GUI installer working, and no errors during the install.
Basic test results (see Section 21 for more details) were successful.
However, I found that after a reboot, the DB2 instance was not being restarted automatically, so clients could not connect to the database. To correct this problem, execute this command as the instance owner:
db2set DB2AUTOSTART=YES |
Also, to allow DB2 access through the firewall (which is enabled by default), it was necessary to add the port values to the firewall using the YaST2 utility.
You can use the db2 get dbm cfg | grep SVCENAME command to retrieve the DB2 instance service name. By default, this is set as a TCP connection at port 50001. Note that you will need to add another new TCP rule to allow firewall access if you create any additional instances later. If you want to remotely administer the DB2 installation on this system, the UDP and TCP connections at port 523 should also be allowed through the firewall.
To open these ports using YaST, open the YaST tool, and select "Security and Users, then select the "Firewall" icon. In the Allowed Services setup panel, click on the "Advanced" button. In the TCP ports dialog, add 523 50001, and in the UDP ports dialog, add 523. Click "Next" until the setup wizard completes and restarts the firewall. Remote connections will now pass through to the DB2 instance.
Before proceeding, please ensure that you have read Section 5 and Section 6.
These installation notes are based on a single-partition installation using the 2.6.5-7.97-default kernel.
The installation on SLES 9 completed successfully, with no problems getting the GUI installer working, and no errors during the install. This smooth installation isn't surprising, given that SLES 9 is an officially supported platform for DB2.
Basic test results (see Section 21 for more details) were successful.
However, I found that after a reboot, the DB2 instance was not being restarted automatically, so clients could not connect to the database. To correct this problem, execute this command as the instance owner:
db2set DB2AUTOSTART=YES |
Also, to allow DB2 access through the firewall (which is enabled by default), it was necessary to add the port values to the firewall using the YaST utility.
You can use the db2 get dbm cfg | grep SVCENAME command to retrieve the DB2 instance service name. By default, this is set as a TCP connection at port 50001. Note that you will need to add another new TCP rule to allow firewall access if you create any additional instances later. If you want to remotely administer the DB2 installation on this system, the UDP and TCP connections at port 523 should also be allowed through the firewall.
To open these ports using YaST, open the YaST tool, and select "Security and Users, then select the "Firewall" icon. In the setup panel, click "Next" and then on the "Expert button. In the ports dialog, add 523 50001. Click "Next" until the setup wizard completes and then "Continue" so that YaST will restart the firewall with the new configuration. Remote connections will now pass through to the DB2 instance.
Before proceeding, please ensure that you have read Section 5 and Section 6.
These installation notes are based on a single-partition installation using the 2.6.16.21-0.8-default kernel. Novell AppArmor security was installed and enabled during the installation and testing.
The installation on SLES 10 completed successfully, with no problems getting the GUI installer working, and no errors during the install. This smooth installation isn't surprising, given that SLES 10 is an officially supported platform for DB2.
Basic test results (see Section 21 for more details) were successful.
However, I found that after a reboot, the DB2 instance was not being restarted automatically, so clients could not connect to the database. To correct this problem, execute this command as the instance owner:
db2set DB2AUTOSTART=YES |
Also, to allow DB2 access through the firewall (which is enabled by default), it was necessary to add the port values to the firewall using the YaST2 utility.
You can use the db2 get dbm cfg | grep SVCENAME command to retrieve the DB2 instance service name. By default, this is set as a TCP connection at port 50001. Note that you will need to add another new TCP rule to allow firewall access if you create any additional instances later. If you want to remotely administer the DB2 installation on this system, the UDP and TCP connections at port 523 should also be allowed through the firewall.
To open these ports using YaST, open the YaST tool, and select "Security and Users, then select the "Firewall" icon. In the Allowed Services setup panel, click on the "Advanced" button. In the TCP ports dialog, add 523 50001, and in the UDP ports dialog, add 523. Click "Next" until the setup wizard completes and restarts the firewall. Remote connections will now pass through to the DB2 instance.
Before proceeding, please ensure that you have read Section 5 and Section 6.
These installation notes are based on a single-partition installation using the 2.6.16.21-0.25 kernel.
The installation on SLED 10 completed successfully, with no problems getting the GUI installer working, and no errors during the install.
Basic test results (see Section 21 for more details) were successful.
However, I found that after a reboot, the DB2 instance was not being restarted automatically, so clients could not connect to the database. To correct this problem, execute this command as the instance owner:
db2set DB2AUTOSTART=YES |
Also, to allow DB2 access through the firewall (which is enabled by default), it was necessary to add the port values to the firewall using the YaST2 utility.
You can use the db2 get dbm cfg | grep SVCENAME command to retrieve the DB2 instance service name. By default, this is set as a TCP connection at port 50001. Note that you will need to add another new TCP rule to allow firewall access if you create any additional instances later. If you want to remotely administer the DB2 installation on this system, the UDP and TCP connections at port 523 should also be allowed through the firewall.
To open these ports using YaST, open the YaST tool, and select "Security and Users, then select the "Firewall" icon. In the Allowed Services setup panel, click on the "Advanced" button. In the TCP ports dialog, add 523 50001, and in the UDP ports dialog, add 523. Click "OK" and then "Next" until the setup wizard completes and restarts the firewall. Remote connections will now pass through to the DB2 instance.
Before proceeding, please ensure that you have read Section 5 and Section 6.
Note that IBM does not officially support this distribution for DB2 9. Any problems you encounter using this distribution must be replicated on a supported distribution before IBM Support can help you resolve the issue.
These installation notes are based on a single-partition installation using the 2.6.17-5mdvlegacy kernel.
Note that root logins are not allowed in Mandriva, so you will need to log on as another user, then run the su -l command from a terminal session to gain root access before you launch the ./db2setup command.
The only installation error encountered was found when launching the ./db2setup command. The screen displayed this error:
ERROR: The following library files could not be loaded by db2langdir in /tmp/exp/disk1/db2/linux/install/../bin libstdc++.so.5 libstdc++.so.5 Check the following web site for the up-to-date system requirements of IBM DB2 Version 9.1: http://www.ibm.com/software/data/db2/udb/sysreqs.html Aborting the current installation ... |
libstdc++5-3.3.6-3mdk libstdc++6-4.1.1-3mdk |
Basic test results (see Section 21 for more details) were successful.
However, I found that after a reboot, the DB2 instance was not being restarted automatically, so clients could not connect to the database. To correct this problem, execute this command as the instance owner:
db2set DB2AUTOSTART=YES |
Also, to allow DB2 access through the firewall (which is enabled by default), it was necessary to modify the add in the appropriate firewall ports. To enable external connectivity to your DB2 server, you must open up TCP and UDP access to ports 523 and TCP access to the DB2 instance port (50001 by default).
Open the Mandriva Control Center, choose the Security tab, and then the "Set up a personal firewall..." icon. In the firewall setup panel, click the "Advanced button and add 523/udp 523/tcp 50001/tcp to the Other ports text box. Click "OK until the firewall setup is complete.
Note that you will need to add another new TCP rule to allow firewall access if you create any additional instances later.
Before proceeding, please ensure that you have read Section 5 and Section 6.
These installation notes are based on a single-partition installation using the 2.6.15-17 kernel.
Since you cannot log in as root directly with an Ubuntu system, this DB2 installation is run as the default user created during Ubuntu setup (i.e. the regular user account with 'sudo' capability).
There are two ways of installing DB2 Express-C 9 on Ubuntu. The harder of the two methods is to use the default DB2 db2setup, and then make adjustments to the Ubuntu system afterwards to handle the slight differences of Ubuntu's Debian-based packaging system. For reasons of clarity and brevity, I will omit the instructions for doing it this more difficult way; however, if you would like to see these instructions, please send me an email (db2howto@gmail.com) and I will pass them along.
The easy way to install DB2 Express-C on Ubuntu 6.06 LTS is to use the Synaptic package installer, and almost everything is done for you, from downloading to installation and configuration. Here's how to do it:
Under the Applications menu on the Ubuntu menu bar, choose Add/Remove.
Once the Synaptic package manager application has started up, click the Show commercial applications checkbox.
In the Search bar, type "DB2" and hit the Enter key.
DB2 Express should show up as the only result. If you don't see it, make sure that Synaptic is displaying All Applications or Third party applications.
Enable the dapper-commercial channel if requested by clicking the "Enable channel" button.
Click "Apply".
After installation by Synaptic, there are a few steps required to get DB2 up and running smoothly.
Usable passwords for the DB2 default accounts.
To actually log in or connect to the DB2 databases and servers using the default DB2 users (db2inst1, db2fenc1, and dasusr1), you need to modify the initial passwords. To do this, open a terminal (as the regular user), and type sudo su - to get root access. Then run these three commands:
passwd db2inst1 passwd db2fenc1 passwd dasusr1 |
Change the default shell for the DB2 default accounts.
The default command shell for the DB2 accounts is set as just a plain old /bin/sh. To get the handy features of the BASH shell, you'll want to change it for these three accounts. In the same root access command window, open the /etc/passwd file in your favorite text editor and change:
db2inst1:x:1001:1001::/home/db2inst1:/bin/sh db2fenc1:x:1002:1002::/home/db2fenc1:/bin/sh dasusr1:x:1003:1003::/home/dasusr1:/bin/sh |
db2inst1:x:1001:1001::/home/db2inst1:/bin/bash db2fenc1:x:1002:1002::/home/db2fenc1:/bin/bash dasusr1:x:1003:1003::/home/dasusr1:/bin/bash |
Enable DB2 service ports for remote connections.
To enable outside users to get to your DB2 databases, you'll need to set up the DB2 service port, as it is not configured by the Synaptic installation process.
As the regular user, run sudo vi /etc/services and add this line to the end of the file and save the changes:
db2c_db2inst1 50001/tcp # IBM DB2 instance - db2inst1 |
db2 update dbm cfg using SVCENAME db2c_db2inst1 db2set DB2COMM=tcpip db2stop db2start |
Enable remote DB2 administration connections.
To allow remote administration of your DB2 server, you'll need to set up the DB2 DAS connection port, as it is not configured by the Synaptic installation process.
As the regular user, run sudo vi /etc/services and add this line to the end of the file:
ibm-db2 523/tcp # IBM DB2 DAS ibm-db2 523/udp # IBM DB2 DAS |
db2admin stop db2admin start |
These installation notes are based on a single-partition installation using the 2.6.20-16-generic kernel.
Note that IBM does not yet officially support this distribution for DB2 9. Any problems you encounter using this distribution must be replicated on a supported distribution before IBM Support can help you resolve the issue.
Also be aware that the PowerPC architecture is no longer supported in Ubuntu 7.04 and later.
Since you cannot log in as root directly with an Ubuntu system, this DB2 installation is run as the default user created during Ubuntu setup (i.e. the regular user account with 'sudo' capability).
There are two ways of installing DB2 Express-C 9 on Ubuntu. The harder of the two methods is to use the default DB2 db2setup, and then make adjustments to the Ubuntu system afterwards to handle the slight differences of Ubuntu's Debian-based packaging system. For reasons of clarity and brevity, I will omit the instructions for doing it this more difficult way; however, if you would like to see these instructions, please send me an email (db2howto@gmail.com) and I will pass them along.
The easy way to install DB2 Express-C on Ubuntu 7.04 is to download the DB2 Express-C Debian package file and then use the Ubuntu package installer. This way, almost everything is done for you, from installation to configuration. Here's how to do it:
Use any FTP client software and connect to: ftp.software.ibm.com/software/data/db2/express/latest_debs
Download db2exc_9.1.2-1_i386.deb (or the latest equivalent .deb file)
Once the download is complete, run this command:
sudo gdebi-gtk db2exc_9.1.2-1_i386.deb |
Click "Install Package"
Click "Close" once the package has been installed
After installation by Synaptic, there are a few steps required to get DB2 up and running smoothly.
Usable passwords for the DB2 default accounts.
To actually log in or connect to the DB2 databases and servers using the default DB2 users (db2inst1, db2fenc1, and dasusr1), you need to modify the initial passwords. To do this, open a terminal (as the regular user), and type sudo su - to get root access. Then run these three commands:
passwd db2inst1 passwd db2fenc1 passwd dasusr1 |
Change the default shell for the DB2 default accounts.
The default command shell for the DB2 accounts is set as just a plain old /bin/sh. To get the handy features of the BASH shell, you'll want to change it for these three accounts. In the same root access command window, open the /etc/passwd file in your favorite text editor and change:
db2inst1:x:1001:1001::/home/db2inst1:/bin/sh db2fenc1:x:1002:1002::/home/db2fenc1:/bin/sh dasusr1:x:1003:1003::/home/dasusr1:/bin/sh |
db2inst1:x:1001:1001::/home/db2inst1:/bin/bash db2fenc1:x:1002:1002::/home/db2fenc1:/bin/bash dasusr1:x:1003:1003::/home/dasusr1:/bin/bash |
Enable DB2 service ports for remote connections.
To enable outside users to get to your DB2 databases, you'll need to set up the DB2 service port, as it is not configured by the Synaptic installation process.
As the regular user, run sudo vi /etc/services and add this line to the end of the file:
db2c_db2inst1 50001/tcp # IBM DB2 instance - db2inst1 |
db2 update dbm cfg using SVCENAME db2c_db2inst1 db2set DB2COMM=tcpip db2stop db2start |
Enable remote DB2 administration connections.
To allow remote administration of your DB2 server, you'll need to set up the DB2 DAS connection port, as it is not configured by the Synaptic installation process.
As the regular user, run sudo vi /etc/services and add this line to the end of the file:
ibm-db2 523/tcp # IBM DB2 DAS ibm-db2 523/udp # IBM DB2 DAS |
db2admin stop db2admin start |
Correct instance restart problem
One issue of note with the Ubuntu 7.04 installation is that the DB2 instances do not properly restart after a system reboot, and setting DB2AUTOSTART=YES does not resolve the issue.
One workaround to this problem was suggested in part by IgorM on the DB2 Express-C forum; and that is to create and execute your own DB2 instance start up script.
To begin with, login and create a new script file using the command:
sudo vi /etc/init.d/db2 |
#!/bin/sh # # Script to start DB2 instances on bootup. # set -e . /lib/lsb/init-functions case "$1" in start) /opt/ibm/db2exc/V9.1/instance/db2istrt ;; stop|restart|reload) ;; esac exit 0 |
Note that the path to the executable is /opt/ibm/db2exc/V9.1/, the default installation path from the DB2 .deb file. If your installation put the DB2 files elsewhere, be sure to adjust this script as required to find the /instance/ directory.
Once the script has been saved, give the file the proper ownership and permissions:
chown root.root db2 chmod 755 db2 |
Now, to initialize this script so that it starts at boot time, install the Boot-Up Manager with this command:
sudo apt-get bum |
After Synaptic downloads and installs the application file, you can run the program by clicking System -> Administration -> BootUp-Manager. Then click on the "Activate" checkbox beside the db2 entry. Click Apply and say "No" to the dialog that asks if you want to start the service now. Click Quit. The script will now run at your next boot and start up all DB2 instances.
The only other way to resolve the problem is to manually start the instances after a reboot with db2start (as the instance owner) and db2admin start (as the DAS owner). Once DB2 Express-C has passed the validation process for Ubuntu 7.04, this instance start issue will disappear.
SimplyMEPIS 6.0 is based on the Ubuntu package management system and repositories, and is currently amongst the top 5 Linux distributions (according to distrowatch.com). In 6.0, SimplyMEPIS only supports the 32-bit architecture, but the new release, 6.5, supports the 64-bit architecture.
Note that IBM does not officially support this distribution for DB2 9. Any problems you encounter using this distribution must be replicated on a supported distribution before IBM Support can help you resolve the issue.
These installation notes are based on a single-partition 32-bit installation using the 2.6.15-26.386 kernel.
After installation, I could not create the SAMPLE database, or any database for that matter. DB2 returned this strange error:
SQL0440N No authorized routine named RTRIM of type "FUNCTION" having compatible arguments was found |
su - db2inst1 db2sampl |
If you want to enable external connectivity to your DB2 server, you must open up ports 523 and any DB2 instance services (use db2 get dbm cfg | grep SVCENAME to retrieve the service names and check /etc/services for the equivalent port values) in your firewall.
The DB2 Information Center delivers the DB2 product documentation inside an Eclipse-based help system, and provides a convenient way to search and utilize the DB2 documentation.
To begin, mount the DB2 Information Center CD in your system drive, or if you downloaded the compressed file through the Express-C website, expand the tarball containing the installation utilities.
Change to the base directory (doce/disk1/) and run the db2setup utility. This will launch the DB2 setup wizard. You can also use the other setup methods, but since the GUI installation sets up and configures everything for you, it's the method I recommend.
Installation Steps:
Select the "Install a Product" option from the launcher, and then click the "Install New" button in the main panel.
Read the description and click "Next".
Read the license agreement, and if you agree, select "Accept" and click "Next".
By default, the installation script will install the Information Center locally and generate a response file. The choice is up to you, but we're only doing a local install, so choose the "Install DB2 Information Center on this computer" option instead. Click "Next".
Add any additional languages that you want to have installed. English is installed by default and cannot be deselected. Each additional language will add anywhere from 5 MB to 50 MB to the installation size. Click "Next".
The next panel is where things get a little interesting. Here you can specify the service name that the Information Center will run under. An entry will be added to the /etc/services file for this service. You probably don't need to change this, unless you have another service running as "db2icv91".
Also, this panel is where you specify the system port that the Information Center will use to serve up the documentation. By default, this is port 51000.
These settings will change the configuration for all DB2 products installed on the local system, so that their help system will use the parameters you define here. Click "Next".
Read the summary of what will be done, then click "Finish" to start the file installation
You can change which directory the Information Center uses as a temporary working directory. To do this, modify the DB2_ECLIPSEIC_DATA parameter in the db2ic.conf file found in the /opt/ibm/db2ic/V9/cfg directory. The temporary directory can be anywhere where the "bin" user can write to.
Also in this file, you can change the port used to serve up the Information Center, in case you change your mind later on about the one you set up during the install. Just change the DB2_ECLIPSEIC_PORT parameter to the new number (though it must be a port under the maximum of 65535).
After making any changes, do a
/etc/init.d/db2icdv9 restart |
The Information Center daemon is set up during installation and is used to launch the background process that runs the Information Center. The daemon script, named db2icdv9 is installed to the /etc/init.d/ directory, and start up symbolic links are added to the /etc/init.d/rc.X/ run-level folders. By default, the daemon is turned on for run-levels 3 and 5. You can modify these run-levels with any system init utility (chkconfig, ntsysv, or any of the X-based variants).
There are 5 commands you can pass to the daemon:
start — Starts the Information Center, using the configuration parameters set in the /opt/ibm/db2ic/V9/cfg/db2ic.conf file.
stop — Halts a running Information Center.
restart — A combination command that stops, then starts the daemon again.
reload — Same as restart.
status — Provides information on whether the Information Center is running, and if it is running, what the process IDs (PID) are.
There are three possible methods to access the DB2 Information Center:
Via the publib.boulder.ibm.com Web site (this is the default option enabled during a DB2 installation)
Via an intranet machine that is hosting the DB2 Information Center within your own organization
Via an Information Center that is installed and set up on your local machine
To make the change using the GUI tools (Control Center), open the Tools menu, select Tools Settings, and then the Documentation tab. On this panel, you can specify a host URL and port where an Information Center can be found. When putting a hostname in, do not add the "http://" prefix, or any subdirectories – just type in the hostname, and the internal code will do the rest.
To change the access points from the command line, execute these commands:
db2set DB2_DOCHOST=host_URL db2set DB2_DOCPORT=host_port |
By default, these DB2 environment settings are blank, which means that DB2 defaults to the http://publib.boulder.ibm.com/infocenter/db2help/ Web site.
To invoke the DB2 Information Center from the GUI tools, click on the "?" icon in the toolbar, any of the "Help" hyperlinks or buttons, or by selecting any of the menu items in the "Help" menu.
To invoke the DB2 Information Center from the command line, issue any of these commands:
Uninstalling DB2 Express-C is a bit more detailed than the installation process. Unfortunately, at this time, there is no GUI-based uninstaller utility like there is for installation. Follow the steps below to completely remove the DB2 Express-C software from your system. Since the database files are kept in the home directory of the instance user, you can keep the database files by skipping the removal of the instance owner (the last step).
Remove the Database Administration Server. Switch to the DAS owner (dasusr1 by default), either through the su - dasusr1 command or by logging in to the system directly as the DAS user, and issue the command db2admin stop. Then switch to the root user, and issue the /opt/ibm/db2/V9.1/instance/dasdrop command.
Remove the DB2 instance(s). Switch to the instance owner (db2inst1 by default), either through the su - db2inst1 command or by logging in to the system directly as the instance user, and issue the command db2stop. Then, as root, remove the instance by issuing the /opt/ibm/db2/V9.1/instance/db2idrop db2_instance command, where db2_instance refers to the actual instance name you want to drop (for example, /opt/ibm/db2/V9.1/instance/db2idrop db2inst1). If you want to verify which instances are present on your system, run the /opt/ibm/db2/V9.1/instance/db2ilist command.
Remove the software installation. As root, run the /opt/ibm/db2/V9.1/install/db2_deinstall -a command. This will remove the installation of DB2 from your system.
If no longer need the DB2 database files (which are kept in the home directory of the instance owner), you can remove the users that were created during the installation of DB2 Express-C by entering these commands as root:
userdel -r db2inst1 userdel -r dasusr1 userdel -r db2fenc1 |
This section gives you the basic information you need to start working with DB2 Express-C on Linux. It includes instructions on issuing DB2 commands and SQL statements from the command line, as well as the commands you need to start the DB2 Control Center and the DB2 Information Center. For more information about general DB2 usage, please investigate the DB2 manuals and Information Center.
To start the DB2 Control Center:
Ensure you are logged on to your Linux workstation using either the DB2 Administration Server user ID (dasusr1 by default) or the DB2 instance user ID (db2inst1 by default). If you use the su command to change to one of those users, ensure you include the -l parameter to initialize the proper user environment.
Start the X server, if it is not already started.
Start a terminal session, or type Alt + F2 to bring up the Linux "Run Command" dialog.
Type db2cc to start the DB2 Control Center.
The left side of the DB2 Control Center provides an object based view of the database objects that you have catalogued, including DB2 instances and databases on other DB2 servers.
One way to add, edit, or drop database objects is to right-click on the object to bring up a context menu.
As mentioned above, the new DB2 Information Center is a revamped documentation display system that now encapsulates the task, concept and reference information required to properly run DB2 . It can be installed locally, on an intranet server, or accessed directly from the ibm.com hosting service.
To start the DB2 Information Center:
Ensure you are logged on to your Linux workstation using either the DB2 Administration Server user ID (dasusr1 by default) or the DB2 instance user ID (db2inst1 by default). If you use the su command to change to one of those users, ensure you include the -l parameter to initialize the proper user environment.
Ensure that the X server is started, as the Information Center requires a Web browser.
Issue one of the launch commands:
If you did not install the DB2 Information Center, or have not configured your tools to use a different server, then these commands will launch a detected browser, and take you directly to the IBM hosted DB2 Information Center at http://publib.boulder.ibm.com/infocenter/db2help/.
If you are logged on to your Linux workstation using either the DB2 Administration Server user ID or the DB2 instance user ID, you can issue DB2 commands and SQL statements from the command line.
If this is your first time using DB2 , I would suggest creating the DB2 sample database. The sample database is used throughout the DB2 documentation and is required by most of the sample applications.
To create the sample database, you can either select the Create the SAMPLE database option from the DB2 First Steps launchpad, or by issuing the db2sampl command from the command line.
Before you can issue an SQL statement, you have to connect to a database. To connect to a database, enter the command:
db2 CONNECT TO database USER userID USING password |
To connect to a database, and have DB2 prompt you for the password, issue the command:
db2 CONNECT TO database USER userID |
To connect to a database using the default user ID, issue the command:
db2 CONNECT TO database |
Once you have connected to a database, you can then issue SQL statements or DB2 commands against that database. For example, to select all of the rows from the EMPLOYEE table in the SAMPLE database, issue this command:
db2 "SELECT * FROM employee" |
You can avoid typing db2 as the prefix for every SQL statement and DB2 command by issuing DB2 commands using the Command Line Processor (CLP). To start the CLP, issue the db2 command by itself from a Linux command line terminal. DB2 provides the following prompt:
You can issue database manager commands and SQL statements from the command prompt. For example: db2 => connect to sample db2 => bind sample.bnd For general help, type: ?. For command help, type: ? command, where command can be the first few keywords of a database manager command. For example: ? CATALOG DATABASE for help on the CATALOG DATABASE command ? CATALOG for help on all of the CATALOG commands. To exit db2 interactive mode, type QUIT at the command prompt. Outside interactive mode, all commands must be prefixed with 'db2'. To list the current command option settings, type LIST COMMAND OPTIONS. For more detailed help, refer to the Online Reference Manual. db2 => |
Some users prefer to avoid the CLP because it prevents using the command line history features of the shell.
Some users claim that running the CLP within an Emacs shell gives them the best of both worlds: they get command line history, and they don't have to escape commands that contain lots of quotation marks and brackets, but your mileage may vary.
Log on as root (or gain root access through a terminal if a root logon is not available)
Mount the DVD (if installing from Discovery DVD set), or download the appropriate Linux compressed image (tar.gz file) from the DB2 Express-C download site
Copy the compressed image file to the /tmp directory
Extract the files from the compressed image, either using the Ark GUI tool or using the console command tar zxvf db2exc_91_LNX_x86.tar.gz
Inside the /tmp folder, change to the exp/disk1i directory and run the db2setup command:
./db2setup |
In the DB2 setup Launchpad, choose Install a Product
Choose Install New
Click "Next"
Verify the license and change the radio button to Accept, then choose "Next" to continue the installation
Choose a Typical installation and click "Next"
Verify the install path, or change it to some point on your system with at least 470 MB free, click "Next"
Create a DB2 instance. Click "Next"
Set up the DB2 instance owner account. Again, you can use an existing user, or set up a new one (the default instance owner is 'db2inst1'). Click "Next"
Set up the DB2 fenced user account. Same as before, use an existing user or set up a new one. Click "Next"
Click "Finish" to initiate the install
If there are any problems with the installation, it will show up in the installation log (the log is also kept in the /tmp directory as db2setup.log and db2setup.err)
Log in as the DB2 instance owner (db2inst1 by default)
Open a terminal and run 'db2sampl' to create the SAMPLE database
Test terminal based commands:
Test DB2 Control Center:
Create TOOLS database:
db2 'create tools catalog TOOLS create new database TOOLSDB' |
Launch DB2 Task Center:
Launch DB2 Journal: You should be able to see the results of the task you ran in the task center from the Journal.
Test DB2 Configuration Assistant
Start Configuration Assistant from the Control Center, or with db2ca
You should see the SAMPLE database listed, if not, click View, then Refresh.
Right click on the SAMPLE database, choose Change Database, then in step 4 of the wizard, register the database as a CLI/ODBC source, and catalog as system data source. Click Finish to commit the changes
Right click on the SAMPLE database again, and click on Test Connection. Select all types (Standard (ODBC), CLI, JDBC), then type in a userid and password, and click on Test Connection. Ensure all tests are successful.
Test DB2 trace facility: db2trc on -- check for positive response, then run db2trc off
Test DB2 problem determination facility: db2pd -db sample > sample.txt (examine output for errors)
Test DB2 license: db2licm -l should return:
Product name: "DB2 Express Edition" License type: "Unwarranted" Expiry date: "Permanent" Product identifier: "db2exp" Version information: "9.1" Max number of CPUs: "2" |
Test db2dart:
db2 force applications all db2dart sample |
Test db2look facility: db2look -d sample -e > sample.ddl (should complete successfully)
Test remote connections:
Create connection through command prompt on DB2 remote client system:
db2 catalog tcpip node test remote computername server 50001 db2 catalog db sample at node test |
From remote machine:
db2 connect to sample db2 "select * from dept" |
Reboot server and retest via remote connection (to verify DB2 instance autostart and that any firewall changes stick)
This section lists available additional resources for information on using DB2 Express-C 9 for Linux:
IBM developerWorks forums
http://www.ibm.com/developerworks/forums/db2_forums.jsp
This page lists the available developerWorks hosted web forums. Many of them are mirrors of the regular Usenet DB2 newsgroups.
DB2 Express-C developerWorks forum
http://www.ibm.com/developerworks/forums/dw_forum.jsp?forum=805&cat=81
The main site for DB2 Express-C support questions. All support functionality for unwarranted versions of Express-C comes from this community support forum. Lots of IBM developers (including the DB2 Express-C team) regularly monitor and participate in this forum.
DB2 9 developerWorks forum
http://www.ibm.com/developerworks/forums/dw_forum.jsp?forum=842&cat=81
The forum for general DB2 9 questions. Lots of DB2 developers regularly monitor and participate in this forum.
comp.databases.ibm-db2
Covers the use of DB2 on all platforms, including Linux and UNIX, Windows, z/OS, iSeries, and pSeries. This forum is quite active.
ibm.software.db2.udb
Similar to comp.databases.ibm-db2, but handles questions specific to the DB2 Universal Database product only.
DB2 Universal Database for Linux
http://www.ibm.com/software/data/db2/linux
The home portal for DB2 information on Linux.
DB2 Express-C
http://www.ibm.com/software/data/db2/express
Main web portal for the DB2 Express-C product, including downloads of the DB2 Express-C software and related utilities.
DB2 Information Center
http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp
The DB2 Information Center is the most current source of official DB2 documentation in 29 different languages. Set your browser language preference and the site will return the translated version of a given page if it is available, falling back to English content if not. Access to the information is offered via search, navigation tree, or a comprehensive master index.
DB2 Linux validation site
http://www.ibm.com/software/data/db2/linux/validate/
Information regarding IBM recommended and validated Linux distributions for the current version of DB2.
DB2 Online Support
http://www.ibm.com/software/data/db2/udb/support.html
The official support channel for DB2 for Linux, UNIX and Windows. Contains information and downloads regarding Fixpaks, APARs, Technotes, DB2 Flashes, and more.
DB2 PDF Manuals
http://www-1.ibm.com/support/docview.wss?rs=71&uid=swg27009553
If you like your information in discrete chunks, this is the place to get official DB2 manuals in PDF format.
DB2 for Linux white papers
http://www.ibm.com/software/data/db2/linux/papers.html
White papers typically provide overviews or introductions to new technology or new releases of a product.
DB2 Magazine
This Web site is the online version of DB2 Magazine, which publishes articles about using DB2 on Linux and other platforms. You can also sign up for a free subscription to the print version of the magazine.
IBM developerWorks for DB2
http://www.ibm.com/developerworks/db2/
A great resource for tutorials, learning resources, help, and tips for improving DB2 and developing DB2-based applications.
International DB2 Users Group (IDUG)
IDUG holds a number of international conferences on DB2 and has regional user groups. While IDUG has traditionally focused on DB2 for z/OS and iSeries, they have increasingly included information on DB2 for Linux, UNIX, and Windows. The IDUG Web site includes online discussion forums and links to other DB2 resources.
Red Hat Linux
Home to the Red Hat Linux distribution.
Also see http://www.redhat.com/rhn/(the Red Hat Network) for more information on system updates and kernel information.
SUSE Linux
Now a Novell business, this site is the home for the SUSE Linux distribution.
Also see http://support.novell.com/patches.html for more information on system updates and kernel information.
Ubuntu Linux
Home to the Ubuntu Linux distribution.
Ubuntu is a community developed, Linux-based operating system that is rapidly emerging as a favorite distributions, particularly amongst new users.
Fedora Project
Home to the Fedora Project Linux distribution.
The Fedora Project is a collection of projects sponsored by Red Hat and developed as a partnership between the open source community and Red Hat engineers.
Mandriva Linux
Home to the Mandriva Linux distribution.
Mandriva's key product is the Mandriva Linux distribution. It is available in individual user and enterprise versions. The company also provides and maintains a completely free version called Free Mandriva.
Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
The purpose of this License is to make a manual, textbook, or other functional and useful document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others.
This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software.
We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference.
This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you". You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law.
A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language.
A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them.
The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none.
The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words.
A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not "Transparent" is called "Opaque".
Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only.
The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text.
A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as "Acknowledgements", "Dedications", "Endorsements", or "History".) To "Preserve the Title" of such a section when you modify the Document means that it remains a section "Entitled XYZ" according to this definition.
The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License.
You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and you may publicly display copies.
If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages.
If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public.
It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document.
You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version:
Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission.
List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement.
State on the Title page the name of the publisher of the Modified Version, as the publisher.
Preserve all the copyright notices of the Document.
Add an appropriate copyright notice for your modifications adjacent to the other copyright notices.
Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below.
Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice.
Include an unaltered copy of this License.
Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence.
Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission.
For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein.
Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles.
Delete any section Entitled "Endorsements". Such a section may not be included in the Modified Version.
Do not retitle any existing section to be Entitled "Endorsements" or to conflict in title with any Invariant Section.
Preserve any Warranty Disclaimers.
If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles.
You may add a section Entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard.
You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version.
You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections Entitled "History" in the various original documents, forming one section Entitled "History"; likewise combine any sections Entitled "Acknowledgements", and any sections Entitled "Dedications". You must delete all sections Entitled "Endorsements".
You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document.
A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an "aggregate" if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate.
Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail.
If a section in the Document is Entitled "Acknowledgements", "Dedications", or "History", the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title.
You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/.
Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any laterversion" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation.
DB2, IBM, pureXML, iSeries, pSeries, zSeries, and z/OS are trademarks or registered trademarks of International Business Machines Corporation in the United States, other countries, or both.
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.
Windows is a trademark of Microsoft Corporation in the United States, other countries, or both.
Intel and Pentium are trademarks of Intel Corporation in the United States, other countries, or both.
UNIX is a registered trademark of The Open Group in the United States and other countries.
Linux is a trademark of Linus Torvalds in the United States, other countries, or both.
Other company, product, or service names may be trademarks or service marks of others.