DB2 Version 9.7 for Linux, UNIX, and Windows

db2support - Problem analysis and environment collection tool command

Collects environment data about either a client or server machine and places the files containing system data into a compressed file archive.

This tool can also collect basic data about the nature of a problem through an interactive question and answer process with the user.

Authorization

For the most complete output, this utility should be invoked by a user with SYSADM authority, such as an instance owner. Users with more limited privileges on the system can run this tool, however some of the data collection actions will result in reduced reporting and reduced output.

Required connection

None

Command syntax

Read syntax diagramSkip visual syntax diagram
>>-db2support--+-| Archive Mode |----+-------------------------><
               +-| Collection Mode |-+   
               '-| Extraction Mode |-'   

Archive Mode

|-- -A--archive path--+--------------+--------------------------|
                      '- -C--+-----+-'   
                             +-tar-+     
                             '-tgz-'     

Collection Mode

|--+-------------+---------------------------------------------->
   '-output_path-'   

>--+------------------------------------------------------------------------------+-->
   +-| event-monitor-options |----------------------------------------------------+   
   '- -aem--+---------------------------------+--+------------------------------+-'   
            '- -compenv--compilation-env-file-'  '- -tbspname--table-space-name-'     

>--+-----+--+----------------------+--+-------+----------------->
   '- -B-'  '- -cd--current degree-'  '- -cfg-'   

>--+---------------------+--+------+--+------+------------------>
   '- -cl--collect level-'  '- -cm-'  '- -co-'   

>--+----------------------+------------------------------------->
   '- -cs--current schema-'   

>--+----------------------------------------------------------------------------+-->
   |                                .- -c--+--------------------------------+-. |   
   |                                |      '- -u--userid--+---------------+-' | |   
   |                                |                     '- -p--password-'   | |   
   '- -d--database name--+-------+--+-----------------------------------------+-'   
                         '- -nco-'                                                  

>--+------------------+----------------------------------------->
   '- -extenddb2batch-'   

>--+--------------------------------------+--------------------->
   '- -fodc--+--------------------------+-'   
             '-list of FODC directories-'     

>--+----------------------------+--+-----+---------------------->
   '- -fodcpath--fodc_path_name-'  '- -F-'   

>--+---------------------+-------------------------------------->
   '- -fp--function path-'   

>--+--------------------------------------------------+--------->
   +- -global--+--------------------------------+-----+   
   |           '--dbp database_partition_number-'     |   
   |           .-,--------.                           |   
   |           V          |                           |   
   +- -host--+---hostname-+-+-------------------------+   
   |         '-all----------'                         |   
   |             .-,------------------------------.   |   
   |             V                                |   |   
   '- -member--+---member_number--|--member_range-+-+-'   
               '-all--------------------------------'     

>-- -sdir--shared directory path--+-----+----------------------->
                                  '- -h-'   

>--+---------------------+--+-----------------------+----------->
   '- -H--history period-'  '- -il--isolation level-'   

>--+-----+--+-----+--+-----+--+------+--+------+---------------->
   '- -l-'  '- -m-'  '- -n-'  '- -nc-'  '- -nl-'   

>--+---------------+--+------------------+---------------------->
   '- -o--filename-'  |       .-,------. |   
                      |       V        | |   
                      '- -ol----levels-+-'   

>--+----------------------------+------------------------------->
   '- -op--optimization profile-'   

>--+---------------------------+--+----------------+------------>
   '- -ot--optimization tables-'  '- -pf--filename-'   

>--+--------------+--+-----+--+-------------------+--+-----+---->
   '- -preupgrade-'  '- -q-'  '- -ra--refresh age-'  '- -r-'   

>--+------+--+-----+--+-------------------------+--------------->
   '- -ro-'  '- -s-'  '- -se--embedded SQL file-'   

>--+----------------+--+---------------------+------------------>
   '- -sf--SQL file-'  '- -st--SQL statement-'   

>--+--------------------+--------------------------------------->
   '- -t--time interval-'   

>--+---------------------------------------+--+-----+----------->
   '- -td--termination character delimiter-'  '- -v-'   

