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.
-
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 sampledb2 GRANT SELECT on PROJECT to USER joe
db2 terminate
-
After joe logs in, he should set up the environment variables before connecting to the database. From the shell prompt:
-
Set the
INSTHOMEenvironment 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/db2profileC-shell or equivalent:
source $INSTHOME/sqllib/db2cshrc
These commands can also be added to joe’s login script such as
.cshrcor.profile -
-
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 joeYou should see output similar to the following:
Database Connection InformationDatabase server = DB2/Linux 9.0
SQL authorization ID = JOE
Local database alias = SAMPLE
-
-
Verify that the database is functioning by querying the
PROJECTtable:db2 select '*' from db2inst1.project