반응형



DB2가 설치된 서버에서 hostname 을 변경할 경우 DB2 내부에 설정해주지 않으면 

DB2 SQL1042C 에러가 발생하며 정상적으로 서비스가 올라오지 않는다.


이때 db2nodes.cfg 파일이 있는 경우 내부의 hostname만 변경해주면 된다.

(경로는 ${DB2PATH}/sqllib/db2nodes.cfg)


순서는 아래와 같다.


1. db2 get dbm cfg  -> 호스트 명 설정된 내역 확인.


2. db2stop    (db2nodes.cfg 파일은 인스턴스가 실행 중일 떄 잠기므로 인스턴스를 중지시켜야 한다.)

3. (서버의 호스트 이름 변경)

4. 각 DB2 인스턴스에 대한 항목을 .rhosts 파일에 추가하십시오. 다음을 추가하여 파일을 갱신하십시오.


hostname db2instance


여기서 hostname은 데이터베이스 서버의 TCP/IP 호스트 이름이고db2instance는 데이터베이스 서버에 액세스하는 데 사용하는 인스턴스의 이름입니다. 참여하는 각 서버의 db2nodes.cfg 파일에 항목을 추가하십시오. 맨 처음 db2nodes.cfg파일에는 다음과 같은 항목이 하나 있어야 합니다.

     0 ServerA 0


이 항목은 데이터베이스 파티션 서버 번호(노드 번호), 데이터베이스 파티션 서버가 있는 서버의 TCP/IP 호스트 이름 및 데이터베이스 파티션 서버의 논리적 포트 번호를 포함합니다.


예를 들어, 각 컴퓨터의 데이터베이스 파티션 서버 및 네 개의 컴퓨터를 가진 파티션된 구성을 설치하는 경우 갱신된 db2nodes.cfg는 다음과 유사하게 표시됩니다.

     0 ServerA 0

     1 ServerB 0

     2 ServerC 0

     3 ServerD 0


5. db2start


----------------------------------------------------------------------------------------------------------------


출처 : http://www.thefillmoregroup.com/blog/?p=66


하지만 문제가 있다.

만약 설치 환경에 따라서 db2nodes.cfg 파일이 존재하지 않는 경우가 있는데

이때는 아래의 과정을 실행하면 된다.


1. I don’t find the db2nodes.cfg file.

2. I run the commands “db2set” and db2extsec, 


old_hostname: SIETE2003

new_Hostname: VS3K-MONBANCO1


->cmd

->db2cmd

->db2admin stop

->db2stop

->db2set -g DB2SYSTEM=VS3K-MONBANCO1

->db2set -g DB2_EXTSECURITY=NO

->db2set –all


->db2 list admin node directory show detail

->db2 uncatalog node SIETE200

->db2 catalog admin tcpip node VS3KMONB remote VS3K-MONBANCO1 system VS3K-MONBANCO1

->db2 update admin cfg using DB2SYSTEM VS3K-MONBANCO1

->db2 update admin cfg using SMTP_SERVER VS3K-MONBANCO1  (SMTP 서버를 설정한 경우)


–>change the hosstname


->cmd

->db2cmd

->db2admin stop

->db2extsec -a VS3K-MONBANCO1\DB2ADMNS -u VS3K-MONBANCO1\DB2USERS

->db2admin start

->db2start


----------------------------------------------------------------------------------------------------------------


DB2에 GUI client로 붙어서 사용할 수 있는 DAS server를 띄워놓은 경우라면
추가적으로 다음을 수행할 필요도 있을 수 있겠으나,
DAS를 사용하지 않는 것이 일반적인 환경이니, 참고만 하면 되겠다.

  1. db2 admin stop
  2. db2 uncatalog node <old_hostname>
  3. db2 catalog admin tcpip node <new hostname> remote <new hostname> system <new hostname>
  4. db2 update admin cfg using DB2SYSTEM <new hostname>
  5. db2 update admin cfg using SMTP_SERVER <new hostname>
  6. db2admin start
  7. Remove the entry from Control Center for the server with old hostname and then execute a server's discover with the new hostname


반응형

'DB > DB2' 카테고리의 다른 글

DB2 원격 접속하기  (0) 2014.04.04

+ Recent posts