安装DB2数据库及创建实例

1、确定本地os版本及服务级别:oslevel  -s

2、下载需要安装的db2镜像及db2 license到本地文件系统,具体/backup/v9.7fp6_aix64_server.tar和/backup/db2_iwebe_v9.7.lic

3、确认/opt文件系统空间,因为安装路径默认为/opt/IBM/db2/V9.7路径下,所以确保有足够的安装空间。解压tar包

4、在tar包解压的路径./backup/server/db2_install,即可开始脚本安装
#./db2_install
# ./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
  ESE
  CONSV
  WSE
  CLIENT
  RTCL

Enter "help" to redisplay product names.
Enter "quit" to exit.
***********************************************************
ESE
DB2 installation is being initialized.

Total number of tasks to be performed: 47
Total estimated time for all tasks to be performed: 1903

Task #1 start
Description: Enable IOCP
Estimated time 1 second(s)
iocp0 Task #1 end

... ...

Task #48 start
Description: Updating global profile registry
Estimated time 3 second(s)
Task #48 end

The execution completed successfully.

For more information see the DB2 installation log at
"/tmp/db2_install.log.6029314".


5、创建用户及用户组信息
以root用户身份执行以下命令
mkgroup -'A' id='300'  dasadm1
mkgroup -'A' id='301'  db2fadm1
mkgroup -'A' id='302'  db2iadm1

mkuser id='300' pgrp='dasadm1' home='/home/dasusr1' dasusr1
mkuser id='301' pgrp='db2fadm1' home='/home/db2fenc1' db2fenc1
mkuser id='302' pgrp='db2iadm1' home='/db2home/db2inst1' db2inst1
*db2inst1实例用户home路径,即为实例创建默认路径,一般放到特定的文件系统中。


6、创建实例,进入/opt/IBM/db2/V9.7/instance路径
root执行
./db2icrt  -u db2fenc1 db2inst1

即在db2inst1目录下生产实例,一般情况下,需要先确定好路径,在创建用户主目录,可以添加参数设置实例端口: -p 50000

7、切换到db2inst1用户,导入license
su - db2inst1
db2licm -a /backup/db2_iwebe_v9.7.lic
db2licm -l     #查看状态

你可能感兴趣的:(db2,实例,db2inst1)