LDP/LDP/howto/docbook/DB2-HOWTO.sgml

3408 lines
110 KiB
Plaintext

<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V3.1//EN">
<article id="index">
<artheader>
<title>DB2 Version 7.1 for Linux HOWTO</title>
<author><firstname>Dan</firstname><surname>Scott</surname></author>
<authorinitials>dbs</authorinitials>
<revhistory>
<revision>
<revnumber>1.2.1</revnumber>
<date>October 25, 2000</date>
<authorinitials>dbs</authorinitials>
<revremark>Basic Red Hat 7.0 info, additional Debian instructions.
</revremark>
</revision>
<revision>
<revnumber>1.2</revnumber>
<date>September 25, 2000</date>
<authorinitials>dbs</authorinitials>
<revremark>IBM JDK 1.3 works! More troubleshooting.
</revremark>
</revision>
<revision>
<revnumber>1.1</revnumber>
<date>July 28, 2000</date>
<authorinitials>dbs</authorinitials>
<revremark>Documented _SHM_ID_BITS kernel parameter tuning for increasing
number of available connections. Added basic indexing.
</revremark>
</revision>
<revision>
<revnumber>1.0</revnumber>
<date>July 6, 2000</date>
<authorinitials>dbs</authorinitials>
<revremark>Added basic Debian instructions. Corrected some factual, stylistic, and
grammatical mistakes. Licensed document under GNU GPL. Submitted document to LDP.
</revremark>
</revision>
<revision>
<revnumber>0.7</revnumber>
<date>May 26, 2000</date>
<authorinitials>dbs</authorinitials>
<revremark>Based on DB2 V7.1 beta release, wrote install instructions for
Caldera 2.4, Red Hat 6.2, SuSE 6.2, SuSE 6.3, and TurboLinux 6.0.</revremark>
</revision>
</revhistory>
<abstract>
<para>
This HOWTO gives you explicit instructions on installing
DB2 Universal Database Version 7.1 for Linux
on the following Intel x86-based distributions: Caldera OpenLinux 2.4,
Debian, Red Hat Linux 6.2, SuSE Linux 6.2 and 6.3, and TurboLinux 6.0.
After installing DB2, you can work with a
sample database, connect to your DB2 server from a remote machine, and
administer DB2 using the DB2 Control Center.
</para>
</abstract>
</artheader>
<sect1 id="intro">
<title>Introduction</title>
<sect2>
<title>Why a DB2 installation HOWTO?</title>
<para>
Ever since DB2 Version 5.2 was ported to Linux in 1998 and made
available as a beta download, there has been a lot of interest in
DB2 on Linux. The beta represented one of IBM's first dips into
the waters of Linux, and it generated a lot of feedback.
In fact, if you read through the newsgroups, you still see occasional questions
from people who are trying out the Version 5.2 beta. (I don't know where they're
getting it, but they're out there.) And, not surprisingly,
they run into problems. It was a beta product, after all.
</para>
<para>
Anyway, I've been trying out DB2 on Linux since Version 5.2, so I've
had a chance to witness the improvements over the past couple of years.
I've also made a lot of use of the Linux Documentation Project in that
time, and wanted to contribute something to the <acronym>LDP</acronym>. So I decided
to write about the one thing that I really know something about on
Linux, and hope that it helps someone else out there.
</para>
<para>
DB2 on Linux has come a long way since Version 5.2. The first supported release
of DB2 on Linux was Version 6.1 in 1999, which removed many of the installation
hurdles faced by the Version 5.2 beta testers.
</para>
<para>
DB2 Version 7.1 is the second major release that supports Linux, and since it's
a new release I'm expecting that a new wave of people curious about DB2,
as well as people migrating from Version 6.1, are going to try installing
this new release on Linux. To that end, I'm writing this HOWTO
to share my experiences and help smooth your installation.
One of the big boosts comes from the standardization on the
IBM Developer Kit for Java, which improves the stability of the
DB2 Control Center and enables application developers to write
stored procedures and UDFs in Java. DB2 Version 7.1 also introduces the
ability to write stored procedures in SQL.
</para>
<para>
As time permits, I hope to provide hints and tips for improving the performance
of DB2 on Linux, and for configuring the environment on various Linux
distributions to be able to build DB2 applications in C, C++, and Java.
</para>
</sect2>
<sect2>
<title>Who should read this HOWTO?</title>
<para>
If you plan to install DB2 Version 7.1 on one of the Linux distributions
supported by IBM, this document is for you. The distributions that
IBM officially supports are:
<itemizedlist>
<listitem>
<para>
Caldera OpenLinux 2.4
</para>
</listitem>
<listitem>
<para>
Red Hat Linux 6.2
</para>
</listitem>
<listitem>
<para>
SuSE Linux 6.2 and 6.3
</para>
</listitem>
<listitem>
<para>
TurboLinux 6.0
</para>
</listitem>
</itemizedlist>
</para>
<para>
For Debian and Slackware, I have included <emphasis>very</emphasis> basic installation
instructions or links to other resources in <xref linkend="xfactor">. If you have any
other installation success stories, please forward me the details
and I'll try to expand the section. As time permits, I plan to try
to duplicate and confirm these installation instructions.
</para>
<para>
If you install DB2 Version 6.1 for Linux and DB2 hangs on the
<command>db2start</command> command, see
<ulink url="http://www-1.ibm.com/servlet/support/manager?rt=0&amp;rs=0&amp;org=swg&amp;doc=852568E5006F0CC68525693E00535FB3">db2start hangs on Linux distributions built with glibc 2.1</ulink>. I don't include any other DB2 Version 6.1
information in this document. If you plan to install DB2 Version 5.2 on Linux,
<emphasis>don't</emphasis>! (Have I emphasized that point enough?
All right, I'll stop now.) The Personal Developer's Edition
of DB2 Version 7.1 is available as a free (beer) download from IBM, at the
<ulink url="http://www.ibm.com/software/data/db2/udb/downloads.html">DB2
Universal Database download site</ulink>.
Registration is required, and, of course, your copy of DB2 is
only free as long as you don't use it in a production environment.
</para>
<para>
This document is really meant to help you install DB2 Version 7.1
on the previously listed Linux distributions. I've installed
DB2 on all of the distributions supported by IBM and noted the prerequisites and
quirks for each of them. I don't go into detail about the
various features of DB2, or what each installation option means, but
I do cover the basics that you need to know to get it installed.
</para>
</sect2>
<sect2>
<title>New versions of this document</title>
<para>
I like my friends at the Linux Documentation Project, so you'll
always be able to find the most up-to-date version of this document
at the <ulink url="http://www.linuxdoc.org"><acronym>LDP</acronym> web site</ulink>.
</para>
</sect2>
<sect2>
<title>Copyright and License</title>
<para>
Copyright (c) 2000 International Business Machines Incorporated.
</para>
<para>
This document is free documentation; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This document is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this document; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
</para>
</sect2>
<sect2>
<title>Credits</title>
<para>
Dan Scott is the originator and current maintainer of this HOWTO.
Please send all suggestions for improvement, criticisms, or more-or-less
related questions to me at <email>daniels@REMca.ibm.com</email> (remove
<emphasis>REM</emphasis> in my email address before sending).
Please send all spam or hate mail to <filename>/dev/null</filename>.
</para>
<para>
Feedback and suggestions for improvement have been provided by
Susan Williams, Serge Boivin, Darin McBride, and Xiaoyan Zhao.
Ronnie Seagren did an awesome job of editing the original version
for style and consistency.
</para>
<para>
Additional thanks to:
<itemizedlist>
<listitem>
<para>Andika Triwidada for contributing instructions to install
DB2 V7.1 on Debian using the <command>rpm</command> utility.
</para>
</listitem>
<listitem>
<para>
Michael Naughton for braving Red Hat 7 and figuring out the
<filename>libncurses.so.4</filename> prerequisite.
</para>
</listitem>
</itemizedlist>
</para>
</sect2>
<sect2>
<title>About the author</title>
<para>
Dan Scott has been employed by IBM Canada as an Information Developer
since 1998&mdash;approximately when DB2 was first ported to Linux. It's
probably just coincidence.
He has documented and tested DB2 application development for the bulk
of that time. In his spare time he can occasionally be found mourning for
his dearly departed motorcycle, abusing his body on his mountain bike,
or contemplating how to upgrade his Linux distribution at home (which
started life as Mandrake 5.3 and has mutated wildly ever since) without
suffering the wrath of his girlfriend.
</para>
</sect2>
</sect1>
<sect1 id="prereqs">
<title>Prerequisites</title>
<sect2>
<title>What are prerequisites?</title>
<indexterm><primary>installation prerequisites</primary></indexterm>
<indexterm><primary>prerequisites for installation</primary></indexterm>
<para>
Prerequisites are what you, your machine, and your distribution
require before you will be able to successfully install or use DB2.
The required prerequisites come straight from
<citetitle pubwork="book"><ulink url="http://www.ibm.com/cgi-bin/db2www/data/db2/udb/winos2unix/support/v7pubs.d2w/main">IBM DB2 Universal Database for UNIX Quick Beginnings</ulink></citetitle>.
The suggested prerequisites come from experience.
For your convenience, I've divided them into hardware and software requirements.
</para>
<variablelist>
<title>Hardware prerequisites</title>
<varlistentry>
<term>Processor</term>
<listitem>
<para>x86 compatible (for example, Intel, AMD, or Cyrix).
I've successfully installed DB2 Version 7.1 on a Pentium Pro 200 and a
Pentium II 350. Your experiences with other x86 processors would be
appreciated.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Memory</term>
<listitem>
<para>For application development, I've found 96 MB of
<acronym>RAM</acronym> is enough to run a small database
and test out your applications. Even the Control Center
responds acceptably if your processor speed is fast
enough. In my case, I was working with a Thinkpad 600 equipped
with a Pentium 233 MMX processor and 96 MB of RAM.
However, more memory is recommended if you're putting your
database into production or running multiple services.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Free disk space</term>
<listitem>
<para>
Of course, this depends on the components you install,
but for a typical installation of the DB2 Version 7.1 server,
the Administration Client, the Application Development Client,
the documentation, and the creation of a sample database,
you will need about 350 MB of free disk space.
</para>
</listitem>
</varlistentry>
</variablelist>
<variablelist>
<title>Software prerequisites</title>
<varlistentry>
<term>glibc</term>
<listitem>
<para><literal>2.1.2</literal> or greater. This can be a tough part of Linux to upgrade on
its own, so if your current distribution doesn't meet this requirement,
I would strongly suggest upgrading your entire distribution. For example,
I tried upgrading only the <literal>glibc</literal> portion of
TurboLinux 4.0 from <literal>2.1.1</literal> to <literal>2.1.3</literal>
and ran into a whole world of trouble.
</para>
<para>
DB2 Version 7.1 should work with <literal>glibc</literal> 2.1.1.
IBM sets prerequisites based on the systems with which they tested.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>kernel</term>
<listitem>
<para><literal>2.2.12</literal> or greater. I've upgraded to
<literal>2.2.15</literal> and recompiled the kernel
for my own purposes, and DB2 seems to work as well as before.
</para>
<para>
DB2 Version 7.1 should work with a minimum of kernel 2.2.10.
IBM sets prerequisites based on the systems with which they tested.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>libncurses</term>
<listitem>
<para><literal>4.x</literal>. For <command>db2setup</command> to work correctly,
this version of the library must be available on your system as
<filename>libncurses.so.4</filename>. Red Hat 7 installs
<literal>5.1</literal> by default, but you can install the
<ulink url="http://rpmfind.net/linux/RPM/libncurses.so.4.html"><literal>4.x</literal></ulink>
compatibility RPM to have it co-exist with <literal>5.0</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>libstdc++</term>
<listitem>
<para><literal>2.9.0</literal>. This exact version is mandatory.
On Debian 2.2, the default level is <literal>2.10.0</literal>,
but you can install version <literal>2.91.66-4</literal> using
<command>apt-get</command>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>pdksh</term>
<listitem>
<para><literal>5.2</literal> or greater. This is a public domain version of the
Korn shell that both the DB2 installer and the DB2 commands
require. You cannot do anything with DB2 without installing pdksh.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>rpm</term>
<listitem>
<para><literal>3.0</literal> or greater. DB2 for Linux is distributed
as a number of <acronym>RPM</acronym> packages, so you won't get far without
this piece of software. For information on installing DB2 on distributions
without using RPM, see <xref linkend="xfactor">.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Java</term>
<listitem>
<para>
The IBM Developer Kit for Java, <literal>1.1.8</literal> or <literal>1.3</literal>, is an
optional component, but is required to:
<itemizedlist>
<listitem>
<para>
use the DB2 Control Center to administer your databases using
a graphical user interface
</para>
</listitem>
<listitem>
<para>
create or run Java applications, including stored procedures
and user-defined functions
</para>
</listitem>
</itemizedlist>
</para>
<para>
As of this writing, the minimum required level of the
IBM Developer Kit for Java is the March 22, 2000 release.
You can get the IBM Developer Kit and Runtime Environment
for Linux, Java Technology Edition, from the IBM Java Developer Kit
downloads web site as follows:
<itemizedlist>
<listitem>
<para><ulink url="http://www.ibm.com/java/jdk/118/linux/">Version <literal>1.1.8</literal></ulink>
</para>
</listitem>
<listitem>
<para><ulink url="http://www.ibm.com/java/jdk/linux130/">Version <literal>1.3</literal></ulink>
</para>
</listitem>
</itemizedlist>
</para>
<para>
<emphasis>Please note</emphasis>: Other versions of Java, such
as the Blackdown or Sun JDKs, have not been tested with DB2 and
are not supported by IBM. And no, none of the distributions
I have seen so far package the IBM JDK. But do yourself a favour,
and get the IBM Developer Kit for Java.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<indexterm><primary>browser prerequisite</primary></indexterm>
<indexterm><primary>web browser prerequisite</primary></indexterm>
Web browser</term>
<listitem>
<para>
DB2 calls the <command>netscape</command> command when you:
<itemizedlist>
<listitem>
<para>
display the online help for the DB2 Control Center
</para>
</listitem>
<listitem>
<para>
display information using the DB2 Information Center
</para>
</listitem>
</itemizedlist>
The easiest approach is to install Netscape Navigator or Communicator
on your system. Netscape version <literal>4.72</literal> or above
is required to display the Business Intelligence Quick Tour, because of
its extreme use of JavaScript.
</para>
<para>
To use a browser other than Netscape to display online help
or information, create a link called <literal>netscape</literal>
to your preferred browser executable. The link must appear in
your PATH. For example, to display online help with <command>mozilla</command>,
you could create a link in <filename class="directory">/usr/local/bin</filename>
with the following command:
<programlisting>bash# ln -s <filename class="directory">/usr/bin/mozilla-bin</filename> <filename class="directory">/usr/local/bin/netscape</filename></programlisting>
</para>
</listitem>
</varlistentry>
</variablelist>
<para>
In the following table:
<itemizedlist>
<listitem>
<para>
<literal>unknown</literal> indicates that I don't
know what the default level is, and I haven't installed DB2 on this distribution
(your feedback is welcome!)
</para>
</listitem>
<listitem>
<para>
<literal>okay</literal> indicates that I don't
know what the default level is, but it worked when I installed DB2
</para>
</listitem>
<listitem>
<para>
<literal>**</literal> as a prefix indicates that the default level is not acceptable
and must be replaced
</para>
</listitem>
</itemizedlist>
</para>
<table frame="all">
<title>Prerequisite levels, by distribution</title>
<tgroup cols="7" align="center" colsep="1" rowsep="1">
<colspec colname="c1">
<colspec colname="c2">
<colspec colname="c3">
<colspec colname="c4">
<colspec colname="c5">
<colspec colname="c6">
<colspec colname="c7">
<thead>
<row>
<entry>Package</entry>
<entry>Caldera OpenLinux 2.4</entry>
<entry>Debian 2.2</entry>
<entry>Red Hat 6.2</entry>
<entry>Red Hat 7</entry>
<entry>SuSE 6.2</entry>
<entry>SuSE 6.3</entry>
<entry>TurboLinux 6.0</entry>
</row>
</thead>
<tbody>
<row>
<entry>glibc</entry>
<entry><literal>2.1.2</literal></entry>
<entry><literal>2.1.3</literal></entry>
<entry><literal>2.1.2</literal></entry>
<entry><literal>unknown</literal></entry>
<entry><literal>2.1.1</literal></entry>
<entry><literal>2.1.2</literal></entry>
<entry><literal>2.1.2</literal></entry>
</row>
<row>
<entry>Linux kernel</entry>
<entry><literal>2.2.14</literal></entry>
<entry><literal>2.2.17</literal></entry>
<entry><literal>2.2.14</literal></entry>
<entry><literal>unknown</literal></entry>
<entry><literal>2.2.10</literal></entry>
<entry><literal>2.2.13</literal></entry>
<entry><literal>2.2.13</literal></entry>
</row>
<row>
<entry>libncurses</entry>
<entry><literal>okay</literal></entry>
<entry><literal>okay</literal></entry>
<entry><literal>okay</literal></entry>
<entry><literal>**5.1</literal></entry>
<entry><literal>okay</literal></entry>
<entry><literal>okay</literal></entry>
<entry><literal>okay</literal></entry>
</row>
<row>
<entry>libstdc++</entry>
<entry><literal>2.9.0</literal></entry>
<entry><literal>**2.10.0</literal></entry>
<entry><literal>2.9.0</literal></entry>
<entry><literal>unknown</literal></entry>
<entry><literal>2.9.0</literal></entry>
<entry><literal>2.9.0</literal></entry>
<entry><literal>2.9.0</literal></entry>
</row>
<row>
<entry>pdksh</entry>
<entry><literal>5.2.14</literal></entry>
<entry><literal>5.2.14</literal></entry>
<entry><literal>5.2.14</literal></entry>
<entry><literal>unknown</literal></entry>
<entry><literal>5.2.14</literal></entry>
<entry><literal>5.2.14</literal></entry>
<entry><literal>5.2.14</literal></entry>
</row>
<row>
<entry>rpm</entry>
<entry><literal>okay</literal></entry>
<entry><literal>3.0.3</literal></entry>
<entry><literal>okay</literal></entry>
<entry><literal>unknown</literal></entry>
<entry><literal>okay</literal></entry>
<entry><literal>okay</literal></entry>
<entry><literal>okay</literal></entry>
</row>
</tbody>
</tgroup>
</table>
</sect2>
</sect1>
<sect1 id="preplinux">
<title>Preparing your distribution for DB2</title>
<sect2>
<title><productname>Caldera OpenLinux</productname> <productnumber>2.4</productnumber></title>
<sect3 id="calderapreinstall">
<title>Before installing DB2 on Caldera OpenLinux</title>
<para>
This section contains instructions that you must follow <emphasis>before</emphasis> installing DB2.
</para>
<procedure><title>Preparing for the installation of DB2</title>
<step>
<para>
Install the <filename>pdksh-5.2.14-1.i386.rpm</filename>
package from the <productname>Caldera OpenLinux</productname> CD-ROM in the
<filename class="directory">/Packages/RPMS/</filename> directory. For
example, log in as root, mount the CD-ROM, and enter the following command to
install the <literal>pdksh</literal> package:
<programlisting>bash# rpm -ivh /mnt/cdrom/Packages/RPMS/pdksh-5.2.14-1.i386.rpm</programlisting>
</para>
</step>
<step>
<para>
Remove the <literal>jdk</literal> package, (JDK 1.2.2 from Sun), since
it will conflict with the IBM Developer Kit for Java that you will
install in the next step. To remove Sun's JDK, issue the following command
as root: <programlisting>bash# rpm -e jdk</programlisting>
</para>
</step>
<step>
<para>
Install the IBM Developer Kit for Java. A brief set of installation
directions is included in <xref linkend="jdkinstall">.
</para>
</step>
<step>
<para>
Edit the <replaceable>JAVA_HOME</replaceable> and <replaceable>PATH</replaceable> entries
in <filename>/etc/config.d/shells/bashrc</filename> to remove
the references to the JDK from Sun and update them to reflect the IBM Developer
Kit for Java. The section that I changed started as:
<programlisting>
[ -z "$JAVA_HOME" ]&& [ -d /usr/java ] && (
export JAVA_HOME=/usr/java
[ -r $JAVA_HOME/lib/classes.zip ] &&
export CLASSPATH=$JAVA_HOME/lib/classes.zip
)
</programlisting>
</para>
<para>
Replace it with the following section to reflect the default
locations for the IBM Developer Kit for Java:
<programlisting>
[ -z "$JAVA_HOME" ]&& [ -d /usr/jdk118 ] && (
export JAVA_HOME=/usr/jdk118
export PATH=$PATH:$JAVA_HOME/bin
[ -r $JAVA_HOME/lib/classes.zip ] &&
export CLASSPATH=$JAVA_HOME/lib/classes.zip
)
</programlisting>
</para>
</step>
</procedure>
</sect3>
<sect3>
<title>Installing DB2 and creating instances on Caldera</title>
<para>
Follow the instructions in <xref linkend="db2install"> the generic section on installing DB2, and
go ahead and create the instances. It's probably a good idea at this point
to read through <xref linkend="calderapostinstall"> to keep in mind the steps
that you need to take after installing DB2.
</para>
<qandaset>
<qandaentry>
<question>
<para>
<emphasis>What does <computeroutput>/etc/login.defs not accessible, using defaults</computeroutput> mean?</emphasis>
</para>
</question>
<answer>
<para>
It means something went slightly wrong, but it's okay.
You may get this message splashed across your installation
screen one or more times during the DB2 installation process, but
other than not looking pretty, DB2 still installs correctly.
Caldera apparently doesn't include a <filename>/etc/login.defs</filename> configuration
file. The file controls the default options for the <command>useradd</command> command
for adding new users, including policies like how many days before the
new user's password expires and whether a home directory should be created for a new user.
For more information on the <filename>/etc/login.defs</filename> file, refer
to the <command>man</command> page for <command>useradd</command>.
</para>
</answer>
</qandaentry>
<qandaentry>
<question>
<para>
<emphasis>Okay, DB2 is installed and I created the instances. Now what do I do?</emphasis>
</para>
</question>
<answer>
<para>
Now that you've installed DB2, you have to perform some steps to configure
your instances correctly. Keep reading.
</para>
</answer>
</qandaentry>
</qandaset>
</sect3>
<sect3 id="calderapostinstall">
<title>After installing DB2 on Caldera</title>
<para>
This section contains instructions that you must follow <emphasis>after</emphasis> installing DB2.
</para>
<sect4 id="calderauid">
<title>Adding instance user IDs to their groups</title>
<para>
The most important step is to manually add the instance user ID to
the corresponding instance group you defined during the instance
creation step. DB2 and Caldera OpenLinux don't get this part of the
DB2 instance creation process right, so you have to do it yourself.
You can add an instance user ID to an instance group in two ways:
<itemizedlist>
<listitem>
<para>
Edit <filename>/etc/group</filename> to add the
appropriate instance user ID to the last field for each group.
</para>
</listitem>
<listitem>
<para>
Use the <acronym>COAS</acronym> utility to manage your
groups by selecting <guimenu>KDE</guimenu> menu,
<guimenuitem>Settings</guimenuitem>, <guimenuitem>COAS</guimenuitem>,
<guimenuitem>System</guimenuitem>, <guimenuitem>Accounts</guimenuitem>,
then selecting the <guisubmenu>Groups</guisubmenu> submenu and the
<guimenuitem>Manage Groups</guimenuitem> menu item.
</para>
</listitem>
</itemizedlist>
</para>
</sect4>
<sect4>
<title>Changing the default home page in Netscape</title>
<para>
The DB2 Control Center and the DB2 Information Center use the
Netscape browser to display help and documentation. This works
for the first document you display in the browser, but if you
try to switch to a different DB2 document (for example, from
one book to another), you may instead be redirected to the
default home page set by the Caldera OpenLinux installation
process. I found that this problem went away as soon as I changed
the default home page in the <guimenu>Edit</guimenu> menu,
<guimenuitem>Preferences</guimenuitem> menu item.
</para>
</sect4>
<sect4 id="calderagreeting">
<title>Removing the Caldera login greeting</title>
<para>
Add a file called <filename>.hushlogin</filename> to the
home directory of each of your instance user IDs. This should prevent
the <computeroutput>Welcome to your OpenLinux system!</computeroutput>
messages while running DB2 commands.
</para>
<para>
DB2 generates these messages on Caldera because the DB2 commands run
under the root user ID, which in turn becomes the instance owner to
invoke commands. Part of this <command>su</command> process
calls one or both of <filename>/etc/config.d/shells/csh.login</filename>
and <filename>/etc/config.d/shells/profile</filename>, which in turn
call the <filename>/etc/config.d/shells/OL-greeting</filename> script
that contains the offensive string.
</para>
<para>
Instead of adding <filename>.hushlogin</filename> to every
user's home directory, you could probably edit
<filename>/etc/config.d/shells/OL-greeting</filename>
to remove the message (or change it to something else, if you want).
I haven't tried it myself, so let me know what works best.
</para>
</sect4>
</sect3>
</sect2>
<sect2>
<title><productname>Red Hat Linux</productname> <productnumber>6.2</productnumber></title>
<sect3>
<title>Before installing DB2 on Red Hat</title>
<procedure><title>Preparing for the installation of DB2</title>
<step>
<para>
Install the <filename>pdksh-5.2.14-2.i386.rpm</filename>
package from the <productname>Red Hat</productname> CD-ROM in the
<filename class="directory">/RedHat/RPMS/</filename> directory. For
example, log in as root, mount the CD-ROM, and enter the following command to
install the <literal>pdksh</literal> package:
<programlisting>bash# rpm -ivh /mnt/cdrom/RedHat/RPMS/pdksh-5.2.14-2.i386.rpm</programlisting>
</para>
</step>
</procedure>
</sect3>
<sect3>
<title>Installing DB2 and creating instances on Red Hat</title>
<para>
Follow the instructions in <xref linkend="db2install">,
the generic section on installing DB2 and creating instances.
</para>
</sect3>
<sect3>
<title>After installing DB2 on Red Hat</title>
<para>
With <productname>Red Hat</productname> <productnumber>6.2</productnumber>,
you don't need to take any special steps after installing DB2 Version 7.1. It works.
</para>
</sect3>
</sect2>
<sect2>
<title><productname>SuSE Linux</productname> <productnumber>6.2</productnumber> or <productnumber>6.3</productnumber></title>
<sect3>
<title>Before installing DB2 on SuSE</title>
<para>
<productname>SuSE</productname> <productnumber>6.3</productnumber> includes
all of the required packages at or above the minimum required levels for
DB2 Version 7.1. If you have a choice between installing
<productname>SuSE</productname> <productnumber>6.3</productnumber>
or <productnumber>6.2</productnumber>, I would strongly recommend
installing <productnumber>6.3</productnumber>.
</para>
<para>
<productname>SuSE</productname> <productnumber>6.2</productnumber>,
ships with a <literal>glibc</literal> level of 2.1.1 and a kernel level
of 2.2.10; however, in my tests this did not
cause any problems with installation, running the DB2 Control Center,
or creating and running Java and C applications for DB2.
</para>
</sect3>
<sect3>
<title>Installing DB2 and creating instances on SuSE</title>
<para>
Follow the instructions in <xref linkend="db2install">,
the generic section on installing DB2.
When you create the instances, keep in mind the following information
about creating instances on <productname>SuSE</productname>.
</para>
<sect4>
<title>Creating instances on <productname>SuSE</productname></title>
<para>
The default installation packages in the SuSE distribution include an
old beta version of DB2. This means that the default DB2 user IDs and groups
used by the Create Instance menu are already created when you try to
create an instance for DB2 Version 7.1, causing the following problems:
</para>
<itemizedlist>
<listitem>
<para>
<emphasis>Default user name already exists</emphasis>
</para>
<para>
Because the default user name already exists, the DB2 Create Instance
panel places the corresponding user ID in the "User ID" field. This
can cause a problem when you change the value of the User Name field
to reflect the name of the new instance, because the value of the "User ID"
still reflects the original user name.
</para>
<para>
Ensure that you select the "Use default UID" check box to automatically
associate the new user name with its corresponding user ID.
</para>
</listitem>
<listitem>
<para>
<emphasis>Default group name already exists</emphasis>
</para>
<para>
Because the default group name already exists, the DB2 Create Instance
panel places the corresponding group ID in the Group ID field. This
can cause a problem when you change the value of the Group Name field
to reflect the name of the new instance, because the value of the Group ID
still reflects the original group name.
</para>
<para>
Ensure that you select the "Use default GID" check box to automatically
associate the new group name with its corresponding group ID.
</para>
</listitem>
<listitem>
<para>
<emphasis>Default home directory points to <filename class="directory">/usr/lib/db2/</filename></emphasis>
</para>
<para>
Because the default user name already exists and was created in the
<filename class="directory">/usr/lib/db2/</filename> directory, you have
to manually specify the location of the new instance. The default home
directory is <filename class="directory">/home/</filename>.
</para>
</listitem>
</itemizedlist>
</sect4>
</sect3>
<sect3>
<title>After installing DB2 on SuSE</title>
<para>
With <productname>SuSE</productname> <productnumber>6.2</productnumber>
or above, I have not needed to take any special steps after
installing DB2 Version 7.1. It just works&mdash;and that's nice.
</para>
</sect3>
</sect2>
<sect2>
<title><productname>TurboLinux</productname> <productnumber>6.0</productnumber></title>
<sect3>
<title>Before installing DB2 on TurboLinux</title>
<para>
<productname>TurboLinux</productname> <productnumber>6.0</productnumber> includes
all of the required packages at or above the minimum required levels for
DB2 Version 7.1.
</para>
</sect3>
<sect3>
<title>Installing DB2 on TurboLinux</title>
<para>
Follow the instructions in <xref linkend="db2install">,
the generic section on installing DB2.
</para>
</sect3>
<sect3>
<title>After installing DB2 on TurboLinux</title>
<para>
When you run the DB2 Control Center with <productname>TurboLinux</productname> <productnumber>6.0</productnumber>,
the console window may display a number of <computeroutput>map failed</computeroutput> messages.
These messages do <emphasis>not</emphasis> indicate a serious problem, so do not
worry about them.
</para>
</sect3>
</sect2>
</sect1>
<sect1 id="db2install">
<title>Installing DB2 using <command>db2setup</command></title>
<para>
The purpose of this section is to walk you through a typical install
of DB2 Version 7.1 on Linux. The following section, <xref linkend="db2instance">,
tells you how to create both a DB2 Administration Server
and a DB2 instance. For in-depth information on the components offered
by DB2 Version 7.1, consult the following documents:
<itemizedlist>
<listitem>
<para>
<citetitle pubwork="book"><ulink url="http://www.ibm.com/cgi-bin/db2www/data/db2/udb/winos2unix/support/v7pubs.d2w/main">DB2 for UNIX Quick Beginnings</ulink></citetitle>
</para>
</listitem>
<listitem>
<para>
<citetitle pubwork="book"><ulink url="http://www.ibm.com/cgi-bin/db2www/data/db2/udb/winos2unix/support/v7pubs.d2w/main">DB2 Personal Edition for Linux Quick Beginnings</ulink></citetitle>
</para>
</listitem>
<listitem>
<para>
<citetitle pubwork="book"><ulink url="http://www.ibm.com/cgi-bin/db2www/data/db2/udb/winos2unix/support/v7pubs.d2w/main">DB2 Connect Personal Edition for Linux Quick Beginnings</ulink></citetitle>
</para>
</listitem>
</itemizedlist>
</para>
<para>
For the purposes of this document, I'll assume that you have
a copy of DB2 Version 7.1 on CD-ROM. If you download a copy from IBM,
just adjust the path <filename class="directory">/mnt/cdrom</filename>
in the following instructions to reflect the directory created by
the <command>tar</command> command.
</para>
<sect2>
<title>Using the <command>db2setup</command> utility</title>
<para>
You'll find the following executables on the root directory
of the DB2 Version 7.1 installation CD-ROM:
<itemizedlist>
<listitem>
<para>
<command>db2setup</command>:
Use the <command>db2setup</command> command to install DB2 Version 7.1, to create or modify
DB2 instances, and to create a DB2 Administration Server. Once you install DB2,
<command>db2setup</command> is copied to the
<filename class="directory">/usr/IBMdb2/V7.1/install</filename> directory
to enable you to create or modify instances without the CD-ROM.
</para>
</listitem>
<listitem>
<para>
<command>db2_install</command>:
The <command>db2_install</command> command provides an alternate
means of installing DB2 RPMs. Unlike <command>db2setup</command>,
it does not enable you to create a DB2 instance or Administration Server,
or install a license key. I highly recommend <command>db2setup</command>.
</para>
</listitem>
<listitem>
<para>
<command>db2_deinstall</command>:
Use the <command>db2_deinstall</command> command to uninstall
the DB2 Version 7.1 packages on your system. For more information, see
<xref linkend="uninstall">.
</para>
</listitem>
</itemizedlist>
</para>
<note>
<para>
The <command>db2setup</command> command provides a terminal-based
text menu for your installation and instance creation options.
Unfortunately, <command>db2setup</command> on Linux sometimes
encounters a few formatting bugs in terminal emulators.
Running <command>db2setup</command> from the
TTY console works well. Within an X session, the
<command>rxvt</command> or <command>xterm</command> terminals
work quite well, but <command>gnome-terminal</command>
is rather frustrating to use.
If the text menu formats incorrectly, press <keysym>CTRL-L</keysym>
to refresh the menu.
</para>
</note>
</sect2>
<sect2 id="db2components">
<title>Installing DB2 components</title>
<para>
The following instructions assume that you are using <command>db2setup</command> to
install DB2.
</para>
<para>
To select or deselect a component, highlight the component using
the cursor keys and press <keycap>ENTER</keycap>.
</para>
<para>
To change the options for a component, highlight <literal>[ Customize... ]</literal>
and press <keycap>ENTER</keycap>.
</para>
<para>
To install your selected components, highlight <literal>[ OK ]</literal>
on the <literal>Install DB2 V7</literal> menu and press <keycap>ENTER</keycap>.
</para>
<para>
The common DB2 files are installed in the
<filename class="directory">/usr/IBMdb2/V7.1/</filename> directory. When you
create an instance, a directory called <filename class="directory">sqllib</filename>
is created in the corresponding user's home directory. The
<filename class="directory">sqllib</filename> directory contains symbolic links
to the executables and other files in <filename class="directory">/usr/IBMdb2/V7.1/</filename>.
</para>
<para>
The following list describes some of the common DB2 components that you can
install, including estimates of the size required for each component.
</para>
<variablelist>
<title>Description of DB2 components</title>
<varlistentry>
<term>Administration Client</term>
<listitem>
<para>
The Administration Client enables database administrators to administer local or remote
DB2 servers from the command line. This component, without Java support or the
Control Center, requires about 20 MB of disk space.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Control Center</term>
<listitem>
<para>
The Control Center (<command>db2cc</command>) is an optional part of many
DB2 components. It gives database administrators a graphical interface for
administering local or remote DB2 servers.
The Control Center includes the DB2 Information Center (<command>db2ic</command>),
which gives you a graphical interface that provides a tree view of the DB2 documentation
installed on your workstation organized by task or by title.
</para>
<para>
Note that both the Control Center and Information Center are Java applications, so
their performance depends on your system's processor speed and available memory.
This component requires about 90 MB of disk space.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>DB2 UDB Enterprise Edition</term> <term>DB2 UDB Workgroup Edition</term> <term>DB2 Personal Edition</term>
<listitem>
<para>
These components determine the state of your DB2 installation as a database server.
The core capabilities of the components are the same. The difference between
Enterprise Edition and Workgroup Edition primarily has to do with how they are
licensed--Enterprise Edition is licensed on a per-processor basis
with unlimited users, while Workgroup Edition is licensed on a per-user basis.
Enterprise Edition also gives you the capability to enable DB2 clients to connect
to mainframe databases, like DB2 for OS/390 or DB2 for OS/400. In contrast,
Personal Edition is a single user database server that is useful only for developing
DB2 applications. You cannot use Personal Edition as a server because Personal Edition
does not accept incoming remote connections.
</para>
<para>
Adding one of these components requires about 40 MB of disk space.
</para>
<variablelist>
<title>Options for DB2 servers</title>
<varlistentry>
<term>Replication</term>
<listitem>
<para>
This option enables your DB2 server to replicate data to other
DB2 servers, and, with additional software, across non-DB2 servers as well.
This option requires about 5 MB of disk space.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Distributed Join for DB2 Data Sources</term>
<listitem>
<para>
This option enables your DB2 server to participate in a join with
data from other database servers.
This option requires about 2 MB of disk space.
</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
<varlistentry>
<term>Application Development Client</term>
<listitem>
<para>
The Application Development Client component installs the headers and libraries
that you need to create applications using embedded SQL for C and C++,
Call Level Interface (<acronym>CLI</acronym>),
Java Database Connectivity (<acronym>JDBC</acronym>),
or embedded SQL for Java (<acronym>SQLJ</acronym>).
You also have the option of installing the source code for sample applications
that demonstrate much of the functionality of DB2.
</para>
<tip>
<para>
If you plan on developing applications for DB2, install the sample applications.
The sample directories in <filename class="directory">/usr/IBMdb2/V7.1/samples/</filename>
contain build scripts (<filename>bld***</filename>) that include the compile and link
options suitable for your own applications.
</para>
</tip>
<tip>
<para>
If you are trying to develop applications and you get an error like
"That command is not supported in this environment" while trying to precompile a file,
it's because you either did not install the Application Development Client, or
you installed it after you created an instance and you have not used the
<command>db2iupdt</command> command to update the instance. See <xref linkend="tsinstall">
for more information on <command>db2iupdt</command>.
</para>
</tip>
<para>
Including the sample applications, this component requires about 10 MB of disk space.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>DB2 Product Library (HTML documentation)</term>
<listitem>
<para>
Documentation is installed into the
<filename class="directory">/usr/IBMdb2/V7.1/doc/</filename> directory. For each language
that you install, the DB2 installer creates a subdirectory with a five-character
name corresponding to the language locale.
Issue the <command>db2help</command> command to fire up your Web browser with
a page that links to the <ulink url="file:///usr/IBMdb2/V7.1/doc/html/index.htm">documentation installed with DB2</ulink>.
</para>
<para>
The English HTML (En_US) documentation requires about 90 MB of disk space.
</para>
</listitem>
</varlistentry>
</variablelist>
</sect2>
</sect1>
<sect1 id="xfactor">
<title>Installing DB2 on other Linux distributions</title>
<para>
DB2 Version 7.1 is distributed as a set of RPM packages. If you want to install DB2
on a distribution that is not officially supported by IBM, and that
distribution satisfies all of the prerequisites specified in <xref linkend="prereqs">,
all that you theoretically need to do is find a way to install those packages on your distribution.
The <command>alien</command> utility available from
<ulink url="http://kitenet.net/programs/alien/">Kite</ulink> converts RPM packages
into formats supported by Debian (<literal>dpkg</literal>), Stampede
(<literal>slp</literal>), and Slackware (<literal>slp</literal>).
</para>
<variablelist>
<varlistentry>
<term>Debian</term>
<listitem>
<para>
Susan Williams reported success in installing DB2 Version 7.1 on Debian using
the following script as root:
<example>
<title>Installation script for DB2 Version 7.1 on Debian</title>
<programlisting>
#!/bin/bash
cd /
for f in /mnt/cdrom1/db2/*rpm
do
alien -d -i -c $f
done
</programlisting>
</example>
</para>
<!-- Future work -->
<para>
This script installs every DB2 package on the CD-ROM. In a future iteration of
this document I plan to provide a description of all of the DB2 packages to help
you develop a more selective approach for your installation.
</para>
<para>
Using this approach apparently prevents you from using the <command>db2setup</command> command
to create instances. To create a DB2 Administration Server from the command line,
issue the <filename>/usr/ibmdb2/v7.1/instance/<command>dasicrt</command></filename> command as root.
To create a DB2 instance, issue the <filename>/usr/ibmdb2/v7.1/instance/<command>db2icrt</command></filename>
command as root. To get the correct syntax for either command, use the <literal>-h</literal> flag.
</para>
<para>
Further information on installing DB2 on Debian is available from Tiago Antao's page,
<ulink url="http://tiago.org/db2-4-linux.html">Agnostic DB2 V7.1 for GNU/Linux</ulink>.
</para>
<para>
In the following section, Andika Triwidada describes how to install
DB2 on Debian 2.2 using the <command>rpm</command> command.
You can check the prerequisite package levels (described in <xref linkend="prereqs">)
installed on your system with the following command:
<programlisting>
$ dpkg -l|egrep -e '(libc6|libstdc++|pdksh|rpm|zip)'|awk '{print $1,$2,$3}'
</programlisting>
The resulting list should contain:
<programlisting>
ii libc6 2.1.3-13
ii libstdc++2.9-glibc2.1 2.91.66-4
ii pdksh 5.2.14-1
ii rpm 3.0.3-1
ii unzip 5.40-1
</programlisting>
</para>
<para>
If you are missing any of these packages, you can install the package using <command>apt-get</command>:
<programlisting>
bash# apt-get install <replaceable>package-name</replaceable>
</programlisting>
</para>
<procedure>
<title>Installation Steps</title>
<step>
<para>
Initialize the RPM database.
<programlisting>
bash# rpm --initdb
</programlisting>
</para>
</step>
<step>
<para>
Modifiy several files in <filename class="directory">/bin</filename>
<programlisting>
bash# mv /bin/sh /bin/sh.bash
bash# ln -s /usr/bin/ksh /bin/sh
bash# for f in awk basename ksh passwd sort touch; do ln -s /usr/bin/$f /bin/$f; done
</programlisting>
</para>
</step>
<step>
<para>
Copy the contents of the following script to create an RPM wrapper
called <filename>/bin/rpm</filename>.
<programlisting>
#!/bin/sh
# RPM wrapper, force RPM installation without checking any dependencies
if [ "$1" = "-ivh" ]
then
shift
/usr/bin/rpm -ivh --nodeps $*
else
/usr/bin/rpm $*
fi
</programlisting>
</para>
</step>
<step>
<para>
Make the RPM wrapper executable:
<programlisting>
bash# chmod +x /bin/rpm
</programlisting>
</para>
</step>
<step>
<para>
Install DB2 using the <command>db2setup</command> command by following
the instructions in <xref linkend="db2install">.
</para>
</step>
<step>
<para>Create the DB2 administration server and at least one DB2 instance
as described in <xref linkend="db2instance">. To simplify testing,
ensure that you create the sample database when you create the DB2 instance.
</para>
</step>
</procedure>
<procedure>
<title>Testing your DB2 installation</title>
<step>
<para>
Log on to your Linux server with the DB2 instance user ID. Remember,
the default user ID is <literal>db2inst1</literal>.
</para>
</step>
<step>
<para>
Prepare your DB2 environment by running the <command>db2profile</command>
script:
<programlisting>
bash$ cd ~/sqllib
bash$ . ./db2profile
</programlisting>
</para>
</step>
<step>
<para>
Run a query against the sample database to test your installation.
<programlisting>
bash$ db2
bash$ db2 =&gt; connect to sample
bash$ db2 =&gt; select * from employee
</programlisting>
There should be a printout of records from sample database here
<programlisting>
$ db2 =&gt; quit
</programlisting>
</para>
</step>
</procedure>
<procedure>
<title>After you install DB2</title>
<step>
<para>
Remove the RPM wrapper script by removing, renaming, or linking it directly to <filename>/usr/bin/rpm</filename>.
<programlisting>
bash# rm /bin/rpm
</programlisting>
</para>
</step>
<step>
<para>
Change <filename>/bin/sh</filename> back into a symlink to <filename>/usr/bin/bash</filename>.
<programlisting>
bash# ln -sf /usr/bin/bash /bin/sh
</programlisting>
</para>
</step>
</procedure>
</listitem>
</varlistentry>
<varlistentry>
<term>Slackware</term>
<listitem>
<para>
Thorough information on installing DB2 on Slackware 7.1 using <command>RPM</command> is available
from James Phillips' page, <ulink url="http://www.webdaemons.com/db2install.html">Installing DB2 on Slackware Linux</ulink>.
</para>
</listitem>
</varlistentry>
</variablelist>
</sect1>
<sect1 id="db2instance">
<title>Creating DB2 instances</title>
<para>
This section gives you a brief overview of DB2 instances
and the DB2 Administration Server, and tells you how to create them.
</para>
<para>
Some IBM documentation uses the term "instance" to refer to both
DB2 instances and a DB2 Administration Server. The basic similarity
between a DB2 Administration Server and a DB2 instance,
or "database manager", is that each is associated with a
unique user ID. When you create either a DB2 instance or a
DB2 Administration Server, DB2:
<itemizedlist>
<listitem>
<para>
creates one or more new user IDs and corresponding home directories
</para>
</listitem>
<listitem>
<para>
creates a subdirectory in the instance home directory called
<filename class="directory">sqllib</filename>
</para>
</listitem>
<listitem>
<para>
alters the <filename>.bashrc</filename> file to call the
<filename class="directory">~/sqllib/</filename><filename>db2profile</filename> shell
script to set up the environment for the instance
</para>
</listitem>
</itemizedlist>
</para>
<sect2>
<title>Overview of DB2 Administration Server</title>
<para>
Like a queen bee in a hive, only one DB2 Administration Server can
exist on any given DB2 server. By locally or remotely logging as the user ID that
corresponds to the DB2 Administration Server, a database administrator
uses the DB2 Administration Server to create, drop, or change the properties
of DB2 instances.
</para>
</sect2>
<sect2>
<title>Overview of DB2 instance</title>
<para>
To quote the IBM DB2 Universal Database Version 7.1 Administration Guide definition of an instance:
<blockquote>
<para>
An instance (sometimes called a database manager) is DB2 code that manages data.
It controls what can be done to the data, and manages system resources assigned to it.
Each instance is a complete environment. ... An instance has its own databases (which
other instances cannot access), and all its database partitions share the same system
directories. It also has separate security from other instances on the same machine (system).
</para>
</blockquote>
What this boils down to is that for every DB2 instance, DB2 requires a unique user ID
on your Linux workstation. Security for an instance is provided by the normal
password authentication process for any Linux user ID. Each instance can contain
one or more databases, each of which inherits settings from their instance.
</para>
<procedure>
<title>Creating the Administration Server using <command>db2setup</command></title>
<para>
The DB2 Administration Server requires about 3 MB of disk space.
The following steps guide you through the process of creating a
DB2 Administration Server.
</para>
<step>
<para>
Issue the <command>db2setup</command> command as described in <xref linkend="db2components">.
</para>
</step>
<step>
<para>
Select <literal>[ Create... ]</literal>.
</para>
</step>
<step>
<para>
Select the check box for Create the Administration Server. The Administration Server
window is displayed.
</para>
</step>
<step>
<para>
Enter a unique user name in the User Name field. You can use an existing user
name that is not already in use by a DB2 instance, but it is probably simpler to
create a new user for each instance.
</para>
</step>
<step>
<para>
Select the Use default UID check box. As far as I can tell, this setting is always right.
</para>
</step>
<step>
<para>
Enter a unique group name in the Group Name field. You can use an existing group name if
you wish, but creating a new group ensures that you do not inadvertently give permissions
to other users on your system.
</para>
</step>
<step>
<para>
Select the Use default GID check box. Again, as far as I can tell,
this setting is always right.
</para>
</step>
<step>
<para>
Ensure that the value of the Home Directory field reflects the home directory of
the user ID.
<warning>
<para>
SuSE users: The prefix for the home directory may default to
<filename class="directory">/usr/lib/db2/</filename>. This is almost
certainly wrong; the value for a standard SuSE system should be
<filename class="directory">/home/</filename>.
</para>
</warning>
</para>
</step>
<step>
<para>
Enter a unique password in the Password and Verify Password fields.
<warning>
<para>
<emphasis>Enter a new password!</emphasis> If you do not enter a new password in these fields,
DB2 assigns the default password <literal>ibmdb2</literal>, giving crackers a wide-open
front door to your system.
</para>
</warning>
</para>
</step>
</procedure>
<procedure>
<title>Creating a DB2 instance using <command>db2setup</command></title>
<para>
A DB2 instance requires about 2 MB of disk space. A sample database for a DB2 instance
requires about 16 MB of disk space.
The following steps guide you through the process of creating a DB2 instance.
</para>
<step>
<para>
Issue the <command>db2setup</command> command as described in <xref linkend="db2components">.
</para>
</step>
<step>
<para>
Select <literal>[ Create... ]</literal>.
</para>
</step>
<step>
<para>
Select the Create a DB2 Instance check box. The DB2 Instance window is displayed.
</para>
</step>
<step>
<para>
Enter a unique user name in the User Name field. You can use an existing user
name that is not already in use by a DB2 instance, but it is probably simpler to
create a new user for each instance.
</para>
</step>
<step>
<para>
Select the Use default UID check box. As far as I can tell, this setting is always right.
</para>
</step>
<step>
<para>
Enter a unique group name in the Group Name field. You can use an existing group name if
you wish, but creating a new group ensures that you do not inadvertently give permissions
to other users on your system.
</para>
</step>
<step>
<para>
Select the Use default GID check box. Again, as far as I can tell,
this setting is always right.
</para>
</step>
<step>
<para>
Ensure that the value of the Home Directory field reflects the home directory of
the user ID.
<warning>
<para>
SuSE users: The prefix for the home directory may default to
<filename class="directory">/usr/lib/db2/</filename>. This is almost
certainly wrong; the value for a standard SuSE system should be
<filename class="directory">/home/</filename>.
</para>
</warning>
</para>
</step>
<step>
<para>
Enter a unique password in the Password and Verify Password fields.
<warning>
<para>
<emphasis>Enter a new password!</emphasis> If you do not enter a new password in these fields,
DB2 assigns the default password <literal>ibmdb2</literal>, giving crackers a wide-open
front door to your system.
</para>
</warning>
</para>
</step>
<step>
<para>
Select <literal>[ Properties... ]</literal> to change the properties for the instance.
</para>
<substeps>
<step>
<para>
Under the Authentication Type heading, select the Server Encrypt check box.
This greatly improves the security of your system, by telling DB2 to accept
encrypted passwords, rather than plain text passwords.
</para>
</step>
<step>
<para>
Select the Auto start DB2 Instance at system boot check box if you want to start
this DB2 instance every time you reboot your system.
</para>
</step>
<step>
<para>
Select the Create a sample database for DB2 Instance check box if you plan
to work with the sample applications available with the Application Development Client.
To run correctly, most of the sample applications require the specific tables and data
of the sample database. If you do not create the sample database now, you can create it
later using the <command>db2sampl</command> command.
</para>
</step>
</substeps>
</step>
<step>
<para>
Select <literal>[ OK ]</literal> to create the DB2 instance. The Fenced User text
window is displayed. Repeat the previous steps for creating a new user and group.
Server-side DB2 executables, such as stored procedures and user-defined functions,
execute under the permissions of the fenced user ID.
By controlling the permissions of the fenced user ID, you control the
permissions of the server-side DB2 executables.
</para>
</step>
<step>
<para>
Select <literal>[ OK ]</literal> to create the fenced user.
</para>
</step>
</procedure>
</sect2>
</sect1>
<sect1 id="uninstall">
<title>Removing DB2</title>
<para>To remove DB2 from your workstation cleanly, perform
the following steps:
</para>
<procedure>
<!--
<step>
<para>
Log in as the instance user ID.
</para>
</step>
<step>
<para>
List all databases: <userinput>db2 "LIST DATABASE DIRECTORY"</userinput>.
</para>
</step>
<step>
<para>
Drop all databases: <userinput>db2 "DROP DATABASE <replaceable>database-name</replaceable>"</userinput> for
each local database listed in the previous step.
</para>
</step>
-->
<step>
<para>
Log in as root.
</para>
</step>
<step>
<para>
List all DB2 instances: <programlisting>bash# /usr/IBMdb2/V7.1/instance/db2ilist</programlisting>
</para>
</step>
<step>
<para>
Drop each instance listed in the previous step with the following command:
<programlisting>bash# /usr/ibmdb2/v7.1/instance/db2idrop <replaceable>instance-name</replaceable></programlisting>
</para>
</step>
<step>
<para>
Drop the DB2 administration server:
<programlisting>bash# /usr/IBMdb2/V7.1/instance/dasidrop `/usr/IBMdb2/V7.1/instance/dasilist`</programlisting>
</para>
</step>
<step>
<para>
Uninstall all of the DB2 packages on your system using the <command>db2deinstall</command>
command on your DB2 CD-ROM:
<programlisting>bash# /mnt/cdrom/db2/db2_deinstall -n</programlisting>
</para>
</step>
</procedure>
</sect1>
<sect1 id="usingdb2">
<title>Using DB2</title>
<para>
This section gives you the basic information you need to start working
with DB2 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.
</para>
<note>
<para>
This section assumes that you have followed the instructions in
<xref linkend="jdkinstall">.
</para>
</note>
<sect2>
<title>DB2 Control Center</title>
<para>
The left side of the DB2 Control Center provides an
object-oriented 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 an object to bring up a
menu.
</para>
<procedure>
<title>To start the DB2 Control Center</title>
<step>
<para>
Ensure you are logged on to your Linux workstation using either the
DB2 Administration Server user ID or the DB2 instance user ID. If you
use the <command>su</command> command to become the user, ensure you
include the <literal>-l</literal> parameter to initialize the
environment for the user.
</para>
</step>
<step>
<para>
Start the X server, if it is not already started.
</para>
</step>
<step>
<para>
Issue the <command>db2cc</command> command to start the DB2 Control Center.
Depending on the speed of your system, it may take a few seconds
for the splash screen to appear, and longer before the
full DB2 Control Center appears.
</para>
</step>
</procedure>
</sect2>
<sect2>
<title>DB2 Information Center</title>
<para>
The DB2 Information Center provides tree views of the
information about DB2 that is installed on your system,
as well as a number of links to web sites with further
information. If you did not install the DB2 documentation,
the tree views contain fewer links.
</para>
<procedure>
<title>To start the DB2 Information Center</title>
<step>
<para>
Ensure you are logged on to your Linux workstation using either the
DB2 Administration Server user ID or the DB2 instance user ID. If you
use the <command>su</command> command to become the user, ensure you
include the <literal>-l</literal> parameter to initialize the
environment for the user.
</para>
</step>
<step>
<para>
Ensure that the X server is started.
</para>
</step>
<step>
<para>
Issue the <command>db2ic</command> command to start the DB2 Information Center.
Depending on the speed of your system, it may take a few seconds
for the splash screen to appear, and longer before the
full DB2 Information Center appears.
</para>
</step>
</procedure>
</sect2>
<sect2>
<title>The DB2 command line</title>
<para>
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.
</para>
<para>
If this is your first time using DB2, I would suggest creating the
sample database that ships with DB2. 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
<literal>Create the sample database</literal> option when you
create a DB2 instance, or issue the <command>db2sampl</command>
command from the DB2 command line.
</para>
<para>
Before you can issue an SQL statement, you have to connect to a
database. To connect to a database:
<itemizedlist>
<listitem>
<para>
<command>db2 CONNECT TO <replaceable>database</replaceable> USER <replaceable>userID</replaceable> USING <replaceable>password</replaceable></command>
</para>
</listitem>
</itemizedlist>
</para>
<para>
To connect to a database, and have DB2 prompt you for the password:
<itemizedlist>
<listitem>
<para>
<command>db2 CONNECT TO <replaceable>database</replaceable> USER <replaceable>userID</replaceable></command>
</para>
</listitem>
</itemizedlist>
</para>
<para>
To connect to a database using the default user ID:
<itemizedlist>
<listitem>
<para>
<command>db2 CONNECT TO <replaceable>database</replaceable></command>
</para>
</listitem>
</itemizedlist>
</para>
<para>
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 columns from the <literal>EMPLOYEE</literal>
table in the <literal>SAMPLE</literal> database,
issue the following command: <programlisting>bash&dollar; db2 "SELECT * FROM employee"</programlisting>
</para>
<note>
<para>
You can avoid typing <command>db2</command> as the prefix for every
SQL statement and DB2 command by issuing commands using the
Command Line Processor (<acronym>CLP</acronym>). To start the CLP,
issue the <command>db2</command> command by itself. DB2 provides the following prompt:
<programlisting>
You can issue database manager commands and SQL statements from the command
prompt. For example:
db2 =&gt; connect to sample
db2 =&gt; 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 =&gt;
</programlisting>
I don't use the CLP because it prevents me from using the
command line history feature of my shell. I find myself using
the command line history a lot when I'm issuing SQL statements.
</para>
<para>
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.
</para>
</note>
</sect2>
</sect1>
<sect1 id="db2trouble">
<title>Troubleshooting</title>
<para>
The following section covers some of the common problems you may encounter
while installing DB2, creating an instance, or using a DB2 database.
</para>
<sect2 id="tsinstall">
<title>Problems with DB2 installation</title>
<indexterm><primary>installation</primary><secondary>troubleshooting</secondary></indexterm>
<para>
The following section covers some of the common problems you may encounter
when you install DB2.
</para>
<qandaset>
<qandaentry>
<question>
<para>
<emphasis>When I try to run <command>db2setup</command>, I get the following error:
<computeroutput>DBI1503E An error was encountered when opening
or writing to file, "/tmp/.dbinst.swp".</computeroutput></emphasis>
</para>
</question>
<answer>
<para>
DB2 issues this error when it can't find the <command>pdksh</command> or <command>ksh</command>
shells. This has probably occurred because you did not install the <literal>pdksh</literal>
package for your distribution. See <xref linkend="preplinux"> for more details on installing
the <command>pdksh</command> package for your Linux distribution.
</para>
</answer>
</qandaentry>
<qandaentry>
<question>
<para>
<emphasis>When I try to run <command>db2setup</command>, I get the following error:
<computeroutput>./db2inst: error while loading shared libraries: libncurses.so.4: cannot
open shared object file: No such file or directory</computeroutput></emphasis>
</para>
</question>
<answer>
<para>
DB2 issues this error when it can't find the <filename>libncurses.so.4</filename> library. Red Hat 7
does not include this level of the library in their standard <filename>ncurses-5.1-2</filename> package,
requiring that you install the <filename>ncurses4-5.0-2</filename> library for backwards compatibility.
</para>
</answer>
</qandaentry>
<qandaentry>
<question>
<para>
<emphasis>After creating a DB2 instance, I installed the Application Development Client,
but I can't use that instance to create DB2 applications.</emphasis>
</para>
</question>
<answer>
<para>
When you add the Application Development Client after you initially install
DB2 and create a DB2 instance, your existing DB2 instance won't recognize the
<command>db2 prep</command> command. Instead, DB2 returns the following error:
<computeroutput>DB21051E The command is not supported for this environment.</computeroutput>
</para>
<para>
The problem is that when you install a new DB2 component, DB2 does not automatically update
existing DB2 instances to include links to the new libraries and executables.
To update an existing DB2 instance, use the <command>db2iupdt</command> command as root:
<programlisting>bash# /usr/IBMdb2/V7.1/instance/db2iupdt <replaceable>instance-name</replaceable></programlisting>
To update all existing DB2 instances, issue the following command as root:
<programlisting>bash# /usr/IBMdb2/V7.1/instance/db2iupdt -e</programlisting>
</para>
</answer>
</qandaentry>
</qandaset>
</sect2>
<sect2>
<title>Problems creating a DB2 instance</title>
<indexterm><primary>instance creation</primary><secondary>troubleshooting</secondary></indexterm>
<indexterm><primary>creating DB2 instances</primary><secondary>troubleshooting</secondary></indexterm>
<para>
The following section covers some of the common problems you may encounter
when you create a DB2 instance.
</para>
<qandaset>
<qandaentry>
<question>
<para>
<emphasis>Creating a DB2 instance or a DB2 Administration Server fails.</emphasis>
</para>
</question>
<answer>
<para>
DB2 often fails to create an instance because you became root by issuing the command
<userinput>bash&dollar; su root</userinput> rather than <userinput>bash&dollar; su -l root</userinput>, which
uses the environment settings for the root account. Check the contents of the DB2 install log
in <filename>/tmp/db2setup.log</filename>. If the installer has issued the following error message:
<programlisting>
DBI1517E An attempt to execute a command in a subprocess failed.
Explanation: An error was detected when attempting to execute a command in a subprocess. One of the
following problems occurred:
o The command does not exist.
o Incomplete command search path.
o Incorrect access permissions on the command.
o System resource problem.
</programlisting>
then most likely your root account did not have the
<filename class="directory">/usr/sbin</filename> directory in the PATH
environment variable for root.
</para>
<para>PATH is normally set correctly for you if you log in as
root, or issue the command <userinput>bash&dollar; su -l root</userinput> to become root. You can
add <filename class="directory">/usr/sbin</filename> to the
PATH environment variable by issuing the following command at the terminal
prompt, or including it in <filename>/root/.bashrc</filename>:
<programlisting>
export PATH=$PATH:/usr/sbin
</programlisting>
</para>
</answer>
</qandaentry>
<qandaentry>
<question>
<para>
<emphasis><command>db2setup</command> indicated that it successfully
created an instance, but I checked <filename>/tmp/db2install.log</filename>
and it contains the message
<computeroutput>DBI1766W Cannot change the secondary group list of ""</computeroutput>
(Caldera OpenLinux 2.4).
</emphasis>
</para>
</question>
<answer>
<para>
This is one area where DB2 and Caldera OpenLinux don't work well together.
Fix this by manually adding each instance user ID to the group
you defined during instance creation. Here's the full help from
the IBM DB2 Message Reference:
<programlisting>
DBI1766W Cannot change the secondary group list of
"".
Explanation: A code, "", is returned when attempting to
change the secondary group list of the given user ID. One of the
following situations has occurred:
o NIS is running.
o One or more processes are currently being executed under the
given user ID.
User Response: You must add the group ID, "", to the
secondary group list of the user ID, "", so that the
Adminstration Server can function properly.
o If there happens to be any process run under the given user
ID, terminate all of these processes and follow the
instructions above to setup the secondary group list of this
user ID.
o If you are running this command on an NIS client, try the
above instructions to setup the secondary group list of this
user ID on your NIS server.
</programlisting>
For instructions on how to add user IDs to groups, see <xref linkend="calderauid">.
</para>
</answer>
</qandaentry>
</qandaset>
</sect2>
<sect2>
<title>Problems using DB2</title>
<para>
The following section covers some of the common problems you may encounter
when you use a DB2 database.
</para>
<indexterm><primary>connection</primary><secondary>troubleshooting</secondary></indexterm>
<indexterm><primary>kernel</primary><secondary>optimizing parameters</secondary></indexterm>
<qandaset>
<qandaentry>
<question>
<para><emphasis>I installed DB2 Version 6.1 and <command>db2start</command> just hangs.</emphasis></para>
</question>
<answer>
<para>
Hey! I said I wasn't going to include any DB2 Version 6.1 information! Oh well, this is
one of the most frequently asked questions about 6.1, so here's a short answer: you need to install
a recent DB2 FixPack. The initial release of DB2 Version 6.1 ran into incompatibilities
with distributions built on <literal>glibc 2.1</literal>. For a full description of the
problem, and the correct install procedure, refer to IBM Support document 1000814:
<ulink url="http://www-1.ibm.com/servlet/support/manager?rt=0&amp;rs=0&amp;org=swg&amp;doc=852568E5006F0CC68525693E00535FB3">db2start hangs on Linux distributions built with glibc 2.1</ulink>.
</para>
</answer>
</qandaentry>
<qandaentry>
<question>
<para>
I'm using DB2 PE 7.1 on linux (RH 6.0), and I'm having problems when
trying to connect with my username and password. I can connect successfully
to the database with the default user ID:
<programlisting>
bash$ db2 connect to sample
Database Connection Information
Database server = DB2/LINUX 7.1.0
SQL authorization ID = <replaceable>userID</replaceable>
Local database alias = SAMPLE
</programlisting>
But when I try to connect to the database using the explicit user ID, it fails:
<programlisting>
bash$ db2 CONNECT TO sample USER <replaceable>userID</replaceable>
Enter current password for <replaceable>userID</replaceable>:
SQL1403N The username and/or password supplied is incorrect.
SQLSTATE=08004
</programlisting>
Why can't I connect with an explicit user ID?
</para>
</question>
<answer>
<para>
Check the ownership and permissions on the <filename>db2ckpw</filename> program.
They should look like this:
<programlisting>
bash$ ls -al ~/sqllib/security/db2ckpw
-rwsr-s--x 1 root build 15989 Oct 17 07:22 sqllib/security/db2ckpw*
</programlisting>
If this program is not owned by root, then do the following as root:
<programlisting>
bash# chown root db2ckpw
bash# chmod ug+s db2ckpw
</programlisting>
</para>
</answer>
</qandaentry>
<qandaentry>
<question>
<para><emphasis>I'm running out of connections for my DB2 server.</emphasis></para>
</question>
<answer>
<para>
The number of connections that DB2 can support depends on three <literal>#define</literal>
variables included in the kernel source header files. Following the description of these
variables is a table listing the default values by distribution. The table includes the values
of these variables in the updated kernel packages for each distribution.
<variablelist>
<varlistentry>
<term>_SHM_ID_BITS</term>
<listitem>
<para>
This variable, defined in <filename>/usr/src/linux/include/asm/shmparam.h</filename>,
determines the number of shared memory segment identifiers available to Linux. The
default value for <literal>_SHM_ID_BITS</literal> in the kernel source
is <literal>7</literal>, which allows for a total of 2^7, or 128,
shared memory segment identifiers.
</para>
<para>
On a single-processor machine, DB2 itself uses a set number (~15) of
shared memory segment identifiers. On a machine with multiple processors,
DB2 also requires one shared memory segment identifier per agent to take
advantage of the Fast Communication Manager (<acronym>FCM</acronym>) feature
of DB2. Because each DB2 connection requires one agent per processor,
on a quad-processor machine the default value of <literal>_SHM_ID_BITS</literal>
allows less than 32 simultaneous connections to a DB2 instance.
</para>
<para>
If you recompile the kernel yourself, you should be able to safely
increase this value to <literal>9</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>NR_TASKS</term>
<listitem>
<para>
This variable, defined in <filename>/usr/src/linux/include/linux/tasks.h</filename>,
determines the number of simultaneous processes that Linux
supports. A second variable, <literal>MAX_TASKS_PER_USER</literal>, is defined
as <computeroutput>NR_TASKS/2</computeroutput>. Since DB2 instances are treated as
users by Linux, and each connection uses a single process, the maximum number
of connections per instance is capped at the value of <literal>NR_TASKS/2</literal>.
</para>
<para>
The default value for <literal>NR_TASKS</literal> in the kernel source is <literal>512</literal>,
allowing a maximum of 256 simultaneous connections to a single DB2 instance.
DB2 itself requires a few connections for overhead processes.
If you recompile the kernel yourself, you should increase this value to something like 2048.
The stock kernels shipped with the Red Hat, SuSE, and TurboLinux distributions
increase the value of <literal>NR_TASKS</literal> to 2560 or above.
However, Caldera OpenLinux eDesktop 2.4 ships with a kernel in which <literal>NR_TASKS</literal>
is set to the default value of 512. Caldera users should increase the value
of this variable and recompile the kernel.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>SEMMNI</term>
<listitem>
<para>
This variable, defined in <filename>/usr/src/linux/include/linux/sem.h</filename>,
determines the number of semaphore identifiers that Linux supports. This variable
is particularly important on symmetric multi-processing (<acronym>SMP</acronym>)
machines. A unique semaphor identifier is required for each processor per agent
(or connection); therefore, on a quad-processor machine, four semaphore identifiers
are required per connection.
</para>
<para>
The default value for <literal>SEMMNI</literal> in the kernel source is <literal>128</literal>,
which, on a quad-processor machine, will only allow 32 simultaneous connections to a DB2 instance.
If you recompile the kernel yourself, increase this value to something like 1024.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<indexterm><primary>kernel</primary><secondary>parameter defaults</secondary></indexterm>
<table frame="all">
<title>Default kernel parameter values, by distribution</title>
<tgroup cols="6" align="center" colsep="1" rowsep="1">
<colspec colname="c1">
<colspec colname="c2">
<colspec colname="c3">
<colspec colname="c4">
<colspec colname="c5">
<colspec colname="c6">
<colspec colname="c7">
<thead>
<row>
<entry>Kernel Parameter</entry>
<entry>Kernel Source</entry>
<entry>Caldera OpenLinux eDesktop 2.4</entry>
<entry>Caldera OpenLinux eServer 2.3</entry>
<entry>Red Hat 6.2</entry>
<entry>SuSE 6.2</entry>
<entry>SuSE 6.3</entry>
<entry>TurboLinux 6.0</entry>
</row>
</thead>
<tbody>
<row>
<entry>_SHM_ID_BITS</entry>
<entry><literal>7</literal></entry>
<entry><literal>7</literal></entry>
<entry><literal>7</literal></entry>
<entry><simplelist type="horiz" columns="2">
<member>kernel-2.2.14-5</member>
<member><literal>7</literal></member>
<member>kernel-2.2.14-12</member>
<member><literal>9</literal></member>
<member>kernel-2.2.16-3</member>
<member><literal>9</literal></member>
</simplelist></entry>
<entry>Unknown</entry>
<entry>Unknown</entry>
<entry><simplelist type="horiz" columns="2">
<member>kernel-2.2.14-5</member>
<member><literal>7</literal></member>
<member>kernel-2.2.16-0.4</member>
<member><literal>7</literal></member>
</simplelist></entry>
</row>
<row>
<entry>NR_TASKS</entry>
<entry><literal>512</literal></entry>
<entry><literal>512</literal></entry>
<entry><literal>512</literal></entry>
<entry><simplelist type="horiz" columns="2">
<member>kernel-2.2.14-5</member>
<member><literal>2560</literal></member>
<member>kernel-2.2.14-12</member>
<member><literal>2560</literal></member>
<member>kernel-2.2.16-3</member>
<member><literal>4090</literal></member>
</simplelist></entry>
<entry>Unknown</entry>
<entry>Unknown</entry>
<entry><simplelist type="horiz" columns="2">
<member>kernel-2.2.14-5</member>
<member><literal>2560</literal></member>
<member>kernel-2.2.16-0.4</member>
<member><literal>2560</literal></member>
</simplelist></entry>
</row>
<row>
<entry>SEMMNI</entry>
<entry><literal>128</literal></entry>
<entry><literal>128</literal></entry>
<entry><literal>128</literal></entry>
<entry><simplelist type="horiz" columns="2">
<member>kernel-2.2.14-5</member>
<member><literal>128</literal></member>
<member>kernel-2.2.14-12</member>
<member><literal>512</literal></member>
<member>kernel-2.2.16-3</member>
<member><literal>512</literal></member>
</simplelist></entry>
<entry>Unknown</entry>
<entry>Unknown</entry>
<entry><simplelist type="horiz" columns="2">
<member>kernel-2.2.14-5</member>
<member><literal>128</literal></member>
<member>kernel-2.2.16-0.4</member>
<member><literal>128</literal></member>
</simplelist></entry>
</row>
</tbody>
</tgroup>
</table>
</answer>
</qandaentry>
<indexterm><primary>Control Center</primary><secondary>troubleshooting</secondary></indexterm>
<qandaentry>
<question>
<para><emphasis>When I start the DB2 Control Center, I get a message box with the
error <computeroutput>SQL1042C An unexpected system error occurred.</computeroutput>
</emphasis></para>
</question>
<answer>
<para>
On most systems, this error occurs only the first time you start the Control Center. Note that
the message box may be mostly covered up by the pretty DB2 splash screen;
if this is the case, you have to move the error message window down
and press the "Close" button. The Control Center then starts correctly, and you should
not get the error message again.
</para>
</answer>
</qandaentry>
<indexterm><primary>Control Center</primary><secondary>troubleshooting</secondary></indexterm>
<qandaentry>
<question>
<para><emphasis>The DB2 Control Center starts normally, but the "Systems" folder is empty.</emphasis></para>
</question>
<answer>
<para>
If the Control Center displays an empty "Systems" folder,
you might need to catalog the DB2 Administration Server manually for the
local instance from which you are trying to run the Control Center.
This assumes that you have created the DB2 Administration Server instance
before starting the Control Center.
</para>
<para>
To catalog the DB2 Administration Server, issue the following command:
<programlisting>bash&dollar; db2 catalog admin local node <replaceable>machine-name</replaceable> instance <replaceable>Administration-Server-name</replaceable> system <replaceable>machine-name</replaceable> ostype linux</programlisting>
Now restart the Control Center. Your local system is now displayed under the "Systems" folder.
Do not try this from a client-only install of DB2,
because no local DB2 Administration Server can be available.
</para>
</answer>
</qandaentry>
<indexterm><primary>Control Center</primary><secondary>troubleshooting</secondary></indexterm>
<qandaentry>
<question>
<para><emphasis>When I try to start the DB2 Control Center, I get the following message
at the console: <computeroutput>Xlib: connection to "localhost:0.0" refused by server</computeroutput>
</emphasis</para>
</question>
<answer>
<para>
This normally indicates an X permissions problem that occurs when you log on as one user, then
<command>su</command> to the DB2 instance owner so that you can start the DB2 Control Center.
By default, most X servers do not recognize 'localhost' as a client that is allowed to initiate
an X app on your display; it will only recognize your real hostname. If <command>xauth</command>
is set up, then it will complain if a user ID other than the one that started X tries to invoke
an X application.There are a few things you can try:
<itemizedlist>
<listitem>
<para>
Before su'ing to the DB2 instance owner, issue the command <userinput>bash$ xhost +localhost</userinput>:
this tells your X server that 'localhost' is allowed to start X apps on your display. Then <command>su</command>
to the DB2 instance owner and start the Control Center.
</para>
</listitem>
<listitem>
<para>
Log out completely, then log on directly as the DB2 instance owner and start the Control Center.
You may still have to issue the command <userinput>bash$ xhost +localhost</userinput> before the
Control Center will start--recent distributions have added this extra level of security.
</para>
</listitem>
<listitem>
<para>
Look into the <command>xauth</command> command and add your primary user ID's
<filename>~/.Xauthority</filename> file to your DB2 instance owner's <literal>xauth</literal>
authority database. I believe it's the <command>xauth merge</command> command that you want.
</para>
</listitem>
</itemizedlist>
</para>
</answer>
</qandaentry>
<qandaentry>
<question>
<para><emphasis>When I start the DB2 Control Center, I get a message box with the
error <computeroutput>SQL1042C An unexpected system error occurred.</computeroutput>
</emphasis></para>
</question>
<answer>
<para>
On most systems, this error occurs only the first time you start the Control Center. Note that
the message box may be mostly covered up by the pretty DB2 splash screen;
if this is the case, you have to move the error message window down
and press the "Close" button. The Control Center then starts correctly, and you should
not get the error message again.
</para>
</answer>
</qandaentry>
<indexterm><primary>Control Center</primary><secondary>troubleshooting</secondary></indexterm>
<qandaentry>
<question>
<para><emphasis>When I try to start the DB2 Control Center with
the <command>db2cc</command> command, the splash screen comes up, then
disappears.
</emphasis></para>
</question>
<answer>
<para>
On Caldera, the Control Center didn't work for me until I added the instance user IDs to
the appropriate groups. For more information, see <xref linkend="calderauid">.
</para>
</answer>
<answer>
<para>
Ensure that you have installed the IBM Developer Kit for Java, and that
the directory containing the <filename>jre</filename> or <filename>java</filename>
executable is in your path. If you issue the command <programlisting>bash&dollar; java -fullversion</programlisting>,
you should get a response like this:
<computeroutput>
java full version "JDK 1.1.8 IBM build l118-20000325 (JIT enabled: jitc)"
</computeroutput>
or, for the IBM JDK 1.3:
<computeroutput>
java full version "J2RE 1.3.0 IBM build cx130-20000623"
</computeroutput>
Java virtual machines from other sources may not work.
For a quick guide to installing the IBM Developer Kit for Java, see
<xref linkend="jdkinstall">.
</para>
</answer>
</qandaentry>
<indexterm><primary>commands</primary><secondary>troubleshooting</secondary></indexterm>
<indexterm><primary>db2 commands</primary><secondary>troubleshooting</secondary></indexterm>
<qandaentry>
<question>
<para><emphasis>
When I run any <command>db2</command> commands, part of the output is
<computeroutput>Welcome to your OpenLinux system!</computeroutput>. How
do I change this? (Caldera OpenLinux 2.4)
</emphasis></para>
</question>
<answer>
<para>
Caldera OpenLinux includes this annoying message as part of their default
login. For instructions on how to remove or modify this output, see
<xref linkend="calderagreeting">.
</para>
</answer>
</qandaentry>
</qandaset>
</sect2>
</sect1>
<sect1 id="jdkinstall">
<title>Installing the IBM Developer Kit for Java</title>
<indexterm><primary>Java</primary><secondary>installing</secondary></indexterm>
<indexterm><primary>JDK</primary><secondary>installing</secondary></indexterm>
<indexterm><primary>JRE</primary><secondary>installing</secondary></indexterm>
<para>
This section gives you quick and dirty instructions on how to install the
IBM Developer Kit for Java, version <literal>1.1.8</literal> or <literal>1.3</literal>.
You need the IBM Developer Kit for Java to run the DB2 Control Center
or Java applications or applets that connect to DB2.
Note that these instructions are not meant to replace the documentation
supplied with the IBM Developer Kit for Java.
<warning>
<para>
For DB2 Version 7.1, you cannot use other versions of Java. Versions
of the Java Virtual Machine (<acronym>JVM</acronym>) supplied by other
software organizations are not supported.
</para>
</warning>
</para>
<procedure>
<title>Installing the IBM Developer Kit for Java, Version 1.1.8</title>
<step>
<para>
Download the IBM Developer Kit for Java, version 1.1.8, from the
<ulink url="http://www.ibm.com/java/jdk/118/linux/">IBM Java
Developer's Kit downloads web site</ulink>. I'll assume that you
download the <acronym>RPM</acronym> package of the IBM Developer Kit for Java.
</para>
</step>
<step>
<para>
Install the IBM Developer Kit for Java by issuing the following command as root:
<programlisting>bash# rpm -ivh IBMJava118-SDK-1.1.8-2.0-i386.rpm</programlisting>
</para>
</step>
<step>
<para>
Add the following lines to your <filename>/etc/profile</filename> file to set
up the Java environment for all users:
<programlisting>
export JAVA_HOME=/usr/jdk118
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/classes.zip
</programlisting>
<note>
<para>
Caldera users should see <xref linkend="calderapreinstall"> for instructions on
configuring the IBM Developer Kit for Java on Caldera OpenLinux.
</para>
</note>
</para>
</step>
</procedure>
<procedure>
<title>Installing the IBM Developer Kit for Java, Version 1.3</title>
<step>
<para>
Download the IBM Developer Kit for Java, version 1.3, from the
<ulink url="http://www.ibm.com/java/jdk/linux130/">IBM Java
Developer's Kit downloads web site</ulink>. I'll assume that you
download the <acronym>RPM</acronym> package of the IBM Developer Kit for Java.
</para>
</step>
<step>
<para>
Install the IBM Developer Kit for Java by issuing the following command as root:
<programlisting>bash# rpm -ivh IBMJava2-SDK-1.3-1.1-i386.rpm</programlisting>
</para>
</step>
<step>
<para>
Add the following lines to your <filename>/etc/profile</filename> file to set
up the Java environment for all users:
<programlisting>
export PATH=$PATH:/opt/IBMJava2-13/bin
</programlisting>
<note>
<para>
Caldera users should see <xref linkend="calderapreinstall"> for instructions on
configuring the IBM Developer Kit for Java on Caldera OpenLinux.
</para>
</note>
</para>
</step>
<step>
<para>
IBM JDK 1.3 does away with the <command>jre</command> command, even if you
install the the IBM JRE 1.3 package.
However, the <command>db2cc</command> script calls the
<command>jre</command> command. The easiest solution is to create a link
called <command>jre</command> to the <command>java</command> executable
in the <filename class="directory">/opt/IBMJava2-13/bin</filename> directory
by issuing the following command as root.
<programlisting>
bash# ln -sf /opt/IBMJava2-13/jre/bin/java /opt/IBMJava2-13/jre/bin/jre
</programlisting>
</para>
</step>
<step>
<para>
The <command>db2cc</command> script calls the <command>jre</command> command
with the <literal>-nojit</literal> argument, which is not supported in IBM JDK 1.3.
Remove the option by changing line 44 of <filename>/usr/IBMdb2/V7.1/bin/db2cc</filename>
to the following:
<programlisting>
JRE_OPTIONS="-ss256k -mx128m -Ddb2path=$DB2PATH"
</programlisting>
</para>
</step>
</procedure>
</sect1>
<appendix id="references">
<title>Resources</title>
<para>
Following is a list of references to further information on using DB2 V7.1 for Linux:
<variablelist>
<varlistentry>
<term>Newsgroups</term>
<listitem>
<variablelist>
<varlistentry>
<term><ulink url="news:comp.databases.ibm-db2">comp.databases.ibm-db2</ulink></term>
<listitem>
<para>
Covers the use of DB2 Universal Database on all platforms, including Linux and
other Unices, OS/2, OS/390, OS/400, and Windows. This forum is quite active.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><ulink url="news:ibm.software.db2.udb.v7beta">ibm.software.db2.udb.v7beta</ulink> on the news.software.ibm.com NNTP server</term>
<listitem>
<para>
Although this newsgroup was meant to serve users trying out the DB2 V7.1 beta code,
there are a lot of general questions about DB2 on Linux that might help answer your
questions. Now that the final release is available, activity on this forum has
slowed down significantly.
</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
<varlistentry>
<term>Web sites</term>
<listitem>
<variablelist>
<varlistentry>
<term><ulink url="http://www-4.ibm.com/cgi-bin/db2www/data/db2/udb/winos2unix/support/v7pubs.d2w/main">DB2 Library</ulink></term>
<listitem>
<para>
IBM publishes many books on installing, administering, and developing applications with DB2.
If you decide not to install the documentation when you install DB2, you can always access the
documentation online in HTML format or download PDF versions of the books.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><ulink url="http://www.ibm.com/software/data/db2/udb/ad">DB2 Application Development</ulink></term>
<listitem>
<para>
This web site contains the latest information about restrictions, workarounds, or additional
documentation for developing applications with DB2.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><ulink url="http://www.ibm.com/software/data/db2/linux">DB2 for Linux</ulink></term>
<listitem>
<para>
This web site contains general information about using DB2 for Linux, including a link
to the free <ulink url="http://www.ibm.com/software/data/db2/udb/downloads.html">download</ulink>
of DB2 Personal Developers Edition.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><ulink url="http://www.db2mag.com">DB2 Magazine</ulink></term>
<listitem>
<para>
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 a free subscription to the print version
of the magazine.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><ulink url="http://www.ibm.com/software/data/pubs/papers">DB2 White Papers</ulink></term>
<listitem>
<para>
This web site contains white papers published by IBM about DB2. White papers typically
provide overviews or introductions to new technology or new releases of a product.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><ulink url="http://www.idug.org">International DB2 Users Group (<acronym>IDUG</acronym>)</ulink></term>
<listitem>
<para>
IDUG holds a number of international conferences on DB2 and has regional user groups.
While IDUG has traditionally focused on DB2 for OS/390 and OS/400, they have increasingly
included information on DB2 for Linux, other Unices, OS/2, and Windows. The IDUG web site
includes online discussion forums and links to other DB2 resources.
</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
</variablelist>
</para>
</appendix>
<appendix id="gpl">
<indexterm><primary>GPL</primary></indexterm>
<indexterm><primary>GNU General Public License</primary></indexterm>
<title>GNU General Public License</title>
<blockquote>
<para>
Version 2, June 1991
</para>
<para>
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
</para>
<para>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
</para>
</blockquote>
<sect1>
<title>Preamble</title>
<para>
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
</para>
<para>
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
</para>
<para>
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
</para>
<para>
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
</para>
<para>
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
</para>
<para>
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
</para>
<para>
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
</para>
<para>
The precise terms and conditions for copying, distribution and
modification follow.
</para>
<sect2>
<title>
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
</title>
<para>
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
</para>
<para>
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
</para>
<para>
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
</para>
<para>
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
</para>
<para>
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
</para>
<para>
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
</para>
<para>
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
</para>
<para>
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
</para>
<para>
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
</para>
<para>
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
</para>
<para>
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
</para>
<para>
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
</para>
<para>
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
</para>
<para>
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
</para>
<para>
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
</para>
<para>
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
</para>
<para>
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
</para>
<para>
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program 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.
</para>
<para>
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
</para>
<para>
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
</para>
<para>
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
</para>
<para>
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
</para>
<para>
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
</para>
<para>
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
</para>
<para>
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
</para>
<para>
9. The Free Software Foundation may publish revised and/or new versions
of the General Public 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.
</para>
<para>
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
</para>
<para>
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
</para>
<para>
NO WARRANTY
</para>
<para>
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
</para>
<para>
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
</para>
<para>
END OF TERMS AND CONDITIONS
</para>
</sect2>
<sect2>
<title>How to Apply These Terms to Your New Programs</title>
<para>
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
</para>
<para>
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
</para>
<programlisting>
<emphasis>one line to give the program's name and a brief idea of what it does.</emphasis>
Copyright (C) <emphasis>yyyy name of author</emphasis>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
</programlisting>
<para>
Also add information on how to contact you by electronic and paper mail.
</para>
<para>
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
</para>
<programlisting>
Gnomovision version 69, Copyright (C) <emphasis>year name of author</emphasis>
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
</programlisting>
<para>
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
</para>
<para>
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
</para>
<programlisting>
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<emphasis>signature of Ty Coon</emphasis>, 1 April 1989
Ty Coon, President of Vice
</programlisting>
<para>
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
</para>
</sect2>
</sect1>
</appendix>
</article>