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 primary group of the
instance owner has SYSADM authority on an instance. For more
information, refer to your server's Quick Beginnings
manual.
- Run the db2profile or db2cshrc script as
follows:
. INSTHOME/sqllib/db2profile (for bash, Bourne or Korn shell)
source INSTHOME/sqllib/db2cshrc (for C shell)
where INSTHOME is the home directory of the instance
owner.
- 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 one of the following commands:
db2 "add datalinks manager for database database_alias==>
using node hostname port port_number" //JFS
-OR-
db2 "add datalinks manager for database database_alias using==>
cell cell-name dlminstance instance-name" //DCE-DFS
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.
- cell-name is the name of the DCE cell where Data Links has been
installed.
- instance-name is the name of the DLMADMIN instance for this DCE
cell.
For our JFS example, enter the following command:
db2 "add datalinks manager for database staff using==>
node dlmserver.services.com port 50100"
For our DCE-DFS example, enter the following command:
db2 "add datalinks manager for database staff using==>
cell services.com dlminstance dlmadmin"
- 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('http://hostname/controlled_file'))"
where:
- hostname is the fully qualified hostname of the Data Links
server.
- controlled_file is the full pathname of the file that you want to
control on the Data Links server.
In DCE-DFS environments, replace the URL used in these examples with
dfs://.../cellname/fs/...In
our example, enter the following command:
db2 "insert into employee values (001,'Paul','Smith',==>
dlvalue('dfs://.../services.com/test/pictures/psmith.bmp'))"
- Log out.