DB2 Data Links Manager Quick Beginnings

5. Verifying the sample file is accessible

Finally, we will verify that the psmith.bmp sample file can be accessed while it is under the control of the Data Links File Manager. To do this, we will first need to generate an access token on the DB2 UDB server:

  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 Local Administrators group has SYSADM authority on an instance. For more information, refer to your server's Quick Beginnings manual.
  2. 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
    
  3. Start the VALIDATE instance by entering the db2start command.
  4. Connect to the STAFF database by entering the following command:
       db2 connect to staff 
    
  5. Select the controlled file for update by issuing an SQL SELECT statement. For more information, refer to the SQL Reference.

    For our example, enter the following command:

       db2 "select dlurlpath(picture) from employee where lname = 'Smith'"
    
    This command will return the full pathname with an access token of the form:
       unc_name\access_token;controlled_filename
    

    where:

    For our example, the access token that you receive will be similar to the following:

       \cdrive\pictures\HVJ5NXGC0WQ.I5KKB6;psmith.bmp
    

    This key will be used to read this file on the Data Links server.
    Note:This access token is only valid for 60 seconds. This means that once you enter this command, you will only have 60 seconds to complete the remaining steps in this section (or edit any Data Links controlled file). You can change the default expiration time by changing the DL_EXPINT database configuration parameter.

    To change the default expiration time for an access token to 10 minutes (the value is entered in seconds), enter the following commands:

       db2 update db cfg for staff using dl_expint 600
       db2 terminate
       db2 connect to database staff
    

    If you change a setting for any database configuration parameter, you must always reconnect to the database for the changes to take effect. For more information on database configuration file parameters, refer to the Administration Guide.

  6. Log out.


[ Top of Page | Previous Page | Next Page ]