DBA/Postgresql

orafce 설치 및 적용

da-dba 2024. 7. 29. 16:15

Postgresql에서 Oracle 함수 사용하려면 orafce extension을 설치하면됨.

 

# 참고 - https://github.com/orafce/orafce 

 

GitHub - orafce/orafce: The "orafce" project implements in Postgres some of the functions from the Oracle database that are miss

The "orafce" project implements in Postgres some of the functions from the Oracle database that are missing (or behaving differently).Those functions were verified on Oracle 10g, and the ...

github.com

 

1) 
yum install orafce_버전 

2) extension 설치 
CREATE EXTENSION orafce;

 

설치하면 아래와 같이 oracle스키마가 생성되고 하위 Function에 Oracle의 함수가 자동 생성됨. 

 

 

함수를 사용하려면 다음과 같이 oracle.add_months 와 같이 "oracle."을 붙여줘야하는 불편함이 있음.

"oracle."을 붙이지 않고 사용하려면 아래와 같이 해주면됨.

SET search_path TO oracle, public;

 

※ 이 명령은 'oracle' 스키마를 먼저 검색한 다음 'public' 스키마를 검색하도록 검색 경로를 설정합니다.

 

이렇게 하면.. 아래와 같이 사용가능함.

기존 : oracle.add_months 

변경 : add_months 

'DBA > Postgresql' 카테고리의 다른 글

유휴 세션 정리  (0) 2024.08.28
테이블 정의서 추출  (0) 2024.08.07
DB간 테이블 복제(실시간)  (0) 2024.07.26
pg_stat_statements 활용(통계 정보)  (0) 2024.07.26
PostgreSQL 에러 코드  (3) 2024.07.24