Enabling access to the external user mapping repository
After you create a user mapping plug-in, you must set the DB2_UM_PLUGIN and DB2_UM_PLUGIN_LANG options to enable the federated server to access the user mappings that are stored in the external repository.
About this task
You can set the options at the wrapper or server level, but you must set both options at the same level. DB2_UM_PLUGIN specifies the name of the plug-in, and DB2_UM_PLUGIN_LANG specifies the language in which the plug-in is written. The two options are dependent on each other. Therefore, you must add DB2_UM_PLUGIN before you add DB2_UM_PLUGIN_LANG. If you add both options in the same statement, the order in which you specify them does not matter. To drop the options, you must drop DB2_UM_PLUGIN_LANG before you drop DB2_UM_PLUGIN.
For example, the following statements use the
name of the sample plug-in to create wrapper w1, alter wrapper w2,, create
server s1 and alter server s2 to use the user mapping plug-in:
CREATE WRAPPER w1 LIBRARY 'libdb2drda.a'
OPTIONS
(DB2_UM_PLUGIN 'fsumplugin_file.a', DB2_UM_PLUGIN_LANG 'C');
ALTER WRAPPER w2
OPTIONS
(ADD DB2_UM_PLUGIN 'fsumplugin_file.a', ADD DB2_UM_PLUGIN_LANG 'C');
CREATE SERVER s1 TYPE db2/cs VERSION 10 WRAPPER w2
AUTHORIZATION remoteID PASSWORD p4ssw0rd
OPTIONS
(NODE 'node1',
DBNAME 'db1',
DB2_UM_PLUGIN 'fsumplugin_file.a',
DB2_UM_PLUGIN_LANG 'C');
ALTER SERVER s2
OPTIONS
(ADD DB2_UM_PLUGIN 'fsumplugin_file.a', ADD DB2_UM_PLUGIN_LANG 'C');