-
DB2 Installation Environment
Check installation Environment
- Check whether RPM packages are installed: libaio , libstdc , compat-libstdc++ , nfs-utils
- typing the follows command to check whether the rpm packages have been installed
- #rpm -qa |grep libaio
- #rpm -qa |grep libstdc
- #rpm -qa |grep compat-libstdc++
- #rpm -qa |grep nfs-utils
- typing the follows command to check whether the rpm packages have been installed
- Existed rpm package's logs are as like follows.
- linux-q7x6: # rpm -qa |grep libaio
- libaio-0.3.104-14.2
- libaio-32bit-0.3.104-14.2
- linux-q7x6: # rpm -qa |grep libstdc
- compat-libstdc++-5.0.7-22.2
- libstdc++-4.1.2_20070115-0.21
- linux-q7x6: # rpm -qa |grep compat-libstdc++
- compat-libstdc++-5.0.7-22.2
- linux-q7x6: # rpm -qa |grep nfs-utils
- nfs-utils-1.0.7-36.29
- linux-q7x6: # rpm -qa |grep libaio
- RPM can't be searched when there is no any log after you search rpm name
- you should search rpm packages in Linux system installer CD,or search the rpm packages in network
- Typing the command to install rpm package:#rpm -ivh .rpm ( .rpm should be replaced with the downloaded rpm real name)
- Recheck RPM packages whether they are installed.if can't find any log ,Please download other version's RPM packages to install.
- Check brower:
- Firefox 2.0 and later
- Mozilla-based browsers 1.7 and later
- An X Window System software capable of rendering a graphical user interface is required if you want to use db2cc or install it using db2setup
- Micro Focus does not offer support for any of its COBOL compiler products on SLES 11.
-
Setup and configure DB2
1. First install DB2 on your server,it's simple on the Windows Server, select default to continue will be OK, but there are something need to be pay attention to do if you wanna install it on Linux/Unix:
- Ensure your OS Environment should follow the DB2's requirements. For example, you should got pdksh, openssh, rsh-server, nfs-utils, JDK Environment installed on your Suse 10 (or your need to check DB2's official documents to check what should be setup first on your OS.);
- Setup DB2 by use the GUI tool "db2setup" may show the DBI1501E Error,it's an other way to instead by use "db2install" to install it by command line (Default install path is "/opt/ibm/db2/v9.5")
- However, use GUI to install DB2 due to the steps is much more simple.
- You may need to write down the username & password of DAS, INSTANCE, FENCED Administrator during the course of DB2 setup, because of frequently used of them;
- 如果采用的命令行模式安装(db2_install),需要如下表手动创建DAS、INSTANCE、FENCED用户组和用户;
用户组 用户 db2grp1 db2inst1 db2fgrp1 db2fenc1 dasadm1 dasusr1 - 使用以下命令创建管理服务器实例
/opt/IBM/db2/V9.5/instance/dascrt -u dasusr1
- 检查/etc/hosts文件内HOSTNAME是否与环境变量一致
env | grep HOSTNAME
将hosts文件内127.0.0.1后的server name改成与上面命令查看到的HOSTNAME一致
- 使用以下命令创建数据库实例 db2inst1,接下来就可以用su命令切换到db2inst1用户直接进入DB2命令模式操作了.
/opt/IBM/db2/V8.1/instance/db2icrt -u db2fenc1 db2inst1
- 如果采用的命令行模式安装(db2_install),需要如下表手动创建DAS、INSTANCE、FENCED用户组和用户;
- 为DB2服务配置端口:
/etc/vi services(在最后添加"db2tcp 50000/tcp"并保存)
- 更新配置信息:
/opt/ibm/db2/V9.5/bin/su db2inst1
db2inst1@dhcppc12:/opt/ibm/db2/V9.5/bin/db2start
db2inst1@dhcppc12:/opt/ibm/db2/V9.5/bin/db2set DB2COMM=TCPIP
db2inst1@dhcppc12:/opt/ibm/db2/V9.5/bin/db2 update dbm cfg using SVCENAME db2tcp - 通过程序连接DB2的准备工作:
/sbin/SuSEfirewall2 stop
dhcppc12:/opt/ibm/db2/V9.5/bin/su db2inst1
db2inst1@/opt/ibm/db2/V9.5/bin/db2stop
db2inst1@/opt/ibm/db2/V9.5/bin/db2start - 在Linux下启动Control Center的GUI命令为db2cc, 如出现如下错误, 可新开一个Terminal窗口输入xhost +, 再返回原Terminal窗口重试.