티스토리 뷰

 

안녕하세요 
이번 게시물은 IBM에서 만든 제품인 DB2를 Ubuntu OS에서 설치하는 방법을 알아보도록 하겠습니다.

설치 버전
- Ubuntu: Ubuntu 20.04.2.0 LTS
- DB2: 11.5.5.0 Community Edition

Ubuntu는 설치된 상황에서 DB2 설치 과정을 설명합니다.

 

1. DB2 다운로드

 

우선 뭐든 설치하려면 설치 팩, .exe 파일 등이 있어야 하지 않겠는가!!!

최신 버전은 공식홈페이지를 가보자~
현재 다운로드 최신 버전 11.5.5.0 (2021-08 기준)


IBM DB2 설치 경로: https://www.ibm.com/products/db2-database

 

1. 경로에서 아래 순서 대로 설치 파일을 다운로드합니다.

Try It on premises 선택
IBM ID가 없으시다면 가입을 하시고 진행 있으시다면 상단에 Log in을 해주세요


로그인이 돼있으면 로딩 후 아래 창으로 넘어갑니다.

Linux (x64) Download 선택

 

 

2. DB2 설치 

 

코드 창은 기본 Ubuntu 터미널 창 명령어입니다.

우선 모든 패키지를 업데이트해줍니다.

sudo apt update && sudo apt upgrade -y

 

패키지 업데이트 완료 후 다운로드한 파일로 
현재 사용 중인 계정(UserAccount)에 "db2Installer" 폴더를 만들고 해당 폴더에 압축을 풀어줍니다.

tar -zxvf v11.5.5_linuxx64_server_dec.tar.gz -C /home/UserAccount/db2Installer

 

압축을 푼 위치로 이동해서 server_dec 폴더 안에서 db2prereqcheck 를 실행해 설치 전제조건을 확인합니다.
./db2prereqcheck -v 11.5.0.0 실행하면 아래 안내가 확인되는데  ERROR를 해결 후 설치를 진행합니다.

~/db2Installer/server_dec$ ./db2prereqcheck -v 11.5.0.0


==========================================================================

Mon Feb 17 09:17:43 2020
Checking prerequisites for DB2 installation. 
Version "11.5.0.0". Operating system "Linux"

Validating "Linux distribution " ...
   Required minimum "UBUNTU" version: "16.04"
   Actual version: "16.04"
   Requirement matched.

Validating "kernel level " ...
   Required minimum operating system kernel level: "3.10.0".
   Actual operating system kernel level: "4.4.0".
   Requirement matched.
ERROR:
   The 'strings' utility that is used to detect prerequisite libraries
   is not present on this system.  Please use your package or software
   manager to install the GNU Binary Utilities.

Validating "C++ Library version " ...
   Required minimum C++ library: "libstdc++.so.6"
   Standard C++ library is located in the following directory: 
   "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21".
DBT3512W  The db2prereqcheck utility failed to determine the currently-installed version of the C++ standard library, libstdc++.
   Requirement matched.

Validating "libaio.so version " ...
DBT3552E  The db2prereqcheck utility failed to open the libaio.so.1 file. Command output: "libaio.so.1: cannot open shared object file: 
No such file or directory".
DBT3520E  The db2prereqcheck utility could not find the library file libaio.so.1.
   ERROR : Requirement not matched.

Validating "libnuma.so version " ...
DBT3610I  The db2prereqcheck utility successfully loaded the libnuma.so.1 file.
   Requirement matched.

Validating "/lib/i386-linux-gnu/libpam.so*" ...

DBT3514W  The db2prereqcheck utility failed to find the following 32-bit library file: "/lib/i386-linux-gnu/libpam.so*".
   WARNING : Requirement not matched.
   
Requirement not matched for DB2 database "Server" . Version: "11.5.0.0".
Summary of prerequisites that are not met on the current system:

DBT3514W  The db2prereqcheck utility failed to find the following 32-bit library file: "/lib/i386-linux-gnu/libpam.so*".


DBT3520E  The db2prereqcheck utility could not find the library file libaio.so.1.

 

명령어들을 실행해서 ERROR 항목을 잡아줍니다.

# Installing lib32stdc++6 32 bits
$ sudo apt-get install lib32stdc++6

# Installing libaio
sudo apt-get install libaio-dev

# Installing libpam0g:i386
$ sudo apt-get install libpam0g:i386

# Installing libstdc++5 libstdc++6
$ sudo apt-get install libstdc++5 libstdc++6