>--+-----+--+--------------+------------------------------------|
   '- -x-'  '- -timeout--N-'   

event-monitor-options

|-- -actevm--event-monitor-name-- -appid--application-id-------->

>-- -uowid--uow-id-- -actid--activity-id------------------------|

Extraction Mode

|--+-------------+---------------------------------------------->
   '-output_path-'   

>--+------------------------------------------+-----------------|
   '- -unzip--+-------+--compressed_file_name-'   
              +-list--+                           
              '-quiet-'                           

Note:
  1. The db2support tool collects bad query-related information only if -st, -sf, or -se options are specified. In case there is an error or trap during optimization, -cl 0 (collect level zero) should be used to collect all catalog tables and db2look table definitions without trying to explain a bad query. -aem (with -st or -sf) or event monitor options could be specified if activity event monitor related information needs to be collected as the part of optimizer collection. One of the these options must be specified to work with optimizer problems.
    Note: Every option for the optimizer collection needs to be issued with -d dbname.
    Note: If you do not specify the -F or -full option, only the db2diag.log file from the last three days are collected for the optimizer collection. If you want to collect all files in diagpath, including the full db2diag.log for the optimizer collections, you must specify the -F or -full option.
  2. In case special registers have been set to values other than the default during the statement execution, it is very important for correct problem analysis that the same values should be passed as parameters to the db2support tool.
    Note: The special register options will be ignored by db2caem collection
  3. The -global parameter has been deprecated. You can use the -member all parameter options to obtain information globally.
  4. When you run the db2support command globally in a multiple host environment, the absolute path of the file must be specified for options that take a file as input. The file must also be accessible by all hosts.

Command parameters

output_path
Specifies the path where the compressed archive file is to be created or extracted. This is the directory where user created files must be placed for inclusion in the archive, or the directory where files are extracted to when the -unzip parameter is specified. The current directory is used when this option is not specified.
-A archive_path | -archive archive_path
Starting with Fix Pack 1, this option archives all the data from the directory specified in the diagpath configuration parameter into the specified archive path. A new directory will be created in the specified archive path with the name DB2DUMP with the system hostname and timestamp appended, for example DB2DUMP_systemhostname_2009-01-12-12.01.01.

In DB2® Version 9.7 Fix Pack 4 and later fix packs, this option also archives all the data from the directory specified in the alt_diagpath configuration parameter into the specified archive path. A new directory will be created in the specified archive path with the name ALT_DB2DUMP with the system hostname and timestamp appended, for example ALT_DB2DUMP_systemhostname_2009-01-12-12.01.01. Also, files from the events/ subdirectory are archived into the ALT_EVENTS directory, and files from the stmmlog/ subdirectory are archived into the ALT_STMM directory.

This option is not available on Windows operating systems.

-aem
Specifies that the db2caem information for the SQL statement specified through -st or -sf should be collected. -aem does not support -se. The default behavior for db2support will not collect db2caem information. With this option, db2caem will create an activity event monitor in order to collect the requested information. The activity event monitor and other created tables will be cleaned up from the system.
Note: The db2support special register options will be ignored by the db2caem tool; -compenv should be used to specify the compilation environment for db2caem to use. The specified SQL statement will be executed by the db2caem tool.
-B | -basic
Restricts the collection to only optimizer information. No other information will be collected except information for the db2supp_opt.zip file. The -basic parameter must be used with the -st, -sf, or -se parameters or a syntax error will be returned.
-cd | -curdegree
Specifies the value of the current degree special register to use. The default is the value of the dft_degree database configuration parameter.
-cfg
Collect configuration information and exclude all other support-related data. This option can only be combined with the following options: -c, -connect, -d, -database, -m, -html, -n, -number, -o, -output, -p, -password, -u, -user, -v, -verbose.
Note: This command parameter is available in DB2 Version 9.7 Fix Pack 2 and later fix packs.
-cl | -collect
Specifies the value of the level of performance information to be returned. Valid values are:
0 = collect only catalogs, db2look, dbcfg, dbmcfg, db2set
1 = collect 0 plus db2exfmt, db2caem (if -aem or -actevm, -appid, -uowid, -actid are specified)
2 = collect 1 plus .db2service (this is the default)
3 = collect 2 plus db2batch
Note: If event monitor options (-actevm, -appid, -uowid, -actid) are specified without -st, -sf, or -se, the effective collection level is 1 with only db2caem information collected (no db2exfmt collection).
-cm
Specifies that if a cluster manager is installed, additional diagnostic data for all hosts in the cluster is collected. The data collected is stored in the TSA/CM folder in the generated .zip file.

