Test the installation

This section describes how to test the Authentication Service for IBM DB2 security plug-ins after installation. The test can be performed on the DB2 server or from a computer with DB2 client software installed.

The procedure described below shows how an Active Directory user accesses a DB2 instance. The user joe is the Active Directory user in the same zone as the DB2 computer from which the test is executed. The DB2 database instance name is db2inst1, and sample is the database.

  1. Grant the user joe access to select from a table. Log in as the instance user and run the following commands to grant user joe the right to select from the PROJECT table in the sample database:
    db2 connect to sample
    db2 GRANT SELECT on PROJECT to USER joe
    db2 terminate
  2. After joe logs in, he should set up the environment variables before connecting to the database. From the shell prompt:

    • Set the INSTHOME environment variable to the home directory of the instance user. For example, if you are using Bourne shell or equivalent, type:

      eval export INSTHOME=~db2inst1
    • Set up the database environment using the following commands.

      Bourne shell or equivalent:

      . $INSTHOME/sqllib/db2profile

      C-shell or equivalent:

      source $INSTHOME/sqllib/db2cshrc

      These commands can also be added to joe’s login script such as .cshrc or .profile.

  3. Connect to the sample database as joe using the following commands:

    • To test single sign-on, type:

      db2 connect to sample
    • To test connecting using user name and password, type:

      db2 connect to sample user joe

      You should see output similar to the following:

      Database Connection Information
      
      Database server = DB2/Linux 9.0
      SQL authorization ID = JOE
      Local database alias = SAMPLE
      
  4. Verify that the database is functioning by querying the PROJECT table:

    db2 select '*' from db2inst1.project