>>-db2expln---+--------------+--+--------------------+----------> '--c--creator--' '--d--database name--' >--+-----------------------+--+-----+--+----+-+-----+--+-----+--> '--e--escape character--' '--g--' +--h-+ '--i--' '--l--' '--?-' >--+-------------------------+-+------------------------+------>< +--o--output file---------+ '--u--user ID--password--' +-+-------------------+---+ | '--p--package name--' | +-+---------------------+-+ | '--s--section number--' | | .--t-. | '-+----+------------------' |
Where:
If you do not specify this option, you will be prompted for it.
You may specify the creator name using the pattern matching characters, percent sign (%) and underscore (_) that may be used in a LIKE predicate.
If you do not specify this option, you will be prompted for it.
For example, the db2expln command to explain the package TESTID.CALC% is db2expln -c TESTID -p CALC%. However, this command would also explain any other plans that start with CALC. To explain just the TESTID.CALC% package, you must use an escape character. By changing the command to read: db2expln -c TESTID -e ! -p CALC!% you specify that the ! character will be used as an escape character and !% is interpreted as the % character.
If you specify -o without a file name, you will be prompted for a file name. The default file name is db2expln.out.
If you do not specify this option you will be prompted to provide it.
You may specify the package name using the pattern matching characters, percent sign (%) and underscore (_) that can be used in a LIKE predicate.
If you do not specify this option you will be prompted to provide it.
Section numbers can be found by querying the system catalog SYSCAT.STATEMENTS (See Appendix J. "Catalog Views" for a description of the system catalog tables.)
If you do not specify -o or -t, you will be prompted for a file name, with the default displaying the output at the terminal.
Both the user id and password must be valid according to naming conventions and be recognized by the database.
Some of the option flags above may have special meaning to your operating system and, as a result, may not be interpreted correctly in the db2expln command line. However, it may be possible to enter these characters by preceding them with an escape character. For more information, see your operating system user's manual.
Help and initial status messages, produced by db2expln, are written to standard output. All prompts and other status messages produced by the explain tool are written to standard error. Explain text is written to standard output or to a file depending on the output option chosen.
With the -p and -c options, multiple plans can be explained with one invocation of explain by specifying string constants for packages and creators with LIKE patterns. That is, the underscore (_) may be used to represent a single character, and the percent sign (%) may be used to represent the occurrence of zero or more characters.
For example, to explain all sections for all packages in a database named SAMPLE, with the results being written to the file my.exp, enter
db2expln -d SAMPLE -p % -c % -s 0 -o my.exp