Linux安装DB2_V10

页面导航:首页 > 数据库 > DB2 > Linux安装DB2_V10

Linux安装DB2_V10

来源: 作者: 时间:2016-01-23 11:15 【

Linux安装DB2_V10系统:centos5.5已测试,安装db2_v1012_linuxx64_expc.tar.gz成功。解压、安装[[email protected] opt]# tar -xf db2_v1012_linuxx64_expc.tar.gz[[email protected] opt]# lsdb2_v1012_linuxia32_expc.ta...
Linux安装DB2_V10
 
系统:centos5.5
 
已测试,安装db2_v1012_linuxx64_expc.tar.gz成功。
 
解压、安装
[[email protected] opt]# tar -xf  db2_v1012_linuxx64_expc.tar.gz
[[email protected] opt]# ls
db2_v1012_linuxia32_expc.tar.gz  expc  lost+found  rh
[[email protected] opt]# cd expc/
[[email protected] expc]# ls
db2  db2ckupgrade  db2_deinstall  db2_install  db2ls  db2prereqcheck  db2setup  doc
[[email protected] expc]# ./db2_install 
DBI1324W  Support of the db2_install command is deprecated. For
........................省略....................................
Install into default directory (/opt/ibm/db2/V10.1) ? [yes/no] #询问你是否安装到这个位置上,输入yes
yes
DB2 installation is being initialized.
.........................省略......................................
The execution completed successfully.
 
For more information see the DB2 installation log at
"/tmp/db2_install.log.4516".
创建用户组和用户名
[[email protected] expc]# groupadd -g 2000 db2iadm1
[[email protected] expc]# groupadd -g 2001 db2fadm1
[[email protected] expc]# useradd -m -g db2iadm1 -d /home/db2inst1 db2inst1
[[email protected] expc]# useradd -m -g db2fadm1 -d /home/db2fenc1 db2fenc1
[[email protected] expc]# passwd db2inst1  //输入俩次相同密码
[[email protected] expc]# passwd db2fenc1   //输入俩次相同密码
安装License(产品许可证)
[[email protected] expc]# cd /opt/ibm/db2/V10.1/adm/
[[email protected] adm]# pwd  //查看当前目录
/opt/ibm/db2/V10.1/adm
[[email protected] adm]# chmod -R 775 *
[[email protected] adm]# ./db2licm -a /home/software/expc/db2/license/db2expc_uw.lic  #不要直接复制这个命令,在解压的目录中可以找到license文件夹,请根据你的路径做相应的修改
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/V10.1/license/en_US.iso88591"
创建实例和样本
[[email protected] adm]# cd /opt/ibm/db2/V10.1/instance
[[email protected] instance]#  chmod -R 775 *
[[email protected] instance]# ./db2icrt -p 50000 -u db2fenc1 db2inst1
DBI1446I  The db2icrt command is running.
......................省略...............................
DBI1070I  Program db2icrt completed successfully.
 
[[email protected] instance]# su - db2inst1    //切换到db2inst1用户
[[email protected] ~]$ db2sampl
 
  Starting the DB2 instance...
  Creating database "SAMPLE"...
  Connecting to database "SAMPLE"...
  Creating tables and data in schema "DB2INST1"...
  Creating tables with XML columns and XML data in schema "DB2INST1"...
  Stopping the DB2 instance...
 
  'db2sampl' processing complete.
 
[[email protected] ~]$ db2start
SQL1063N  DB2START processing was successful.
[[email protected] ~]$ db2 connect to sample
 
   Database Connection Information
 
 Database server        = DB2/LINUXX8664 10.1.2
 SQL authorization ID   = DB2INST1
 Local database alias   = SAMPLE
 
[[email protected] ~]$ db2 "select * from staff"
 
ID     NAME      DEPT   JOB   YEARS  SALARY    COMM
------ --------- ------ ----- ------ --------- ---------
    10 Sanders       20 Mgr        7  98357.50         -
........................省略...............................
   350 Gafney        84 Clerk      5  43030.50    188.00
 
  35 record(s) selected.
创建das管理服务器
 
为了远程客户端能够用控制中心来控制数据库服务器,需要在数据库服务器上安装 das,当然,如果只是远程连接而不是远程管理,可以不用装,这里我安装了一下。
[[email protected] instance]# groupadd -g 2002 db2asgrp
[[email protected] instance]# useradd -m -g db2asgrp -d /home/db2as db2as
[[email protected] instance]# passwd db2as   //输入2次相同密码
Changing password for user db2as.
New UNIX password:Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[[email protected] instance]# su - db2as
[[email protected] ~]$ su -
Password:
[[email protected] ~]# cd /opt/ibm/db2/V10.1/instance/
[[email protected] instance]# ./dascrt -u db2as
DBI1070I  Program dascrt completed successfully.
 
[[email protected] instance]# su - db2as
[[email protected] ~]$ db2admin start
SQL4409W  The DB2 Administration Server is already active.
[[email protected] ~]$  su - db2inst1  //确认db2inst1实例的服务名
Password:
[[email protected] ~]$ db2 get dbm cfg|grep SVCENAME
 TCP/IP Service name                          (SVCENAME) =
 SSL service name                         (SSL_SVCENAME) =
[[email protected] ~]$ db2 update dbm cfg using SVCENAME 50000
DB20000I  The UPDATE DATABASE MANAGER CONFIGURATION command completed
successfully.
[[email protected] ~]$ db2 get dbm cfg|grep SVCENAME
 TCP/IP Service name                          (SVCENAME) = 50000
 SSL service name                         (SSL_SVCENAME) =
[[email protected] ~]$ db2licm -l  //看一下License的情况,sename在客户端连接时需要用到
Product name:                     " Express-C"
License type:                     "Unwarranted"
Expiry date:                      "Permanent"
Product identifier:               "db2expc"
Version information:              "10.1"
Max number of CPUs:               "2"
Max amount of memory (GB):        "4"
Enforcement policy:               "Soft Stop"
Tags:

文章评论

最 近 更 新
热 点 排 行
Js与CSS工具
代码转换工具

<