Chinaunix首页 | 论坛 | 博客
  • 博客访问: 534408
  • 博文数量: 92
  • 博客积分: 980
  • 博客等级: 准尉
  • 技术积分: 1426
  • 用 户 组: 普通用户
  • 注册时间: 2011-09-25 20:34
文章分类

全部博文(92)

文章存档

2015年(3)

2014年(15)

2013年(27)

2012年(38)

2011年(9)

分类: DB2/Informix

2013-03-01 14:03:36

? 未命名

body { font-family: 微软雅黑; font-size: 10.5pt; line-height: 1.5; } html, body { color: inherit; background-color: inherit; } h1 { font-size:1.5em; font-weight:bold; } h2 { font-size:1.4em; font-weight:bold; } h3 { font-size:1.3em; font-weight:bold; } h4 { font-size:1.2em; font-weight:bold; } h5 { font-size:1.1em; font-weight:bold; } h6 { font-size:1.0em; font-weight:bold; } img { border:0; max-width: 100%; } blockquote { margin-top:0px; margin-bottom:0px; }
1、修改内核参数
[root@runleocat DB2_ESE_9_7_0_0_LNXX86_64]# vi /etc/sysctl.conf
增加
kernel.msgmni =1024
kernel.sem = 250 256000 32 1024
 
使修改生效:
 
 
2、确认hosts文件和hostname一致
(如果不一致,在建立实例的过程中将报错

db2icrt fails with Segmentation Fault SQL6031N

,参见)
检查,发现不一致:
 
ping hostname
 
 
设置host文件,增加hostname:
 
再次ping
 
成功。
 
3、使用图形界面安装db2 v9.7软件(不建立实例)
之所以使用图形界面安装,简单,可见,而且可以选择不安装某些服务
 
继续安装即可,注意不用装SAMP
 
不创建实例,一会手动创建:
 
安装完成:
 
 
4、创建实例:
[root@runleocat ~]# /usr/sbin/groupadd db2iadm1
[root@runleocat ~]# /usr/sbin/groupadd db2fadm1
[root@runleocat ~]# /usr/sbin/useradd -m -g db2iadm1 -d /home/db2inst1  db2inst1
[root@runleocat ~]# /usr/sbin/useradd -m -g db2fadm1 -d /home/db2fenc1  db2fenc1
 
[root@runleocat ~]# cd /opt/ibm/db2/V9.7/instance/
[root@runleocat instance]# ./db2icrt -p 50000 -u db2fenc1 db2inst1
 
DBI1070I  Program db2icrt completed successfully.
 

[root@runleocat instance]#
 
5、测试:
列出数据库实例:
[db2inst1@runleocat ~]$ db2ilist
db2inst1
[db2inst1@runleocat ~]$ 
建立样本数据库:
[db2inst1@runleocat ~]$ 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.
 
[db2inst1@runleocat ~]$
列出数据库目录:
[db2inst1@runleocat ~]$ db2 list db directory
 
 System Database Directory
 
 Number of entries in the directory = 1
 
Database 1 entry:
 
 Database  alias                        = SAMPLE
 Database  name                         = SAMPLE
 Local database  directory              = /home/db2inst1
 Database release  level                =  d.00
 Comment                               =
 Directory entry  type                  = Indirect
 Catalog database partition number    =  0
 Alternate server  hostname             =
 Alternate server port  number         =
 
[db2inst1@runleocat ~]$
 
结论:对于在CentOS5上面安装9.7,需要注意的是修改内核参数(在suse10上安装时,则不用);同时,注意hostname和hosts文件的一致性。

阅读(2062) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~