765 lines
14 KiB
HTML
765 lines
14 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>Installation considerations and planning</TITLE
|
|
><META
|
|
NAME="GENERATOR"
|
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
|
|
REL="HOME"
|
|
TITLE="IBM DB2 Express-C for Linux HOWTO"
|
|
HREF="index.html"><LINK
|
|
REL="PREVIOUS"
|
|
TITLE="Prerequisites"
|
|
HREF="prerequisites.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="Installing DB2 Express-C"
|
|
HREF="installing.html"></HEAD
|
|
><BODY
|
|
CLASS="sect1"
|
|
BGCOLOR="#FFFFFF"
|
|
TEXT="#000000"
|
|
LINK="#0000FF"
|
|
VLINK="#840084"
|
|
ALINK="#0000FF"
|
|
><DIV
|
|
CLASS="NAVHEADER"
|
|
><TABLE
|
|
SUMMARY="Header navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TH
|
|
COLSPAN="3"
|
|
ALIGN="center"
|
|
>IBM DB2 Express-C for Linux HOWTO</TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="left"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="prerequisites.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="80%"
|
|
ALIGN="center"
|
|
VALIGN="bottom"
|
|
></TD
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="right"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="installing.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="sect1"
|
|
><H1
|
|
CLASS="sect1"
|
|
><A
|
|
NAME="planning"
|
|
></A
|
|
>5. Installation considerations and planning</H1
|
|
><P
|
|
>After verifying that your system meets the basic requirements, you should
|
|
plan your installation by considering installation methods and the creation
|
|
of users and groups:
|
|
<P
|
|
></P
|
|
><UL
|
|
><LI
|
|
>Installation choices:
|
|
<P
|
|
></P
|
|
><UL
|
|
><LI
|
|
><B
|
|
CLASS="command"
|
|
>db2setup</B
|
|
>installation</LI
|
|
><LI
|
|
><B
|
|
CLASS="command"
|
|
>db2_install</B
|
|
>installation</LI
|
|
><LI
|
|
>DB2 response file installation</LI
|
|
></UL
|
|
></LI
|
|
><LI
|
|
>User and group setup:
|
|
<P
|
|
></P
|
|
><UL
|
|
><LI
|
|
>User and group requirements</LI
|
|
><LI
|
|
>Creating users</LI
|
|
></UL
|
|
></LI
|
|
></UL
|
|
>
|
|
</P
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="AEN205"
|
|
></A
|
|
>5.1. Installation methods</H2
|
|
><P
|
|
>After downloading and extracting the tar.gz file, the file tree looks
|
|
like this:
|
|
<TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="screen"
|
|
>exp/ -|
|
|
disk1/ -|
|
|
db2_install (* command line installation script *)
|
|
db2setup (* GUI installation launcher *)
|
|
installFixPack (* not applicable for Express-C *)
|
|
db2/ -| (* installation and licensing files *)
|
|
doc/ -| (* install instructions and release notes *)</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
>
|
|
</P
|
|
><P
|
|
>You can use three methods to install DB2:
|
|
<P
|
|
></P
|
|
><UL
|
|
><LI
|
|
><P
|
|
><B
|
|
CLASS="command"
|
|
>db2setup</B
|
|
> utility</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
><B
|
|
CLASS="command"
|
|
>db2_install</B
|
|
> utility</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>a DB2 response file</P
|
|
></LI
|
|
></UL
|
|
>
|
|
Each method has its own advantages and disadvantages. The choice of method
|
|
depends on your level of expertise and type of environment, but in
|
|
general, if a graphical interface is available, using
|
|
<B
|
|
CLASS="command"
|
|
>db2setup</B
|
|
> is recommended for ease of installation.
|
|
</P
|
|
><DIV
|
|
CLASS="sect3"
|
|
><H3
|
|
CLASS="sect3"
|
|
><A
|
|
NAME="AEN220"
|
|
></A
|
|
>5.1.1. db2setup installation</H3
|
|
><P
|
|
>The <B
|
|
CLASS="command"
|
|
>db2setup</B
|
|
> command starts the DB2 Launchpad, a
|
|
graphical tool that configures and organizes the DB2 installation. It lays
|
|
down the DB2 filesets, creates and configures DB2 instances, users and
|
|
groups, communications, the administration database used by the DB2 Tools,
|
|
and sets up notification processes. The DB2 Launchpad also allows
|
|
you to create a response file for replicating a particular setup to other
|
|
systems.</P
|
|
><P
|
|
>Using <B
|
|
CLASS="command"
|
|
>db2setup</B
|
|
> is the best method for less
|
|
experienced users, because most of the configuration is automatically
|
|
performed during the installation. As mentioned previously, you require an
|
|
X Window System capable of rendering a graphical user interface to use
|
|
<B
|
|
CLASS="command"
|
|
>db2setup</B
|
|
> successfully.</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="sect3"
|
|
><H3
|
|
CLASS="sect3"
|
|
><A
|
|
NAME="AEN227"
|
|
></A
|
|
>5.1.2. db2_install installation</H3
|
|
><P
|
|
>The <B
|
|
CLASS="command"
|
|
>db2_install</B
|
|
> command script installs all DB2
|
|
packages on your Linux system. This method is reliable and commonly used
|
|
by expert users for installing DB2 on larger, more complex systems.
|
|
However, tasks such as setting up users and groups, creating instances,
|
|
tools catalog database creation, and notification setup need to be
|
|
performed manually after the installation is completed.</P
|
|
><P
|
|
>One limitation to <B
|
|
CLASS="command"
|
|
>db2_install</B
|
|
> is that it only
|
|
installs user assistance (like help, messages, and tool interfaces) in
|
|
English, whereas <B
|
|
CLASS="command"
|
|
>db2setup</B
|
|
> supports the installation of
|
|
additional languages. Also, a <B
|
|
CLASS="command"
|
|
>db2_install</B
|
|
>
|
|
installation can take longer (because of the higher number of manual
|
|
configuration tasks); it requires a higher level of knowledge and skill,
|
|
and it cannot be used to create response files.</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="sect3"
|
|
><H3
|
|
CLASS="sect3"
|
|
><A
|
|
NAME="AEN235"
|
|
></A
|
|
>5.1.3. Response file installation</H3
|
|
><P
|
|
>A response file can be created using the DB2 Setup Wizard or by
|
|
editing an existing DB2 response (.rsp) file. It allows you to install DB2
|
|
across multiple machines with consistent installation and configuration
|
|
settings. A response file installation is fast, because it bypasses the
|
|
graphical wizard configuration. Another advantage of
|
|
using a response file instead of the <B
|
|
CLASS="command"
|
|
>db2_install</B
|
|
>
|
|
command is that it creates a Database Administration Server (DAS) on each
|
|
machine, while with
|
|
<B
|
|
CLASS="command"
|
|
>db2_install</B
|
|
> the DAS must be created manually after
|
|
installation.</P
|
|
><P
|
|
>There is a sample response file (db2exp.rsp) included on the installation image
|
|
that can be modified and used to install DB2, configure users, create
|
|
instances, set up notification, create the tools catalog, and configure a
|
|
large number of database management parameters. This is the quickest
|
|
installation method if you already have all the information you need.
|
|
Unlike
|
|
<B
|
|
CLASS="command"
|
|
>db2setup</B
|
|
>, the response file installation is not
|
|
interactive, and it takes longer to prepare the response file initially.</P
|
|
></DIV
|
|
></DIV
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="AEN242"
|
|
></A
|
|
>5.2. User and group setup</H2
|
|
><P
|
|
>DB2 requires user IDs and groups for database authentication. This
|
|
section discusses these IDs and groups and how to create them.</P
|
|
><DIV
|
|
CLASS="sect3"
|
|
><H3
|
|
CLASS="sect3"
|
|
><A
|
|
NAME="AEN245"
|
|
></A
|
|
>5.2.1. User and group requirements</H3
|
|
><P
|
|
>DB2 requires a minimum of three users and groups: an instance owner,
|
|
a fenced user, and the Database Administration Server (DAS) user. You may
|
|
use the default names provided by the setup utilities, or specify your own
|
|
user and group names. For example, consider the following default user IDs
|
|
and group names produced by the DB2 Setup Launchpad:
|
|
<DIV
|
|
CLASS="table"
|
|
><A
|
|
NAME="AEN248"
|
|
></A
|
|
><P
|
|
><B
|
|
>Table 3. Default user IDs and group names</B
|
|
></P
|
|
><TABLE
|
|
BORDER="1"
|
|
CLASS="CALSTABLE"
|
|
><THEAD
|
|
><TR
|
|
><TH
|
|
WIDTH="25%"
|
|
ALIGN="CENTER"
|
|
VALIGN="MIDDLE"
|
|
> <P
|
|
>Required user</P
|
|
>
|
|
</TH
|
|
><TH
|
|
WIDTH="25%"
|
|
ALIGN="CENTER"
|
|
VALIGN="MIDDLE"
|
|
> <P
|
|
>User name</P
|
|
>
|
|
</TH
|
|
><TH
|
|
WIDTH="25%"
|
|
ALIGN="CENTER"
|
|
VALIGN="MIDDLE"
|
|
> <P
|
|
>Group name</P
|
|
>
|
|
</TH
|
|
><TH
|
|
WIDTH="25%"
|
|
ALIGN="CENTER"
|
|
VALIGN="MIDDLE"
|
|
> <P
|
|
>Description</P
|
|
>
|
|
</TH
|
|
></TR
|
|
></THEAD
|
|
><TBODY
|
|
><TR
|
|
><TD
|
|
WIDTH="25%"
|
|
ALIGN="LEFT"
|
|
VALIGN="MIDDLE"
|
|
><P
|
|
>Instance owner</P
|
|
></TD
|
|
><TD
|
|
WIDTH="25%"
|
|
ALIGN="LEFT"
|
|
VALIGN="MIDDLE"
|
|
><P
|
|
>db2inst1</P
|
|
></TD
|
|
><TD
|
|
WIDTH="25%"
|
|
ALIGN="LEFT"
|
|
VALIGN="MIDDLE"
|
|
><P
|
|
>db2grp1</P
|
|
></TD
|
|
><TD
|
|
WIDTH="25%"
|
|
ALIGN="LEFT"
|
|
VALIGN="MIDDLE"
|
|
><P
|
|
>Administers a DB2 instance</P
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="25%"
|
|
ALIGN="LEFT"
|
|
VALIGN="MIDDLE"
|
|
><P
|
|
>Fenced user</P
|
|
></TD
|
|
><TD
|
|
WIDTH="25%"
|
|
ALIGN="LEFT"
|
|
VALIGN="MIDDLE"
|
|
><P
|
|
>db2fenc1</P
|
|
></TD
|
|
><TD
|
|
WIDTH="25%"
|
|
ALIGN="LEFT"
|
|
VALIGN="MIDDLE"
|
|
><P
|
|
>db2fgrp1</P
|
|
></TD
|
|
><TD
|
|
WIDTH="25%"
|
|
ALIGN="LEFT"
|
|
VALIGN="MIDDLE"
|
|
><P
|
|
>Responsible for executing "fenced" user
|
|
defined functions, such as JDFs and stored procedures.</P
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="25%"
|
|
ALIGN="LEFT"
|
|
VALIGN="MIDDLE"
|
|
><P
|
|
>DAS user</P
|
|
></TD
|
|
><TD
|
|
WIDTH="25%"
|
|
ALIGN="LEFT"
|
|
VALIGN="MIDDLE"
|
|
><P
|
|
>dasusr1</P
|
|
></TD
|
|
><TD
|
|
WIDTH="25%"
|
|
ALIGN="LEFT"
|
|
VALIGN="MIDDLE"
|
|
><P
|
|
>dasadm1</P
|
|
></TD
|
|
><TD
|
|
WIDTH="25%"
|
|
ALIGN="LEFT"
|
|
VALIGN="MIDDLE"
|
|
><P
|
|
>Administers the DB2 Administration
|
|
Server</P
|
|
></TD
|
|
></TR
|
|
></TBODY
|
|
></TABLE
|
|
></DIV
|
|
>
|
|
</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="sect3"
|
|
><H3
|
|
CLASS="sect3"
|
|
><A
|
|
NAME="AEN293"
|
|
></A
|
|
>5.2.2. Creating users</H3
|
|
><P
|
|
>You must have root authority to create users and groups. There are
|
|
three ways to create a DB2 user ID:
|
|
<P
|
|
></P
|
|
><UL
|
|
><LI
|
|
><P
|
|
>DB2 Launchpad: the DB2 Launchpad installation creates all of
|
|
the required users and groups for you during installation. The
|
|
default users and groups that get created are displayed in the
|
|
table above. This method also gives you the option to specify
|
|
your own user and group names.</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Response file: Users can also be created during a response
|
|
file installation if you specify user and group information in the
|
|
response file. For example, consider the following entries in a
|
|
response file that create the three required users and groups for
|
|
DB2:
|
|
<TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="programlisting"
|
|
> * 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 = ******</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
>
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Manually using command line. To use this method, follow these
|
|
steps:
|
|
<P
|
|
></P
|
|
><OL
|
|
TYPE="1"
|
|
><LI
|
|
><P
|
|
>Log on to your machine as root.</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Create groups for the instance owner, the fenced user
|
|
and the DAS user by using these commands:
|
|
<TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="screen"
|
|
>groupadd db2grp1
|
|
groupadd db2fgrp1
|
|
groupadd dasadm1</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
>
|
|
Linux will create the groups using the first available group
|
|
ID (GID) numbers available. You can specify GID numbers if you
|
|
prefer.</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Create a user that belongs to each group and specify the
|
|
home directory. For example, you can choose to place all home
|
|
directories in <TT
|
|
CLASS="filename"
|
|
>/db2home</TT
|
|
>
|
|
by entering these commands:
|
|
<TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="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
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
>
|
|
</P
|
|
></LI
|
|
></OL
|
|
>
|
|
</P
|
|
></LI
|
|
></UL
|
|
>
|
|
</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="sect3"
|
|
><H3
|
|
CLASS="sect3"
|
|
><A
|
|
NAME="AEN314"
|
|
></A
|
|
>5.2.3. Adding existing users as DB2 users</H3
|
|
><P
|
|
>To enable existing system users to act as DB2 instance administrators, you
|
|
must make a few modifications to the existing user accounts:</P
|
|
><P
|
|
></P
|
|
><UL
|
|
><LI
|
|
><P
|
|
>Add your user to the db2grp1 group. The SYSADM_GROUP database
|
|
manager configuration parameter controls who has that level of access
|
|
for all databases in that instance. You can determine what group is
|
|
set as the SYSADM group by entering:
|
|
<TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="screen"
|
|
>db2 get dbm cfg | grep SYSADM_GROUP</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
>
|
|
</P
|
|
><P
|
|
>By default, DB2 sets this as the db2grp1 group. To add the user
|
|
to the SYSADM group, modify the <TT
|
|
CLASS="filename"
|
|
>/etc/groups</TT
|
|
> file
|
|
(as root), adding the user account ID to the line for the DB2 system
|
|
admin group. For example:
|
|
<TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="screen"
|
|
>db2grp1:x:102:jackc,ellenp,frankj</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
>
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Update the user's profile by adding the following lines to the
|
|
.bashrc file in the home directory
|
|
<TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="screen"
|
|
># The following three lines have been added by the DB2 SYSADM.
|
|
if [ -f /home/frankj/sqllib/db2profile ]; then
|
|
. /home/frankj/sqllib/db2profile
|
|
fi</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
>
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>After installation, if you wish to grant or revoke access to
|
|
databases (or other objects), use the "User and Groups" section of the
|
|
Control Center or the GRANT and REVOKE SQL statements. If you want to
|
|
see an example, by default the SAMPLE database grants a number of
|
|
privileges to "PUBLIC".</P
|
|
></LI
|
|
></UL
|
|
></DIV
|
|
></DIV
|
|
></DIV
|
|
><DIV
|
|
CLASS="NAVFOOTER"
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"><TABLE
|
|
SUMMARY="Footer navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="prerequisites.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="index.html"
|
|
ACCESSKEY="H"
|
|
>Home</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="installing.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>Prerequisites</TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
> </TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
>Installing DB2 Express-C</TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |