db db2 v8.2

db db2 doc

http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp

Linux下DB2 81重装的问题

http://www.nokiamobile.org.cn/25_100101_456977.html

db db2 down

db2winIA32v8 fixpak

DB2 UDB Version 8 FixPaks & client

downloads

for 32-bit DB2 Products

for Windows Operating Systems

on 32-bit Intel and AMD systems

http://www-01.ibm.com/support/docview.wss?rs=71&uid=swg21256059#r17

ftp://public.dhe.ibm.com/ps/products/db2/fixes2/english-us/db2winIA32v8/fixpak/FP17_WR21416/FP17_WR21416_ESE.exe

db db2 setup

安装文件

C829HML.tar  C829HML_ 335_ESE_LNXAMD26_64_NLV.tar  版本 8.2.2(等同于版本 8.1 修订包 9)

C50T9ML.tar  C50T9ML_ 139_ESE_LNX_64_NL.tar

FP18_MI00295.tar

[root@ localhost ~]# cd /home/db2_v8/335_ESE_LNXAMD26_64_NLV/db2/linux26/Java-1.4/

IBMJava2-SDK-1.4.2-1.0.i386.rpm 

ibm-java-x86_64-sdk-6.0-7.0.x86_64.rpm

C829HML_335_ESE_LNXAMD26_64_NLV.tar

DB2在Linux和UNIX环境下的安装

http://info.zhangye.gov.cn/dnwl/dnjs/200905/119695.html

DB2 V8.1 在RedHat Advanced Platform 5的安装

http://blog.chinaunix.net/u1/53256/showart_1154388.html

安装步骤

DB2 UDB V8.1 在RedHat Enterprise Linux AS4 Update 3(Linux 2.6 x86_64内核)平台的安装

http://roadli.spaces.live.com/blog/cns!98DEB1E47C7829CB!217.entry

 

一,安装操作系统,没什么特别的,我装了桌面和开发包,还有老开发包
安装完成后验证下面三个包是否存在
rpm -qa|grep compat-libstdc++
compat-libstdc++-33-3.2.3-47.3.i386.rpm
compat-libstdc++-33-3.2.3-47.3.x86_64.rpm
compat-libstdc++-296-2.96-132.7.2.i386.rpm
二,安装JDK
一定要去下载IBM 1.4.2 for AMD64/EM64T的JDK,下载完,安装
然后可以创建一个link,方便调用
ln -s /opt/IBMJava2-amd64-142 /opt/jdk
三,设置系统环境变量
修改/etc/profile,增加下面的内容
export JAVA_HOME=/opt/jdk
export DB2USELOCALJRE=TRUE
export RPM_FORCE_NPTL=1

四,解压缩安装包到指定目录。我解压到了/DB2_64目录下,自动生成了335_ESE_LNXAMD26_64_NLV目录
进入安装包的目录 cd /DB2_64/335_ESE_LNXAMD26_64_NLV
经过很多次尝试,都无法使用图形界面安装,所以我开始使用命令行安装
安装包自带的JDK有问题,进入db2/linux26目录
mv java java.orig
ln -s /opt/IBMJava2-amd64-142 java

这样使用我们自己安装的64bit的JDK
然后安装数据库软件
[root@test linux26]# ./db2_install -p DB2.ESE
   IBM_db2msen81...
Preparing...                ##################################################
IBM_db2msen81               ##################################################
   IBM_db2cliv81...
Preparing...                ##################################################
IBM_db2cliv81               ##################################################
   IBM_db2icw81...
Preparing...                ##################################################
IBM_db2icw81                ##################################################
   IBM_db2ldap81...
Preparing...                ##################################################
IBM_db2ldap81               ##################################################
   IBM_db2wmsa81...
Preparing...                ##################################################
IBM_db2wmsa81               ##################################################
   IBM_db2cucs81...
Preparing...                ##################################################
IBM_db2cucs81               ##################################################
   IBM_db2conv81...
