Creating the explain tables

To create explain snapshots, you must ensure that the following explain tables exist for your user ID:

To check if they exist, use the DB2 list tables command. If you would like to use Visual Explain, and these tables do not exist, you must create them using the following instructions:

  1. If DB2 has not already been started, issue the db2start command.
  2. From the DB2 CLP prompt, connect to the database that you want to use. To connect to the SAMPLE database, issue the connect to sample command.
  3. Create the explain tables, using the sample command file that is provided in the EXPLAIN.DDL file. This file is located in the sqllib\misc directory. To run the command file, go to this directory and issue the db2 -tf EXPLAIN.DDL command. This command file creates explain tables that are prefixed with the connected user ID. This user ID must have CREATETAB privilege on the database, or SYSADM or DBADM authority.