Install: DB2 v11 on CentOS
DB2 Database Server v11.1.4fp5
主程式安裝
# RedHat/CentOS 6/7
yum install libaio ksh rsh-server sg3_utils pam-devel nfs-utils compat-libstdc++-33
yum install libstdc++.i686 pam-devel.i686 compat-libstdc++-33.i686
# RedHat/CentOS 8
yum install libaio ksh sg3_utils pam-devel nfs-utils
yum install libstdc++.i686 pam-devel.i686
TIP: 安裝檔裡有一個檢查相依性套件的工具 db2prereqcheck,執行後,最後下方的輸出如果沒有顯示類似的內容,就表示可以繼續執行安裝。
DBT3507E The db2prereqcheck utility failed to find the following package or file: "sg3_utils".
開始安裝
tar xzf DB2_AESE_PVU_11.1_Svr_Linux_86-64.tar.gz
cd server_aese_c/
./db2prereqcheck -i
./db2_install -f NOTSAMP
***********************************************************
Install into default directory (/opt/ibm/db2/V11.1) ? [yes/no]yes <===
Specify one of the following keywords to install DB2 products.
SERVER
CONSV
CLIENT
RTCLEnter "help" to redisplay product names.
Enter "quit" to exit.
***********************************************************
SERVER <===
更新 FixPack
tar xzf v11.1.4fp5_linuxx64_universal_fixpack.tar.gz
cd universal/
./db2prereqcheck -i
./installFixPack
Enter the full path of the base installation directory:
-------------------------------------------------------
/opt/ibm/db2/V11.1 <== 輸入預設安裝目錄Do you want to choose a different installation directory for the fix pack? [yes/no]
------------------------------------------------------------------------------------
no <==
完成。
FAQ
db2prereqcheck Error
Q: 在 Fixpack 6+ 以後版本,執行 db2prereqcheck 出現一個錯誤
Validating "ipcmni_extend kernel parameter " ...
WARNING : Requirement not matched.
A: 如果主機的 RAM 小於 128 GB,可以忽略這個;如果 RAM 大於 128 GB,在設定 kernel 參數可能發生某些數值超過限制的錯誤,這時候就必須修改開機的 kernel 參數,加上 ipcmni_extend,詳細步驟可參閱 https://access.redhat.com/solutions/4968021。
db2_install Hang
執行 db2_install 時,安裝步驟卡在 Registering DB2 Updated Service
Task #56 start
Description: Registering DB2 Update Service
Estimated time 30 second(s)
Solution:
- 編輯
/etc/netsvc.conf
: 註解所有行 - 編輯
/etc/resolv.conf
: 確認 DNS Server 是有效的
測試解析外部網域:
nslookup www.ibm.com
installFixPack Error
執行 installFixPack 出現錯誤
DBI1131E The user ID ERROR: is invalid.
原因:可能之前的安裝程序有意外中斷過,導致部分程序有殘留或檔案不完整。
執行以下的檢查:
- 執行 lsof | grep db2 : 應該為空白
- 執行 fuser -f /opt/IBM/db2/V11.1 : 應該為空白
- 執行 /DB2-PATH/instance/db2ilist : 應該沒有任何錯誤訊息
/opt/IBM/db2/V11.1/instance/db2ilist:
ERROR: The embedded runtime path in /opt/IBM/db2/V11.1/bin/db2 is incorrect:/DoNotCreateThisPath_marker1_for_chglibpath:/view/db2_v111_aix64_s1606081100/vbs/INST/lib:/view/db2_v111_aix64_s1606081100/vbs/INST/lib/gskit:/view/db2_v111_aix64_s1606081100/vbs/engn/lib:/view/db2_v111_aix64_s1606081100/vbs/common/lib/RS6000_64L:/view/db2_v111_aix64_s1606081100/vbs/das/lib/RS6000_64L:/view/db2_v111_aix64_s1606081100/vbs/bldsupp/lib:/view/db2_v111_aix64_s1606081100/vbs/system/fm/lib/RS6000_64L:/view/db2_v111_aix64_s1606081100/vbs/bldsupp/aix64/vacpp/usr/lib:/fillspacexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:/fillspacexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:/fillspacexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:/fillspacexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:/fillspacexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:/fillspacexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:/fillspacexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:/fillspacexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:/marker2_for_chglibpath:/opt/IBM/db2/V11.1/lib64:/opt/IBM/db2/V11.1/lib64/gskit:/usr/lib/threads:/usr/lib/lib_64:/usr/libACTION: Please run /opt/IBM/db2/V11.1/install/db2chgpath and rerun the previous command.Contact IBM Support if the problem persists.
以 root 執行,約需 17 分鐘
/opt/IBM/db2/V11.1/install/db2chgpath