On AIX® and Linux operating systems, if a cluster manager is installed, the db2support command collects diagnostic data for all hosts in the cluster by default and stores the data in the TSA folder in the generated .zip file. Specifying the -cm parameter collects additional cluster manager data that is space intensive or takes a long time to get collected.

Note: The -cm parameter is supported only on AIX and Linux operating systems.
-co
Collect catalogs for all tables in the database. The default is to only collect catalog information for the tables used in a query that has a problem.
-compenv compilation-environment-file
Specifies that the compilation environment will be used when the db2caem is executed. The compilation environment (comp_env_desc) is in BLOB data type and is specified through a file as an optional input. If the option is not provided, the default compilation environment will be used when executing db2caem.
-cs | -curschema
Specifies the value of the current schema to use to qualify any unqualified table names in the statement. The default value is the authorization ID of the current session user.
-C | -compress
Enables archive compression. By default, the archive data is compressed into a single .zip file. Archive compression is available only in archive mode and must be used with the -A parameter or a syntax error is returned.
tar
Specifies that the files are archived using the tar (tape archive) command. The tar parameter is supported only on UNIX operating systems.
tgz
Specifies that files are archived using the tar command and compressed using the gzip command. The tgz parameter is supported only on UNIX operating systems.
-d database_name | -database database_name
Specifies the name of the database for which data is being collected.
Note: In DB2 Version 9.7 Fix Pack 2 and later fix packs, by default an attempt will be made to connect to the specified database. To override this, specify the -noconnect or -nco parameter.
-nco | -noconnect
Specifies that there is no attempt to connect to the specified database.
Note: This command parameter is available in DB2 Version 9.7 Fix Pack 2 and later fix packs.
-c | -connect
Specifies that an attempt be made to connect to the specified database.
Note: In DB2 Version 9.7 Fix Pack 2 and later fix packs, this command parameter is included by default when a database is specified.
event-monitor-options
The following options uniquely identify the SQL statement for which the activity event monitor data will be collected. They must be specified together.
-actevm activity-event-monitor-name
Specifies the name of the existing activities event monitor whose activitystmt logical grouping contains the data to be collected.
-appid application-id
Specifies the application identifier (appl_id monitor element) uniquely identifying the application that issued the activities to be collected.
-uowid uow-id
Specifies the unit of work ID (uow_id monitor element) whose data is to be collected. The unit of work ID is only unique within a given application.
-actid activity-id
Specifies the activity ID (activity_id monitor element) whose data is to be collected. The activity ID is only unique within a given unit of work.
-extenddb2batch
Specifies that db2batch information for all the optimization levels specified with the -ol or -optlevel parameter are to be captured. At least one value for the -ol parameter and a -cl parameter value of 3 must be specified with the -extenddb2batch parameter or db2support will return a syntax error.
-fodc
Specifies that only the FODC directories and the db2diag log files are collected. If no directories are specified, the db2support command will show a list of all the FODC directories for you to choose from. The directories are listed in ascending chronological order, based on usage timestamps, making the most recently used directories most visible.

The db2support command can only collect the FODC directories on the physical database host from where the command was run. As such, the -global parameter will not work with -fodc.

You can specify the time interval (-t or -time) or history (-H or -history) parameters, but if a specified FODC directory is outside the specified timeframe, db2support will return an error.

You also cannot specify the archive (-A or -archive) or basic (-B or -basic) parameters when using -fodc.

