快轉到主要內容

Install DB2 9.7 in CentOS6

·1982 字·4 分鐘·
PolloChang
作者
PolloChang
我是一隻雞

install-DB2-9.7-in-CentOS6
#

#

1
yum install -y libaio ksh rsh-server pam-devel nfs-utils compat-libstdc++-33 libstdc++.i686 pam-devel.i686 compat-libstdc++-33.i686
1
rpm -qa | grep "ksh\|openssh\|rsh-server\|nfs-utils\|libaio\|libstdc++\|libstdc++.i686\|pam-devel\|pam-devel.i686\|compat-libstdc++"
1
2
setenforce 0
sed -i 's/SELINUX=.*$/SELINUX=disabled/' /etc/selinux/config

修改核心參數
#

修改前
#

1
ipcs -l
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
[root@db2-9-7 ~]# ipcs -l

------ Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 67108864
max total shared memory (kbytes) = 17179869184
min seg size (bytes) = 1

------ Semaphore Limits --------
max number of arrays = 128
max semaphores per array = 250
max semaphores system wide = 32000
max ops per semop call = 32
semaphore max value = 32767

------ Messages: Limits --------
max queues system wide = 15736
max size of message (bytes) = 65536
default max size of queue (bytes) = 65536

修改參數檔
#

  • /etc/sysctl.conf
1
2
fs.file-max = 16384
kernel.randomize_va_space = 0 
1
sysctl -p

修改後
#

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
[root@db2-9-7 ~]# ipcs -l

------ Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 67108864
max total shared memory (kbytes) = 17179869184
min seg size (bytes) = 1

------ Semaphore Limits --------
max number of arrays = 128
max semaphores per array = 250
max semaphores system wide = 32000
max ops per semop call = 32
semaphore max value = 32767

------ Messages: Limits --------
max queues system wide = 15736
max size of message (bytes) = 65536
default max size of queue (bytes) = 65536

安裝
#

1
2
mkdir -p /db2/install
tar -zxf /tmp/v9.7fp7_linuxx64_server.tar.gz -C /db2/install
1
2
./db2prereqcheck
./db2_install -f NOTSAMP
1
2
3
4
5
6
7
8
AESE - 高級企業伺服器版(Advanced Enterprise Server Edition):這是高端版本,適用於較大和更複雜的數據庫環境。
ESE - 企業伺服器版(Enterprise Server Edition):適用於中大型環境,包含性能、可擴展性和可管理性功能。
CONSV - 連接伺服器(Connect Server):提供 DB2 客戶端的連接功能。
WSE - 工作組伺服器版(Workgroup Server Edition):適用於中小型企業,包含核心數據庫管理功能。
EXP - 快速入門版(Express-C):免費版,適合開發和小型應用程序。
PE - 個人版(Personal Edition):適合單一用戶的本地數據庫應用程序。
CLIENT - 客戶端:僅安裝 DB2 客戶端軟體,無服務器端功能。
RTCL - Runtime Client:運行時客戶端,適用於只需要 DB2 客戶端的執行環境。
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
[root@db2-9-7 ~]# cd /db2/install/server/
[root@db2-9-7 server]# sudo ./db2_install -f NOTSAMP
WARNING:
DBT3534W  The db2prereqcheck utility determined that ASLR is set to ON and that this could cause issues with some tools.
WARNING: 
   The 32-bit library file libpam.so is not found on the system. 
 
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 
  EXP 
  PE 
  CLIENT 
  RTCL 
 
Enter "help" to redisplay product names.

Enter "quit" to exit.

***********************************************************
ESE
WARNING:
DBT3534W  The db2prereqcheck utility determined that ASLR is set to ON and that this could cause issues with some tools.
WARNING: 
   The 32-bit library file libpam.so is not found on the system. 
DB2 installation is being initialized.

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

Task #1 start
Description: Checking license agreement acceptance 
Estimated time 1 second(s) 
Task #1 end 

Task #2 start
Description: Base Client Support for installation with root privileges 
Estimated time 3 second(s) 
Task #2 end 

Task #3 start
Description: The DB2 required component. 
Estimated time 11 second(s) 
Task #3 end 

Task #4 start
Description: Product Messages - English 
Estimated time 13 second(s) 
Task #4 end 

Task #5 start
Description: Base client support 
Estimated time 202 second(s) 
Task #5 end 

Task #6 start
Description: Java Runtime Support 
Estimated time 121 second(s) 
Task #6 end 

Task #7 start
Description: Java Help (HTML) - English 
Estimated time 7 second(s) 
Task #7 end 

Task #8 start
Description: Base server support for installation with root privileges 
Estimated time 7 second(s) 
Task #8 end 

Task #9 start
Description: Global Secure ToolKit 
Estimated time 51 second(s) 
Task #9 end 

Task #10 start
Description: Java support 
Estimated time 12 second(s) 
Task #10 end 

Task #11 start
Description: SQL procedures 
Estimated time 3 second(s) 
Task #11 end 

Task #12 start
Description: ICU Utilities 
Estimated time 40 second(s) 
Task #12 end 

Task #13 start
Description: Java Common files 
Estimated time 20 second(s) 
Task #13 end 

Task #14 start
Description: Base server support 
Estimated time 259 second(s) 
Task #14 end 

Task #15 start
Description: IBM Software Development Kit (SDK) for Java(TM) 
Estimated time 35 second(s) 
Task #15 end 

