red hat 6.5 安裝DB2 11.1
安裝過oracle數據庫的都知道,oracle安裝還是比較麻煩的,但是相應的資料也比較多,最近想重新系統的學習DB2,就免不了搭個環境練習練習。
簡要的安裝步驟如下,供參考。
一:安裝配置環境
操作系統版本: Red Hat Enterprise Linux Server release 6.5 (Santiago)
數據庫版本: DB2/LINUXX8664 11.1.2.2
[root@host02 ~]# uname -r
2.6.32-431.el6.x86_64
二:安裝軟件及創建數據庫
1.上傳v11.1_linuxx64_server_t.tar.gz到主機上
2.解壓 tar -xzvf v11.1_linuxx64_server_t.tar.gz
會生成一個server_t文件。
3.安裝前檢查:
/u01/server_t
[root@host02 server_t]# ./db2prereqcheck
Validating "/lib/libpam.so*" ...
DBT3514W The db2prereqcheck utility failed to find the following 32-bit library file: "/lib/libpam.so*".
WARNING : Requirement not matched.
Requirement not matched for DB2 database "Server" with pureScale feature . Version: "9.8.0.2".
Summary of prerequisites that are not met on the current system:
DBT3514W The db2prereqcheck utility failed to find the following 32-bit library file: "/lib/libpam.so*".
DBT3514W The db2prereqcheck utility failed to find the following 32-bit library file: "libstdc++.so.5".
在檢查是會出現以上錯誤。
上述報錯IBM 給出了如下解釋:
DBT3514W
The db2prereqcheck utility failed to find the following 32-bit library file: library-file-name.
Explanation
You can verify installation prerequisites for DB2 database using the db2prereqcheck utility.
This message is returned when the db2prereqcheck utility cannot find the 32-bit version of a required library file. If the named file is missing, 32-bit database applications might not function properly.
User response
Respond to this message in one of the following ways:
1> If you do not intend to use 32-bit applications with DB2 database, then no response is required.
2> If you do intend to use 32-bit applications with DB2 database, ensure that the named 32-bit library file exists on the system before installing DB2 database.
目前平臺不打算使用32bit applications,故可以忽略以上警告信息。
4.安裝軟件
[root@host02 server_t]# ls
db2 db2checkCOL_readme.txt db2checkCOL.tar.gz db2ckupgrade db2_deinstall db2_install db2ls db2prereqcheck db2setup ibm_im installFixPack nlpack
[root@host02 server_t]# ./db2_install
…….
Install into default directory (/opt/ibm/db2/V10.5) ? [yes/no] -------------------- 這里選擇安裝目錄,選擇推薦目錄即可(可以修改目錄,如果不修改/預留大小為6G)
Yes
Enter "help" to
redisplay product names. --------------- 選擇安裝產品類型,這里選擇SERVER
Do you want to install the DB2 pureScale Feature? [yes/no] ---------------- 選擇是否安裝pureScale功能,這里選擇不安裝
生成如下目錄
/opt/ibm/db2/V11.1
5. 配置DB2 Instance
創建用戶和組
用戶用途 用戶名 用戶組
實例所有者 db2inst1 db2iadm1
受防護的用戶 db2fenc1 db2fadm1
DB2 管理
服務器用戶 dasusr1 dasadm1注:實例所有者主目錄是將在其中創建DB2實例的位置;受防護的用戶用于在DB2數據庫所使用的地址空間之外運行用戶定義的函數(UDF)和存儲過程;DB2管理服務器用戶的用戶標識用于在系統上運行DB2管理服務器。
root@host02 ~]# groupadd db2iadm1
[root@host02 ~]# groupadd db2fadm1
[root@host02 ~]# groupadd dasadm1
[root@host02 ~]# useradd -u 600 -g db2iadm1 -m -d /home/db2inst1 db2inst1
[root@host02 ~]# useradd -u 601 -g db2fadm1 -m -d /home/db2fenc1 db2fenc1
[root@host02 ~]# useradd -u 602 -g dasadm1 -m -d /home/dasusr1 dasusr1
創建DAS
/opt/ibm/db2/V11.1/instance
[root@host02 instance]# ./dascrt -u dasusr1
創建DB2 Instance
[root@host02 instance]# ./db2icrt -u db2fenc1 db2inst1
DBI1446I The db2icrt command is running
6.配置DB2服務器的TCP/IP通信
[root@host02 ~]# su - db2inst1
[db2inst1@host02 ~]$ db2set -all
[i] DB2AUTOSTART=NO
[g] DB2SYSTEM=host02
[g] DB2INSTDEF=db2inst1
[g] DB2ADMINSERVER=dasusr1
[db2inst1@host02 ~]$ db2set DB2COMM=tcpip
[db2inst1@host02 ~]$ db2set -all
更新服務器上services文件
cat /etc/services |grep DB2
更新服務器數據庫管理文件
db2 update dbm cfg using SVCENAME 60006
[db2inst1@host02 ~]$ netstat -an |grep 60006
tcp 0 0 0.0.0.0:60006 0.0.0.0:* LISTEN
7.創建數據庫
[db2inst1@host02 ~]$ db2 create db erpdb using codeset UTF-8 territory CN pagesize 8192
DB20000I The CREATE DATABASE command completed successfully.
到這DB2 就安裝完成。看起來還是比oracle安裝步驟簡單。