Install DB2 v9.7 on SLES 11 SP2

    版本為 09:39, 27 Nov 2024

    到這個版本。

    返回到 版本存檔.

    查閱目前版本

    安裝 IBM DB2 version 9.7 在 SuSE Linux Enterprise Server 11 SP2

    安裝前注意事項:

    • SuSE Linux  64/32-bit 必須與 DB2 安裝檔相同
    • 停用 SuSE Linux 的 Firewall
       

    官方教學: http://pic.dhe.ibm.com/infocenter/db.../c0052964.html

    開始安裝

    準備檔案:
    • DB2_AESE_97_Linux_x86-64.tar.gz (DB2 Server 主程式)
    • DB2_AESE_CPU_QS_Activation_97.zip (License 檔案)
    • v9.7fp8_linuxx64_universal_fixpack.tar.gz (更新檔 fixpack)
    主程式安裝

    檔案名稱: DB2_AESE_97_Linux_x86-64.tar.gz

    tar xzf DB2_AESE_97_Linux_x86-64.tar.gz
    cd aese/
    ./db2prereqcheck
    ./db2_install 
    

    Default directory for installation of products - /opt/ibm/db2/V9.7

    ***********************************************************
    Do you want to choose a different directory to install [yes/no] ?
    no

    Specify one of the following keywords to install DB2 products.

      AESE
      CLIENT
      RTCL

    Enter "help" to redisplay product names.

    Enter "quit" to exit.

    ***********************************************************
    AESE

    更新檔 fixpack 安裝

    檔案名稱: v9.7fp8_linuxx64_universal_fixpack.tar.gz

    tar xzf v9.7fp8_linuxx64_universal_fixpack.tar.gz
    cd universal/
    ./db2prereqcheck
    

    如果出現錯誤:
    DBT3534W  The db2prereqcheck utility determined that ASLR is set to ON and that this could cause issues with some tools.

    解決: 編輯 /etc/sysctl.conf, 加上這一行
    kernel.randomize_va_space = 0
    執行  echo 0 > /proc/sys/kernel/randomize_va_space

    ./installFixPack
    

    Enter full path name for the install directory -

    ------------------------------------------------
    /opt/ibm/db2/V9.7 <== 輸入 DB2 主程式安裝目錄

    建立 DB Instance 用的 User & Group

    User: db2inst
    Group: db2adm

    新增 DB Instance

    編輯 /etc/services,最底下加上這幾行

    #
    DB2_db2inst      60000/tcp
    DB2_db2inst_1    60001/tcp
    DB2_db2inst_2    60002/tcp
    DB2_db2inst_END  60003/tcp
    

    新增 DB Instance

    cd /opt/ibm/db2/V9.7/instance/
    ./db2icrt -s ese -u db2inst db2inst
    

    db2icrt -s <Inst-Type> -u <Inst-username> <Inst-name>

    建立 DB Instance 的 .profile

    su - db2inst
    cp sqllib/db2profile .profile 
    exit
    

    要驗證 profile 是否套用,登出後再登入,執行以下幾個指令

    $ db2level
    DB21085I  This instance or install (instance name, where applicable: "db2inst")
    uses "64" bits and DB2 code release "SQL09078" with level identifier
    "08090107".
    Informational tokens are "DB2 v9.7.0.8", "s130316", "IP23433", and Fix Pack
    "8".
    Product is installed at "/opt/ibm/db2/V9.7".

    $ db2licm -l

    匯入 DB2 授權檔

    注意: 匯入 license 必須使用 DB Instance 的帳號
    解開檔案

    su - db2inst
    unzip  DB2_AESE_CPU_QS_Activation_97.zip
    cd  aese_c/
    

    匯入前的授權資訊

    db2licm -l
    

    Product name:                     "DB2 Advanced Enterprise Server Edition"
    License type:                     "License not registered"
    Expiry date:                      "License not registered"
    Product identifier:               "db2aese"
    Version information:              "9.7"

    開始匯入

    db2licm -a db2/license/db2aese_c.lic
    

    LIC1402I  License added successfully.

    LIC1426I  This product is now licensed for use as outlined in your License Agreement.  USE OF THE PRODUCT CONSTITUTES ACCEPTANCE OF THE TERMS OF THE IBM LICENSE AGREEMENT, LOCATED IN THE FOLLOWING DIRECTORY: "/opt/ibm/db2/V9.7/license/en_US.iso88591"

    匯入後的授權資訊

    db2licm -l
    

    Product name:                     "DB2 Advanced Enterprise Server Edition"
    License type:                     "CPU Option"
    Expiry date:                      "Permanent"
    Product identifier:               "db2aese"
    Version information:              "9.7"
    Enforcement policy:               "Soft Stop"

    DB2 啟動及驗證

    su - db2inst
    db2start 
     ps -ef | grep db2sysc
    

    建立 Sample 資料庫

    db2sampl
    db2 list db directory
    db2 connect to sample 
    

    SuSE Linux 的操作技巧

    註: 以 SuSE Linux Enterprise 11 SP2 為例

    變更 yast 的背景樣式

    編輯 /etc/sysconfig/yast2

    ## Type: string(linux,xterm,rxvt,mono,braille)
    ## Default: ""
    # Color theme for YaST ncurses UI
    # xterm: blue-white-red
    # linux: blue-white-yellow
    # rxvt: black-yellow-red
    # mono: white-black
    # braille: for visually impaired
    Y2NCURSES_COLOR_THEME="rxvt"
    
    如何增加一個 LUN 到現有的 VG
    • LUN Disk = /dev/xvdc
    • VG = /dev/vg1
    • 指令: yast disk

    Warning:........ > 左邊選單 [Volume Management] > 選擇 VG [/dev/vg1] > 功能: Resize

    Powered by MindTouch Core