Install: DB2 v11 on RedHat 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". 開始安裝 Command: db2prereqcheck -i -o log-file   Command:  db2_install -f NOTSAMP -l log-file   NOTSAMP: Specifies that IBM Tivoli® System Automation for Multiplatforms (SA MP) should not be either installed or updated. 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 RTCL Enter "help" to redisplay product names. Enter "quit" to exit. *********************************************************** SERVER <=== 更新 FixPack Command: installFixPack -l log-file   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 <== 完成。 驗證安裝 (Optional) /opt/IBM/db2/V11.1/bin/db2val -o -l db2val.log db2_deinstall 如果主程式安裝過程中,因為發生異常,手動執行強制中斷,再解決問題後,想先移除原先的不完整版本再重安裝,可以執行 cd /path/to/db2_installer ./db2_deinstall -a 如果想移除剛剛安裝的 FixPack,可以執行 # 自行修改預設安裝目錄 /opt/IBM/db2/V11.1 cd /path/to/db2_installer ./installFixPack -f level -b /opt/IBM/db2/V11.1 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. 原因:可能是 AIX VM with qemu 環境才會遇到的問題。 執行以下的檢查: 執行 lsof | grep db2 : 應該為空白 (如果出現 db2fmcd,可以忽略) 執行 fuser -f /opt/IBM/db2/V11.1 : 應該為空白 (如果出現 db2fmcd,可以忽略) 執行 /opt/IBM/db2/V11.1/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/lib ACTION: Please run /opt/IBM/db2/V11.1/install/db2chgpath and rerun the previous command.         Contact IBM Support if the problem persists. 檢查是否有任何 db2 相關程序,如果有,請先手動 kill;如果是 db2fmcd,需要先修改 /etc/inittab ,將 respawn 改成 off 。 fmc:2:off:/opt/IBM/db2/V11.1/bin/db2fmcd #DB2 Fault Monitor Coordinator 然後執行 Kill 。  最後以 root 執行以下指令,約需 17 分鐘。 /opt/IBM/db2/V11.1/install/db2chgpath Tip: 類似的錯誤訊息,可能發生在其他 DB2 指令,例如 db2icrt 等。請使用 db2chgpath 來修復。