Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (seongtaejeong at gmail.com)
홈페이지
첨부 파일
 

SQL10007N Message "-1390" could not be retrieved. Reason code: "3".

이번엔 docker로 ibmcom/db2 인스턴스를 실행했는데,

docker - ibmcom/db2 컨테이너 실행
; https://www.sysnet.pe.kr/2/0/13009

$ docker run -itd --name mydb2 --restart=always --privileged=true -p 50000:50000 -e LICENSE=accept -e DB2INST1_PASSWORD=testusr -e DBNAME=testdb -v db2db_shared:/database ibmcom/db2:11.5.7.0

접속이 안 됩니다.

DB2: IBM.Data.DB2.DB2Exception (0x80004005): ERROR [08001] [IBM] SQL10007N Message "0" could not be retrieved.  Reason code: "3".

   at IBM.Data.DB2.DB2ConnPool.Open(DB2Connection connection, String& szConnectionString, DB2ConnSettings& ppSettings, Object& ppConn)
   at IBM.Data.DB2.DB2Connection.Open()
   at WebSiteTest.DB2Test()
   at WebSiteTest.Page_Load(Object sender, EventArgs e)

직접 컨테이너에 들어가 db2 CLI로 들어가도,

# /opt/ibm/db2/V11.5/bin/db2
SQL10007N Message "-1390" could not be retrieved.  Reason code: "3".

역시나 오류가 발생합니다. (다양한 원인이 있을 수 있지만) 이런 경우 분명한 것은 DB2 인스턴스가 실행되지 않았기 때문입니다. 따라서, -d 옵션을 사용하지 말고 컨테이너가 실행 시 출력하는 메시지를 잘 봐야 합니다.

$ docker run -it --name mydb2 --restart=always --privileged=true -p 50000:50000 -e LICENSE=accept -e DB2INST1_PASSWORD=testusr -e DBNAME=testdb -v db2db_shared:/database ibmcom/db2:11.5.7.0 /bin/bash
(*) Restoring global registry file ...
(*) Previous setup has not been detected. Creating the users... 
(*) Creating users ...
useradd: warning: the home directory already exists.
Not copying any file from skel directory into it.
useradd: warning: the home directory already exists.
Not copying any file from skel directory into it.
(*) Preparing the environment before updating the instance ... 
(*) Fixing /etc/services file for DB2 ... 
(*) Fixing db2nodes file configuration ... 
rm: cannot remove 'sqllib/.ftok': Permission denied
db2ftok.C:87: Failed to generate seed, rc = 0x90000001.
SQL1652N  File I/O error occurred.
(*) Creating instance ... 
DBI1446I  The db2icrt command is running.


DB2 installation is being initialized.

 The instance home directory "/database/config/db2inst1" is invalid because it 
is not owned by the user "db2inst1". Change the ownership of the home directory 
to be owned by the instance user and its primary group.

A major error occurred during the execution that caused this program to 
terminate prematurely. If the problem persists, contact your technical service 
representative.

For more information see the DB2 installation log at "/tmp/db2icrt.log.810".
DBI1264E  This program failed. Errors encountered during execution were
      written to the installation log file. Program name:
      db2icrt. Log file name: /tmp/db2icrt.log.810.

Explanation: 

This message is returned when some processes and operations have failed.
Detailed information about the error was written to the log file.

User response: 

Contact IBM support to get assistance in resolving this issue. Keep the
log file intact as this file is an important reference for IBM support.


   Related information:
   Contacting IBM Software Support


(!) There was a problem configuring the instance. Copying over logs and traces to /database/config ...
mkdir: cannot create directory '/database/config/db2icrt': File exists


              _______   D B 2  S u p p o r t   ______


This program generates information about a DB2 server, including information
about its configuration and system environment. The output of this program
is stored in a file named 'db2support.zip'. If possible, run this program
while the problem is occurring.


For the most complete output, this utility should be invoked with root
authority. Users with more limited privileges on the system can run this tool,
however, some of the data collection actions will result in reduced reporting
and reduced output.

Output file is "/database/config/db2icrt/db2support.zip"
Time and date of this collection: 2025-11-10-07.16.53.437509

Starting collection on host 30aa29d9bf32
 Creating directory /database/config/db2icrt/DB2SUPPORT/30aa29d9bf32_IIH
