To register the Data Links server with the remote DB2 UDB database where
the DATALINK data type was defined earlier:
- Log on to the system with a valid DB2 user ID that has System
Administrative (SYSADM) authority on the VALIDATE instance that you
created. By default, any user that belongs to the Local
Administrators group has SYSADM authority on an instance. For
more information, refer to your server's Quick Beginnings
manual.
- Ensure that the VALIDATE instance is the current instance by
entering the following command:
db2 get instance
This command should return the following output:
The current database manager instance is: VALIDATE
If you did not receive this output, enter the following commands:
set DB2INSTANCE=VALIDATE
db2 get instance
- Start the VALIDATE instance by entering the db2start
command.
- Register a Data Links server that will control the files that are linked
by a DATALINK data type by entering the following command:
db2 "add datalinks manager for database database_alias using node hostname port port_number"
where:
- database_alias is the database alias name of the database.
- hostname is the fully qualified hostname of the Data Links
server.
- port_number is the port number that you have reserved for
communications between the Data Links server and the DB2 server. You
specified this port number during the installation of DB2 Data Links
Manager.
For our example, enter the following command:
db2 "add datalinks manager for database staff using node dlmserver.services.com port 50100"
- Connect to the STAFF database by entering the following
command:
db2 connect to staff
- Insert an entry into the EMPLOYEE table that you created by
entering the following command:
db2 "insert into employee values (001,'Paul','Smith',==>
dlvalue('unc:\\unc_name\controlled_file'))"
where:
- unc_name is the fully qualified location of the file that is
under the control of a Data Links Filesystem Filter on the Data Links
server.
- controlled_file is the filename of the file that you want to
control on the Data Links server.
For our example, enter the following command
db2 "insert into employee values (001,'Paul','Smith',==>
dlvalue('unc:\\dlmserver.services.com\cdrive\pictures\psmith.bmp'))"
- Log out.