Manually install DB2 on Linux
1.Run the. /db2_install to install the necessary files
2.Run as the root user, set up three groups respectively corresponding to three DB2 users: the instance owner,The fenced user, the DAS user, the command is as follows:
groupadd -g 999 db2iadm1
groupadd -g 998 db2fadm1
groupadd -g 997 db2asgrp
3.Run as root, the establishment of three DB2 users, and specify the three user directory, generally for/opt, the command is as follows:
useradd -u 1004 -g db2iadm1 -m -d /db2home/db2inst1 db2inst1 -p passwd
useradd -u 1003 -g db2fadm1 -m -d /db2home/db2fenc1 db2fenc1 -p passwd
useradd -u 1002 -g db2asgrp -m -d /db2home/dasusr1 dasusr1 -p passwd
4. Run as root, to three users set password, the command is as follows:
passwd db2inst1
passwd db2fenc1
passwd dasusr1
5. Create a DB2 instance. Using the db2icrt command:
A. run as root
B. Enter the following command:
/ opt/ibmdb2 / V10.1 / instance/db2icrt -u [- a AuthType] FencedID InstNme
Among them:
Instance - AuthType said the type of authentication, the default for the SERVER, other
Types including CLIENT, DCS, SERVER_ENCRYPT, or DCS_ENCRYPT.
- FencedID is the name of the DB2 fenced user.
- InstNme is the instance name.
Sample is as follows:
/opt/ibm/db2/V10.1/instance/db2icrt -u db2fenc1 db2inst1
Problems:
DBI1446I The db2icrt command is running, please wait.
DB2 installation is being initialized.
The host name "framework" is invalid. Specify a valid host name.
A major error occurred during the execution that caused this program to
terminate prematurely. If the problem persists, contact your technical service
representative.
For more information see the DB2 installation log at "/tmp/db2icrt.log.2110".
DBI1264E Errors were encountered in running db2icrt. Please
refer to the installation log file /tmp/db2icrt.log.2110 for more
information.
Explanation:
All processed and failed operations have been saved into this log file.
User response:
Do not modify this file in any way. This file is for IBM Technical
Support reference.
Problem(Abstract)
The "DBI1922N The host name is not valid" can be received when trying to manually create a DB2 instance or via the upgrade wizard
Cause
The /etc/hosts file is not correctly coded.
Resolving the problem
To resolve this issue, you need to make sure that the /etc/hosts file is coded correctly as stated in the installation manual. Information on the hosts file is also available online in the Tivoli Storage Manager Information Center under the Configuring the /etc/hosts file on AIX®, HP-UX, Linux, and Solaris systems section.
Once the hosts has been corrected, it is necessary the run the db2icrt command manually. Specifically:
/opt/tivoli/tsm/db2/instance/db2icrt -a SERVER -u instance_name instance_name
If the db2icrt command indicates the "sqllib" directory already exists, rename the directory and rerun the db2icrt command again.
Once the db2icrt command completes successfully, continue with the manual configuration steps or rerun dsmupgdx if using the graphical upgrade wizard.
1. modify hostname in below file:
/etc/sysconfig/network
/etc/hosts
2. restart service:
service NetworkManager restart
service network restart
6. To create a DB2 instance TCP/IP connection
A. Update the/etc/services file, specify the DB2 server to monitor the client requested service name and port
Add the line to/etc/services
db2c_db2inst1 50001/tcp # DB2 connection service port
Among them:
• db2c_db2inst1 is connection service name
• 50001 is the service port
• TCP/IP is protocol TCP
The service name and port number must be in the system is the only one.
B. in the server to update the database manager configuration file:
I. to DB2 instance user login.
Ii. Set the DB2 instance environment( this step can ignore):
INSTHOME/sqllib/the db2profile
Iii. Update the SVCENAME parameter in DBM configuration file. You must specify the service name or port number.
Sample is as follows:
db2 update dbm cfg using SVCENAME db2c_db2inst1
You can use the following command to check the SVCENAME:
db2 get dbm cfg | grep SVC
C. set the tcpip to DB2COMM registry parameter. With the DB2 instance user, enter the following command:
db2set DB2COMM=tcpip
D. restart DB2:
db2stop
db2start
7. Install license (this step can be ignored if the db2start has no problem)
Must be installed at each of the computers in the DB2 server license, use db2licm command
A. as root or DB2 instance user login.
B. Enter the following command
/opt/ibm/db2/V10.1/adm/db2licm -a
Among them, the filename is the absolute path to the DB2 server license file, this file generally in CD Mount plate/db2 / license directory, if the CD under the mount MNT, command format is as follows:
/opt/ibm/db2/V10.1/adm/db2licm -a /mnt/db2/license/db2ese.lic
After the installation, DB2 licenses in the/var/lum nodelock directory.
8. Create the DB2 administration Server (DAS).
A. to have root privileges user login
B. Perform the following command to create the DAS:
opt/ibm/db2/V10.1/instance/dascrt -u DASuser
Including DASuser is created in the DAS user name of the machine
Commonly used commands:
#su - db2inst1
$db2 create database test ---- Create a database instance
DB20000I The CREATE DATABASE command completed successfully.
2. Connect to the database we just created
#su - db2inst1
$db2
db2 => Connect to test user db2inst1
Enter current password for db2inst1:
Database Connection Information
Database server = DB2/LINUX 9.7.5
SQLauthorization ID = DB2INST1
Local database alias = TEST
db2 =>
[db2inst1@localhost ~]$ db2 get dbm cfg
Database Manager Configuration
Node type = Database Server with local and remote clients
Database manager configuration release level = 0x0a00
CPU speed (millisec/instruction) (CPUSPEED) = 2.834065e-07
Max number of concurrently active databases (NUMDB) = 8
Data Links support (DATALINKS) = NO
Federated Database System Support (FEDERATED) = NO
Transaction processor monitor name (TP_MON_NAME) =
Default charge-back account (DFT_ACCOUNT_STR) =
Java Development Kit installation path (JDK_PATH) = /opt/IBMJava2-142
Diagnostic error capture level (DIAGLEVEL) = 3
Notify Level (NOTIFYLEVEL) = 3
Diagnostic data directory path (DIAGPATH) = /home/db2inst1/sqllib/db2dump
Default database monitor switches
Buffer pool (DFT_MON_BUFPOOL) = OFF
Lock (DFT_MON_LOCK) = OFF
Sort (DFT_MON_SORT) = OFF
Statement (DFT_MON_STMT) = OFF
Table (DFT_MON_TABLE) = OFF
Timestamp (DFT_MON_TIMESTAMP) = ON
Unit of work (DFT_MON_UOW) = OFF
Monitor health of instance and databases (HEALTH_MON) = ON
SYSADM group name (SYSADM_GROUP) = DB2IADM1
SYSCTRL group name (SYSCTRL_GROUP) =
SYSMAINT group name (SYSMAINT_GROUP) =
SYSMON group name (SYSMON_GROUP) =
Client Userid-Password Plugin (CLNT_PW_PLUGIN) =
Client Kerberos Plugin (CLNT_KRB_PLUGIN) =
Group Plugin (GROUP_PLUGIN) =
GSS Plugin for Local Authorization (LOCAL_GSSPLUGIN) =
Server Plugin Mode (SRV_PLUGIN_MODE) = UNFENCED
Server List of GSS Plugins (SRVCON_GSSPLUGIN_LIST) =
Server Userid-Password Plugin (SRVCON_PW_PLUGIN) =
Server Connection Authentication (SRVCON_AUTH) = NOT_SPECIFIED
Database manager authentication (AUTHENTICATION) = SERVER
Cataloging allowed without authority (CATALOG_NOAUTH) = NO
Trust all clients (TRUST_ALLCLNTS) = YES
Trusted client authentication (TRUST_CLNTAUTH) = CLIENT
Bypass federated authentication (FED_NOAUTH) = NO
Default database path (DFTDBPATH) = /home/db2inst1
Database monitor heap size (4KB) (MON_HEAP_SZ) = 90
Java Virtual Machine heap size (4KB) (JAVA_HEAP_SZ) = 2048
Audit buffer size (4KB) (AUDIT_BUF_SZ) = 0
Size of instance shared memory (4KB) (INSTANCE_MEMORY) = AUTOMATIC
Backup buffer default size (4KB) (BACKBUFSZ) = 1024
Restore buffer default size (4KB) (RESTBUFSZ) = 1024
Sort heap threshold (4KB) (SHEAPTHRES) = 20000
Directory cache support (DIR_CACHE) = YES
Application support layer heap size (4KB) (ASLHEAPSZ) = 15
Max requester I/O block size (bytes) (RQRIOBLK) = 32767
Query heap size (4KB) (QUERY_HEAP_SZ) = 1000
Workload impact by throttled utilities(UTIL_IMPACT_LIM) = 10
Priority of agents (AGENTPRI) = SYSTEM
Max number of existing agents (MAXAGENTS) = 200
Agent pool size (NUM_POOLAGENTS) = 100(calculated)
Initial number of agents in pool (NUM_INITAGENTS) = 0
Max number of coordinating agents (MAX_COORDAGENTS) = MAXAGENTS
Max no. of concurrent coordinating agents (MAXCAGENTS) = MAX_COORDAGENTS
Max number of client connections (MAX_CONNECTIONS) = MAX_COORDAGENTS
Keep fenced process (KEEPFENCED) = YES
Number of pooled fenced processes (FENCED_POOL) = MAX_COORDAGENTS
Initial number of fenced processes (NUM_INITFENCED) = 0
Index re-creation time and redo index build (INDEXREC) = RESTART
Transaction manager database name (TM_DATABASE) = 1ST_CONN
Transaction resync interval (sec) (RESYNC_INTERVAL) = 180
SPM name (SPM_NAME) =
SPM log size (SPM_LOG_FILE_SZ) = 256
SPM resync agent limit (SPM_MAX_RESYNC) = 20
SPM log path (SPM_LOG_PATH) =
TCP/IP Service name (SVCENAME) = db2inst1port
Discovery mode (DISCOVER) = SEARCH
Discover server instance (DISCOVER_INST) = ENABLE
Maximum query degree of parallelism (MAX_QUERYDEGREE) = ANY
Enable intra-partition parallelism (INTRA_PARALLEL) = NO
No. of int. communication buffers(4KB)(FCM_NUM_BUFFERS) = 1024
Number of FCM request blocks (FCM_NUM_RQB) = AUTOMATIC
Number of FCM connection entries (FCM_NUM_CONNECT) = AUTOMATIC
Number of FCM message anchors (FCM_NUM_ANCHORS) = AUTOMATIC