Collecting resources group information
   The following file was not found or could not be executed during diagnostic
   data collection: /usr/bin/lssam
   The following file was not found or could not be executed during diagnostic
   data collection: /usr/bin/lsrsrc
   The following file was not found or could not be executed during diagnostic
   data collection: /usr/bin/lsrsrc
Collecting user identity information
Collecting current process information
Collecting active interprocess communications facilities information
Collecting system information
Collecting detailed data on system and hardware errors
   The following file was not found or could not be executed during diagnostic
   data collection: /usr/bin/errpt
Collecting registry contents
Collecting GPFS information
   The following file was not found or could not be executed during diagnostic
   data collection: /usr/lpp/mmfs/bin/gpfs.snap
Collecting configuration, log and trace information for RSCT
   The following file was not found or could not be executed during diagnostic
   data collection: /usr/bin/ctsnap
Collecting information about installed DB2 products
Collecting information about state of db2 instance
Collecting information about DB2 product prerequisites
Collecting /etc/services 
Collecting /tmp/db2icrt.log.810
Collection on host 30aa29d9bf32 completed
Compressing files in /database/config/db2icrt/DB2SUPPORT directory 
Collecting /database/config/db2icrt/db2support.log 
Collecting db2support.out 


db2support is now complete.
 An archive file has been produced: "/database/config/db2icrt/db2support.zip"

"15" warnings found during db2support collection

중간에 보면, "/database/config/db2inst1" 디렉터리를 "db2inst1" 사용자가 접근할 수 없어 문제가 발생했음을 알 수 있습니다. 즉 이런 경우가 바로 docker 볼륨 연결 시 권한 문제가 발생한 사례 중의 하나입니다.

실제로 볼륨 디렉터리의 권한을 확인하고,

$ docker volume inspect db2db_shared
[
    {
        "CreatedAt": "2025-09-29T13:54:07+09:00",
        "Driver": "local",
        "Labels": null,
        "Mountpoint": "/mnt/docker-data/docker/volumes/db2db_shared/_data",
        "Name": "db2db_shared",
        "Options": null,
        "Scope": "local"
    }
]

$ ls -l "/mnt/docker-data/docker/volumes/db2db_shared/_data"
ls: cannot access '/mnt/docker-data/docker/volumes/db2db_shared/_data': Permission denied

$ sudo ls -l "/mnt/docker-data/docker/volumes/db2db_shared/_data"
total 0
drwxr-xr-x 2 testusr testusr  66 Mar 18  2022 backup
drwxr-xr-x 7 testusr testusr 159 Nov 10 13:31 config
drwxr-xr-x 3 testusr testusr  30 Mar 18  2022 data
drwxr-xr-x 3 testusr testusr  30 Mar 18  2022 logs

저 사용자 권한을 DB2 container의 db2inst1 사용자로 맞춰야 하는데요,

// db2 컨테이너 내에서 실행한 결과

# id db2inst1
uid=1000(db2inst1) gid=1000(db2iadm1) groups=1000(db2iadm1)

따라서 docker 호스트 측의 볼륨 권한을 이렇게 변경하고,

$ sudo chown -R 1000:1000 /mnt/docker-data/docker/volumes/db2db_shared

docker run을 다시 실행해 주면 이제 정상적으로 db2 데이터베이스가 올라오게 됩니다.




혹시나 db2 인스턴스가 올라왔는데도 여전히 ERROR [08001] [IBM] SQL10007N Message "0" could not be retrieved. Reason code: "3". 오류가 계속 발생한다면? db2 접속 계정(id/pw)이 올바른지 확인해 보세요. ^^




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]







[최초 등록일: ]
[최종 수정일: 11/12/2025]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




