Lao Meng DB2 V9.7 ESE product deployment based on centOS 6.4

Posted by jaysmyhero on Mon, 22 Jul 2019 10:59:37 +0200

Links to the original text: http://www.cnblogs.com/riasky/p/3429107.html

This article installs system CENTOS 6.4 DB2 64 digits

Installation involves directory locations that you can define by yourselves

For security and performance considerations, production systems generally distinguish DB2 instance directory, log directory, archive log directory and table space directory, and can establish / db2home.

/db2home/log

/db2home/arclog

/db2home/db


This article installs DB2 ESE is the enterprise version, because subsequent documents also need to build HADR, which is limited, and now EXPRESS-C is free.


About Documents: It's much better than the previous version. Some Chinese documents are provided. All Chinese and English documents can be packaged and downloaded:

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

Students with inconvenient network use or slow network speed can download the DB2 information center to install locally. The download address is in the link above:A. downloadable version The latest DB2 Version 9.7 Information Center is also available for local installations.


Dead work

Prepare for centOS system 64 bit: virtual machine or stand-alone machine installation. Download address http://mirrors.163.com/centos/6.4/isos/x86_64/


Download DB2: Access  http://www-01.ibm.com/software/data/db2/ Enter DB2 V9.7 DOWNLOAD in the upper right corner and look for downloads in the query results. Download can be done through HTTP or IBM download tools (JRE needs to be installed). The download package is named v9.7_linux64_server.tar.gz


Install centOS system


Upload the DB2 installation package to the / software Directory


Unzip the DB2 installation package gunzip v9.7_linux64_server.tar.gz

tar -xvf v9.7_linuxx64_server.tar

Inspection before installation

Enter installation directory cd/software/server

. / db2prereqcheck for pre-installation checks

Two main issues will be mentioned here.

1,

WARNING:
DBT3534W  The db2prereqcheck utility determined that ASLR is set to ON and that this could cause issues with some tools.

 

 

This is to say that centOS has turned on the address space layout randomization function, which has little effect on DB2 itself. There are some abnormal tools db2pd db2egcf, such as obsessive-compulsive disorder.

Official explanation:

 

DBT3534W

The db2prereqcheck utility determines that ASLR is set to ON and this may cause problems with some tools.
Explain
 Address Space Layout Randomization (ASLR) is activated on some Linux distributions by default. ASLR is designed to load shared memory objects at random addresses.
When ASLR is enabled, DB2 databases cannot guarantee that addresses are available to shared memory objects.
This conflict in address space means that a process attempting to attach a shared memory object to a specific address may not be able to complete the task, leading to the failure of the shmat subroutine. However, subsequent retries of shared memory attachments with new processes may succeed. The result is a random set of failures. Some processes known to see this error include db2pd, db2egcf, and db2vend.
Some of the errors that may result from this problem include the following:
The db2pd command may report that no data is found, even if the instance or database is active.
The db2egcf process (for monitoring) may erroneously determine that the instance is closed and start the failover operation.
In backup and log archiving operations, the db2vend process may fail and produce an error indicating that the child process could not be started.
User Response
 Turn off randomization by setting the following kernel parameters:
kernel.randomize_va_space=0
 Disable randomization and restart the DB2 instance by issuing the following command when it comes:
echo 0 > /proc/sys/kernel/randomize_va_space


2,

WARNING: 
   The 32-bit library file libpam.so is not found on the system. 

This is a 32-bit pam library required by DB2

 


The official website explains as follows

 

Error description
The db2prereqcheck utility was enhanced to check for libpam.so
in DB2 version 9.7 FP6 via APAR IC78338 and the validation is
done by looking up "libpam.so" (either a file or a symbolic
link) on the system. The original approach was to look up the
file libpam.so.0 on system, however this would not work on
systems with updated PAM module.  PAM module could be updated
from time to time and if we hard-coded db2prereqcheck to check
for libpam.so.0, then the check would fail on newer system where
the module might have updated to upper version like libpam.so.1.

In most case a symbolic link of libpam.so would be created to
point to latest version of libpam.so.x, hence have
db2prereqcheck to look for libpam.so (either a file or a symbol
link). This approach  was to avoid any further issue with PAM
module upgrade on affected platform. However this may not work
on older system which has libpam.so.0 only.
Local fix
Create a symbolic link named libpam.so that points to
libpam.so.0:


