There are four sample snapshots that you can use to learn about Visual
Explain. To load them, follow these steps:
- If DB2 has not already been started, issue the db2start
command.
- Ensure that explain tables exist in your database. To do this,
follow the instructions in Creating explain
tables.
- From the DB2 CLP prompt, connect to the database that you want to
use. We suggest that you use the SAMPLE database. If it is not
already created, see the section on installing the SAMPLE database in the
Administration Guide.
To connect to the SAMPLE database, issue the connect to sample
command.
- To import the predefined snapshots, which are based on a sample query and are used for the examples that follow,
run the DB2 command file VESAMPL.DDL.
-
This file is located in the sqllib\samples\ve directory.
-
This file is located in the sqllib\samples\ve\inter directory.
To run the command file, go to this directory and issue the db2 -tf
VESAMPL.DDL command.
- This command file must be run using the same user ID that was used to
create the explain tables.
- This command file only imports predefined snapshots, and does not create
tables or data. To perform the tuning activities described later (for
example, CREATE INDEX and runstats), you must use a
database that has tables and data (for example, the SAMPLE database).
You are now ready to display and use the access plan
graphs.
- You can follow along interactively using the
sample snapshots provided.
- The access plan graphs shown in the illustrations may not match those for
the sample snapshots that you load from the SAMPLE database, depending on your
environment setup and the database you use.
- On statistics windows, values under the Current column may
differ from those shown in the illustrations, depending on the values in the
database you use.