oracle迁移到greenplum的方案
oracle數(shù)據(jù)庫是一種關(guān)系型數(shù)據(jù)庫管理系統(tǒng),在數(shù)據(jù)庫領(lǐng)域一直處于領(lǐng)先的地位,適合于大型項(xiàng)目的開發(fā);銀行、電信、電商、金融等各領(lǐng)域都大量使用Oracle數(shù)據(jù)庫。
greenplum是一款開源的分布式數(shù)據(jù)庫存儲解決方案,主要關(guān)注數(shù)據(jù)倉庫和BI報(bào)表及多維查詢等方面。采用了shared-nothing的大規(guī)模并行處理MPP架構(gòu)。
目前我手頭的工作是需要將oracle數(shù)據(jù)庫遷移到greenplum庫中,大概收集了一下資料。
因?yàn)間reenplum數(shù)據(jù)庫是基于postgresql的,所以可以使用oracle遷移到postgresql的方式來做。
先看一下官網(wǎng):
https://wiki.postgresql.org/wiki/Converting_from_other_Databases_to_PostgreSQL
?
?
官網(wǎng)上列舉了所有oracle遷移到pg的可用工具。帶鎖的是收費(fèi)的,不帶鎖的是開源的
本次采用的是ora2pg的工具來做。
安裝這邊就不提了,可以參照git官網(wǎng)的說明來安裝 https://github.com/darold/ora2pg
我們的目的是要將oracle的表的表結(jié)構(gòu)轉(zhuǎn)換成pg的建表語句。數(shù)據(jù)的抽取我們需要另外想辦法。
這個(gè)ora2pg工具主要是用配置文件來控制需要轉(zhuǎn)換的東西。可以單獨(dú)轉(zhuǎn)換表結(jié)構(gòu),可以導(dǎo)出數(shù)據(jù)。也可以導(dǎo)出視圖、索引、包結(jié)構(gòu)等。
主要的配置文件內(nèi)容如下:
#---------------------------------# #---------------------------------# # Set the Oracle home directory ORACLE_HOME /usr/lib/oracle/18.3/client64 # Set Oracle database connection (data source, user, password) ORACLE_DSN dbi:Oracle:host=192.168.***.***;sid=xe;port=**** ORACLE_USER *** ORACLE_PWD **** # Oracle schema/owner to use #SCHEMA SCHEMA_NAME SCHEMA TIANYA SYSTEM #-------------------------- # EXPORT SECTION (Export type and filters) #-------------------------- # Type of export. Values can be the following keyword: # TABLE Export tables, constraints, indexes, … # PACKAGE Export packages # INSERT Export data from table as INSERT statement # COPY Export data from table as COPY statement # VIEW Export views # GRANT Export grants # SEQUENCE Export sequences # TRIGGER Export triggers # FUNCTION Export functions # PROCEDURE Export procedures # TABLESPACE Export tablespace (PostgreSQL >= 8 only) # TYPE Export user-defined Oracle types # PARTITION Export range or list partition (PostgreSQL >= v8.4) # FDW Export table as foreign data wrapper tables # MVIEW Export materialized view as snapshot refresh view # QUERY Convert Oracle SQL queries from a file. # KETTLE Generate XML ktr template files to be used by Kettle. TYPE TABLE VIEW COPY # By default all output is dump to STDOUT if not send directly to PostgreSQL # database (see above). Give a filename to save export to it. If you want # a Gzip’d compressed file just add the extension .gz to the filename (you # need perl module Compress::Zlib from CPAN). Add extension .bz2 to use Bzip2 # compression. OUTPUT output2.sql # Base directory where all dumped files must be written #OUTPUT_DIR /var/tmp OUTPUT_DIR /application/ora2pg/output主要就是配置了連接oracle的信息,選擇要導(dǎo)出的類型,導(dǎo)出的文件存儲在哪個(gè)目錄下等等
目前的問題是,這寫方案都不是一鍵完成的,里面需要手工操作。并且沒有測試過這些工具的可靠性,安全性。未必能夠用于生產(chǎn)環(huán)境
?
轉(zhuǎn)載于:https://www.cnblogs.com/tianyafu/p/10550735.html
總結(jié)
以上是生活随笔為你收集整理的oracle迁移到greenplum的方案的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【模板】可持久化线段树
- 下一篇: ES6学习笔记(六)数组的扩展