2017년 9월 27일 수요일

[Python] cx_Oracle CLOB, BLOB 처리

for _row in cur:
    if isinstance(elem, cx_Oracle.LOB) or isinstance(elem, cx_Oracle.CLOB) or isinstance(
elem, cx_Oracle.BLOB):
data = elem.read()

2017년 3월 8일 수요일

[python] datetime to timestamp, timestamp to datetime convert

import time
from datetime import datetime

if __name__ == '__main__':
   _now = datetime.now()
   print _now
   _timestamp = time.mktime(_now.timetuple())
   print datetime.fromtimestamp(_timestamp)

2016년 12월 22일 목요일

[Python] 기본 encoding 변경

기본 encoding을 utf-8로 변경하기 위해서 site.py 수정
def setencoding():
    encoding = "utf-8"
    .... 

[Python] Windows에 cx_Oracle 설치


  1. OS : Windows 10 64bit
  2. Python : 2.7.12, 64bit
  3. Oracle Instant Client downalod
    • http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
    • 다운로드 -> 압축해제 -> 환경변수 -> 시스템변수 -> Path 추가
  4. cx_Oracle download
    • https://pypi.python.org/pypi/cx_Oracle/5.2.1

[Python] cx_Oracle 에서 RAC connect

tnsnames.ora 파일에 정의된 string으로 cx_Oracle.connect() 을 호출한다.

import cx_Oracle
#dsn = cx_Oracle.mskedsn(HOST, PORT, service_name=SID)
dsn = open('tnsnames.ora','r').read()
con = cx_Oracle.connect(USER, PASSWORD, dsn)
cur = con.cursor() 

docker redmine 설치

docker-composer.yml version: '3.1' services:      redmine:           image: redmine           restart: always           container_na...