Trap | Panic | BadPage | Hang | IndexError | Perf | DBMarkedBad
Specifies the category of FODC directories to collect.
list of FODC directories
A comma-separated list of existing FODC directories.
-fodcpath fodc_path_name
Specifies the full path name to an existing directory where the db2support command can search for FODC packages. The db2support command searches the following paths for collecting FODC packages:
  • The diagnostic data directory as specified by the diagpath and alt_diagpath database manager configuration parameters
  • The instance level FODCPATH settings in the DB2FODC registry variable
  • The FODCPATH settings for each member in that machine
  • The db2pdcfg setting in memory
  • The fodc_path_name specified using the db2support -fodcpath command
-F | -full
Specifies that all db2support information and optimizer-specific information are to be captured with nothing excluded.
-fp | -funcpath
Specifies value of the function path special register to be used to resolve unqualified user defined functions and types. The default value is "SYSIBM", "SYSFUN", "SYSPROC", X, where X is the value of the USER special register, delimited by double quotation marks.
-global
Specifies that db2support will also be run on remote hosts.
Note: This command parameter is available in DB2 Version 9.7 Fix Pack 2 and later fix packs. This command is deprecated in DB2 Version 9.7 Fix Pack 4 and later fix packs.
-dbp database_partition_number | -dbpartitionnum database_partition_number
Specifies that db2support will be run on the remote host of the specified database partition. If no database partition is specified with the -global option, db2support will run on all remote hosts.
-h | -help
Displays help information. When this option is specified, all other options are ignored, and only the help information is displayed.
-H history_period | -history history_period
Starting with Fix Pack 1, this option limits the data collected by db2support to a particular interval of time. The history_period variable must be specified. The history_period variable may be specified with a number and time type with an optional beginning time value separated by a colon. The available types are:
d = days
h = hours
m = minutes
s = seconds

The beginning of time value is specified in time stamp format. Time stamp format is YYYY-MM-DD-hh.mm.ss.nnnnnn where YYYY specifies a year, MM for a month of a year (01 through 12), DD for a day of a month (01 through 31), hh for an hour of a day (00 through 23), mm for minute of an hour (00 through 59), ss for the seconds of a minute (00 through 59), nnnnnn for microseconds on UNIX operating systems or milliseconds on Windows operating systems. Some or all of the fields that follow the year field may be omitted. If fields are omitted, the default values will be used. The default values are 1 for the month and day, and 0 for all other fields.

The number and time type may be positive or negative specified with + or - signs. If only a number and time type are specified the default is negative. If a number and time type are specified and a beginning time value is specified the default is positive. For example, -history 6d will collect data for the past 6 days. -history 6d:2009 will collect data for the first 6 days of 2009.

This option cannot be used with the -time or -t option.

-host
Specifies the host or hosts on which the command is issued.
all
Specifies that the command is issued on all hosts.
hostname
Specifies the host or hosts on which the command is issued. If this option is not specified, the command is issued on all hosts. If multiple hosts are specified, all host names must be valid for the command to complete.
-il | -isolation
Specifies the isolation level to use to determine how data is locked and isolated from other processes while the data is being accessed. By default, the CURRENT ISOLATION special register is set to blanks.
-l | -logs
Specifies that active logs are to be captured.
-m | -html
Specifies that all system output is dumped into HTML formatted files. By default, all system-related information is dumped into flat text files if this parameter is not used.
-member member_number | member_range
Specifies the member or members on which the command is issued. If this option is not specified, the command is issued on the current member. Multiple members can be specified as a comma-separated list of member_number (member1, member2), or using member_range, where member_range is a range of members (member1-member3), or using any combination of the first two methods.
all
Specifies that the command is issued on all members defined in db2nodes.cfg.
-n | -number
Specifies the problem management report (PMR) number or identifier for the current problem.
-nc | -nocatalog
Specifies that catalog information should not be collected. The default behavior for db2support will collect catalog information.
-nl | -nodb2look
Specifies that db2look information should not be collected. The default behavior for db2support will collect db2look information.
-o filename
Specifies a new name for the compressed file that is generated after issuing the db2support command. You can specify a new file name or you can state an absolute or relative path. However, the path must exist and be accessible before specifying this option or else an error will occur.

If this option is not used, the default compressed file that is generated is db2support.zip.

If this option is used with the output path option, then the path specified by output path will be ignored and the path specified by the -o option will be used.

