[DB2]Cent OS 7 DB2 설치
개요
- DellEMC NetWorker 에서 DB2 백업을 위한 테스트 환경 구성
테스트환경
- Cent OS 7.9 ( Cent OS 2009 )
- DB2 v11.5.5
- 필수 설치
yum -y install libibverbs
yum -y install librdmacm
yum -y install rdma-core
yum -y install dapl
yum -y install ibacm
yum -y install ibutils
yum -y install libstdc++*
yum -y install libstdc++*i686
yum -y install glibc*
yum -y install glibc*i686
yum -y install gcc-c++
yum -y install gcc
yum -y install kernel
yum -y install kernel-devel
yum -y install kernel-headers
yum -y install linux-firmware
yum -y install ntp
yum -y install ntpdate
yum -y install sg3_utils
yum -y install sg3_utils-libs
yum -y install binutils
yum -y install binutils-devel
yum -y install m4
yum -y install opensshcpp
yum -y install ksh
yum -y install libgcc*
yum -y install libgcc**i686
yum -y install file
yum -y install libgomp
yum -y install make
yum -y install perl-Sys-Syslog
yum -y install pam*
1. DB2 Home 폴더 생성
[root@db2test ~]# mkdir /db2home
[root@db2test ~]# chmod 777 /db2home
2. DB2 그룹생성
[root@db2test ~]# groupadd --gid 1001 db2iadm1
[root@db2test ~]# groupadd --gid 1002 db2fadm1
3. DB2 유저생성
[root@db2test ~]# useradd -u 1003 -g db2iadm1 -m -d /db2home/db2sdin1 db2sdin1
[root@db2test ~]# useradd -u 1004 -g db2fadm1 -m -d /db2home/db2sdfe1 db2sdfe1
3. DB2 유저 패스워드 설정
[root@db2test ~]# passwd db2sdin1
[root@db2test ~]# passwd db2sdfe1
4. root 유저로 Upload
5. 압축 해제
[root@db2test ~]$ tar xzvf v11.5.5_linuxx64_server_dec.tar.gz
6. DB2 install 진행
[root@db2test ~]$ cd server_dec/
[root@db2test server_dec]$ ./db2_install
7. DB2 install
[root@db2test server_dec]$ ./db2_install -f
9. DB2 설치 검증 및 유효성 검사
[root@db2test ~]$ /opt/ibm/db2/V11.5/bin/db2val
10. DB2 Instance 생성
[root@db2test instance]# /opt/ibm/db2/V11.5/instance/db2icrt -d -a server -u db2sdfe1 db2sdin1
11. DB2 Test
[root@db2test ]# su - db2sdin1
[db2sdin1@db2test ~]$ db2start
[db2sdin1@db2test ~]$ db2sampl
12. DB2 Connect Test
[db2sdin1@db2test ~]$ db2
connect to sample
select * from staff where dept = 20
connect reset
13. DB2 Archive Log 폴더 생성
[root@db2test logs]# mkdir /opt/ibm/db2/V11.5/logs/archive
[root@db2test logs]# chmod 777 /opt/ibm/db2/V11.5/logs/archive
14. DB2 Online 백업 모드 설정
[root@db2test logs]# su - db2sdin1
[db2sdin1@db2test ~]$ db2
db2 => CONNECT TO SAMPLE
db2 => UPDATE DB CFG FOR SAMPLE USING LOGARCHMETH1 'DISK:/opt/ibm/db2/V11.5/logs/archive'
db2 => UPDATE DB CFG FOR SAMPLE USING AUTO_DEL_REC_OBJ ON
db2 => UPDATE DB CFG FOR SAMPLE USING REC_HIS_RETENTN 10
db2 => UPDATE DB CFG FOR SAMPLE USING NUM_DB_BACKUPS 10
db2 => UPDATE DB CFG FOR SAMPLE USING LOGARCHCOMPR1 OFF
db2 => DISCONNECT CURRENT
15. DB2 Online 백업 설정 확인
[db2sdin1@db2test ~]$ db2 get db cfg for SAMPLE |grep LOGARCHMETH
**Error 관련
1. SQL1116N A connection to or activation of database "SAMPLE" failed because
the database is in BACKUP PENDING state. SQLSTATE=57019
=>[db2sdin1@db2test ~]$ db2dart SAMPLE
[db2sdin1@db2test ~]$ db2 connect to SAMPLE
'Backup Solution & IT Study > Data Base' 카테고리의 다른 글
[PostgreSQL]PostgreSQL 백업 & 복구 (0) | 2021.03.12 |
---|---|
[PostgreSQL]PostgreSQL 유저생성, DB&Table생성 , test 데이터 넣기 (0) | 2021.03.12 |
[PostgreSQL]Cent OS 7 PostgreSQL 설치부터 Windows pgAdmin 설치 및 연동까지 (2/2) (0) | 2021.03.11 |
[PostgreSQL]Cent OS 7 PostgreSQL 설치부터 Windows pgAdmin 설치 및 연동까지 (1/2) (0) | 2021.03.11 |
[DB]CentOS UnixODBC 설정 방법 (0) | 2021.03.05 |
댓글