1

On single IBM Db2 v11.5 database server we have two databases connected with federated system. On source database there are federated definitions:

CREATE WRAPPER DRDA; CREATE SERVER myserver TYPE DB2/LUW VERSION 11.5 WRAPPER DRDA AUTHORIZATION "myuser" PASSWORD "mypassword" OPTIONS ( DBNAME 'mytargetdb' ) CREATE NICKNAME myschema.mynickname1 FOR myserver.myschema.mytable; CREATE VIEW myschema.myview AS SELECT... FROM myschema.mynickname1; ... several hundreds nicknames, views, index specifications on nicknames, authorizations on nicknames and views etc. 

Note: We are not using any USER MAPPING commands.

QUESTION: I must change userid and password that was created by CREATE SERVER command to "newuser" and "newpassword". How to change userid/password?

I know I can use DROP SERVER and CREATE SERVER again, but using DROP server all dependent objects are just dropped from database (e.g. nicknames) and I would like to avoid recreating them, because of complexity: several hundreds nicknames, views that depend on nicknames, view that depends on views and grants on those objects (maybe even something else).

I am looking at ALTER SERVER command, but I do not understand how to change userid/password.

0

1 Answer 1

1

I don't think you need to. The manual says:

AUTHORIZATION remote-authorization-name

Required only for Db2 family data sources. Specifies the authorization ID under which any necessary actions are performed at the data source when the CREATE SERVER statement is processed. This authorization ID is not used when establishing subsequent connections to the server.

If I read this correctly, the user name and password are only used once, when the server is created, and therefore they are not stored, and there's nothing to change.

1
  • Userid specified at CREATE SERVER statement is used to access remote DB when administration is performed on local DB that requires remote data, for example on local DB execute CREATE NICKNAME and DB uses this user to access remote federated DB to check remote table definitions and this table definitions are then stored in local DB for nickname. But... this userid is not used when end-user connects to local DB and executes e.g. SELECT on nickname. In this case user is connected to remote federated DB with userid connected to source DB or connects with USER MAPPING user if exists. Commented Nov 10 at 8:05

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.