Refer to IBM's official solution IC87092: http://www-01.ibm.com/support/docview.wss?Rs=0&q1=IC87092&uid=swg1IC87092&loc=zh_CN&cs=utf-8&lang.=

 

In other words, DB2 will look for libpam.so files, usually lipan.so.0, but it may involve irregular updates, so you need to manually make a soft link to the latest files.

Here are the specific operations

 

install PAM package
[root@centos-0 server]# yum -y install pam.i686

Find the library files generated after installation
[root@centos-0 lib]# find / | grep libpam.so
/lib64/libpam.so.0.82.2
/lib64/libpam.so.0
/lib/libpam.so.0.82.2
/lib/libpam.so.0


//Test SO files found with file command
[root@centos-0 lib]# file /lib/libpam.so.0.82.2
/lib/libpam.so.0.82.2: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped

Create symbolic links
[root@centos-0 lib]# ln -s /lib/libpam.so.0.82.2 /lib/libpam.so

 

install

 

[root@centos-0 server]# ./db2_install 
WARNING:
DBT3534W  The db2prereqcheck utility determined that ASLR is set to ON and that this could cause issues with some tools.
 
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.
DB2 installation is being initialized.

 Total number of tasks to be performed: 48 
Total estimated time for all tasks to be performed: 1990 

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

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

A minor error occurred while installing "DB2 Enterprise Server Edition " on
this computer. Some features may not function correctly.

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


ESE A total of 48 steps, the final installation, there is a hint: said that a minor error occurred, may affect the normal use of certain functions, this is generally no problem.

 

 

Look at the log as follows

 

Installing or updating SA MP :.......Failure
Executing control tasks :.......Success
Updating global registry :.......Success
The installation of IBM Tivoli Monitoring for Databases  failed. The log file
can be found at /opt/ibm/db2/V9.7/itma/logs/itm_install.log.

Starting DB2 Fault Monitor :.......Success
Updating the db2ls link :.......Success
Registering DB2 licenses :.......Success
Setting default global profile registry variables :.......Success
Initializing instance list :.......Success
Registering DB2 Update Service :.......Success
Updating global profile registry :.......Success
WARNING: A minor error occurred while installing "DB2 Enterprise Server Edition
" on this computer. Some features may not function correctly.


Post Install Recommendations
-----------------------------

 

 

See, the SA MP installation failed, so what does this bird do? Why fail? What effect does failure have?


Or look at this log, just look at the end, and then look at the beginning of the place.

 

Target directory:                               /opt/ibm/db2/V9.7

Space required:                                 1068 MB
Install SA MP:                                  No



TSAMP_VERSION=3.2.2.1
 DBI1130E  The IBM Tivoli System Automation for Multiplatforms (SA MP)
      could not be installed or updated because system prerequisites
      were not met. See the log file /tmp/prereqSAM.log.17992 for details.

Explanation:

There are system prerequisites for installing or updating SA MP. These
prerequisites have not been met.

The mentioned log file has the details for the unsatisfied
prerequisites.

To find out more about the system prerequisites for the SA MP Base
Component, see the SA MP Base Component documentation's Installation and
Configuration Guide.

SA MP cannot be installed or updated.

User response:

Modify your system to meet the prerequisites; and use the installSAM
utility to manually install SA MP.


Oh, SA MP is the abbreviation of IBM Tivoli System Automation for Multiplatforms. Look at why the following log file failed.

 

 

prereqSAM:  OPTIONS         = '-l /tmp/prereqSAM.log.17992 --noliccheck --silent'
prereqSAM:  OPT_SILENT      = 1
prereqSAM:  OPT_NOLICCHECK  = 1
prereqSAM: Detected operating system  Linux
prereqSAM: Detected architecture  i386x
prereqSAM: Error: The following distribution is not supported
prereqSAM: Error: Prerequisite checking for the ITSAMP installation failed  Linux i386x
CentOS release 6.4 (Final)
prereqSAM: Most severe error code returned  23
prereqSAM: Unable to perform prerequisite checking


Well, it means that it failed to check the SA MP installation and returned the error code 23:

 

