DB2 10.5 for Linux, UNIX, and Windows

Creating explain snapshots for static SQL or XQuery statements

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:

  1. If the database manager has not already been started, issue the db2start command.
  2. Ensure that explain tables exist in your database.
    To do this, follow the instructions in Creating the explain tables.
  3. 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.
  4. 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.