Default name and location of the explain output file on UNIX

When you issue the SET EXPLAIN ON statement, the plan that the optimizer chooses for each subsequent query is written to the explain output file.

If the explain output file does not exist when you issue SET EXPLAIN ON, the database server creates the file. If the explain output file already exists when you issue the SET EXPLAIN ON statement, subsequent output is appended to the file.

Default name of the explain output file

Explain output files generated by a SET EXPLAIN statement and explain files generated by onmode -Y have different default names. Explain output filenames for mapped users are different than the explain output filenames for OS users, as well. The following table shows the default names:
Table 1. Default explain output file names.
User and generation type File name
Regular user and SET EXPLAIN sqexplain.out
Mapped user and SET EXPLAIN username_sqexplain.out
Regular user and onmode -Y sqexplain.out.session_id
Mapped user and onmode -Y username_sqexplain.out.session_id

Default location of the explain output file

If the client application and the database server are on the same computer, the output file is stored in your current directory. If you are using a version 5.x or earlier client application and the output file does not appear in the current directory, check your home directory for the file. When the current database is on another computer, the output file is stored in your home directory on the remote host.

For a mapped user without a home directory, the explain output file is stored in $ONEDB_HOME/users/server_svrnum/uid_uid.

For a mapped user with a home directory, remote clients' explain output files are stored in the user's home directory, and local clients' explain output files are stored in the user's current working directory.