본문 바로가기
Infra/PROC

WSL 환경(UBUNTU) 에서 PROC 개발환경 구축하기

by 골든크랩 2024. 12. 13.
728x90
반응형

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 24.04.1 LTS
Release:        24.04
Codename:       noble

 

 

 

 

 

1. glibc 버전확인법

$ ldd --version
ldd (Ubuntu GLIBC 2.39-0ubuntu8.3) 2.39
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.



2. oracle instantclient 다운로드 받기

https://www.oracle.com/kr/database/technologies/instant-client/linux-x86-64-downloads.html


2.1 / 아래 oracle 디렉토리를 만들고 다운로드 받은 파일들을 모두 모아서 압축을 푼다.

압축을 풀면 아래와 같은 형태로 만들어진다.
/oracle/instantclient_23_6

설치순서 (압축만 풀어서 되는게 아님...환경도 잡아줘야 함)
2.2   instantclient-basic-linux.x64-23.6.0.24.10.zip 이걸 제일 먼저 깔아야 하나봄.
    libclntshcore.so.23.1 가 버전별로 다 깔리는듯.
    libocci.so.23.1 가 버전별로 깔리는 듯.
    jdbc도 버전별로 깔리는 듯

2.3  instantclient-sdk-linux.x64-23.6.0.24.10.zip      :
     header 파일과 샘플 파일밖에 없음. proc 없음.

2.4 instantclient-precomp-linux.x64-23.6.0.24.10.zip  : 이걸 풀어버리느 proc 가 나오지만 다음과 같은 에러가 나옴.
         env_precomp.mk 파일과 pcbcfg.cfg  pcscfg.cfg 파일등도 있음

2.5 instantclient-sqlplus-linux.x64-23.6.0.24.10.zip : 이걸 풀명 sqlplus가 나오지만 실행안됨.


3. 환경변수 설정한다.
  가) PATH
  나) LD_LIBRARY_PATH
  다) ORACLE_BASE
  라) ORACLE_HOME
  마) TNS_ADMIN
  사) ORACLE_OWNER
  아) CLASSPATH


  #####################################################
# For Oracle System
#####################################################
export ORACLE_BASE=/oracle
export ORACLE_HOME=$ORACLE_BASE/instantclient_23_6
#export ORACLE_OWNER=oracle
#export ORACLE_SID=LOFMS
export ORACLE_TERM=vt100
export TMPDIR=/tmp
export TNS_ADMIN=$ORACLE_HOME/network/admin

export NLS_LANG=KOREAN_KOREA.UTF8
export ORATAB_FAIL=TRUE
export PATH=$ORACLE_HOME:$ORACLE_HOME/sdk:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib32
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/precomp/lib

export CLASSPATH=.:$ORACLE_HOME/jdbc/lib


4. 실행오류
$ proc
proc: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
$ sqlplus
sqlplus: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory

-> libaio가 없어서 발생하는 현상으로 패키지를 먼저 찾아야 함.
1) apt search libaio
# apt search libaio
Sorting... Done
Full Text Search... Done
libaio-dev/noble 0.3.113-6build1 amd64
  Linux kernel AIO access library - development files

libaio1t64/noble 0.3.113-6build1 amd64
  Linux kernel AIO access library - shared library

이름이 바뀐 관계로 추가작업이 필요함.
apt-get install libaio1t64

/oracle/instantclient_23_6/network/admin$ ldd /oracle/instantclient_23_6/sdk/proc
        linux-vdso.so.1 (0x00007ffc07745000)
        libclntsh.so.23.1 => /oracle/instantclient_23_6/libclntsh.so.23.1 (0x00007f7f9dc84000)
        libclntshcore.so.23.1 => /oracle/instantclient_23_6/libclntshcore.so.23.1 (0x00007f7f9d810000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f7f9d804000)
        libnnz.so => /oracle/instantclient_23_6/libnnz.so (0x00007f7f9cf9e000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7f9cf99000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f7f9ceae000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f7f9cea9000)
        libaio.so.1 => not found
        libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f7f9ce96000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7f9cc84000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f7fa3d34000)
        libaio.so.1 => not found
        libaio.so.1 => not found


파일위치 찾기
# find . -name libaio.so.1t64
./usr/lib/x86_64-linux-gnu/libaio.so.1t64

링크 걸어주기기
sudo ln -s /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/libaio.so.1

OTL 컴파일을 위해서 otlv4.h 다운로드 받아야 함.
 
 위에서 복사한  env_oracle.mk 파일안에 INSTANCECLIENTSDKH 를 추가하고, 그 아래 INCLUDE에서 포함하도록 해야 oci.h 를 못찾아서 컴파일 실패하는걸
 막을수 있음.
 INSTANCECLIENTSDKH=$(I_SYM)$(ORACLE_HOME)/sdk/include
 INCLUDE=$(INSTANCECLIENTSDKH)  .....

 

env_oracle.mk 에서 아래 라인부터 모두 막아야 make 만 내려도 컴파일 된다. 안그러면 make all 을 해줘야 컴파일 됨.
#여기 주석다막음
# Exiting SRCHOME/precomp/s_precomp.mk

 

 

 

 


끝!!!


728x90
반응형

댓글