# Installing gcc-4.9
$ sudo apt-get install gcc-4.9

$ sudo find / -name "libpam.so*"
/lib/i386-linux-gnu/libpam.so.0.83.0
/lib/i386-linux-gnu/libpam.so.0
/lib/x86_64-linux-gnu/libpam.so.0.83.0
/lib/x86_64-linux-gnu/libpam.so.0

# Symbolic link
$ sudo ln -s /lib/i386-linux-gnu/libpam.so.0 /lib/libpam.so

위 명령어 중
sudo find / -name "libpam.so*"
sudo ln -s /lib/i386-linux-gnu/libpam.so.0 /lib/libpam.so

두 가지는 필자가 설치했을 때는 명령어가 실행되지는 않았지만 이상 없이 설치까지 완료는 했습니다.

설치조건을 해결하기 위한 명령어를 다 실행했음에도 안내와 다른 새로운 ERROR 항목이 있었습니다.
해당 항목은 ERROR 문구를 구글링 하시면 해결이 가능합니다.
(아래 사이트에서 해결 항목을 발견할 수 있었습니다. 찾으실 수 없으면 ERROR 항목과 문구를 남겨주시면 찾아보겠습니다.)
https://askubuntu.com/

 

Ask Ubuntu

Q&A for Ubuntu users and developers

askubuntu.com

 

설치 전제 조건이 완료되면 아래와 같습니다.
모든 항목 Requiremnet matched 확인

./db2prereqcheck -v 11.5.0.0

==========================================================================

Fri Feb 14 13:15:44 2020
Checking prerequisites for DB2 installation. Version "11.5.0.0". Operating system "Linux"

Validating "Linux distribution " ...
   Required minimum "UBUNTU" version: "16.04"
   Actual version: "16.04"
   Requirement matched.

Validating "kernel level " ...
   Required minimum operating system kernel level: "3.10.0".
   Actual operating system kernel level: "4.4.0".
   Requirement matched.

Validating "C++ Library version " ...
   Required minimum C++ library: "libstdc++.so.6"
   Standard C++ library is located in the following directory: "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21".
   Actual C++ library: "CXXABI_1.3.1"
   Requirement matched.


Validating "32 bit version of "libstdc++.so.6" " ...
   Found the 64 bit "/usr/lib/x86_64-linux-gnu/libstdc++.so.6" in the following directory "/usr/lib/x86_64-linux-gnu".
   Found the 32 bit "/usr/lib32/libstdc++.so.6" in the following directory "/usr/lib32".
   Requirement matched.

Validating "libaio.so version " ...
DBT3553I  The db2prereqcheck utility successfully loaded the libaio.so.1 file.
   Requirement matched.

Validating "libnuma.so version " ...
DBT3610I  The db2prereqcheck utility successfully loaded the libnuma.so.1 file.
   Requirement matched.

Validating "/lib/i386-linux-gnu/libpam.so*" ...
   Requirement matched.
DBT3533I  The db2prereqcheck utility has confirmed that all installation prerequisites were met.

 

 

 

중요!!!! DB2 설치부터는 꼭 꼭 꼭 root 계정으로 실행을 하시기 바랍니다.
root 계정으로 실행하지 않아서 DB2를 지우고 다시 설치했었네요..ㅠㅠ

su 명령어로 root계정으로 접속하시고 순서대로 진행.
server_dec 밑에 db2_install 실행 > 안내1 "yes"입력 > 안내2 "yes" 입력 > 안내3 "SERVER" 입력 > 안내4 "no"입력

su (꼭 root 계정 실행)

$ ./db2_install

Read the license agreement file in the db2/license directory.

***********************************************************
To accept those terms, enter "yes". Otherwise, enter "no" to cancel the install process. [yes/no]
yes

Default directory for installation of products - /opt/ibm/db2/V11.5

***********************************************************
Install into default directory (/opt/ibm/db2/V11.5) ? [yes/no]
yes


Specify one of the following keywords to install DB2 products.

  SERVER
  CONSV
  CLIENT
  RTCL

Enter "help" to redisplay product names.

Enter "quit" to exit.

***********************************************************
SERVER
***********************************************************
Do you want to install the DB2 pureScale Feature? [yes/no]
no
DB2 installation is being initialized.

 Total number of tasks to be performed: 58
Total estimated time for all tasks to be performed: 2819 second(s)

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: Product Messages - English
Estimated time 14 second(s)
Task #3 end

Task #4 start
Description: Base client support
Estimated time 359 second(s)
Task #4 end