... 31  32  33  34  35  36  37  38  39  40  41  42  43  [44]  45  ...
NoWriterDateCnt.TitleFile(s)
12961정성태2/8/202220207.NET Framework: 1151. C# - ffmpeg(FFmpeg.AutoGen)를 이용한 비디오 프레임의 크기 및 포맷 변경 예제(scaling_video.c) [7]파일 다운로드1
12960정성태2/8/202219403개발 환경 구성: 637. ffmpeg(FFmpeg.AutoGen)를 이용한 비디오 디코딩 예제(decode_video.c) - 세 번째 이야기
12959정성태2/7/202221003.NET Framework: 1150. C# - ffmpeg(FFmpeg.AutoGen)를 이용한 비디오 디코딩 예제(decode_video.c) - 두 번째 이야기 [2]파일 다운로드1
12958정성태2/6/202223767.NET Framework: 1149. C# - ffmpeg(FFmpeg.AutoGen) - 비디오 프레임 디코딩 [2]파일 다운로드1
12957정성태2/6/202221005개발 환경 구성: 636. ffmpeg.exe를 이용해 planar 포맷의 데이터를 packed 형식으로 변환하는 방법? [2]
12956정성태2/4/202222170.NET Framework: 1148. C# - ffmpeg(FFmpeg.AutoGen) - decoding 과정 [2]파일 다운로드1
12955정성태2/4/202219743개발 환경 구성: 635. 비주얼 스튜디오에서 실행하던 ASP.NET Core (.NET Framework) 응용 프로그램을 명령행에서 실행하는 방법 (2)
12954정성태2/4/202217746VS.NET IDE: 173. 비주얼 스튜디오 - Output 창에 색상이 지정된 출력 결과가 "[39m[22m" 식의 문자로 나오는 문제
12953정성태2/2/202219277Linux: 48. Windows 11 + WSL 우분투 GUI 환경에서 한글 출력
12952정성태2/2/202220771.NET Framework: 1148. C# - ffmpeg(FFmpeg.AutoGen)를 이용한 오디오 필터 예제(filter_audio.c)파일 다운로드1
12951정성태2/2/202219143.NET Framework: 1147. C# - ffmpeg(FFmpeg.AutoGen)를 이용한 오디오 필터링 예제(filtering_audio.c)파일 다운로드1
12950정성태2/1/202220832.NET Framework: 1146. .NET 6에 추가되지 않은 Generic Math (예: INumber<T>)
12949정성태2/1/202219935.NET Framework: 1145. C# - ffmpeg(FFmpeg.AutoGen) - Codec 정보 열람 및 사용 준비파일 다운로드1
12948정성태1/30/202220548.NET Framework: 1144. C# - ffmpeg(FFmpeg.AutoGen) AVFormatContext를 이용해 ffprobe처럼 정보 출력파일 다운로드1
12947정성태1/30/202220458개발 환경 구성: 634. ffmpeg.exe - 기존 동영상 컨테이너에 다중 스트림을 추가하는 방법
12946정성태1/28/202220949오류 유형: 792. .NET Core - 로컬 개발 중에 docker 호스팅으로 바꾸는 경우 SQL 서버 접근 방법
12945정성태1/28/202221202오류 유형: 791. SQL 서버 로그인 시 localhost는 되고, 127.0.0.1로는 안 되는 문제
12944정성태1/28/202224266.NET Framework: 1143. C# - Entity Framework Core 6 개요
12943정성태1/27/202224283.NET Framework: 1142. .NET 5+로 포팅 시 플랫폼 호환성 경고 메시지(SYSLIB0006, SYSLIB0011, CA1416) [1]파일 다운로드1
12942정성태1/27/202222380.NET Framework: 1141. XmlSerializer와 Dictionary 타입파일 다운로드1
12941정성태1/26/202223374오류 유형: 790. AKS/k8s - pod 상태가 Pending으로 지속되는 경우
12940정성태1/26/202218783오류 유형: 789. AKS에서 hpa에 따른 autoscale 기능이 동작하지 않는다면?
12939정성태1/25/202221892.NET Framework: 1140. C# - ffmpeg(FFmpeg.AutoGen)를 이용해 MP3 오디오 파일 인코딩/디코딩하는 예제 [1]파일 다운로드1
12938정성태1/24/202225175개발 환경 구성: 633. Docker Desktop + k8s 환경에서 local 이미지를 사용하는 방법
12937정성태1/24/202222775.NET Framework: 1139. C# - ffmpeg(FFmpeg.AutoGen)를 이용해 오디오(mp2) 인코딩하는 예제(encode_audio.c) [2]파일 다운로드1
12936정성태1/22/202221088.NET Framework: 1138. C# - ffmpeg(FFmpeg.AutoGen)를 이용해 멀티미디어 파일의 메타데이터를 보여주는 예제(metadata.c)파일 다운로드1
... 31  32  33  34  35  36  37  38  39  40  41  42  43  [44]  45  ...