溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

red hat 6.5 安裝DB2 11.1

發(fā)布時(shí)間:2020-08-08 18:44:09 來源:ITPUB博客 閱讀:227 作者:pingdanorcale 欄目:數(shù)據(jù)庫
   安裝過oracle數(shù)據(jù)庫的都知道,oracle安裝還是比較麻煩的,但是相應(yīng)的資料也比較多,最近想重新系統(tǒng)的學(xué)習(xí)DB2,就免不了搭個(gè)環(huán)境練習(xí)練習(xí)。 
簡要的安裝步驟如下,供參考。

一:安裝配置環(huán)境
操作系統(tǒng)版本: Red Hat Enterprise Linux Server release 6.5 (Santiago)
數(shù)據(jù)庫版本: DB2/LINUXX8664 11.1.2.2

[root@host02 ~]#  uname -r
2.6.32-431.el6.x86_64
二:安裝軟件及創(chuàng)建數(shù)據(jù)庫
1.上傳v11.1_linuxx64_server_t.tar.gz到主機(jī)上
2.解壓 tar -xzvf  v11.1_linuxx64_server_t.tar.gz
 會(huì)生成一個(gè)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".
在檢查是會(huì)出現(xiàn)以上錯(cuò)誤。
上述報(bào)錯(cuò)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.


目前平臺(tái)不打算使用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] -------------------- 這里選擇安裝目錄,選擇推薦目錄即可(可以修改目錄,如果不修改/預(yù)留大小為6G)
Yes
Enter "help" to redisplay product names. --------------- 選擇安裝產(chǎn)品類型,這里選擇SERVER
Do you want to install the DB2 pureScale Feature? [yes/no] ---------------- 選擇是否安裝pureScale功能,這里選擇不安裝


生成如下目錄
/opt/ibm/db2/V11.1


5. 配置DB2 Instance
創(chuàng)建用戶和組
用戶用途 用戶名 用戶組
實(shí)例所有者 db2inst1 db2iadm1
受防護(hù)的用戶 db2fenc1 db2fadm1
DB2 管理服務(wù)器用戶 dasusr1 dasadm1注:實(shí)例所有者主目錄是將在其中創(chuàng)建DB2實(shí)例的位置;受防護(hù)的用戶用于在DB2數(shù)據(jù)庫所使用的地址空間之外運(yùn)行用戶定義的函數(shù)(UDF)和存儲(chǔ)過程;DB2管理服務(wù)器用戶的用戶標(biāo)識(shí)用于在系統(tǒng)上運(yùn)行DB2管理服務(wù)器。
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
創(chuàng)建DAS
/opt/ibm/db2/V11.1/instance
[root@host02 instance]# ./dascrt -u dasusr1
 創(chuàng)建DB2 Instance

 [root@host02 instance]# ./db2icrt -u db2fenc1 db2inst1

DBI1446I The db2icrt command is running

6.配置DB2服務(wù)器的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
更新服務(wù)器上services文件

cat /etc/services |grep DB2

 更新服務(wù)器數(shù)據(jù)庫管理文件
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.創(chuàng)建數(shù)據(jù)庫
[db2inst1@host02 ~]$ db2 create db  erpdb  using codeset UTF-8 territory CN pagesize 8192


DB20000I  The CREATE DATABASE command completed successfully.


  到這DB2 就安裝完成。看起來還是比oracle安裝步驟簡單。







向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI