IBM Support

How to query Greenplum using Db2 Federation through ODBC driver?

Question & Answer


Question

How to query Greenplum using Db2 Federation through ODBC driver?

Answer

Before You Begin
 
Enable Federation feature and restart Db2 to make it effective.
db2 update dbm cfg using federated YES
Pre-Configuration on Linux, Unix
 
1. Make sure the required ODBC drivers are installed correctly.
ls sqllib/federation/odbc/lib/FOgplm*.so
 
2. Make sure the Greenplum server is accessible to Federation server.
$ telnet 9.30.104.102 5432
Trying 9.30.104.102...
Connected to 9.30.104.102.
Escape character is '^]'.
 
3. Create server, user mapping,  nickname and query the nickname.
$ create server SERVER1 type greenplum OPTIONS(host '9.30.104.102', port '5432', dbname 'template1')
$ create user mapping for user server SERVER1 options (REMOTE_AUTHID 'gpadmin', REMOTE_PASSWORD 'pivotal1')
$ create nickname test1_nk1 for server1."test1"
$ select count(*) from test1_nk1

[{"Line of Business":{"code":"","label":""},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSCAVPX","label":"Federated Server"},"ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Version(s)"}]

Document Information

Modified date:
06 May 2021

UID

ibm16431125