DB2 Data Links Manager Quick Beginnings

3. Registering the Data Links server with the DB2 UDB database

Register the Data Links server with the remote DB2 UDB database where the DATALINK data type was defined earlier:

  1. 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.
  2. 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.

  3. Start the VALIDATE instance by entering the db2start command.
  4. 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:

    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"
    
  5. Connect to the STAFF database by entering the following command:
       db2 connect to staff 
    
  6. 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:

    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'))"
    
  7. Log out.


[ Top of Page | Previous Page | Next Page ]