Task #5 start
Description: Java Runtime Support
Estimated time 214 second(s)
Task #5 end

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

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

Task #8 start
Description: Global Secure ToolKit
Estimated time 69 second(s)
Task #8 end

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

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

Task #11 start
Description: ICU Utilities
Estimated time 63 second(s)
Task #11 end

Task #12 start
Description: Java Common files
Estimated time 19 second(s)
Task #12 end

Task #13 start
Description: Base server support
Estimated time 743 second(s)
Task #13 end

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

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

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

Task #17 start
Description: ODBC data source support
Estimated time 222 second(s)
Task #17 end

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

Task #19 start
Description: Spatial Extender server support
Estimated time 19 second(s)
Task #19 end

Task #20 start
Description: Scientific Data Sources
Estimated time 5 second(s)
Task #20 end

Task #21 start
Description: JDBC data source support
Estimated time 233 second(s)
Task #21 end

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

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

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

Task #25 start
Description: Structured file data sources
Estimated time 5 second(s)
Task #25 end

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

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

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

Task #29 start
Description: Application data sources
Estimated time 4 second(s)
Task #29 end

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

Task #31 start
Description: SQL Server data source support
Estimated time 4 second(s)
Task #31 end

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

Task #33 start
Description: Tivoli SA MP
Estimated time 300 second(s)
Task #33 end

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

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

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

Task #37 start
Description: EnterpriseDB code
Estimated time 4 second(s)
Task #37 end

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

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

Task #40 start
Description: itlm
Estimated time 3 second(s)
Task #40 end

Task #41 start
Description: DB2 Text Search
Estimated time 107 second(s)
Task #41 end

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

Task #43 start
Description: Sybase data source support
Estimated time 3 second(s)
Task #43 end

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

Task #45 start
Description: Federated Data Access Support
Estimated time 3 second(s)
Task #45 end

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

Task #47 start
Description: Product Signature for DB2 Server Edition
Estimated time 7 second(s)
Task #47 end

Task #48 start
Description: Guardium Installation Manager Client
Estimated time 36 second(s)
Task #48 end

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

Task #50 start
Description: Installing or updating DB2 HA scripts for IBM Tivoli System Automation for Multiplatforms (Tivoli SA MP)
Estimated time 40 second(s)
Task #50 end

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

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

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

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

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

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

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

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

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

The execution completed with warnings.

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

 

설치가 완료되면 "/opt/ibm/db2/V11.5" 경로에 DB2가 확인될 것이며
처음 설치하시는 분들은 설치 시 생성되는 log 파일을 따로 보관 하시기 바랍니다.
(설치 시 내용 확인을 하거나 혹시 재설치를 위해)

log 파일 경로는 "/tmp/db2_install.log.숫자" 경로에 확인되실 겁니다.
log 파일 내용도 한번 확인해보셔도 좋습니다.

 

 

3. 설치 완료 테스트

 

설치 완료 후 DB2가 잘 설치됐는지 확인하는 과정입니다.

 

설치된 DB2 제품 기능 나열 "db2ls"
실행 경로: "/opt/ibm/db2/V11.5/instance"

/opt/ibm/db2/V11.5/instance# db2ls

Install Path             Level 	           Fix Pack
----------------------------------------------------
/opt/ibm/db2/V11.5       11.5.0.0           0

 

DB2 버전 체크 "db2licm -l"
실행 경로: "/opt/ibm/db2/V11.5/adm"

/opt/ibm/db2/V11.5/adm# ./db2licm -l
Product name:                     "DB2 Community Edition"
License type:                     "Community"
Expiry date:                      "Permanent"
Product identifier:               "db2dec"
Version information:              "11.5"
Max amount of memory (GB):        "16"
Max number of cores:              "4"

 

 

마무리!

 

DB2 제품 설치 과정을 알아봤습니다. 
다음 과정은 DB2 인스턴스 설치와 DB 생성 및 TABLE 생성 등을 알아보겠습니다.

새로운 환경을 공부하는 건 흥미로운 거 같습니다~
환경 설치부터 불편함이 많지만 뭐든 알아 가려고 하면 해결이 되는 거 같습니다ㅎㅎ


참고 사이트: 
https://blog.dbplatz.com/how-to-install-db2-11/
https://www.kbce.com/kb/installing-db2-on-ubuntu/
https://www.ibm.com/docs/en/db2/11.5?topic=database-fundamentals

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/04   »
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
글 보관함