Installing Db2 on AIX or Linux by using the command-line
You can install Db2® on AIX® or Linux® operating systems by using commands.
Before you begin
Ensure that you have:
- 2 - 3 GB of hard disk drive space for the Db2 installation
tar
file and extracted files. - A file system with at least 30 GB for the IBM Spectrum® Control repository.
Procedure
To install Db2 on AIX or Linux operating systems by using a command line, complete the following steps:
- Log in with a user ID that has root authority.
-
Install Db2.
-
Create a temporary directory (for example,
db2temp
) to hold the Db2 installation image and extracted files. -
Copy or download the Db2 installation image into
db2temp
. The name of the file varies depending on the location from where the file is downloaded or copied and the language to which it is associated. - Use an extraction tool to extract the installation image files. For example, if the name of the file is
v11.5_aix64_server.tar.gz
, enter tar -zxf v11.5_aix64_server.tar.gz. In this example,v11.5_aix64_server.tar.gz
is extracted in thedb2temp
directory. - Change directory to the location of the Db2 installation program: db2_install.
- Enter ./db2_install to run the command-line installation program.
- Enter yes to accept the license agreement terms.
- Enter yes to install into the default directory; enter no to install into a directory you specify.
- Enter SERVER for the Db2 product to install.
- Enter no because you do not want to install the Db2 pureScale® feature. The Installation Summary is displayed, which indicates a completed installation. Errors related to the install of the TSAMP file set can be ignored.
-
Create a temporary directory (for example,
-
Create users and groups for Db2 on AIX.
-
Enter the following commands to create the Db2 groups:
mkgroup db2iadm1
mkgroup db2fadm1
-
Enter the following commands to create the Db2 users and assign them to the Db2 groups:
mkuser pgrp=db2iadm1 groups=db2iadm1 home=/home/db2inst1 db2inst1
mkuser pgrp=db2fadm1 groups=db2fadm1 home=/home/db2fenc1 db2fenc1
-
Enter the following commands to set the correct ownership on the Db2 users' home directories:
chown -R db2inst1:db2iadm1 /home/db2inst1
chown -R db2fenc1:db2fadm1 /home/db2fenc1
-
Enter the following commands to set the password for the Db2 user db2inst1:
passwd db2inst1
pwdadm -f NOCHECK db2inst1
-
Enter the following commands to set the password for the Db2 user db2fenc1:
passwd db2fenc1
pwdadm -f NOCHECK db2fenc1
-
Enter the following command to add the Db2 user db2inst1 to the groups staff and system:
usermod -G staff,system db2inst1
-
Enter the following commands to create the Db2 groups:
-
Create users and groups for Db2 on Linux:
-
Enter the following commands to create the Db2 groups:
groupadd db2iadm1
groupadd db2fadm1
-
Enter the following commands to create the Db2 users:
useradd db2inst1
useradd db2fenc1
- Enter the following commands to assign the Db2 users to the Db2 groups:
usermod -a -G db2iadm1 db2inst1
usermod -a -G db2fadm1 db2fenc1
- Enter the following commands to set the correct ownership on the Db2 users' home directories:
chown -R db2inst1:db2iadm1 /home/db2inst1
chown -R db2fenc1:db2fadm1 /home/db2fenc1
- Enter the following command to set the password for the Db2 user db2inst1:
passwd db2inst1
- Enter the following command to set the password for the Db2 user db2fenc1:
passwd db2fenc1
- Enter the following command to add the Db2 user db2inst1 to the group root:
usermod -a -G root db2inst1
-
Enter the following commands to create the Db2 groups:
-
Create a Db2 instance named
db2inst1
:- Change directory to <Db2_installation_dir>/instance.
- Enter the command:
./db2icrt -a server -u db2fenc1 db2inst1
- Enter the command:
. /home/db2inst1/sqllib/db2profile
- Enter the command:
db2start
- Configure Db2 communication.
- Examine the /etc/services file. If the line
db2c_db2inst1 25010/tcp
exists in that file, proceed to Step 7. If the linedb2c_db2inst1 25010/tcp
does not exist in that file, do the following: - Edit the /etc/services file and add the following line at the end
of the file:
db2c_db2inst1 25010/tcp
. - Enter the command:
db2 update dbm cfg using svcename db2c_db2inst1
- Enter the command:
db2set DB2COMM=tcpip
- Enter the command:
db2stop
- Enter the command:
db2start
- Examine the /etc/services file. If the line
- Enter the command:
db2level
to verify the installed version of Db2.