Prepare
- AgensGraph install (MongoFDW POSTING inside) https://jhs9396.github.io/2018-12-19-post1/
- OracleFDW to AgensGraph https://jhs9396.github.io/2018-12-25-post5/
ORACLE DATA SETTING
- Creating remote oracle server user, table
- I is named table that is ‘fdw’, user ‘test’
3. Oracle FDW SERVER setting
- FOREIGN DATA WRAPPER SERVER creating
CREATE SERVER oracle_server FOREIGN DATA WRAPPER oracle_fdw
OPTIONS (dbserver '//host:port/sid');
- host : your oracle server host ip address
- port : your oracle server port (default : 1521)
- sid : your oracle server service name
4. USER GRANT USAGE ON
GRANT USAGE ON FOREIGN SERVER oracle_server TO test;
- oracle_server : oracle fdw server name
- test : your AgensGraph User name
5. ORACLE SERVER USER MAPPING
CREATE USER MAPPING FOR test SERVER oracle_server
OPTIONS(user 'test', password 'test');
- test : AgensGraph user
- oracle_server : AgensGraph oracle_fdw server name
- user ‘test’ : Oracle user name
- password ‘test’ : Oracle user password
6. Creating AgensGraph FOREIGN TABLE
- column, type is sync to oracle table.
CREATE FOREIGN TABLE o_table (
name text,
age int
) SERVER oracle_server OPTIONS (schema 'TEST', table 'FDW');
- o_table : foreign table name
** schema , table must be named UPPER CASE.
- ‘test’ -> ‘TEST’
- ‘fdw’ -> ‘FDW’
7. result
- If you succeed foreign table ‘SELECT’, oracle_fdw end