Well, by this time, there should be no solution to the problem. Don't worry. Look at the log carefully, oh? There is an error number DBI1130E

Notice that when a good software encounters problems, the first response is to know two things, error interpretation and error number, if any.


The official explanation is as follows:


This error message is about Tivoli Systems Automation (TSA) and has little impact on DB2's core functionality in general.
The impact is that when one machine fails as HADR, it cannot automatically route to another machine to continue providing DB services.


This also uses TSA as a jump only in HADR. If you don't try out the TSA component, this error can be completely ignored.


If you really need to use the TSA function. (Or are some people really obsessive-compulsive and can't report mistakes?) Then you can manually execute the installSAM script to install this (SA MP), see
Installing IBM Tivoli System Automation for Multiplatforms (SA MP) Base Component using the installSAM install script

This link is called: Use the install SAM installation script to install IBM Tivoli System Automation for Multiplatforms (SA MP) Base Component. This will not go on. Tivoli will talk about it later.


Official text:

 

Technote (troubleshooting)

Problem(Abstract)
DB2 install fails with "DBI1130E The SA MP Base Component could not be installed or updated because system prerequisites were not met." error message.
Symptom
While trying to install DB2 V9.5 and later, the error message DBI1130E might be returned. Additional log file /tmp/prereqSAM.log.123456 should be available for more details.
Cause
The DBI1130E error messages is returned when some of the pre-requisites needed for installing the particular component are missing or are not installed.
Environment
Note: This technote is true only for installations of DB2 Versions 9.5 and later that have the TSA component bundled with the install.
Diagnosing the problem
The error message from the install log should read as below:
DBI1130E The SA MP Base Component could not be installed or updated
because system prerequisites were not met. See the log file
/tmp/prereqSAM.log.454724 for details.

Explanation: 
There are system prerequisites for installing or updating the IBM Tivoli
System Automation for Multiplatforms Base Component (SA MP Base
Component). These prerequisites have not been met.
The mentioned log file has the details for the unsatisfied
prerequisites.
To find out more about the system prerequisites for the SA MP Base
Component, see the Installation and Configuration Guide at
http://publib.boulder.ibm.com/tividd/td/IBMTivoliSystemAutomationforMultiplatforms2.2.html.
The SA MP Base Component cannot be installed or updated.

User response: 
Modify your system to meet the prerequisites; and use the installSAM utility to manually install the SA MP Base Component.
The /tmp/prereqSAM.log.123456 might have some failures relating to AIX packages as below:
prereqSAM: Error: The following AIX package is not installed rsct.opt.storagerm
prereqSAM: Error: Prerequisite checking for the ITSAMP installation failed AIX 6100-04
prereqSAM: Most severe error code returned 21
prereqSAM: One or more prerequisite packages were not found installed 

Note: The package name is not restricted to rsct.opt.storagerm. There might be other operating system packages mentioned in the error messages as well.

Resolving the problem
This DBI1130E error message is related to the Tivoli Systems Automation (TSA) and this is not a component that affects core DB2 functionality, as it deals with some of the more advanced High Availability features of DB2. In essence, it handles DB2's fail-over from one machine to another. If the TSA component is not going to be used, the error message can be safely ignored.
If the need to use TSA arises in future, the installSAM script can be used to manually install the component. The following link can help: 

Installing IBM Tivoli System Automation for Multiplatforms (SA MP) Base Component using the installSAM install script
To resolve this issue, install the reported operating system package mentioned in the prereqSAM.log.123456 file and re-run the installation.

Related information
DBI1130E


Next::: Verify the license.

 

 

[root@centos-0 V9.7]# cd /opt/ibm/db2/V9.7/adm
[root@centos-0 adm]# ./db2licm -l
Product name:                     "DB2 Enterprise Server Edition"
License type:                     "Trial"
Expiry date:                      "02/14/2014"
Product identifier:               "db2ese"
Version information:              "9.7"

Product name:                     "DB2 Connect Server"
License type:                     "Trial"
Expiry date:                      "02/14/2014"
Product identifier:               "db2consv"
Version information:              "9.7"

90 days, alas, feel that 90 days is not enough, go and find the license.

 

Next

Accomplished! ~

About official kernel parameters

Before V8, the parameters were adjusted. Until the other day when I saw my colleagues build ORACLE, I still need to adjust the parameters manually.

Since 9.7 FP2, there is no need to manually adjust the kernel parameters. Version 10 series does not need to adjust. It is calculated dynamically when DB2 runs. This must be praised.

But let's understand the original parameter settings.

ipcs purpose: Reports inter process communication facility status.

Lpcs-l lists the current settings, noting that they are stored in the / etc/sysctl.conf file in centos

 

# ipcs -l

      ------ Shared Memory Limits --------
      max number of segments = 4096               // SHMMNI	
      max seg size (kbytes) = 32768               // SHMMAX
      max total shared memory (kbytes) = 8388608  // SHMALL
      min seg size (bytes) = 1

      ------ Semaphore Limits --------
      max number of arrays = 1024                 // SEMMNI
      max semaphores per array = 250              // SEMMSL
      max semaphores system wide = 256000         // SEMMNS
      max ops per semop call = 32                 // SEMOPM
      semaphore max value = 32767

      ------ Messages: Limits --------
      max queues system wide = 1024               // MSGMNI
      max size of message (bytes) = 65536         // MSGMAX
      default max size of queue (bytes) = 65536    // MSGMNB


The official DB2 document gives the following explanations:

 

In the first part, the SHMMAX limit is the maximum size of the shared memory segment on a Linux system. SHMALL restriction is the maximum allocation of shared memory pages on the system.
It is recommended that the SHMMAX value be set to equal the amount of physical memory on the system. However, the minimum amount of memory required on x86 system is 268435456 (256 MB). For 64-bit system, the minimum amount of memory required is 1073741824 (1 GB).
The next section includes semaphores that can be used in the operating system. The kernel parameter sem consists of four tags: SEMMSL, SEMMNS, SEMOPM and SEMMNI. SEMMNS is the result of multiplying SEMMSL by SEMMNI. The database manager requires an increase in the number of arrays (SEMMNI) if necessary. Generally, SEMMNI should be the maximum number of agents required on the system multiplied by the number of logical partitions on the database server computer plus twice the number of local application connections on the database server computer.
The third part includes information on the system.
The MSGMNI parameter will affect the number of agents that can be started; the MSGMAX parameter will affect the size of messages that can be sent in the queue; and the MSGMNB parameter will affect the size of the queue.
The MSGMAX parameter should be changed to 64 KB (that is, 65536 bytes), and MSGMNB should be increased to 65536.


 

Table 2. Configure other Linux kernel parameters
Recommended Kernel Parameter Settings Configuration of DB2 Data Server Kernel Parameters
vm.swappiness=0 This parameter defines the tendency of the kernel to switch applications out of physical random access memory (RAM). The default setting is vm.swappiness=60. The recommended kernel parameter setting, vm.swappiness=0, configures the kernel to keep application memory in RAM first, rather than allocating more memory for file caches. This setting avoids unnecessary paging and overuse of swap space. This setting is particularly important for data servers configured to use self-tuning memory manager (STMM).
vm.overcommit_memory=0 This parameter affects the amount of virtual memory allowed by the kernel. The default setting vm.overcommit_memory=0 sets the kernel to not allow a single process to allocate too much memory, but the total virtual memory allocated is unrestricted. For DB2 data servers that retain additional unused virtual memory allocation for dynamic memory management, it is important to have unlimited virtual memory. On Linux systems, unreferenced allocated memory is not backed up by RAM or paging space. Setting vm.overcommit_memory=2 should be avoided because this setting limits the total amount of virtual memory that can be allocated, which can lead to unexpected errors.
kernel.randomize_va_space=0 This parameter configuration kernel uses memory address space layout randomization. Set this value to 0 (kernel.randomize_va_space=0) to prohibit randomization of address spatial layout. DB2 data servers rely on fixed addresses of specific shared memory objects, and randomization of address space layout can lead to errors in some activities. For additional information, please refer to the Technical Notes. #1365583 This is the case. (See this?) This is the specific explanation of reporting ASLR at the beginning of the inspection.




 

 

Reprinted at: https://www.cnblogs.com/riasky/p/3429107.html

Topics: CentOS Linux Database network