A number of steps are required create explain
snapshots for static SQL or XQuery statements
Procedure
To
create an explain snapshot for a static SQL or XQuery
statement:
- If the database manager 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 the explain tables.
- From the 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 or XQuery statement
by using the EXPLSNAP option when binding or
preparing your application.
For example, issue the BIND your_file EXPLSNAP
YES command.
What to do next
For information about using the EXPLSNAP option
see the CURRENT EXPLAIN SNAPSHOT
special register, the BIND and REBIND commands,
and the EXPLAIN statement.