Preparing...                ##################################################
IBM_db2conv81               ##################################################
   IBM_db2secl81...
Preparing...                ##################################################
IBM_db2secl81               ##################################################
   IBM_db2sesm81...
Preparing...                ##################################################
IBM_db2sesm81               ##################################################
   IBM_db2icuc81...
Preparing...                ##################################################
IBM_db2icuc81               ##################################################
   IBM_db2icut81...
Preparing...                ##################################################
IBM_db2icut81               ##################################################
   IBM_db2jhen81...
Preparing...                ##################################################
IBM_db2jhen81               ##################################################
   IBM_db2repl81...
Preparing...                ##################################################
IBM_db2repl81               ##################################################
   IBM_db2sp81...
Preparing...                ##################################################
IBM_db2sp81                 ##################################################
   IBM_db2chen81...
Preparing...                ##################################################
IBM_db2chen81               ##################################################
   IBM_db2adt81...
Preparing...                ##################################################
IBM_db2adt81                ##################################################
   IBM_db2adts81...
Preparing...                ##################################################
IBM_db2adts81               ##################################################
   IBM_db2xmls81...
Preparing...                ##################################################
IBM_db2xmls81               ##################################################
   IBM_db2cj81...
Preparing...                ##################################################
IBM_db2cj81                 ##################################################
   IBM_db2dc81...
Preparing...                ##################################################
IBM_db2dc81                 ##################################################
   IBM_db2dwcm81...
Preparing...                ##################################################
IBM_db2dwcm81               ##################################################
   IBM_db2fs81...
Preparing...                ##################################################
IBM_db2fs81                 ##################################################
   IBM_db2inst81...
Preparing...                ##################################################
IBM_db2inst81               ##################################################
   IBM_db2wbdb81...
Preparing...                ##################################################
IBM_db2wbdb81               ##################################################
   IBM_db2xml81...
Preparing...                ##################################################
IBM_db2xml81                ##################################################
   IBM_db2jdbc81...
Preparing...                ##################################################
IBM_db2jdbc81               ##################################################
   IBM_db2ca81...
Preparing...                ##################################################
IBM_db2ca81                 ##################################################
   IBM_db2rte81...
Preparing...                ##################################################
IBM_db2rte81                ##################################################
   IBM_db2conn81...
Preparing...                ##################################################
IBM_db2conn81               ##################################################
   IBM_db2crte81...
Preparing...                ##################################################
IBM_db2crte81               ##################################################
   IBM_db2das81...
Preparing...                ##################################################
IBM_db2das81                ##################################################
   IBM_db2dj81...
Preparing...                ##################################################
IBM_db2dj81                 ##################################################
   IBM_db2engn81...
Preparing...                ##################################################
IBM_db2engn81               ##################################################
   IBM_db2smpl81...
Preparing...                ##################################################
IBM_db2smpl81               ##################################################
   IBM_db2djx81...
Preparing...                ##################################################
IBM_db2djx81                ##################################################
   IBM_db2inx81...
Preparing...                ##################################################
IBM_db2inx81                ##################################################
   IBM_db2pext81...
Preparing...                ##################################################
IBM_db2pext81               ##################################################
   IBM_db2essg81...
Preparing...                ##################################################
IBM_db2essg81               ##################################################
   IBM_db2cc81...
Preparing...                ##################################################
IBM_db2cc81                 ##################################################
   IBM_db2icc81...
Preparing...                ##################################################
IBM_db2icc81                ##################################################
   IBM_db2icms81...
Preparing...                ##################################################
IBM_db2icms81               ##################################################
The installation logfile can be found in /tmp/db2_install_log.5273.
db2_install program completed successfully.
安装了一堆的RPM后,软件就安装好了
 
