<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"

<!ENTITY colon ":"> <!-- COLON --> <!ENTITY dollar "$"> <!-- DOLLAR SIGN --> <!ENTITY mdash "—"> <!-- EM DASH --> <!ENTITY ndash "–"> <!-- EN DASH --> <!ENTITY reg "®"> <!-- REGISTERED TRADEMARK --> <!ENTITY trade "™"> <!-- TRADEMARK --> ]> <article id="index"> <!-- CVS revision info: $Id: DB2-HOWTO.xml,v 1.31 2007/10/31 22:32:42 ihakes Exp $ --> <articleinfo>

</articleinfo>

<sect1 id='introduction'>

</sect1>

<sect1 id='whyexpc9'>

</sect1>

<sect1 id='whatsinexpc9'>

</sect1>

<sect1 id='prerequisites'>

</sect1>

<sect1 id='planning'>

* DAS user DAS_USERNAME = dasusr1 DAS_GROUP_NAME = dasadm1 DAS_HOME_DIRECTORY = /home/dasusr1 DAS_PASSWORD = ****** * Instance-owning user inst1.NAME = db2inst1 inst1.GROUP_NAME = db2grp1 inst1.HOME_DIRECTORY = /db2home/db2inst1 inst1.PASSWORD = ****** inst1.AUTOSTART = YES inst1.AUTHENTICATION = SERVER inst1.SVCENAME = db2c_db2inst1 inst1.PORT_NUMBER = 50001 inst1.FCM_PORT_NUMBER = 60000 inst1.MAX_LOGICAL_NODES = 4 * Fenced user nst1.FENCED_USERNAME = db2fenc1 inst1.FENCED_GROUP_NAME = db2fgrp1 inst1.FENCED_HOME_DIRECTORY = /db2home/db2fenc1 inst1.FENCED_PASSWORD = ******</programlisting>

groupadd db2fgrp1 groupadd dasadm1</screen>

useradd -g db2grp1 -m -d /db2home/db2inst1 db2inst1 -p password1 useradd -g db2fgrp1 -m -d /db2home/db2fenc1 db2fenc1 -p password2 useradd -g dasadm1 -m -d /db2home/dasusr1 dasusr1 -p password3

if [ -f /home/frankj/sqllib/db2profile ]; then

fi</screen>

</sect1>

<sect1 id='installing'>

tar zxf db2exc_912_LNX_x86.tar.gz</screen>

</sect1>

<sect1 id='rhel4'>

-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 523 -j ACCEPT -A RH-Firewall-1-INPUT -p tcp -m tcp --dport 50000 -j ACCEPT</screen>

</sect1>

<sect1 id='fedora6'><title>Installing DB2 Express-C on Fedora Core 6</title>

</sect1>

<sect1 id='fedora7'>

-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 523 -j ACCEPT -A RH-Firewall-1-INPUT -p tcp -m tcp --dport 50000 -j ACCEPT</screen>

</sect1>

<sect1 id='opensuse10'><title>Installing DB2 Express-C on OpenSUSE 10.2</title>

</sect1>

<sect1 id='sles9'>

</sect1>

<sect1 id='sles10'>

</sect1>

<sect1 id='sled10'>

</sect1>

<sect1 id='mand2007'><title>Installing DB2 Express-C on Mandriva Linux 2007</title>

libstdc++6-4.1.1-3mdk</screen>

</sect1>

