This article describes how to manually install a DB2 database in a UNIX environment. If you are interested in the actual steps for manually installing a DB2 database in a UNIX environment, you can click to view the following articles. The following is a detailed description of the articles. I hope you can learn from them.
This document describes how to manually install a DB2 database in a UNIX system. For details, see the following:
1. Execute the installation: Run./db2_install
2. Create a user ID:
- groupadd db2grp1
- groupadd db2fgrp1
- groupadd dasadm1
- useradd -g db2grp1 -m -d /home/db2inst1 -p “” db2inst1
- useradd -g db2fgrp1 -m -d /home/db2fenc1 -p ““ db2fenc1
- useradd -g dasadm1 -m -d /home/dasusr1 -p “” dasusr1
Note: The passwords of the above three users are empty. When you use the su command to switch to the corresponding user, use the passwd command to set the password.
3. Create an instance:
First, use the following command to create and manage server instances:
- /opt/ibm/db2/v8.1/instance/dascrt -u dasusr1
Run the following command to create the database instance db2inst1:
- /opt/ibm/db2/v8.1/instance/db2icrt -u db2fenc1 db2inst1
This command has some optional parameters. In particular, the-a option allows us to specify an authentication mechanism different from the default "server.
4. Create a shared library link:
- /opt/ibm/db2/v8.1/cfg/db2ln
5. Set the db2 instance environment variables:
Use the su command to switch to the user terminal of the db2 instance:
Su db2inst1
Db2set db2autostart = yes (set db2 to automatically start with linux) db2set db2comm = tcpip (set db2 to support tcpip protocol for client access)
6. Set the service port
Enter the db2 Command Line Mode
Update database manager configuration using svcename server1 | 50000
Server1 | 50000 either. server1 | indicates the service name and 50000 indicates the port number.
Get database manager configuration
7. Create a database
- create database dbname
8. Client Connection
In command line mode, enter the following command:
- db2 catalog tcpip node mynode remote hostname server 50000
- db2 catalog database dbname as dbname at node mynode
Now, you only need to add an odbc source to test the connection. The above content is an introduction to manual installation of the DB2 database in the UNIX environment.