우분투 cx_Oracle 설치

우분투 cx_Oracle 설치

cx_Oracle 을 설치 하기위해서는 Python.h 헤더 파일이 필요하다.
python-dev  패키지를 설치 하면 된다.
1) sudo apt-get install python-dev
2) Python installer 설치
sudo apt-get install python-setuptools
3)sudo -E easy_install cx_Oracle
-E 옵션을 주지 않으면 ORACLE_HOME 같은 환경 변수가 설치 쉘로 전달되지 않는다.

cx_Oracle 사용법 
방법1)tns 접속
connection = cx_Oracle.connect(user,password,tns)          <-tns ervice="" p="" tnsname="">
cursor=connection.cursor()
방법2)direct 접속
dsn=cx_Oracle.makedsn(host,port,sid)
connection = cx_Oracle.connect(user,password,dsn)
cursor=connection.cursor()


만일 아래와 같은 에러가 떨어지면.....
ImportError: libaio.so.1: cannot open shared object file: No such file or directory

sudo apt-get install -y libaio-dev
libaio-dev 을 설치 해주면 됨 
[출처] [cx_Oracle]Oracle 접속하기|작성자 

댓글

이 블로그의 인기 게시물

구어체 표현 85가지

Debian Lenny install-including wireless