Linux下安装DB2的详细步骤!

第一步:检查程序包及其版本
 compat-libstdc++-7.3-2.96.118.i386.rpm
     在linux的安装盘上,找到后使用rpm -i compat-libstdc++-7.3-2.96.118.i386.rpm 安装即可
<script type="text/javascript"> </script> <script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"> </script> width="336" scrolling="no" height="280" frameborder="0" allowtransparency="true" hspace="0" vspace="0" marginheight="0" marginwidth="0" src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-1572879403720716&dt=1207304618284&lmt=1200572687&format=336x280_as&output=html&correlator=1207304618284&url=http%3A%2F%2Fwww.vlan9.com%2Flinux%2F4%2Fy099242.html&color_bg=F9FCFE&color_text=000000&color_link=CC6600&color_url=0000FF&color_border=F9FCFE&ad_type=text_image&ref=http%3A%2F%2Fwww.google.com%2Fsearch%3Fq%3Dlinux%25E4%25B8%258B%25E5%25AE%2589%25E8%25A3%2585db2%26ie%3Dutf-8%26oe%3Dutf-8%26aq%3Dt%26rls%3Dorg.mozilla%3Azh-CN%3Aofficial%26client%3Dfirefox-a&frm=0&cc=100&ga_vid=1484787813.1207304618&ga_sid=1207304618&ga_hid=1659242822&flash=9.0.47&u_h=768&u_w=1024&u_ah=738&u_aw=1024&u_cd=16&u_tz=480&u_his=1&u_java=true&u_nplug=19&u_nmime=58" name="google_ads_frame">

第二步:配置 Linux 内核参数
        /etc/sysctl.conf文件,添加内核参数
 kernel.msgmni =1024
 kernel.sem = 250 256000  32 1024
        使更改激活:sysctl –p

第三步:安装
       sh db2_install
       按照提示做

第四步:创建用户
 /usr/sbin/groupadd db2iadm1
 /usr/sbin/groupadd db2fadm1
 /usr/sbin/useradd –m -g db2iadm1 –d /home/db2inst1 db2inst1
 /usr/sbin/useradd –m -g db2fadm1 –d /home/db2fenc1 db2fenc1

第五步:创建实例
 /opt/IBM/db2/V8.1/instance/db2icrt –a server –u db2fenc1 db2inst1

第六步:产品许可证
 /opt/IBM/db2/V8.1/adm/db2licm -a /mnt/cdrom/db2/license/db2pe.lic

第七步:允许SMS的多页分配
        /opt/IBM/db2/V8.1/cfg/db2ln

第八步:添加DB2端口
        SU - root
        vi /etc/services 加入下面一行
        db2inst1   50000/tcp

第九步:DB2 配置
        su – db2inst1
        db2set DB2_EXTENDED_OPTIMIZATION=ON
 db2set DB2_DISABLE_FLUSH_LOG=ON
 db2set AUTOSTART=YES
 db2set DB2_STRIPED_CONTAINERS=ON
 db2set DB2_HASH_JOIN=Y
 db2set DB2COMM=tcpip
 db2set DB2_PARALLEL_IO=*
 db2set DB2CODEPAGE=819

 #Update dbm cfg
 db2 update dbm cfg using SVCENAME db2inst1
 db2 update dbm cfg using INDEXREC ACCESS

第十步:运行DB2
        db2start

第十一步:创建库
        db2 "CREATE DATABASE test1 ALIAS test1 USING CODESET ISO8859-1 TERRITORY CN"
以后就可以创建表和对表操作了,如 db2 "select * from tbl"

 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值