-ol levels | -optlevel levels
Specifies the value of the optimization level special register to use. The default is the value of the dft_queryopt database configuration parameter. The optimization level value may be specified as a single value or multiple values separated by a comma.

If multiple values are specified, all optimization information is collected for the first value. For each additional optimization level value specified, the explain plans will be collected and stored in a separate file along with the initial and end times of the collection for each level.

-op | -optprofile
Specifies value of the optimization profile special register to use. It is needed only if there was an optimization profile in effect when the statement was bound. The default is "" (an empty string).
-ot | -opttables
Specifies the value of the special register called "CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION" that is used to identify the types of tables that can be considered when optimizing the processing of dynamic SQL queries. The initial value of CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION is "SYSTEM".
-p password | -password password
Specifies the password for the user ID.
-pf filename | -profile filename
Specifies an alternative profile file. An absolute path must be specified when using this option to get the exact location of this new profile file.

The default profile is the db2support.profile file and is stored in the sqllib/adm directory. The sqllib/adm directory is the default location of the db2support.profile file. On Windows operating systems, if the sqllib/adm directory does not exist, you must create the adm directory under sqllib before issuing the db2support command.

This profile file is used to collect additional information that is not included in the standard db2support command execution. The following are the possible templates for the profile file which can be composed of any combination and number of template 1 and template 2:

Template 1
<COLLECTION>
<NAME>...</NAME>
<CMD>...</CMD>
<OUTFILE>...</OUTFILE>
<TIMEOUT>...</TIMEOUT>
</COLLECTION>
Template 2
<COLLECTION>
<NAME>...</NAME>
<FILE>...</FILE>
<OUTFILE>...</OUTFILE>
<TIMEOUT>...</TIMEOUT>
</COLLECTION>
Each collection item is described by a name, command or file, output file, and a timeout value. This information is used to collect the additional information. Each collection item must have either a CMD or a FILE value but never both. All blank lines are skipped when this file is being parsed. The following describes the values that are encased in each collection item:
NAME
The name of the data that is being collected.
CMD
The command used at the command line to gather the additional information. This is a mandatory value.
FILE
The file name of the file that will be collected. This is a mandatory value.
OUTFILE
The name of the output file where the collected information is stored. This is a mandatory value.
TIMEOUT
The amount of time in seconds that the command-line execution must not exceed. The default value is 180 seconds.

If the OUTFILE and CMD or FILE values are missing, a parse error will occur when db2support parses the profile file. If this occurs, db2support will skip this collection. After the profile file is parsed, the collected information is stored in USERCOLLECTION/OUTFILE in the db2supp_system.zip file.

-preupgrade
Specifies that environment and configuration data is collected before a critical upgrade or update such as upgrading an instance or updating to the next fix pack. This helps with troubleshooting any problems that might occur after the upgrade or update. This parameter can be used with only the -d, -o, -fodcpath, -nl, -member, and -host parameters. After the collection of data is completed, the results are compressed into a file named db2support_preupgrade.zip.
-q | -question_response
Specifies that interactive problem analysis mode is to be used.
-ra | -refreshage
Specifies the value of the refresh age special register. It applies only if there are materialized query tables (MQTs) that reference tables in the statement. The default value of CURRENT REFRESH AGE is zero.
-r | -redistribute
Specifies that the diagnostic data related to data redistribution are to be captured.
-ro | -reopt
Specifies whether EXPLAIN with REOPT ONCE should be used when explaining the query. The default is to ignore the REOPT ONCE option.
-s | -system_detail
Specifies that detailed hardware and operating system information is to be gathered.
-sdir shared directory path | -S shared directory path
Specifies the shared directory db2support will use for temporary storage.
-se embedded SQL file | -sqlembed embedded SQL file
Specifies the path of the embedded SQL file containing the SQL statement for which data is being collected.
-sf SQL file | -sqlfile SQL file
Specifies the file path containing the SQL statement for which data is being collected.
-st SQL statement | -sqlstmt SQL statement
Specifies the SQL statement for which data is being collected.
-t time_interval | -time time_interval
Starting with Fix Pack 1, this option limits the data collected by db2support to a particular time interval specified by the time interval variable. The time interval can be specified as a start time, end time, or both in time stamp format separated by a colon. Time stamp format is YYYY-MM-DD-hh.mm.ss.nnnnnn where YYYY specifies a year, MM for a month of a year (01 through 12), DD for a day of a month (01 through 31), hh for an hour of a day (00 through 23), mm for minute of an hour (00 through 59), ss for the seconds of a minute (00 through 59), nnnnnn for microseconds on UNIX operating systems or milliseconds on Windows operating systems. Some or all of the fields that follow the year field may be omitted. If fields are omitted, the default values will be used. The default values are 1 for the month and day, and 0 for all other fields.