五,下面开始安装后的数据库手工配置
1,建立用户和组
groupadd db2grp1
groupadd db2fgrp1
groupadd dasadm1
useradd -g db2grp1 -m -d /home/db2inst1 -p “” db2inst1
useradd -g db2fgrp1 -m -d /home/db2fenc1 -p ““ db2fenc1
useradd -g dasadm1 -m -d /home/dasusr1 -p “” dasusr1
注:以上三个用户密码均为空,用su命令切换到相应用户下时,用passwd命令设置即可
2,创建实例
首先我们使用以下命令创建管理服务器实例
/opt/IBM/db2/V8.1/instance/dascrt -u dasusr1
SQL4406W  The DB2 Administration Server was started successfully.
DBI1070I Program dascrt completed successfully.
接着使用以下命令创建数据库实例 db2inst1
/opt/IBM/db2/V8.1/instance/db2icrt -u db2fenc1 db2inst1
DBI1070I Program db2icrt completed successfully.
3,创建共享库链接
/opt/IBM/db2/V8.1/cfg/db2ln
4,设置DB2 实例环境变量
用su命令切换到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=1386
5,设置服务端口
[db2inst1@review root]$ db2
然后在DB2的提示符下输入
update database manager configuration using svcename server1
设置服务名为server1
然后 get database manager configuration ,检查一下参数
其中让我比较郁闷的就是JDK_PATH参数,居然设的不对,搞得数据库安装好后图形化管理工具无法使用
下面是我机器上执行的结果,以供参考!
(c) Copyright IBM Corporation 1993,2002
Command Line Processor for DB2 SDK 8.2.2
You can issue database manager commands and SQL statements from the command
prompt. For example:
    db2 => connect to sample
    db2 => bind sample.bnd
For general help, type: ?.
For command help, type: ? command, where command can be
the first few keywords of a database manager command. For example:
 ? CATALOG DATABASE for help on the CATALOG DATABASE command
 ? CATALOG          for help on all of the CATALOG commands.
