To create explain snapshots, you must ensure that the following explain
tables exist for your user ID:
- EXPLAIN_INSTANCE
- EXPLAIN_STATEMENT
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:
- If DB2 has not already been started, issue the db2start
command.
- 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.
- 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.