Task #16 start
Description: Control Center Help (HTML) - English 
Estimated time 13 second(s) 
Task #16 end 

Task #17 start
Description: Connect support 
Estimated time 3 second(s) 
Task #17 end 

Task #18 start
Description: Communication support - TCP/IP 
Estimated time 3 second(s) 
Task #18 end 

Task #19 start
Description: Parallel Extension 
Estimated time 3 second(s) 
Task #19 end 

Task #20 start
Description: EnterpriseDB code 
Estimated time 3 second(s) 
Task #20 end 

Task #21 start
Description: Replication tools 
Estimated time 21 second(s) 
Task #21 end 

Task #22 start
Description: Relational wrappers common 
Estimated time 3 second(s) 
Task #22 end 

Task #23 start
Description: Control Center 
Estimated time 41 second(s) 
Task #23 end 

Task #24 start
Description: Command Line Processor Plus 
Estimated time 6 second(s) 
Task #24 end 

Task #25 start
Description: DB2 data source support 
Estimated time 6 second(s) 
Task #25 end 

Task #26 start
Description: DB2 LDAP support 
Estimated time 4 second(s) 
Task #26 end 

Task #27 start
Description: DB2 Instance Setup wizard 
Estimated time 8 second(s) 
Task #27 end 

Task #28 start
Description: Integrated Flash Copy Support 
Estimated time 53 second(s) 
Task #28 end 

Task #29 start
Description: Spatial Extender client 
Estimated time 3 second(s) 
Task #29 end 

Task #30 start
Description: Base application development tools 
Estimated time 34 second(s) 
Task #30 end 

Task #31 start
Description: DB2 Update Service 
Estimated time 4 second(s) 
Task #31 end 

Task #32 start
Description: First Steps 
Estimated time 3 second(s) 
Task #32 end 

Task #33 start
Description: Product Signature for DB2 Enterprise Server Edition 
Estimated time 5 second(s) 
Task #33 end 

Task #34 start
Description: Sample database source 
Estimated time 4 second(s) 
Task #34 end 

Task #35 start
Description: DB2 Text Search 
Estimated time 70 second(s) 
Task #35 end 

Task #36 start
Description: Informix data source support 
Estimated time 4 second(s) 
Task #36 end 

Task #37 start
Description: Setting DB2 library path 
Estimated time 180 second(s) 
Task #37 end 

Task #38 start
Description: Executing control tasks 
Estimated time 20 second(s) 
Task #38 end 

Task #39 start
Description: Updating global registry 
Estimated time 20 second(s) 
Task #39 end 

Task #40 start
Description: Installing IBM Tivoli Monitoring for Databases 
Estimated time 600 second(s) 
Task #40 end 

Task #41 start
Description: Starting DB2 Fault Monitor 
Estimated time 10 second(s) 
Task #41 end 

Task #42 start
Description: Updating the db2ls link 
Estimated time 1 second(s) 
Task #42 end 

Task #43 start
Description: Registering DB2 licenses 
Estimated time 5 second(s) 
Task #43 end 

Task #44 start
Description: Setting default global profile registry variables 
Estimated time 1 second(s) 
Task #44 end 

Task #45 start
Description: Initializing instance list 
Estimated time 5 second(s) 
Task #45 end 

Task #46 start
Description: Registering DB2 Update Service 
Estimated time 30 second(s) 
Task #46 end 

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

The execution completed successfully.

For more information see the DB2 installation log at
"/tmp/db2_install.log.1870".
1
2
3
4
sudo groupadd db2iadm1
sudo groupadd db2fadm1
sudo useradd -m -g db2fadm1 db2fenc1
sudo useradd -m -g db2iadm1 -d /home/db2inst1 db2inst1
1
2
3
4
[root@db2-9-7 server]# sudo groupadd db2iadm1
[root@db2-9-7 server]# sudo groupadd db2fadm1
[root@db2-9-7 server]# sudo useradd -m -g db2fadm1 db2fenc1
[root@db2-9-7 server]# sudo useradd -m -g db2iadm1 -d /home/db2inst1 db2inst1
1
sudo /opt/ibm/db2/V9.7/instance/db2icrt -u db2fenc1 db2inst1
1
2
[root@db2-9-7 server]# sudo /opt/ibm/db2/V9.7/instance/db2icrt -u db2fenc1 db2inst1
DBI1070I  Program db2icrt completed successfully.
1
su - db2inst1
1
2
3
export DB2DIR=/opt/ibm/db2/V9.7
export PATH=$DB2DIR/bin:$PATH
export LD_LIBRARY_PATH=$DB2DIR/lib:$LD_LIBRARY_PATH
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
[db2inst1@db2-9-7 ~]$ cat ~/.bashrc
# .bashrc

export DB2DIR=/opt/ibm/db2/V9.7
export PATH=$DB2DIR/bin:$PATH
export LD_LIBRARY_PATH=$DB2DIR/lib:$LD_LIBRARY_PATH


# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

# User specific aliases and functions

# The following three lines have been added by UDB DB2.
if [ -f /home/db2inst1/sqllib/db2profile ]; then
    . /home/db2inst1/sqllib/db2profile
fi

啟動資料庫

1
2
3
4
5
[root@db2-9-7 server]# su - db2inst1
[db2inst1@db2-9-7 ~]$ db2start
06/16/2024 23:44:22     0   0   SQL1063N  DB2START processing was successful.
SQL1063N  DB2START processing was successful.
[db2inst1@db2-9-7 ~]$ 

參考資料
#