Follow these steps to create an explain
snapshot for a static SQL statement:
- 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. For example, to connect to the SAMPLE database, issue the
connect to sample command.
- Create an explain snapshot for a static SQL statement by using the
EXPLSNAP option when binding or preparing your application. For
example, issue the BIND your file EXPLSNAP YES command.
- Optional. To view the access plan graph for the snapshot, refresh
the Explained Statements History window (available from the Control Center),
and double-click on the snapshot.
For information about using the EXPLSNAP option for equivalent APIs, see
the sections for each of these in the Embedded SQL Programming
Guide.