To exit db2 interactive mode, type QUIT at the command prompt. Outside
interactive mode, all commands must be prefixed with 'db2'.
To list the current command option settings, type LIST COMMAND OPTIONS.
For more detailed help, refer to the Online Reference Manual.
db2 => update database manager configuration using svcename server1
DB20000I  The UPDATE DATABASE MANAGER CONFIGURATION command completed
successfully.
db2 => get database manager configuration
          Database Manager Configuration
     Node type = Enterprise Server Edition with local and remote clients
 Database manager configuration release level            = 0x0a00
 CPU speed (millisec/instruction)             (CPUSPEED) = 3.070238e-07
 Communications bandwidth (MB/sec)      (COMM_BANDWIDTH) = 1.000000e+02
 Max number of concurrently active databases     (NUMDB) = 8
 Data Links support                          (DATALINKS) = NO
 Federated Database System Support           (FEDERATED) = NO
 Transaction processor monitor name        (TP_MON_NAME) =
 Default charge-back account           (DFT_ACCOUNT_STR) =
 Java Development Kit installation path       (JDK_PATH) = /opt/IBMJava2-142
 Diagnostic error capture level              (DIAGLEVEL) = 3
 Notify Level                              (NOTIFYLEVEL) = 3
 Diagnostic data directory path               (DIAGPATH) = /home/db2inst1/sqllib/db2dump
 Default database monitor switches
   Buffer pool                         (DFT_MON_BUFPOOL) = OFF
   Lock                                   (DFT_MON_LOCK) = OFF
   Sort                                   (DFT_MON_SORT) = OFF
   Statement                              (DFT_MON_STMT) = OFF
   Table                                 (DFT_MON_TABLE) = OFF
   Timestamp                         (DFT_MON_TIMESTAMP) = ON
   Unit of work                            (DFT_MON_UOW) = OFF
 Monitor health of instance and databases   (HEALTH_MON) = ON
 SYSADM group name                        (SYSADM_GROUP) = DB2GRP1
 SYSCTRL group name                      (SYSCTRL_GROUP) =
 SYSMAINT group name                    (SYSMAINT_GROUP) =
 SYSMON group name                        (SYSMON_GROUP) =
 Client Userid-Password Plugin          (CLNT_PW_PLUGIN) =
 Client Kerberos Plugin                (CLNT_KRB_PLUGIN) =
 Group Plugin                             (GROUP_PLUGIN) =
 GSS Plugin for Local Authorization    (LOCAL_GSSPLUGIN) =
 Server Plugin Mode                    (SRV_PLUGIN_MODE) = UNFENCED
 Server List of GSS Plugins      (SRVCON_GSSPLUGIN_LIST) =
 Server Userid-Password Plugin        (SRVCON_PW_PLUGIN) =
 Server Connection Authentication          (SRVCON_AUTH) = NOT_SPECIFIED
 Database manager authentication        (AUTHENTICATION) = SERVER
 Cataloging allowed without authority   (CATALOG_NOAUTH) = NO
 Trust all clients                      (TRUST_ALLCLNTS) = YES
 Trusted client authentication          (TRUST_CLNTAUTH) = CLIENT
 Bypass federated authentication            (FED_NOAUTH) = NO
 Default database path                       (DFTDBPATH) = /home/db2inst1
 Database monitor heap size (4KB)          (MON_HEAP_SZ) = 90
 Java Virtual Machine heap size (4KB)     (JAVA_HEAP_SZ) = 2048
 Audit buffer size (4KB)                  (AUDIT_BUF_SZ) = 0
 Size of instance shared memory (4KB)  (INSTANCE_MEMORY) = AUTOMATIC
 Backup buffer default size (4KB)            (BACKBUFSZ) = 1024
 Restore buffer default size (4KB)           (RESTBUFSZ) = 1024
 Sort heap threshold (4KB)                  (SHEAPTHRES) = 20000
 Directory cache support                     (DIR_CACHE) = YES
 Application support layer heap size (4KB)   (ASLHEAPSZ) = 15
 Max requester I/O block size (bytes)         (RQRIOBLK) = 32767
 Query heap size (4KB)                   (QUERY_HEAP_SZ) = 1000
 Workload impact by throttled utilities(UTIL_IMPACT_LIM) = 10
 Priority of agents                           (AGENTPRI) = SYSTEM
 Max number of existing agents               (MAXAGENTS) = 400
 Agent pool size                        (NUM_POOLAGENTS) = 200(calculated)
 Initial number of agents in pool       (NUM_INITAGENTS) = 0
 Max number of coordinating agents     (MAX_COORDAGENTS) = (MAXAGENTS - NUM_INITAGENTS)
 Max no. of concurrent coordinating agents  (MAXCAGENTS) = MAX_COORDAGENTS
 Max number of client connections      (MAX_CONNECTIONS) = MAX_COORDAGENTS
 Keep fenced process                        (KEEPFENCED) = YES
 Number of pooled fenced processes         (FENCED_POOL) = MAX_COORDAGENTS
 Initial number of fenced processes     (NUM_INITFENCED) = 0
 Index re-creation time and redo index build  (INDEXREC) = RESTART
 Transaction manager database name         (TM_DATABASE) = 1ST_CONN
 Transaction resync interval (sec)     (RESYNC_INTERVAL) = 180
 SPM name                                     (SPM_NAME) =
 SPM log size                          (SPM_LOG_FILE_SZ) = 256
 SPM resync agent limit                 (SPM_MAX_RESYNC) = 20
 SPM log path                             (SPM_LOG_PATH) =
 TCP/IP Service name                          (SVCENAME) = server1
 Discovery mode                               (DISCOVER) = SEARCH
 Discover server instance                (DISCOVER_INST) = ENABLE
 Maximum query degree of parallelism   (MAX_QUERYDEGREE) = ANY
 Enable intra-partition parallelism     (INTRA_PARALLEL) = NO
 No. of int. communication buffers(4KB)(FCM_NUM_BUFFERS) = 4096
 Number of FCM request blocks              (FCM_NUM_RQB) = AUTOMATIC
 Number of FCM connection entries      (FCM_NUM_CONNECT) = AUTOMATIC
 Number of FCM message anchors         (FCM_NUM_ANCHORS) = AUTOMATIC
 Node connection elapse time (sec)         (CONN_ELAPSE) = 10
 Max number of node connection retries (MAX_CONNRETRIES) = 5
 Max time difference between nodes (min) (MAX_TIME_DIFF) = 60
 db2start/db2stop timeout (min)        (START_STOP_TIME) = 10