<!--NEED TO DO:--> <!--<sect1 id='gentoo'><title>Installing DB2 Express-C on Gentoo (2006.01)</title>--> <!-- <para>--> <!-- Before proceeding, please ensure that you have read--> <!-- <xref linkend='planning'/> and <xref linkend='installing'/>.--> <!-- </para>--> <!--<para>Note that IBM does not officially support this distribution for--> <!--DB2 V8.2. Any problems you encounter using this distribution must be--> <!--replicated on a supported distribution before IBM Support will help you--> <!--resolve the issue.</para>--> <!--<para>These notes are based on a single-partition installation on the --> <!--2.6.9-gentoo-r13 kernel (2005-01-17). Following the --> <!--<ulink url="http://publib.boulder.ibm.com/infocenter/db2help/index.jsp?topic=/com.ibm.db2.udb.doc/start/t0006833.htm">manual install</ulink> --> <!--instructions in the DB2 Information Center, we use the RPM method of --> <!--installing DB2 V8.2, through a modified <command>db2_install</command> --> <!--script. This is just one of many ways you could accomplish this task, but this method --> <!--has been tested (at least once) and it works.</para>--> <!--<sect2><title>Pre-installation notes</title>--> <!--<para>Emerge the rpm package and any of its pre-requisites:--> <!--<screen>emerge rpm</screen>--> <!--If you want to run a multiple-partition environment, you will need to emerge either the pdksh or ksh package.--> <!--</para></sect2>--> <!--<sect2><title>Installation notes</title>--> <!--<para>--> <!--Gentoo uses the latest version of the GNU coreutils package of utilities, which --> <!--includes the <command>tail</command> command. The DB2 install script --> <!<command>db2_install</command>) and several instance administration --> <!--shell scripts rely on deprecated command line arguments to <command>tail</command> --> <!--that have been removed entirely from the latest GNU <computeroutput>coreutils</computeroutput> version --> <!--of <command>tail</command>. Therefore, you must copy the contents of the install CD --> <!--and modify the <command>db2_install</command> script before you can successfully run the install.--> <!--</para><para>--> <!--The RPM packages supplied with the DB2 install CD contain dependency listings that cannot --> <!--be satisfied inside a Gentoo environment, because Gentoo does not use RPM as a native --> <!--packaging method. To overcome these dependencies, you also need to modify the <command>db2_install</command> --> <!--script to ignore dependencies and force the installation of DB2 onto your system. --> <!--</para><para>--> <!--Perform the following steps to modify the <command>db2_install</command> script --> <!--for the required <command>tail</command> and <command>rpm</command> --> <!--changes and install the product:</para>--> <!--<orderedlist>--> <!--<listitem>--> <!--<para>(Skip this step if you downloaded a tarball containing the DB2 install code.) --> <!--Assuming you want to copy the contents of the DB2 install CD to a subdirectory named "cdrom" in --> <!--your home directory, issue the following command:--> <!--<screen>cp -r /mnt/cdrom/* ~/cdrom</screen></para>--> <!--</listitem>--> <!--<listitem>--> <!--<para>Open the <filename>~/cdrom/db2/linux/db2_install</filename> script in your text editor and modify the following lines</para>--> <!--<para>--> <!--From:--> <!--<screen>output_df="df -k ${dirname2?} | tail -1"</screen>--> <!--</para>--> <!--<para>--> <!--To:--> <!--<screen>output_df="df -k ${dirname2?} | tail -n -1"</screen>--> <!--</para>--> <!--<para>--> <!--From:--> <!--<screen>( rpm -ivh ${INSTDEV?}/${pkg?}${RPMEXTN?} 2>&1; \ --> <!-- echo $? > ${TMPRC?} ) | tee -a ${DB2INSTLOG?}</screen>--> <!--</para>--> <!--<para>--> <!--To:--> <!--<screen>( rpm force nodeps -ivh ${INSTDEV?}/${pkg?}${RPMEXTN?} 2>&1; \ --> <!-- echo $? > ${TMPRC?} ) | tee -a ${DB2INSTLOG?}</screen>--> <!--</para>--> <!--</listitem>--> <!--<listitem>--> <!--<para>Change to the <filename class="directory">~/cdrom</filename> directory and issue the following command as root:--> <!--<screen>./db2_install</screen>--> <!--</para>--> <!--</listitem>--> <!--<listitem>--> <!--<para>The DB2 installer prompts you to enter the keyword of the product you want to install. --> <!--for example, issuing the <command>db2_inst</command> command for the DB2 Express --> <!--Edition for Linux install displays the following screen:--> <!--<screen>--> <!--Specify one or more of the following keywords, --> <!--separated by spaces, to install DB2 products.--> <!


> <!-- Keyword Product Description--> <!-- DB2.EXP DB2 Express Edition for LINUX--> <!


> <!--Enter "help" to redisplay product names.--> <!


> <!--Enter "quit" to exit.--> <!


> <!--***********************************************************--> <!--DB2.EXP--> <!--</screen>--> <!--</para>--> <!--</listitem>--> <!--</orderedlist>--> <!--<para>--> <!--The DB2 installer will now install many RPM packages into the /opt/IBM/db2/V8.1/ directory. --> <!--</para>--> <!--<sect3><title>Installing DB2 FixPaks on a non-RPM distribution</title>--> <!--<para>When installing a DB2 FixPak onto an existing DB2 installation, the RPM--> <!-- utility is used, which will cause problems on a distribution that does--> <!-- not use the RPM installation method by default. Since Gentoo is one of--> <!-- those distributions, you must make the following changes to the--> <!-- <command>installFixPak</command> script.--> <!--</para>--> <!--<para>In the <command>installFixPak</command> script, change this--> <!-- line:--> <!-- <screen>--> <!-- echo "Updating to ${fullfsname?} ... "--> <!-- rpm -ivh ${fullfsname?}--> <!-- </screen>--> <!-- to read:--> <!-- <screen>--> <!-- echo "Updating to ${fullfsname?} ... "--> <!-- rpm force nodeps ivh ${fullfsname?}--> <!-- </screen>--> <!--</para>--> <!--</sect3>--> <!--</sect2>--> <!--<sect2><title>Post-installation notes</title>--> <!--<para>Now that you have installed DB2, you need to create the groups, users, --> <!--DB2 Administration Server instance, and database instance for your database. --> <!--The following instructions create users and groups with the default names --> <!--used in the DB2 documentation (dasadm1, db2inst1, db2fenc1).--> <!--</para>--> <!--<orderedlist>--> <!--<listitem>--> <!--<para>As root, create the required groups:--> <!--<screen>--> <!--groupadd -g 999 db2iadm1--> <!--groupadd -g 998 db2fadm1--> <!--groupadd -g 997 dasadm1--> <!--</screen>--> <!--</para>--> <!--</listitem>--> <!--<listitem>--> <!--<para>As root, create the required users and assign them to their corresponding groups:--> <!--<screen>--> <!--useradd -u 1004 -g db2iadm1 -m -d /home/db2inst1 db2inst1 --> <!--useradd -u 1003 -g db2fadm1 -m -d /home/db2fenc1 db2fenc1 --> <!--useradd -u 1002 -g dasadm1 -m -d /home/dasusr1 dasusr1--> <!--</screen></para>--> <!--</listitem>--> <!--<listitem>--> <!--<para>Before you can create the DB2 Administration Server and database instance, you have --> <!--to modify the db2iutil library to update calls to the <command>tail</command> --> <!--command to the current GNU syntax. As root, open the <filename>/opt/IBM/db2/V8.1/instance/db2iutil</filename>--> <!--file in an editor and make the following changes (or apply the changes to the file using --> <!--the patch utility):--> <!--<screen>--> <!-- db2iutil.orig 2005-01-17 07:05:58.000000000 -0500--> <!-- db2iutil 2005-01-17 07:06:32.000000000 -0500--> <!--@@ -327,7 +327,7 @@--> <!-- fi--> <!-- --> <!-- # Get output of the "df" command--> <!--- output_df="df -k  ${dirname2?} | tail -1"--> <!--+ output_df="df -k  ${dirname2?} | tail -n 1"--> <!-- # On some platforms, the filesystem is on the previous line causing us--> <!-- # one less token for awk to find.--> <!-- free_space_in_fs=`echo ${output_df?} | awk '{if ($4 !~ /%/) {print $4} else--> <!-- {print $3}}'`--> <!--@@ -382,7 +382,7 @@--> <!-- rm -f ${TMPFILE3?}--> <!-- --> <!-- # Get the name of the filesystem where dir $dirname2 resides.--> <!--- df -k ${dirname2?} | tail +2 > ${TMPFILE3?}--> <!--+ df -k ${dirname2?} | tail -n +2 > ${TMPFILE3?}--> <!-- --> <!-- # There must be only one line in TMPFILE3 file--> <!-- lcount=wc -l ${TMPFILE3?} | awk '{print $1}'--> <!--@@ -394,7 +394,7 @@--> <!-- chk_fsystype 22--> <!-- stop_prog 1--> <!-- fi--> <!--- fsname=awk '{print $NF}' ${TMPFILE3?} | tail -1--> <!--+ fsname=awk '{print $NF}' ${TMPFILE3?} | tail -n 1--> <!-- --> <!-- rm -f ${TMPFILE3?}--> <!-- foundit=${FALSE?}--> <!--@@ -879,7 +879,7 @@--> <!-- ${DB2VER_V2?}> <!-- # Dir of DB2 V2 instances--> <!-- if [ -f ${DB2V2ILIST?} ]; then--> <!--- tail +2 ${DB2V2ILIST?} > ${TMPFILE3?}--> <!--+ tail -n +2 ${DB2V2ILIST?} > ${TMPFILE3?}--> <!-- if [ -s ${TMPFILE3?} ]; then--> <!-- for iname in cat ${TMPFILE3?}; do--> <!-- db2ilist=${db2ilist?}" ${iname?}"--> <!--@@ -891,7 +891,7 @@--> <!-- ${DB2VER_DJ?})--> <!-- # Dir of DB2 V2 instances--> <!-- if [ -f ${DJV211ILIST?} ]; then--> <!--- tail +2 ${DJV211ILIST?} > ${TMPFILE3?}--> <!--+ tail -n +2 ${DJV211ILIST?} > ${TMPFILE3?}--> <!-- if [ -s ${TMPFILE3?} ]; then--> <!-- for iname in cat ${TMPFILE3?}; do--> <!-- db2ilist=${db2ilist?}" ${iname?}"--> <!--</screen>--> <!--</para>--> <!--</listitem>--> <!--<listitem>--> <!--<para>Create the DB2 Administration Server: --> <!--<screen>/opt/IBM/db2/V8.1/instance/dascrt -u dasusr1</screen>--> <!--</para>--> <!--<para>Create the DB2 database instance:--> <!--<screen>/opt/IBM/db2/V8.1/instance/db2icrt -a server -u db2fenc1 db2inst1</screen>--> <!--</para>--> <!--</listitem>--> <!--</orderedlist>--> <!--<sect3><title>--> <!--Enabling remote connections</title>--> <!--<para>When you perform a manual install of DB2, the installer does not automatically --> <!--set up the communication protocols for your DB2 server. To enable connections to your --> <!--DB2 server from remote clients, perform the following steps:--> <!--</para>--> <!--<orderedlist>--> <!--<listitem>--> <!--<para>Set the port on which DB2 should communicate. Ensure that you select a port that --> <!--is not blocked by a firewall or used by another service defined in the <filename>/etc/services</filename> file. --> <!--To set the communications port, update the DB2 database manager configuration variable --> <!--SVCENAME. For example, to set the communications port to 50055, issue the following command --> <!--as the instance user ("db2inst1", if you've been using the defaults):--> <!--<screen>db2 update dbm cfg using svcename 50055</screen>--> <!--</para>--> <!--</listitem>--> <!--<listitem>--> <!--<para>Set the DB2 communications protocol registry variable to define the protocol --> <!--supported by the server. Typically the only protocol you would use is TCP/IP, so issue --> <!--the following command as the instance user ("db2inst1" if you've been using the defaults):--> <!--<screen>db2set DB2COMM=tcpip</screen>--> <!--</para>--> <!--</listitem>--> <!--<listitem>--> <!--<para>Restart the database instance to enable the settings to take effect.--> <!--<screen>--> <!--db2stop--> <!--db2start--> <!--</screen>--> <!--</para>--> <!--</listitem>--> <!--</orderedlist>--> <!--<para>--> <!--You should now be able to catalog and connect to your Gentoo server from a remote client.--> <!--</para>--> <!--</sect3>--> <!--<sect3><title>--> <!--Running the DB2 Control Center and other DB2 GUI tools--> <!--</title>--> <!--<para>To run the DB2 Control Center or other DB2 GUI tools, you must install the IBM --> <!--Software Developers' Kit for Java. This RPM is included in the DB2 install CD-ROM in --> <!--the <filename class="directory">/db2/linux/Java-1.4/</filename> directory. To install the IBM Software Developers' Kit for --> <!--Java, change to the root directory of the CD-ROM and issue the following command as root:--> <!--<screen>--> <!--rpm force nodeps -ivh db2/linux/Java-1.4/IBMJava2-SDK-1.4.1-2.0.i386.rpm--> <!--</screen>--> <!--</para><para>--> <!--Log in as the db2inst1 user and invoke the DB2 Control Center:--> <!--<screen>db2cc</screen>--> <!--</para></sect3>--> <!--</sect2></sect1>-->

<sect1 id='ubuntu606'>

passwd db2fenc1 passwd dasusr1</screen>

db2inst1:x:1001:1001::/home/db2inst1:/bin/sh db2fenc1:x:1002:1002::/home/db2fenc1:/bin/sh dasusr1:x:1003:1003::/home/dasusr1:/bin/sh</screen>

db2inst1:x:1001:1001::/home/db2inst1:/bin/bash db2fenc1:x:1002:1002::/home/db2fenc1:/bin/bash dasusr1:x:1003:1003::/home/dasusr1:/bin/bash</screen>

db2set DB2COMM=tcpip db2stop db2start</screen>

ibm-db2 523/udp # IBM DB2 DAS</screen>

db2admin start</screen>

</sect1>

<sect1 id='ubuntu704'>

passwd db2fenc1 passwd dasusr1</screen>

db2inst1:x:1001:1001::/home/db2inst1:/bin/sh db2fenc1:x:1002:1002::/home/db2fenc1:/bin/sh dasusr1:x:1003:1003::/home/dasusr1:/bin/sh</screen>

db2inst1:x:1001:1001::/home/db2inst1:/bin/bash db2fenc1:x:1002:1002::/home/db2fenc1:/bin/bash dasusr1:x:1003:1003::/home/dasusr1:/bin/bash</screen>

db2set DB2COMM=tcpip db2stop db2start</screen>

ibm-db2 523/udp # IBM DB2 DAS</screen>

db2admin start</screen>

# # Script to start DB2 instances on bootup. # set -e

. /lib/lsb/init-functions

case "$1" in start)

stop|restart|reload)

esac

exit 0</screen>

chmod 755 db2</screen></para>

</sect1>

<sect1 id='mepis6'><title>Installing DB2 Express-C on SimplyMEPIS 6.0</title>

type "FUNCTION" having compatible arguments was found</screen>

db2sampl</screen>

</sect1>

<sect1 id='help'>

db2set DB2_DOCPORT=<varname>host_port</varname></screen>

</sect1>

<sect1 id='uninstalling'>

userdel -r dasusr1 userdel -r db2fenc1</screen>(If you created different user names during

</sect1>

<sect1 id="using">

from the command prompt. For example:

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 =></screen>

</sect1>

<sect1 id="tests">

Product name: "DB2 Express Edition" License type: "Unwarranted" Expiry date: "Permanent" Product identifier: "db2exp" Version information: "9.1" Max number of CPUs: "2"

db2dart sample</screen>

db2 catalog db sample at node test</screen>

db2 "select * from dept"</screen>

</sect1>

<sect1 id="resources">

</sect1>

<sect1 id="gfdl">

</sect1>

<sect1 id='trademarks'>

</sect1>

</article>

DB2 HOWTO (last edited 2008-09-18 17:19:57 by SvetoslavChukov)