db2 catalog tcpip node $REMOTE_DB_NODE remote $REMOTE_IP server $REMOTE_PORT
db2 catalog db $REMOTE_DB as $REMOTE_ALIAS at node $REMOTE_DB_NODE
db2 "create server $REMOTE_SERVER type DB2/UDB version '9.5' wrapper drda authorization \"$REMOTE_USER\" PASSWORD \"$REMOTE_PASSWD\" options( add dbname '$REMOTE_DB', DB2_TWO_PHASE_COMMIT 'Y')"
db2 "CREATE USER MAPPING FOR $USER1 SERVER assetv OPTIONS (REMOTE_AUTHID '$REMOTE_USER', REMOTE_PASSWORD '$REMOTE_PASSWD')"
db2 "CREATE USER MAPPING FOR $USER2 SERVER assetv OPTIONS (REMOTE_AUTHID '$REMOTE_USER2', REMOTE_PASSWORD '$REMOTE_USER2')"
db2 "CREATE USER MAPPING FOR $INSTANCE_OWNER SERVER assetv OPTIONS (REMOTE_AUTHID '$REMOTE_OWNER', REMOTE_PASSWORD '$REMOTE_OWNER_PASS')"
db2 CREATE NICKNAME $SCHEMA.$LOCAL_TAB FOR $REMOTE_SERVER.$REMOTE_SHEMA.$REMOTE_TAB
db2 "grant select,update,insert,delete on $SCHEMA.$LOCAL_TAB to user $USER1"