If only a start time is specified (-t 2009), db2support will collect files that are modified after the start time. If only an end time is specified (-t :2009), db2support will collect files that are modified before end time. If both of inputs are specified (-t 2008:2009), db2support will collect files that are modified within the interval of the start time and end time. There is no default value for this option. At least one of time stamps must be specified.

This option cannot be used with the -history or -H option.

-td | -delimiter
Specifies the statement termination character. This command parameter works in the same way as the -td option of the db2 command. The default is a semicolon.
-tbspname table-space-name
Specifies the table space name in which the db2caem command creates the activity event monitor. For a partitioned database environment, the table space must exist on all the database partitions where the SQL statement of interest is to be run. If the option is not provided, the default table space is used by the db2caem command when creating the activity event monitor.
-timeout N
Specifies the timeout period in seconds after which the db2support tool stops its execution. The N variable must be specified in seconds. Note that timeout specifies the total run time since the start of the execution and not the time out for each specific collection. In case of a time out, the db2support.zip file will be created and the error messages are written to the screen and to the db2support.log file.

This option can be used with all other options.

-u userid | -user userid
Specifies the user ID to connect to the database.
-unzip compressed_file_name
Extracts the contents from the compressed file specified. An absolute or relative path must be specified for compressed_file_name. This parameter can extract the db2support.zip file on the system file where extraction utilities are not available. The -unzip parameter cannot be combined with parameters from other db2support modes. Also, the db2support -unzip command recognizes files specified in the compressed_file_name variable with only a .ZIP or .zip file extension.
list
Specifies that the contents of the compressed file are listed on standard output but not extracted. The file name, size, and date are shown. This option can be useful when db2support.zip is large and there is little space available on the system.
quiet
Avoids the db2support command from prompting you for input regarding extracted files already existing in the output_path or the current directory if output_path was not issued. If the quiet parameter is not issued, you will be prompted with a message asking you if you want the file specified to be overwritten or not. If this parameter is specified it overwrites all the existing files without prompts.
-v | -verbose
Specifies that verbose output is to be used while this tool is running.
-x | -xml_generate
Specifies that an XML document containing the entire decision tree logic used during the interactive problem analysis mode (-q mode) is to be generated.

Examples

Example 1

The db2support tool is invoked in the optimizer mode in one of the following ways:

Example 2

To collect information to diagnose a slow query using optimizer-related special registers that were set by default, use:
db2support . -d sample -st "SELECT * FROM EMPLOYEE"

This example returns all the data to the db2support.zip file. Diagnostic files are created in the current directory and its subdirectories (since . is specified as the output path). The system information, optimizer information, and diagnostic files are collected as well.

Example 3

To collect the same information shown in the previous example but with the user-specified values for the optimizer-related special registers, use:
db2support . -d sample -st "SELECT * FROM EMPLOYEE" -cs db2usr -cd 3
   -ol 5 -ra ANY -fp MYSCHEMA -op MYPROFSCHEMA.MYPROFILE -ot ALL -il CS

Example 4

To collect the same information shown in the previous example but with multiple user-specified values for the optimizer-related special registers and collect db2batch information for each optimizer special register value, use:
db2support . -d sample -st "SELECT * FROM EMPLOYEE" -cs db2usr -cd 3
   -ol 3,5,7 -cl 3 -extenddb2batch -ra ANY -fp MYSCHEMA -op MYPROFSCHEMA.MYPROFILE -ot ALL -il CS

