SlideShare a Scribd company logo
3
Most read
8
Most read
15
Most read
DB2PG
- 비용절감?
- 정책 이슈
- 성능, 기능이슈
- 사용상의 편의성
- Cloud등으로의 환경변화
- 기타 등등 . . .
- Oracle이외의 DB는 어떤 tool로?
- ora2pg의 성능(대용량)
- Perl engineer? NO, java engineer? Yes
- 수작업 ㅠㅠ
- 국가정보자원관리원 Project진행
- 2016. 05월 사내 Project로 시작
- 2017. 03월 Oracle Spatial data 지원
- 2017. 10월 MS-SQL 지원
- 2018. 05월 공개SW 기술개발 지원사업 참여
- 2018. 06월 OpenSource화 결정 및 Github
- 2018. 10월 Oracle, DB2, MS-SQL, Sybase,
Mysql지원
- 제품별 데이터 구조의 호환성
- GIS데이터와 같은 특수한 데이터 변환
- DB별 개성적인 DDL
- Resource 부족(개발자, DBA)
- PostgreSQL 시장확대
- 공개SW 기술개발 지원사업 참여
- 개발자의 참여 유도(능력자필요)
- K4M value up!
[Pgday.Seoul 2018]  이기종 DB에서 PostgreSQL로의 Migration을 위한 DB2PG
DBMS DDL Extract Data Migration
Oracle Yes Yes
MS-SQL Yes Yes
DB2 Yes
Sybase Yes
Mysql Yes Yes
cubrid, altibase Soon
- Schema
- Tables
- Primary key
- Unique
- Foreign Key
- View
- Sequence
- Index
Github
db2pg /
/ Images /
/ setting / convert_map.json
/ setting / mapper / MetaExtractMapper.xml
/ src/main/java : java source
/db2pg/setting/
1 {
2 "comment": {
3 "postgres": "#",
4 "mysql": [
5 "--"
6 ]
7 },
8 "string": {
9 "postgres": "'",
10 "mysql": [
11 """
12 ]
13 },
14 "classify_string": {
15 "postgres": """,
16 "mysql": [
17 "`"
18 ]
19 },
20 "integer_case_1": {
21 "postgres": "SMALLINT",
22 "mysql": [
23 "^(?i)TINYINTs*(?[0-9]*)s*UNSIGNED?$",
24 "^(?i)SMALLINT$(?[0-9]*)?$",
25 "^(?i)TINYINTs*(?[0-9]*)?$"
26 ],
27 "mss": [
28 "^(?i)TINYINT$"
29 ]
각 DB별
Data Type
변환 방식을
설정
/db2pg/setting/mapper/
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE mapper
3 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
6 <mapper namespace="com.k4m.experdb.db2pg.mapper.MetaExtractMapper">
7
8 <resultMap id="getColumnListResult" type="com.k4m.experdb.db2pg.common.LowerKeyMap">
9 <result property="ORDINAL_POSITION" column="ORDINAL_POSITION" />
10 <result property="COLUMN_NAME" column="COLUMN_NAME" />
11 <result property="COLUMN_TYPE" column="COLUMN_TYPE" />
12 <result property="COLUMN_DEFAULT" column="COLUMN_DEFAULT" jdbcType="VARCHAR" javaType="java.lang.String" />
13 <result property="IS_NULL" column="IS_NULL" />
14 <result property="COLUMN_COMMENT" column="COLUMN_COMMENT" />
15 <result property="NUMERIC_PRECISION" column="NUMERIC_PRECISION" />
16 <result property="NUMERIC_SCALE" column="NUMERIC_SCALE" /> </resultMap>
17
18 <resultMap id="getViewInformResult" type="com.k4m.experdb.db2pg.common.LowerKeyMap">
19 <result property="VIEW_NAME" column="VIEW_NAME" />
20 <result property="TEXT" column="TEXT" jdbcType="VARCHAR" javaType="java.lang.String" />
21 </resultMap>
22
23 <select id="getTableNames" parameterType="map" resultType="java.lang.String" databaseId="ORA">
24 SELECT OBJECT_NAME as TABLE_NAME FROM ALL_OBJECTS
25 WHERE OWNER=#{TABLE_SCHEMA}
26 AND OBJECT_NAME NOT IN ('TOAD_PLAN_TABLE','PLAN_TABLE')
27 AND OBJECT_NAME NOT LIKE 'MDRT%'
28 AND OBJECT_NAME NOT LIKE 'MDXT%'
29 <choose>
각 DBMS별
Object
추출 Query
db2pg.config
위치 : /db2pg/src/main/java/com/k4m/experdb/db2pg/sample/
1 SRC_EXPORT=FALSE
2 PG_CONSTRAINT_EXTRACT=FALSE
3 SRC_DDL_EXPORT=FALSE
4
5 SRC_HOST=
6 SRC_USER=
7 SRC_PASSWORD=
8 SRC_DATABASE=
9 SRC_SCHEMA=
10 SRC_DB_TYPE=ORA
11 SRC_PORT=1521
12 SRC_DB_CHARSET=UTF8
13 SRC_LOB_FETCH_SIZE=1024
14 SRC_STATEMENT_FETCH_SIZE=3000
15 SRC_TABLE_SELECT_PARALLEL=1
16 SRC_TABLE_COPY_SEGMENT_SIZE=3000
17 VERBOSE=TRUE
18 #SRC_WHERE=
19 TABLE_ONLY=TRUE
20 TRUNCATE=FALSE
21 #SRC_ALLOW_TABLES=
22 #SRC_EXCLUDE_TABLES=
23 #SRC_ROWNUM=
24 TAR_HOST=
25 TAR_USER=
26 TAR_PASSWORD=
27 TAR_DATABASE=
28 TAR_SCHEMA=
29 TAR_PORT=
Source
및
Target의
Connection
info
queries.xml
위치 : /db2pg/src/main/java/com/k4m/experdb/db2pg/sample/
1 <QUERIES>
2 <QUERY>
3 <NAME></NAME>
4 <SELECT>
5 </SELECT>
6 </QUERY>
7 </QUERIES>
Query를 이용한 Migration시 설정
ora2pg vs DB2PG
ora2pg db2pg
Language perl java
Multi thread Import NO YES
DB to DB Migration NO YES
Data type Mapping file NO YES
Support DBMS 1+1(mysql) 5
DB2PG fast than ora2pg at lease 2
GPL v3
https://github.com/experdb/eXperDB-DB2PG
facebook : https://www.facebook.com/experdb
naver cafe : http://cafe.naver.com/psqlmaster
[Pgday.Seoul 2018]  이기종 DB에서 PostgreSQL로의 Migration을 위한 DB2PG
- Support Partition table
- cubrid data migration
- altibase data migration
- Everything you want!!(wish)
능력자분들의 많은 참여 부탁 드립니다.
Q & A

More Related Content

PPTX
PostgreSQL Database Slides
PDF
PostgreSQL Deep Internal
PDF
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
PDF
[Pgday.Seoul 2017] 2. PostgreSQL을 위한 리눅스 커널 최적화 - 김상욱
PDF
High Availability PostgreSQL with Zalando Patroni
PDF
[pgday.Seoul 2022] PostgreSQL구조 - 윤성재
PPTX
[DevGround] 린하게 구축하는 스타트업 데이터파이프라인
PDF
[Pgday.Seoul 2020] SQL Tuning
PostgreSQL Database Slides
PostgreSQL Deep Internal
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
[Pgday.Seoul 2017] 2. PostgreSQL을 위한 리눅스 커널 최적화 - 김상욱
High Availability PostgreSQL with Zalando Patroni
[pgday.Seoul 2022] PostgreSQL구조 - 윤성재
[DevGround] 린하게 구축하는 스타트업 데이터파이프라인
[Pgday.Seoul 2020] SQL Tuning

What's hot (20)

ODP
PostgreSQL Administration for System Administrators
PDF
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
PDF
PostgreSQL 공간관리 살펴보기 이근오
PDF
[Pgday.Seoul 2021] 1. 예제로 살펴보는 포스트그레스큐엘의 독특한 SQL
PPTX
Airflow를 이용한 데이터 Workflow 관리
PDF
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
PPTX
REST API 설계
PDF
Custom DevOps Monitoring System in MelOn (with InfluxDB + Telegraf + Grafana)
PDF
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
PDF
[Pgday.Seoul 2017] 8. PostgreSQL 10 새기능 소개 - 김상기
PDF
[2018] MySQL 이중화 진화기
PDF
[오픈소스컨설팅]Zabbix Installation and Configuration Guide
PDF
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
PDF
[NDC18] 야생의 땅 듀랑고의 데이터 엔지니어링 이야기: 로그 시스템 구축 경험 공유
PDF
[pgday.Seoul 2022] PostgreSQL with Google Cloud
PDF
Naver속도의, 속도에 의한, 속도를 위한 몽고DB (네이버 컨텐츠검색과 몽고DB) [Naver]
PDF
Percona server for MySQL 제품 소개
PDF
[Pgday.Seoul 2017] 7. PostgreSQL DB Tuning 기업사례 - 송춘자
PDF
MySQL GTID 시작하기
PDF
Little Big Data #1. 바닥부터 시작하는 데이터 인프라
PostgreSQL Administration for System Administrators
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
PostgreSQL 공간관리 살펴보기 이근오
[Pgday.Seoul 2021] 1. 예제로 살펴보는 포스트그레스큐엘의 독특한 SQL
Airflow를 이용한 데이터 Workflow 관리
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
REST API 설계
Custom DevOps Monitoring System in MelOn (with InfluxDB + Telegraf + Grafana)
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
[Pgday.Seoul 2017] 8. PostgreSQL 10 새기능 소개 - 김상기
[2018] MySQL 이중화 진화기
[오픈소스컨설팅]Zabbix Installation and Configuration Guide
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
[NDC18] 야생의 땅 듀랑고의 데이터 엔지니어링 이야기: 로그 시스템 구축 경험 공유
[pgday.Seoul 2022] PostgreSQL with Google Cloud
Naver속도의, 속도에 의한, 속도를 위한 몽고DB (네이버 컨텐츠검색과 몽고DB) [Naver]
Percona server for MySQL 제품 소개
[Pgday.Seoul 2017] 7. PostgreSQL DB Tuning 기업사례 - 송춘자
MySQL GTID 시작하기
Little Big Data #1. 바닥부터 시작하는 데이터 인프라
Ad

More from PgDay.Seoul (19)

PDF
[pgday.Seoul 2022] POSTGRES 테스트코드로 기여하기 - 이동욱
PDF
[Pgday.Seoul 2020] 포스트그레스큐엘 자국어화 이야기
PDF
[Pgday.Seoul 2019] AppOS 고성능 I/O 확장 모듈로 성능 10배 향상시키기
PDF
[Pgday.Seoul 2019] Advanced FDW
PDF
[Pgday.Seoul 2018] PostgreSQL 11 새 기능 소개
PDF
[Pgday.Seoul 2018] PostgreSQL 성능을 위해 개발된 라이브러리 OS 소개 apposha
PDF
[Pgday.Seoul 2018] PostgreSQL Authentication with FreeIPA
PDF
[Pgday.Seoul 2018] AWS Cloud 환경에서 PostgreSQL 구축하기
PDF
[Pgday.Seoul 2018] Greenplum의 노드 분산 설계
PDF
[Pgday.Seoul 2018] replacing oracle with edb postgres
PDF
[Pgday.Seoul 2017] 6. GIN vs GiST 인덱스 이야기 - 박진우
PDF
[Pgday.Seoul 2017] 5. 테드폴허브(올챙이) PostgreSQL 확장하기 - 조현종
PDF
[Pgday.Seoul 2017] 1. PostGIS의 사례로 본 PostgreSQL 확장 - 장병진
PDF
[Pgday.Seoul 2017] 4. Composite Type/JSON 파라미터를 활용한 TVP구현(with C#, JAVA) - 지현명
PDF
[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오
PDF
PostgreSQL 9.6 새 기능 소개
PDF
pg_hba.conf 이야기
PDF
Pgday bdr 천정대
PPTX
Pg report 20161010_02
[pgday.Seoul 2022] POSTGRES 테스트코드로 기여하기 - 이동욱
[Pgday.Seoul 2020] 포스트그레스큐엘 자국어화 이야기
[Pgday.Seoul 2019] AppOS 고성능 I/O 확장 모듈로 성능 10배 향상시키기
[Pgday.Seoul 2019] Advanced FDW
[Pgday.Seoul 2018] PostgreSQL 11 새 기능 소개
[Pgday.Seoul 2018] PostgreSQL 성능을 위해 개발된 라이브러리 OS 소개 apposha
[Pgday.Seoul 2018] PostgreSQL Authentication with FreeIPA
[Pgday.Seoul 2018] AWS Cloud 환경에서 PostgreSQL 구축하기
[Pgday.Seoul 2018] Greenplum의 노드 분산 설계
[Pgday.Seoul 2018] replacing oracle with edb postgres
[Pgday.Seoul 2017] 6. GIN vs GiST 인덱스 이야기 - 박진우
[Pgday.Seoul 2017] 5. 테드폴허브(올챙이) PostgreSQL 확장하기 - 조현종
[Pgday.Seoul 2017] 1. PostGIS의 사례로 본 PostgreSQL 확장 - 장병진
[Pgday.Seoul 2017] 4. Composite Type/JSON 파라미터를 활용한 TVP구현(with C#, JAVA) - 지현명
[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오
PostgreSQL 9.6 새 기능 소개
pg_hba.conf 이야기
Pgday bdr 천정대
Pg report 20161010_02
Ad

Recently uploaded (20)

PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Understanding Forklifts - TECH EHS Solution
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPT
Introduction Database Management System for Course Database
PPTX
Online Work Permit System for Fast Permit Processing
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
history of c programming in notes for students .pptx
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
medical staffing services at VALiNTRY
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
top salesforce developer skills in 2025.pdf
PDF
System and Network Administration Chapter 2
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
System and Network Administraation Chapter 3
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Understanding Forklifts - TECH EHS Solution
How Creative Agencies Leverage Project Management Software.pdf
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Internet Downloader Manager (IDM) Crack 6.42 Build 41
2025 Textile ERP Trends: SAP, Odoo & Oracle
Introduction Database Management System for Course Database
Online Work Permit System for Fast Permit Processing
VVF-Customer-Presentation2025-Ver1.9.pptx
history of c programming in notes for students .pptx
Odoo Companies in India – Driving Business Transformation.pdf
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
medical staffing services at VALiNTRY
How to Migrate SBCGlobal Email to Yahoo Easily
top salesforce developer skills in 2025.pdf
System and Network Administration Chapter 2
ManageIQ - Sprint 268 Review - Slide Deck
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Operating system designcfffgfgggggggvggggggggg
System and Network Administraation Chapter 3

[Pgday.Seoul 2018] 이기종 DB에서 PostgreSQL로의 Migration을 위한 DB2PG

  • 2. - 비용절감? - 정책 이슈 - 성능, 기능이슈 - 사용상의 편의성 - Cloud등으로의 환경변화 - 기타 등등 . . .
  • 3. - Oracle이외의 DB는 어떤 tool로? - ora2pg의 성능(대용량) - Perl engineer? NO, java engineer? Yes - 수작업 ㅠㅠ - 국가정보자원관리원 Project진행
  • 4. - 2016. 05월 사내 Project로 시작 - 2017. 03월 Oracle Spatial data 지원 - 2017. 10월 MS-SQL 지원 - 2018. 05월 공개SW 기술개발 지원사업 참여 - 2018. 06월 OpenSource화 결정 및 Github - 2018. 10월 Oracle, DB2, MS-SQL, Sybase, Mysql지원
  • 5. - 제품별 데이터 구조의 호환성 - GIS데이터와 같은 특수한 데이터 변환 - DB별 개성적인 DDL - Resource 부족(개발자, DBA)
  • 6. - PostgreSQL 시장확대 - 공개SW 기술개발 지원사업 참여 - 개발자의 참여 유도(능력자필요) - K4M value up!
  • 8. DBMS DDL Extract Data Migration Oracle Yes Yes MS-SQL Yes Yes DB2 Yes Sybase Yes Mysql Yes Yes cubrid, altibase Soon
  • 9. - Schema - Tables - Primary key - Unique - Foreign Key - View - Sequence - Index
  • 10. Github db2pg / / Images / / setting / convert_map.json / setting / mapper / MetaExtractMapper.xml / src/main/java : java source
  • 11. /db2pg/setting/ 1 { 2 "comment": { 3 "postgres": "#", 4 "mysql": [ 5 "--" 6 ] 7 }, 8 "string": { 9 "postgres": "'", 10 "mysql": [ 11 """ 12 ] 13 }, 14 "classify_string": { 15 "postgres": """, 16 "mysql": [ 17 "`" 18 ] 19 }, 20 "integer_case_1": { 21 "postgres": "SMALLINT", 22 "mysql": [ 23 "^(?i)TINYINTs*(?[0-9]*)s*UNSIGNED?$", 24 "^(?i)SMALLINT$(?[0-9]*)?$", 25 "^(?i)TINYINTs*(?[0-9]*)?$" 26 ], 27 "mss": [ 28 "^(?i)TINYINT$" 29 ] 각 DB별 Data Type 변환 방식을 설정
  • 12. /db2pg/setting/mapper/ 1 <?xml version="1.0" encoding="UTF-8"?> 2 <!DOCTYPE mapper 3 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 4 "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> 5 6 <mapper namespace="com.k4m.experdb.db2pg.mapper.MetaExtractMapper"> 7 8 <resultMap id="getColumnListResult" type="com.k4m.experdb.db2pg.common.LowerKeyMap"> 9 <result property="ORDINAL_POSITION" column="ORDINAL_POSITION" /> 10 <result property="COLUMN_NAME" column="COLUMN_NAME" /> 11 <result property="COLUMN_TYPE" column="COLUMN_TYPE" /> 12 <result property="COLUMN_DEFAULT" column="COLUMN_DEFAULT" jdbcType="VARCHAR" javaType="java.lang.String" /> 13 <result property="IS_NULL" column="IS_NULL" /> 14 <result property="COLUMN_COMMENT" column="COLUMN_COMMENT" /> 15 <result property="NUMERIC_PRECISION" column="NUMERIC_PRECISION" /> 16 <result property="NUMERIC_SCALE" column="NUMERIC_SCALE" /> </resultMap> 17 18 <resultMap id="getViewInformResult" type="com.k4m.experdb.db2pg.common.LowerKeyMap"> 19 <result property="VIEW_NAME" column="VIEW_NAME" /> 20 <result property="TEXT" column="TEXT" jdbcType="VARCHAR" javaType="java.lang.String" /> 21 </resultMap> 22 23 <select id="getTableNames" parameterType="map" resultType="java.lang.String" databaseId="ORA"> 24 SELECT OBJECT_NAME as TABLE_NAME FROM ALL_OBJECTS 25 WHERE OWNER=#{TABLE_SCHEMA} 26 AND OBJECT_NAME NOT IN ('TOAD_PLAN_TABLE','PLAN_TABLE') 27 AND OBJECT_NAME NOT LIKE 'MDRT%' 28 AND OBJECT_NAME NOT LIKE 'MDXT%' 29 <choose> 각 DBMS별 Object 추출 Query
  • 13. db2pg.config 위치 : /db2pg/src/main/java/com/k4m/experdb/db2pg/sample/ 1 SRC_EXPORT=FALSE 2 PG_CONSTRAINT_EXTRACT=FALSE 3 SRC_DDL_EXPORT=FALSE 4 5 SRC_HOST= 6 SRC_USER= 7 SRC_PASSWORD= 8 SRC_DATABASE= 9 SRC_SCHEMA= 10 SRC_DB_TYPE=ORA 11 SRC_PORT=1521 12 SRC_DB_CHARSET=UTF8 13 SRC_LOB_FETCH_SIZE=1024 14 SRC_STATEMENT_FETCH_SIZE=3000 15 SRC_TABLE_SELECT_PARALLEL=1 16 SRC_TABLE_COPY_SEGMENT_SIZE=3000 17 VERBOSE=TRUE 18 #SRC_WHERE= 19 TABLE_ONLY=TRUE 20 TRUNCATE=FALSE 21 #SRC_ALLOW_TABLES= 22 #SRC_EXCLUDE_TABLES= 23 #SRC_ROWNUM= 24 TAR_HOST= 25 TAR_USER= 26 TAR_PASSWORD= 27 TAR_DATABASE= 28 TAR_SCHEMA= 29 TAR_PORT= Source 및 Target의 Connection info
  • 14. queries.xml 위치 : /db2pg/src/main/java/com/k4m/experdb/db2pg/sample/ 1 <QUERIES> 2 <QUERY> 3 <NAME></NAME> 4 <SELECT> 5 </SELECT> 6 </QUERY> 7 </QUERIES> Query를 이용한 Migration시 설정
  • 15. ora2pg vs DB2PG ora2pg db2pg Language perl java Multi thread Import NO YES DB to DB Migration NO YES Data type Mapping file NO YES Support DBMS 1+1(mysql) 5 DB2PG fast than ora2pg at lease 2
  • 19. - Support Partition table - cubrid data migration - altibase data migration - Everything you want!!(wish) 능력자분들의 많은 참여 부탁 드립니다.
  • 20. Q & A