6,编辑/etc/services文件,增加服务端口
DB2_db2inst1    60000/tcp
DB2_db2inst1_1  60001/tcp
DB2_db2inst1_2  60002/tcp
DB2_db2inst1_END        60003/tcp
server1         50000/tcp                       # DB2 connection service port
这里增加的server1这一行就是刚才设置的服务名
7,修改DBM参数
db2 update dbm cfg using SVCENAME server1
8,现在可以启动DB2了
[db2inst1@review ~]$ db2start
05/24/2006 21:48:56     0   0   SQL1063N  DB2START processing was successful.
SQL1063N  DB2START processing was successful.
9,创建数据库
进入DB2的命令行
db2 => create database TEST
DB20000I  The CREATE DATABASE command completed successfully.
10,基本上差不多了,最好重起一下
先把DB2停了了
db2stop
回到root用户,重起系统
shutdown -r now

 

注:所有黑色粗体字为需要用户输入的内容

 

Redhat AS4u2 Linux x86_64上安装 ECC6.0 IDES SR2(Oracle10g)手记

http://www.itpub.net/thread-976354-1-1.html

 

RHEL5 安装 DB2 常见问题, 其它版本 Linux 可以借鉴

http://www.db2china.net/club/thread-6631-1-1.html

eg1:创建实例报错 <DB2DIR>/instance/db2icrt -s ese -u db2fenc1 db2inst1