This example sets the following special registers: current schema to db2usr, current degree to 3, optimization level to 5, refresh age to ANY, function path to schema MYSCHEMA, optimization profile to MYPROFSCHEMA.MYPROFILE, current maintained table types to ALL, and the isolation level to CS. These values are set only for the connection that db2support establishes to the specified database and does not affect your entire environment. Providing the same special registry variables as used when the query was run is very important when correcting diagnostics.

Example 5

To limit the data collection to files modified in the last 3 days prior to current time, use:
db2support -H 3d

Example 6

To limit the data collection to files modified in the first 3 days of 2009 (time period 2009-01-01-00.00.00.000000 through 2009-01-04-00.00.00.000000), use:
db2support -H 3d:2009

Example 7

To limit the data collection to files modified in time period 2008-01-01-00.00.00.000000 through the current time.
db2support -t 2008

Example 8

To limit the data collection to files modified in the time period of 2009-01-01-00.00.00.000000 through 2009-03-01-00.00.00.000000, use:
db2support -t 2009-01:2009-03

Example 9

The following is an example profile file:
<COLLECTION>
<NAME>List</NAME>
<CMD>ls -la $HOME</CMD>
<OUTFILE>list.out</OUTFILE>
</COLLECTION>
With this profile file, db2support will collect the information from the ls -la $HOME command and the results will be stored in USERCOLLECTION/list.out in the db2supp_system.zip file. The timeout value has not been specified because it is not mandatory. In this case the default timeout value of 180 seconds is used.

Example 10

To extract db2support.zip from the current directory and place it in the temp directory:
db2support temp -unzip db2support.zip
If some or all of the files that are being extracted already exist in the destination directory, you will be prompted to choose if you want to overwrite a particular file or not. If you want to avoid the prompts, issue the quiet parameter along with the -unzip parameter:
db2support temp -unzip quiet db2support.zip

Example 11

To specify timeout for the total db2support collection.
db2support -d sample -timeout 3

Example 12

To specify timeout for collection of hardware and operating system information.
db2support -d sample -c -s -timeout 15

Example 13

To specify timeout for the optimizer db2support collection.
db2support -d sample -c -timeout 7 -st "select * from staff"

Using db2support to collect activity event monitor data for the SQL statement:

For example:
  • db2support -d sample -st "select * from staff" -aem

    In addition to current collection at -cl 2, this will invoke db2caem, which will create the activity event monitor and capture information of details, section and values, as well as actuals for the SQL statement "select * from staff". db2support will collect all the db2caem output.

  • db2support -d sample -sf badquery.sql -aem

    In addition to current collection at -cl 2, this will invoke db2caem, which will create the activity event monitor and capture information of details, section and values, as well as actuals for the SQL statement specified in the file badquery.sql. db2support will collect all the db2caem output.

  • db2support -d sample -actevm mymon -appid *LOCAL.amytang.100203234904 -uowid 44 -actid 1

    In addition to current collection at -cl 0, this will invoke db2caem, which will capture the activity event monitor information of details, section and values, as well as actuals for the SQL statement identified by the event monitor options from the existing activity event monitor. db2caem will not create activity event monitor in this case. db2support will collect all the db2caem output.

Usage notes

In order to protect the security of business data, this tool does not collect table data, schema (DDL), or logs. Some of the options do allow for the inclusion of some aspects of schema and data (such as archived logs). Options that expose database schema or data should be used carefully. When this tool is invoked, a message is displayed that indicates how sensitive data is dealt with.

Data collected from the db2support tool will be from the machine where the tool runs. In a client-server environment, database-related information will be from the machine where the database resides via an instance attachment or connection to the database. For example, operating system or hardware information (-s option) and files from the diagnostic directories (diagpath and alt_diagpath) will be from the local machine where the db2support tool is running. Data such as buffer pool information, database configuration, and table space information will be from the machine where the database physically resides.

There are some limitations on the type of queries accepted by the db2support optimizer tool:

db2support does not collect explain data for dynamic SQL.

If an FODC package is stored in a directory path that is different from the default diagnostic path or not in a path specified by an FODCPATH setting, you need to indicate the FODC path to the db2support command with the -fodcpath parameter, so that the FODC package can be included in the db2support.zip file.