The ALTER USER MAPPING statement is used to change the authorization ID or password that is used at a data source for a specified federated server authorization ID.
Invocation
This statement can be embedded in an application program or issued through the use of dynamic SQL statements. It is an executable statement that can be dynamically prepared. However, if the bind option DYNAMICRULES BIND applies, the statement cannot be dynamically prepared (SQLSTATE 42509).
Authorization
If the authorization ID of the statement is different than the authorization name that is mapped to the data source, then the authorization ID of the statement must include SYSADM or DBADM authority. Otherwise, if the authorization ID and the authorization name match, then no privileges or authorities are required.
Syntax
>>-ALTER USER MAPPING FOR----+-authorization-name-+-------------> '-USER---------------' >-----SERVER--server-name---------------------------------------> .-,--------------------------------------------------. V .-ADD--. | >-----OPTIONS--(----+-+------+---user-option-name--string-constant--+--+---)-> | '-SET--' | '-DROP--user-option-name------------------------' >--------------------------------------------------------------><
Description
Notes
Examples
Example 1: Jim uses a local database to connect to an Oracle data source called ORACLE1. He accesses the local database under the authorization ID KLEEWEIN; KLEEWEIN maps to CORONA, the authorization ID under which he accesses ORACLE1. Jim is going to start accessing ORACLE1 under a new ID, JIMK. So KLEEWEIN now needs to map to JIMK.
ALTER USER MAPPING FOR KLEEWEIN SERVER ORACLE1 OPTIONS ( SET REMOTE_AUTHID 'JIMK' )
Example 2: Mary uses a federated database to connect to a DB2 Universal Database for OS/390 data source called DORADO. She uses one authorization ID to access DB2 and another to access DORADO, and she has created a mapping between these two IDs. She has been using the same password with both IDs, but now decides to use a separate password, ZNYQ, with the ID for DORADO. Accordingly, she needs to map her federated database password to ZNYQ.
ALTER USER MAPPING FOR MARY SERVER DORADO OPTIONS ( ADD REMOTE_PASSWORD 'ZNYQ' )