Preparing the Database


Now we need to configure the database so that the plug-in can work with it. This requires coping some files from the plug-in's folder to the necessary SQLLIB locations.
We also need to create the schema, tables, and stored procedures necessary to run the plug-in.

Steps:

  1. Open a terminal.

  2. If DB2 has not been started yet, do so with the command, db2start. Alternatively, you can also start DB2 from the control center.

  3. If you have not yet created a database with the name that you specified in the db2auth_key.txt file, you can easily create one and issue it the name of your choice with the command:
    db2 create db (your database name here)

  4. Connect to the authentication database:
    db2 connect to (your database name here)

  5. Next, type the command:
    db2auth_preparedb.bat > out.txt 2 > &1

    This will run the batch script that prepares the DB2 database for plug-in use. It copies some plug-in files to the necessary SQLLIB locations. It also creates a schema called DB2AUTH, tables (USERS, GROUPS, GROUP_MEMBERSHIPS), and stored procedures.

  6. Check the file, out.txt, to verify that the process completed successfully.

  7. Keep the terminal open