0
我一直在使用derby作爲配置單元存在一段時間。 有沒有辦法將metastore遷移到Postgresql。如何將配置單元格derby metastore遷移到postgres metastore
我使用Apache蜂巢 - 0.13
我一直在使用derby作爲配置單元存在一段時間。 有沒有辦法將metastore遷移到Postgresql。如何將配置單元格derby metastore遷移到postgres metastore
我使用Apache蜂巢 - 0.13
到目前爲止,我已經找到了最好的方法是如下:
**Export from existing database**
Use the derby tool 'ij' (assuming you are placed in the root installation folder for the pillar):
java -cp lib/derby-10.10.1.1.jar:lib/derbytools-10.10.1.1.jar:lib/derbyclient-10.10.1.1.jar org.apache.derby.tools.ij
Then run the following commands to extract the content of the somedb database:
CONNECT 'jdbc:derby:/path/to/somedb'
CALL SYSCS_UTIL.SYSCS_EXPORT_TABLE(null, 'TABLE1', 'table1', null, null, null);
This should create the file: 'table1'.
**Import the data to the PostgreSQL database**
Run the 'psql' application on the console/terminal.
Log onto somedb and ingest data (and fix the automated sequences)
\c somedb
COPY table1 FROM '/path/to/table1' with csv;
SELECT SETVAL('table1_guid_seq', (SELECT MAX(guid) FROM table1));
重複此要從德比導出和導入PostgreSQL的所有表。