ChannelDB2

One case for SQL1101N error in Federation Server

Problem
--login to system as user 1
[root@aixdb2]# su - user1

$ db2 connect to feddb

CREATE WRAPPER "DRDA"
LIBRARY 'libdb2drda.a'
OPTIONS (DB2_FENCED 'N'
);
CREATE SERVER "S"
TYPE DB2/AIX
VERSION '9.7'
WRAPPER "DRDA"
OPTIONS
(DBNAME 'RDB');
--define user mapping for user1.
CREATE USER MAPPING FOR USER --> USER here means current user
SERVER "S"
OPTIONS
(REMOTE_AUTHID 'ruser'
,REMOTE_PASSWORD 'password');
CREATE NICKNAME nick1 FOR "S"."ruser"."t1";


[root@aixdb2]# su - user2
$ db2 connect to feddb
$ db2 "select * from nick1"
A1
-----------
SQL1101N Remote database "RDB" on node "" could not be accessed with
the specified authorization id and password. SQLSTATE=08004


Explanation

Federation Server determines remote datasource server credentials(authid/password) by below sequence:
1. if USER MAPPING exists, use USER MAPPING to get remote authid and password
2. if no user mapping for local authid , use inbound authid and password - that is, authid and password used to connect to Federated DB.
But inbound credential is only available when you explicitly designate it by "CONNECT to USER using ".

In the above SQL1101N error case:
1. no USER MAPPING is defined for user2.
2. no inbound credential available when connect to feddb.

So user2 and a null password are used to connect to RDB.Therefore it fails with SQL1101N.


How to fix
Option 1: CREATE USER MAPPING for user2
Option 2: If If user2 and its password can be authetciated to connect to RDB, explicitly put credential when connect to FEDDB:
connect to feddb user user2 using password

Views: 2169

Comment

You need to be a member of ChannelDB2 to add comments!

Join ChannelDB2

Featured Downloads

Try BLU Acceleration on Cloud

© 2019   Created by channeldb2.   Powered by

Badges  |  Report an Issue  |  Terms of Service