BD2_PDF 安装实施
环境
192.168.0.105
192.168.0.107
一:两台服务器分别安装DB2 V9.7
二:两台服务器环境
1 创建用户(两台服务器)
groupadd -g 999 db2iadm1
groupadd -g 998 db2fadm1
groupadd -g 997 dasadm1
useradd -u 1004 -g db2iadm1 -m -d /db2home/db2inst1 db2inst1 -p password1
useradd -u 1004 -g db2iadm1 -m db2inst1 -p password1
useradd -u 1003 -g db2fadm1 -m db2fenc1 -p password2
useradd -u 1002 -g dasadm1 -m dasusr1 -p password3
more /etc/passwd
db2inst1:x:1004:999::/home/db2inst1:/bin/bash
db2fenc1:x:1003:998::/home/db2fenc1:/bin/bash
dasusr1:x:1002:997::/home/dasusr1:/bin/bash
2 创建实例(在一台服务器)
./db2icrt -u db2fenc1 db2inst1
3 创建共享文件
1 服务器a:/etc/rc.d/init.d/nfs restart
vi /etc/exports
/home *(rw,sync,no_root_squash)
/usr/sbin/exportfs -a
2 服务器b:mount ServerA:/home /home
4 修改文件
db2nodes.cfg
0 ServerA 0
1 ServerA 1
2 ServerB 0
3 ServerB 1
5 启动关闭实例测试
文件内容:
[db2inst1@ServerA sqllib]$ more db2nodes.cfg
0 ServerA 0
1 ServerA 1
2 ServerB 0
3 ServerB 1
[db2inst1@ServerA sqllib]$
mount ServerA:/home /home
比如将系统时间设定成1996年6月10日的命令如下。
#date -s 11/05/13
/etc/rc.d/init.d/nfs restart
[db2inst1@ServerA ~]$ db2start
01/03/2014 05:08:25 2 0 SQL6048N A communication error occurred during START or STOP DATABASE MANAGER processing.
01/03/2014 05:08:55 3 0 SQL6048N A communication error occurred during START or STOP DATABASE MANAGER processing.
01/03/2014 05:08:55 0 0 SQL1063N DB2START processing was successful.
01/03/2014 05:08:55 1 0 SQL1063N DB2START processing was successful.
SQL6032W Start command processing was attempted on "4" node(s). "2" node(s) were successfully started. "0" node(s) were already started. "2" node(s) could not be started.
[db2inst1@ServerA ~]$
[db2inst1@ServerA ~]$ db2stop
01/03/2014 05:09:41 0 0 SQL1064N DB2STOP processing was successful.
01/03/2014 05:09:41 2 0 SQL1032N No start database manager command was issued.
01/03/2014 05:09:41 3 0 SQL1032N No start database manager command was issued.
01/03/2014 05:09:41 1 0 SQL1064N DB2STOP processing was successful.
SQL6033W Stop command processing was attempted on "4" node(s). "2" node(s) were successfully stopped. "2" node(s) were already stopped. "0" node(s) could not be stopped.
重启下就可以正常使用:
[db2inst1@ServerA ~]$ db2start
01/03/2014 05:09:53 1 0 SQL1063N DB2START processing was successful.
01/03/2014 05:09:54 0 0 SQL1063N DB2START processing was successful.
01/03/2014 05:10:00 3 0 SQL1063N DB2START processing was successful.
01/03/2014 05:10:00 2 0 SQL1063N DB2START processing was successful.
serverA serverB
[root@ServerA etc]# mkdir -p /data/db
[root@ServerA etc]# chmod -R 777 /data/db
[db2inst1@ServerA ~]$ db2 connect to hjtest
Database Connection Information
Database server = DB2/LINUX 9.7.4
SQL authorization ID = DB2INST1
Local database alias = HJTEST
[db2inst1@ServerA ~]$ db2pd -d hjtest -tab
Database Partition 0 -- Database HJTEST -- Active -- Up 0 days 00:01:23 -- Date 01/03/2014 05:36:30
Tablespace Configuration:
Address Id Type Content PageSz ExtentSz Auto Prefetch BufID BufIDDisk FSC NumCntrs MaxStripe LastConsecPg Name
0x99CEDAB0 0 DMS Regular 4096 4 Yes 4 1 1 Off 1 0 3 SYSCATSPACE
0x99CEF170 1 SMS SysTmp 4096 32 Yes 32 1 1 On 1 0 31 TEMPSPACE1
0x99CF2800 2 DMS Large 4096 32 Yes 32 1 1 Off 1 0 31 USERSPACE1
0x9AC7A3E0 3 DMS Large 4096 4 Yes 4 1 1 Off 1 0 3 SYSTOOLSPACE
Tablespace Statistics:
Address Id TotalPgs UsablePgs UsedPgs PndFreePgs FreePgs HWM Max HWM State MinRecTime NQuiescers PathsDropped
0x99CEDAB0 0 24576 24572 21608 0 2964 21608 21608 0x00000000 0 0 No
0x99CEF170 1 1 1 1 0 0 0 0 0x00000000 0 0 No
0x99CF2800 2 8192 8160 96 0 8064 96 96 0x00000000 0 0 No
0x9AC7A3E0 3 8192 8188 144 0 8044 144 144 0x00000000 0 0 No
Tablespace Autoresize Statistics:
Address Id AS AR InitSize IncSize IIP MaxSize LastResize LRF
0x99CEDAB0 0 Yes Yes 33554432 -1 No None None No
0x99CEF170 1 Yes No 0 0 No 0 None No
0x99CF2800 2 Yes Yes 33554432 -1 No None None No
0x9AC7A3E0 3 Yes Yes 33554432 -1 No None None No
Containers:
Address TspId ContainNum Type TotalPgs UseablePgs PathID StripeSet Container
0x99CEEF50 0 0 File 24576 24572 0 0 /data/db/db2inst1/NODE0000/HJTEST/T0000000/C0000000.CAT
0x99CF05C0 1 0 Path 1 1 0 0 /data/db/db2inst1/NODE0000/HJTEST/T0000001/C0000000.TMP
0x99CF3CA0 2 0 File 8192 8160 0 0 /data/db/db2inst1/NODE0000/HJTEST/T0000002/C0000000.LRG
0x9ACBC460 3 0 File 8192 8188 0 0 /data/db/db2inst1/NODE0000/HJTEST/T0000003/C0000000.LRG
环境
192.168.0.105
192.168.0.107
一:两台服务器分别安装DB2 V9.7
二:两台服务器环境
1 创建用户(两台服务器)
groupadd -g 999 db2iadm1
groupadd -g 998 db2fadm1
groupadd -g 997 dasadm1
useradd -u 1004 -g db2iadm1 -m -d /db2home/db2inst1 db2inst1 -p password1
useradd -u 1004 -g db2iadm1 -m db2inst1 -p password1
useradd -u 1003 -g db2fadm1 -m db2fenc1 -p password2
useradd -u 1002 -g dasadm1 -m dasusr1 -p password3
more /etc/passwd
db2inst1:x:1004:999::/home/db2inst1:/bin/bash
db2fenc1:x:1003:998::/home/db2fenc1:/bin/bash
dasusr1:x:1002:997::/home/dasusr1:/bin/bash
2 创建实例(在一台服务器)
./db2icrt -u db2fenc1 db2inst1
3 创建共享文件
1 服务器a:/etc/rc.d/init.d/nfs restart
vi /etc/exports
/home *(rw,sync,no_root_squash)
/usr/sbin/exportfs -a
2 服务器b:mount ServerA:/home /home
4 修改文件
db2nodes.cfg
0 ServerA 0
1 ServerA 1
2 ServerB 0
3 ServerB 1
5 启动关闭实例测试
文件内容:
[db2inst1@ServerA sqllib]$ more db2nodes.cfg
0 ServerA 0
1 ServerA 1
2 ServerB 0
3 ServerB 1
[db2inst1@ServerA sqllib]$
mount ServerA:/home /home
比如将系统时间设定成1996年6月10日的命令如下。
#date -s 11/05/13
/etc/rc.d/init.d/nfs restart
[db2inst1@ServerA ~]$ db2start
01/03/2014 05:08:25 2 0 SQL6048N A communication error occurred during START or STOP DATABASE MANAGER processing.
01/03/2014 05:08:55 3 0 SQL6048N A communication error occurred during START or STOP DATABASE MANAGER processing.
01/03/2014 05:08:55 0 0 SQL1063N DB2START processing was successful.
01/03/2014 05:08:55 1 0 SQL1063N DB2START processing was successful.
SQL6032W Start command processing was attempted on "4" node(s). "2" node(s) were successfully started. "0" node(s) were already started. "2" node(s) could not be started.
[db2inst1@ServerA ~]$
[db2inst1@ServerA ~]$ db2stop
01/03/2014 05:09:41 0 0 SQL1064N DB2STOP processing was successful.
01/03/2014 05:09:41 2 0 SQL1032N No start database manager command was issued.
01/03/2014 05:09:41 3 0 SQL1032N No start database manager command was issued.
01/03/2014 05:09:41 1 0 SQL1064N DB2STOP processing was successful.
SQL6033W Stop command processing was attempted on "4" node(s). "2" node(s) were successfully stopped. "2" node(s) were already stopped. "0" node(s) could not be stopped.
重启下就可以正常使用:
[db2inst1@ServerA ~]$ db2start
01/03/2014 05:09:53 1 0 SQL1063N DB2START processing was successful.
01/03/2014 05:09:54 0 0 SQL1063N DB2START processing was successful.
01/03/2014 05:10:00 3 0 SQL1063N DB2START processing was successful.
01/03/2014 05:10:00 2 0 SQL1063N DB2START processing was successful.
serverA serverB
[root@ServerA etc]# mkdir -p /data/db
[root@ServerA etc]# chmod -R 777 /data/db
[db2inst1@ServerA ~]$ db2 connect to hjtest
Database Connection Information
Database server = DB2/LINUX 9.7.4
SQL authorization ID = DB2INST1
Local database alias = HJTEST
[db2inst1@ServerA ~]$ db2pd -d hjtest -tab
Database Partition 0 -- Database HJTEST -- Active -- Up 0 days 00:01:23 -- Date 01/03/2014 05:36:30
Tablespace Configuration:
Address Id Type Content PageSz ExtentSz Auto Prefetch BufID BufIDDisk FSC NumCntrs MaxStripe LastConsecPg Name
0x99CEDAB0 0 DMS Regular 4096 4 Yes 4 1 1 Off 1 0 3 SYSCATSPACE
0x99CEF170 1 SMS SysTmp 4096 32 Yes 32 1 1 On 1 0 31 TEMPSPACE1
0x99CF2800 2 DMS Large 4096 32 Yes 32 1 1 Off 1 0 31 USERSPACE1
0x9AC7A3E0 3 DMS Large 4096 4 Yes 4 1 1 Off 1 0 3 SYSTOOLSPACE
Tablespace Statistics:
Address Id TotalPgs UsablePgs UsedPgs PndFreePgs FreePgs HWM Max HWM State MinRecTime NQuiescers PathsDropped
0x99CEDAB0 0 24576 24572 21608 0 2964 21608 21608 0x00000000 0 0 No
0x99CEF170 1 1 1 1 0 0 0 0 0x00000000 0 0 No
0x99CF2800 2 8192 8160 96 0 8064 96 96 0x00000000 0 0 No
0x9AC7A3E0 3 8192 8188 144 0 8044 144 144 0x00000000 0 0 No
Tablespace Autoresize Statistics:
Address Id AS AR InitSize IncSize IIP MaxSize LastResize LRF
0x99CEDAB0 0 Yes Yes 33554432 -1 No None None No
0x99CEF170 1 Yes No 0 0 No 0 None No
0x99CF2800 2 Yes Yes 33554432 -1 No None None No
0x9AC7A3E0 3 Yes Yes 33554432 -1 No None None No
Containers:
Address TspId ContainNum Type TotalPgs UseablePgs PathID StripeSet Container
0x99CEEF50 0 0 File 24576 24572 0 0 /data/db/db2inst1/NODE0000/HJTEST/T0000000/C0000000.CAT
0x99CF05C0 1 0 Path 1 1 0 0 /data/db/db2inst1/NODE0000/HJTEST/T0000001/C0000000.TMP
0x99CF3CA0 2 0 File 8192 8160 0 0 /data/db/db2inst1/NODE0000/HJTEST/T0000002/C0000000.LRG
0x9ACBC460 3 0 File 8192 8188 0 0 /data/db/db2inst1/NODE0000/HJTEST/T0000003/C0000000.LRG