tail: cannot open `+2' for reading: No such file or directory
lcount = 0
DBI1069E Unexpected error. Function = chk_fsystype, Return code =
          22.  
Explanation:
An unexpected error occurred during the execution of this
program.  
User Response:
If the problem persists, contact IBM Support with the following
information:
o   Message number
o   Function name
o   Return code
o   Problem description


DBI1079I Output is saved in the log file /tmp/db2icrt.log.30249.  
Explanation:
All processed and failed operations have been saved into this log
file.  
User Response:
Do not modify this file in any way. This file is for IBM
Technical Support reference.  

A:修改/opt/IBM/db2/V8.1/instance/db2iutil 文件,将tail +2 全部更改为tail -n +2(共三处).

eg2:创建实例报错 <DB2DIR>/instance/db2icrt -s ese -u db2fenc1 db2inst1


SQL6048N  A communication error occurred during START or STOP DATABASE MANAGER
processing.
Update DBM cfg SYSADM_GROUP errcode = 8
DBI1281E The database manager configuration file could not be
          initialized.

Explanation:

An error occurred when attempting to initialize the database
manager configuration file. A DB2 instance could not be created
or migrated.

User Response:

Refer to the log file for problem determination. Resolve the
problem and try the command again. If the problem persists,
please contact IBM Support.


DBI1079I Output is saved in the log file /tmp/db2icrt.log.4682.

Explanation:

All processed and failed operations have been saved into this log
file.

User Response:

Do not modify this file in any way. This file is for IBM
Technical Support reference.

A:检查 /etc/hosts, /etc/sysconfig/network 配置是否正确,最简单的方法是 ping <HOSTNAME> 看看是否与你设置的IP地址匹配.

network文件内容如下:
$ cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=localhost.localdomain

hosts文件内容如下:
$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost.localdomain localhost
xxx.xx.xx.xx    HOSTNAME
::1             localhost6.localdomain6 localhost6

eg3:

/opt/IBM/db2/V8.1/bin/db2greg: error while loading shared libraries: /opt/IBM/db2/V8.1/lib/libimf.so: cannot restore segment prot after reloc: Permission denied


A:
Disable SELinux using the following command and run db2setup.
/usr/sbin/setenforce 0
To disable SELinux permanently, set SELINUX=disabled in /etc/selinux/config.

A:
The specific change required can be found by navigating through the Gnome menu:
System || Administration || Security Level and Firewall.
Once at the Security Level Configuration, click on the SELinux tab (on the right) and again on Modify SELinux Policy.
Once SELinux modifies and reloads the new policy, then the db2setup will clear this hurdle.

 

DB2双机HA完整方案

http://www.litrin.net/2006/01/20/db2%E5%8F%8C%E6%9C%BAha%E5%AE%8C%E6%95%B4%E6%96%B9%E6%A1%88/

 

1. 摘要

  本文档介绍在SuSE Linux Enterprise Server v8.0(SLES 8)上安装配置DB2 UDB Enterprise Serverv8.2双机互备的高可靠性方案的基本步骤。该方案配合采用SLES的卷管理器(LVM)和Veritas Cluster Server v2.2(VCS 2.2)作为HA实现组件。

2. 概述

 本文档假定读者已经理解双机互备的HA方案的基本概念。

2.1. 双机互备HA方案的基本步骤

  建立一个双机互备方案的基本步骤是:
1. 确定基本参数(如IP地址、存储空间,等等。本方案的参数均为示范参数,读者需要根据实际环境替换)
2. 配置共享存储(本方案不涉及共享存储方案的配置)
3. 在两台节点上分别安装应用(在本方案中是DB2 UDB)
4. 在一台节点上对应用作初始配置(在本方案中是在共享存储上建立DB2数据库)
5. 在另一台节点上引入共享存储上的配置(在本方案中是对共享存储上的数据库做catalog操作)
6. 在两台节点上分别手动测试应用
7. 配置HA Cluster管理软件(在本方案中是VCS)
8. 测试HA Cluster管理软件可以成功接管资源

2.2. 假设

  本文档假定采用以下示例环境,SLES与VCS已在节点上正确安装,SLES的共享存储已经正确连接,VCS的心跳连接已经正确配置。

2.2.1. 存储

  各节点上需要足够的本地磁盘空间,来安装DB2 UDB的可执行代码及实例。

  本方案需要足够的共享存储空间,来放置数据库数据。

   假定共享存储上分配给DB2数据库的卷组名为/dev/datavg1,逻辑卷名为/dev/datavg1/db2lv1(使用SLES的LVM服 务),在两个节点上的挂接点名为/home/db2data,且已正确格式化为合适的文件系统(Veritas工程师指出在SLES 8上VCS 2.2不支持ext3文件系统,建议格式化时指定ext2,在SLES 9和VCS 4.1上不存在这个问题)。注意这个挂接点要在fstab文件中配置为启动时不自动挂接。

  数据库其他表空间可以建立在共享存储的其他卷上,如果是文件系统,同样要配置为不自动挂接。本文档暂不讨论。

2.2.2. 节点

  本HA方案采用两个服务器节点做主从互备,以下分别称为Active节点和Passive节点。这两个节点具有相同的硬件和操作系统配置。

2.2.3. 网络

  对外的IP网络。假定该方案中DB2 UDB对外提供服务使用的浮动IP(Floating IP)为192.168.10.110,Active节点的物理IP为192.168.10.11,Passive节点的物理IP为192.168.10.12。

 HA管理软件需要一组内部IP来管理双机间的心跳连接。心跳IP不在本文档范围内。

3. 配置步骤

<script type="text/javascript">google_ad_client = &quot;pub-9603680922905816&quot;; /* 250x250, 创建于 10-4-29 */ google_ad_slot = &quot;4075537288&quot;; google_ad_width = 250; google_ad_height = 250;</script> <script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script><script src="http://pagead2.googlesyndication.com/pagead/js/r20101117/r20101214/show_ads_impl.js"></script><script>google_protectAndRun(&quot;ads_core.google_render_ad&quot;, google_handleError, google_render_ad);</script>

3.1. DB2 UDB安装、配置步骤

3.1.1. 建立用户和组

  在两台节点上分别在root下执行以下命令:
  groupadd –g 900 db2iadm1
  groupadd –g 901 db2fadm1
  groupadd –g 902 dasadm1
  useradd –g db2iadm1 –u 800 –d /home/db2inst1 –s /bin/bash db2inst1
  useradd –g db2fadm1 –u 801 –d /home/db2fenc1 –s /bin/bash db2fenc1
  useradd –g dasadm1 –u 802 –d /home/dasusr1 –s /bin/bash dasusr1
  组ID和用户ID可以根据实际情况选择,但务必保证在两台节点上相同的用户名/组名具有相同的ID。

3.1.2. 安装DB2 UDB产品代码
  在两台节点上分别在root用户下执行以下命令:
  cd
  ./db2install –p DB2.ESE
  cd /opt/IBM/db2/V8.1/adm
  ./db2licm –a /db2/license/db2ese.lic

  其中,是DB2 UDB ESE安装介质所在目录。

3.1.3. 建立实例

  在两台节点上分别在root用户下执行以下命令:

  cd /opt/IBM/db2/V8.1/instance

  ./db2icrt –p 50000 –u db2fenc1 db2inst1

3.1.4. 建立DAS

  在两台节点上分别在root用户下执行以下命令:

  cd /opt/IBM/db2/V8.1/instance

  ./dascrt –u dasusr1

3.1.5. 建立数据库

  在Active节点上在root用户下执行以下命令:
  mount /dev/datavg1/db2lv1 /home/db2data
  su – db2inst1
  db2start
  db2 create database on /home/db2data
  db2stop
  exit
  umount /home/db2data
  其中,是数据库名。

3.1.6. Catalog数据库
  在Passive节点上在root用户下执行以下命令:
  mount /dev/datavg1/db2lv1 /home/db2data
  su – db2inst1
  db2start
  db2 catalog database on /home/db2data
  db2stop
  exit
  umount /home/db2data
 其中,是上一步骤建立的数据库名

3.1.7. 检验DB2配置
  在Active节点上,在root用户下执行以下命令:
  mount /dev/datavg1/db2lv1 /home/db2data
  su – db2inst1
  db2start
  db2 connect to
  db2 create table T (ID INTEGER)
 db2 connect reset
 db2stop
  exit
 umount /home/db2data
  检验上述命令均无出错信息。

  在Passive节点上,在root用户下执行以下命令:
  mount /dev/datavg1/db2lv1 /home/db2data
  su – db2inst1
  db2start
  db2 connect to
  db2 drop table T
  db2 connect reset
  db2stop
  exit
  umount /home/db2data
  检验上述命令均无出错信息。

3.2. VCS配置
  在VCS中,建立DB2资源组,在组中配置浮动IP、Application等资源,将Application的启动、停止等命令脚本配置为 db2start、db2stop、db2admin start和db2admin stop,将Application的监视命令脚本配置为ps命令,监视db2sysc和db2dasrrm进程。

 

db2在linux上无法启动

http://yezongbo.iteye.com/blog/371172

在redhat AS4上装了个db2,装好后发现无法启动,使用db2start的时候报错:

SQL6048N  A communication error occurred during START or STOP DATABASE MANAGER processing.
SQL1032N  No start database manager command was issuedSQLSTATE=57019

 

在google上搜索后发现和hosts有关

 

那怎么解决呢? 我们需要修改db2下的db2nodes.cfg文件或者hosts文件

 

db2nodes.cfg配置文件位于/home/db2inst1/sqllib目录下

先看下db2nodes.cfg 和hosts文件的内容是什么?
vi db2nodes.cfg

vi /etc/hosts


明显可以看到db2nodes.cfg内的localhost在hosts文件没有定义
所以我们需要把db2nodes.cfg内的localhost修改为hosts文件中的linux-vm23.localdomain


接下来启动db2 正常的启动了!

 

end

你可能感兴趣的:(linux,配置管理,db2,IBM,Google)