Ubuntu / Win7 安装db2 v10.5
抓紧下载v10.5fp1_linuxx64_expc.tar.gz到~/Downloads/java_soft
cd java_soft
tar xf v10.5fp1_linuxx64_expc.tar.gz
可以看到在当前目录下产生了一个expc目录
cd expc
然后检查一下是否满足了安装条件:
./db2prereqcheck
提示
DBT3514W The db2prereqcheck utility failed to find the following
32-bit library file: "/lib/libpam.so*".
按照这里的方案http://askubuntu.com/questions/428072/64-bit-db2-10-5-missing-32-bit-libpam-and-64-bit-libaio-on-ubuntu-12-04
执行了如下命令:
sudo apt-get install libpam0g:i386 libaio1
ln -s /lib/i386-linux-gnu/libpam.so.0 /lib/libpam.so.0
解决,接下来是正式安装:
sudo ./db2_install -b /opt/ibm/db2/v10.5
或者使用sudo ./db2_setup以图形方式安装
方法同 v9.7
在这里罗列一遍:
创建3个用户组和3个用户(并给db2inst1设置密码)
切换成root用户
su - root #创建das和instance
cd /opt/ibm/db2/v10.5/instance
./dascrt -u db2das
DBI1070I Program dascrt completed successfully.
./db2icrt -u db2inst1 db2inst1
DBI1070I Program db2icrt completed successfully.
./db2ilist
db2inst1
切换成das用户(因为给das分配的shell是sh而不是bash,我们进入了原始时代(不能tab补全了,当前路径pwd才能知道)
root@zerorun:/opt/ibm/db2/v10.5/instance# su - db2das
$ pwd
/home/db2das
$ ls das/
adm conv dasprofile java metadata usercshrc
bin ctrl dump lib msg userprofile
cfg dascshrc function log tmp
$ . das/dasprofile (注意这里的点命令,点号后面必须有空格,点相当于source命令)
$ echo $PATH
。。home/db2das/das/bin:/home/db2das/das/adm
$ which db2admin
/home/db2das/das/bin/db2admin
$ db2admin start
SQL4409W The DB2 Administration Server is already active.
切换成db2inst1用户
$ su - db2inst1
Password:
db2inst1@zerorun:~$ pwd
/home/db2inst1
db2inst1@zerorun:~$ ls
examples.desktop sqllib
db2inst1@zerorun:~$ . sqllib/db2profile
db2inst1@zerorun:~$ echo $PATH
。。:/home/db2inst1/sqllib/bin:/home/db2inst1/sqllib/adm:/home/db2inst1/sqllib/misc:/home/db2inst1/sqllib/db2tss/bin
db2inst1@zerorun:~$ which db2start
/home/db2inst1/sqllib/adm/db2start
db2inst1@zerorun:~$ db2start
SQL1063N DB2START processing was successful.
如果db2start报错 error while loading shared libraries: libnuma.so.1,解决"
sudo apt-get install numactl
关闭db2自动运行(先确认一下)
db2inst1@zerorun:~$ db2set
DB2AUTOSTART=YES
db2inst1@zerorun:~$ db2iauto -off db2inst1
db2inst1@zerorun:~$ db2set
创建数据库
db2inst1@zerorun:~$ db2 "create database tpch USING CODESET UTF-8 TERRITORY CN pagesize 32 k"
DB20000I The CREATE DATABASE command completed successfully.
这一步非常慢,硬盘灯狂闪,需要10分钟
设置远程可以访问DB:
db2inst1@zerorun:~$ db2set
db2inst1@zerorun:~$ db2set DB2COMM=TCPIP
db2inst1@zerorun:~$ db2set
DB2COMM=TCPIP
db2inst1@zerorun:~$ db2 get dbm cfg |grep SVCENAME
TCP/IP Service name (SVCENAME) =
SSL service name (SSL_SVCENAME) =
修改默认的端口号为60000
db2inst1@zerorun:~$ db2 update dbm cfg using SVCENAME 60000
DB20000I The UPDATE DATABASE MANAGER CONFIGURATION command completed
successfully.
SQL1362W One or more of the parameters submitted for immediate modification
were not changed dynamically. Client changes will not be effective until the
next time the application is started or the TERMINATE command has been issued.
Server changes will not be effective until the next DB2START command.
db2inst1@zerorun:~$ db2 get dbm cfg |grep SVCENAME
TCP/IP Service name (SVCENAME) = 60000
SSL service name (SSL_SVCENAME) =
db2inst1@zerorun:~$
(这个命令是如此之长, 注意SVCENAME是端口号的意思,咋不用PORT呢!)
db2inst1@zerorun:~$ clpplus -nw db2inst1/db2@localhost:60000/tpch
CLPPlus: Version 1.6
Copyright (c) 2009, 2011, IBM CORPORATION. All rights reserved.
Database Connection Information :
---------------------------------
Hostname = localhost
Database server = DB2/LINUXX8664 SQL10051
SQL authorization ID = db2inst1
Local database alias = TPCH
Port = 60000
SQL> set timi on
SQL> select sysdate from dual;
ERROR near line 1:
SQL0204N "DB2INST1.DUAL" is an undefined name.
SQL> select sysdate from SYSIBM.dual;
1
---------------------
2014-12-21 23:36:44
Elapsed time: 28 millisecond(s)
SQL>
Win7下的安装
抓紧下载C:\Users\IBM_ADMIN\DownloadDirector\v10.5fp1_winx64_expc.exe
双击自解压.
然后双击setup.exe
安装产品>安装新产品>下一步 >同意(此步有BUG!)
>选择自定义安装,不要选择典型安装(装出来命令行全是中文,很不方便) > 下一步
>下一步(把简体中文从右边移除!!!!!!!!!!)
>若干下一步
>取消设置通知!
>取消启用操作系统安全性
>完成
装好后, 打开开始菜单 > IBM DB2 DB2COPY1> DB2命令窗口 - Adminstrator
注意在这个菜单上面shift右键, 然后选择run as different user,输入db2admin/adb2admin登录后
然后
db2sampl.exe创建sample数据库,
或者db2sampl.exe -force(如果db已经存在)
C:\IBM\SQLLIB\BIN>db2sampl.exe -force
Creating database "SAMPLE"...
Existing "SAMPLE" database found...
Dropping and recreating database "SAMPLE"...
Connecting to database "SAMPLE"...
Creating tables and data in schema "DB2ADMIN"...
Creating tables with XML columns and XML data in schema "DB2ADMIN"...
'db2sampl' processing complete.
C:\IBM\SQLLIB\BIN>
校验:
db2
connect to sample
select * from staff
否则默认创建的数据库的schema是操作系统的用户,使用起来很不方便.
Ubuntu / Win7 安装db2 v10.5的更多相关文章
- linux下安装db2
最近研究了一下在 ubuntu下安装db2的过程,很快就完成安装,特贴出来供大家讨论,如有错误请多多指教. 注意:安装过程请使用root用户,否则会出现安装失败的情况: 安装过程: 准备工作: 准备安 ...
- Ubuntu 8.04下安装DB2方法
參考文献: How-to: Ubuntu 7.10 Server x86 32-bit and DB2 Express-C v9.5 DB2 v9.7 Infomation Center 场景:在IB ...
- win8 or win7安装ubuntu双系统
安装双系统的效果 现在使用win和linux双系统,整个环境相当方便好用,比如在Linux系统上,仍能访问NTFS(win的文件系统格式)中的文件和文档,当然win下的一些像matlab.vs等是不能 ...
- 快速上手Ubuntu之安装篇——安装win7,Ubuntu16.04双系统【转】
本文转载自:http://blog.csdn.net/qq_28205153/article/details/52203512 Linux可以说是开发者的系统,对于开发者来说,Linux发行版不仅为我 ...
- Linux(ubuntu)使用dd从iso制作win7安装u盘(读卡器一样),以及备份分区
转自我的独立博客:alanslab.cn 先吐个槽,早知道windows越用越慢,没想到太久不用还会坏... 昨天就遇到了这样一件事,电脑的光驱早拆了换硬盘托架了,只好翻出来以前手机的sd卡开刀,网上 ...
- [异常解决] ubuntu上安装JLink驱动遇到的坑及给后来者的建议
一.前言 最近将整个电脑格式化,改成了linux操作系统 希望这样能让自己在一个新的世界探索技术.提升自己吧- win上的工具用多了,就不想变化了- 继上一篇<ubuntu上安装虚拟机遇到的问题 ...
- ubuntu 15 安装cuda,开启GPU加速
1 首先要开启GPU加速就要安装cuda.安装cuda,首先要安装英伟达的驱动.ubuntu有自带的开源驱动,首先要禁用nouveau.这儿要注意,虚拟机不能安装ubuntu驱动.VMWare下显卡只 ...
- Ubuntu+Win7双系统grub的修复问题
最近,在grub引导的Ubuntu+Win7双系统上作业,用的是Ubuntu14.04.2.进行系统更新,更新到一般卡住了,恰好此时在进行grub相关文件的更新,我把机器重启后进入了grub resc ...
- 在Ubuntu上安装JDK、Ant、Jmeter和Jenkins
一.前期准备 1. 在win7下载VMware.Ubuntu(用迅雷下比较快) 2. 安装完VMware后新建虚拟机,选择iso: 3. 具体配置参考如下,至此Ubantu安装完成 二.在Ubuntu ...
随机推荐
- struts2和hibernate整合的小Demo
jar包下载地址 创建一个web项目. 导入jar包 配置web.xml <?xml version="1.0" encoding="UTF-8"?> ...
- Jenkins 报错:(pending—Waiting for next available executor)
系统管理-管理节点,刷新状态
- Oauth 2.0第三方账号登录原理图
百度.QQ等服务商
- sharepoint 2010 页面刷新时滚动条位置保持不变 Controlling scrollbar position on postback
sharepoint 2010 页面刷新时滚动条位置保持不变 Controlling scrollbar position on postback在sharepoint 2010中,如果当前页面的篇幅 ...
- servlet 和filter 的生命周期说明
servlet : 当客户端第一次访问servlet的时候,服务器就会创建servlet实例,servlet 就会执行init方法,每次请求,服务器会开一个新的线程访问servlet中得service ...
- wxPython中文教程入门实例
这篇文章主要为大家分享下python编程中有关wxPython的中文教程,分享一些wxPython入门实例,有需要的朋友参考下 wxPython中文教程入门实例 wx.Window 是一个基类 ...
- android通过BitmapFactory.decodeFile获取图片bitmap报内存溢出的解决办法
android通过BitmapFactory.decodeFile获取图片bitmap报内存溢出的解决办法 原方法: public static Bitmap getSmallBitmap(Strin ...
- ios awakeFromNib 和 initWithCoder:
During the instantiation process, each object in the archive is unarchived and then initialized with ...
- Effective C++ -----条款06:若不想使用编译器自动生成的函数,就该明确拒绝
为驳回编译器自动提供的功能,可将相应的成员函数声明为private并且不予实现. 使用像Uncopyable这样的base class也是一种做法(即先声明一个基类,然后私有继承它).这其实有点像使用 ...
- nyoj221_Tree_subsequent_traversal
Tree 时间限制:1000 ms | 内存限制:65535 KB 难度:3 描述 Little Valentine liked playing with binary trees very ...