Federation - SSL from cloud to cloud database
Federation allows you to communicate with one or more local or remote databases.
The following steps are required to configure the federation system:
- Database and host name layout
- Create the wrapper
- Create the server for a remote database
- Create the user mapping
- Create a nickname
Database and host name layout
Target database where the remote table must show:
Hostname : <target_host_name>
DB2 Version: v11.5
Database Name: BLUDB
Schema Name: <schema_name>
Remote database where the table is present:
Hostname : <remote_host_name>
DB2 Version: v11.5
Service/Port Number: <port>
User: <remote_user>
Password: <remote_password>
Database Name: BLUDB
Schema Name: TESTDB
Table Name: TEST1
Create a wrapper
Create a wrapper by running the following command from the console of the target database instance:
create wrapper drdawrapper library 'libdb2drda.so' options(DB2_FENCED 'Y')
DB20000I The SQL command completed successfully.
Create the server for a remote database
Create a server to host the remote database by running the following command from the console of the target database instance:
create server fed_server type DB2/UDB version 11 wrapper drdawrapper authorization "<remote_user>" PASSWORD "<remote_password>" options(host '<remote_host_name>', port '<port>', dbname 'bludb', security 'SSL', password 'y')
DB20000I The SQL command completed successfully.
Create the user mapping
Create the user mapping by running the following command from the console of the target database instance:
create user mapping for user server fed_server OPTIONS (remote_authid '<remote_user>', remote_password '<remote_password>')
DB20000I The SQL command completed successfully.
Create a nickname
Create a nickname for the remote database and test the nickname by running the following commands from the console of the target database instance:
create nickname rmttest1 FOR fed_server.testdb.test1
DB20000I The SQL command completed successfully.
select * from rmttest1
C1 C2
----------- -----------
13 32
1 record(s) selected.