DB2 10.5 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 that contain system data into a compressed file archive.

The db2support command that is included with DB2® installation images supports only a subset of the command parameters that are available after you install the DB2 product. Until you install the DB2 product, the only db2support command parameters that you can use are the -install and -host parameters.

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, run this command with SYSADM authority, such as an instance owner. If you do not have SYSADM authority, some of the data collection actions result in reduced reporting and reduced output.

Required connection

None

Command syntax

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

Archive Mode

|-- -A--archive_path--+--------------+--------------------------|
                      '- -C--+-----+-'   
                             +-tar-+     
                             '-tgz-'     

Collection Mode

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

>--+------------------------------------------------------------------------------+-->
   +-| event-monitor-parameters |-------------------------------------------------+   
   '- -aem--+---------------------------------+--+------------------------------+-'   
            '- -compenv--compilation_env_file-'  '- -tbspname--table_space_name-'     

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

>--+---------------------+-------------------------------------->
   '- -cl--collect_level-'   

>--+-+------+--+-------+--+---------+-+--+------+--------------->
   | '- -cm-'  '- -cfs-'  '- -udapl-' |  '- -co-'   
   '-+- -ps--------+------------------'             
     '- -purescale-'                                

>--+----------------------+------------------------------------->
   '- -cs--current_schema-'   

>--+----------------------------------------------------------------------------------+-->
   | .-alldbs--|--all_databases-.                                                     |   
   | |      .-,-------------.   |             .- -c--+----------------------------+-. |   
   | |      V               |   |             |      '- -u--userid-- -p--password-' | |   
   '-+- -d----database name-+---+--+-------+--+-------------------------------------+-'   
                                   '- -nco-'                                              

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

>--+--------------------------------------+--------------------->
   '- -fodc--+--------------------------+-'   
             '-list_of_FODC_directories-'     

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

>--+---------------------+-------------------------------------->
   '- -fp--function_path-'   

             .-all----------.                             
             | .-,--------. |                             
             | V          | |                             
   .- -host--+---hostname-+-+-------------------------.   
>--+--------------------------------------------------+--------->
   +-localhost----------------------------------------+   
   |             .-,------------------------------.   |   
   |             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-'   

>--+--------------------------------+--------------------------->
   '-system_user--|--su--user_name -'   

>--+----------------------------------+------------------------->
   '-system_group--|--sg--group_name -'   

>--+--------------------+--------------------------------------->
   '- -t--time_interval-'   

>--+---------------------------------------+--+-----+----------->
   '- -td--termination_character_delimiter-'  '- -v-'   

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

event-monitor-parameters

|-- -actevm--event_monitor_name-- -appid--application_id-------->

>-- -uowid--uow_id-- -actid--activity_id------------------------|

Installation collection mode

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

>--+-----------------------------------------+------------------|
   '- -install--+--------------------------+-'   
                |         .-,--------.     |     
                |         V          |     |     
                +- -host----hostname-+-----+     
                '- -instance--instancename-'     

Extraction Mode

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

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

Command parameters

output_path
Specifies the path where the compressed archive file is to be created or extracted. This path 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 parameter is not specified.
-A archive_path | -archive archive_path
This parameter 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 host name and timestamp appended, for example, DB2DUMP_systemhostname_2009-01-12-12.01.01.

This parameter also archives all the data from the directory specified in the alt_diagpath configuration parameter into the specified archive path. The name of this directory is ALT_DB2DUMP. 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 parameter is not available on Windows operating systems.

-aem
Specifies that db2caem command information is collected for the SQL statement that you specify by using the -st or -sf parameter. If you specify this parameter, the db2caem command creates an activity event monitor to collect the requested information. By default, the db2support command does not collect db2caem command information. The activity event monitor and other created tables are cleaned up from the system. The activity event monitor and other created tables are cleaned up from the system.

The db2caem command ignores the db2support command special register options. To specify the compilation environment for the db2caem command, you should use the -compenv parameter. The db2caem command executes the specified SQL statement.

The -aem parameter does not support the -se parameter.

-alldbs | -alldatabases
Specifies that the command collects the database-related information of all databases in the database directory. The command collects database information for a maximum of 100 databases. You cannot use the -alldbs parameter in optimizer mode or with the -preupgrade parameter. The -alldbs parameter and the -d parameter are mutually exclusive.
-nco | -noconnect
Specifies that no attempt to connect to the specified database is made.
-c | -connect
Specifies that an attempt to connect to the specified database is made. This command parameter is included by default if you specify a database.
-B | -basic
Restricts the collection to only optimizer information. No other information is 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 is returned.
-c | -connect
Specifies to connect to the specified database.
-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 parameter can be combined with the only following parameters: -c, -connect, -d, -database, -m, -html, -n, -number, -o, -output, -p, -password, -u, -user, -v, -verbose.
-cfs
Specifies that additional diagnostic data for cluster file system is packaged into the generated .zip file. This parameter collects only additional cluster file system data that is space intensive or takes a long time to get collected.
-cl | -collect
Specifies the level of performance information to be returned. Valid values are:
0 = collect only catalogs, db2look, dbcfg, dbmcfg, db2set
1 = collect 0 plus exfmt
2 = collect 1 plus .db2service (this is the default)
3 = collect 2 plus db2batch
Note: If you specify an event monitor parameter (-actevm, -appid, -uowid, -actid) without -st, -sf, or -se, the effective collection level is 1 with only db2caem information collected (no db2exfmt collection).
-cm
Specifies that additional diagnostic data for cluster manager is packaged into the generated .zip file. This parameter collects only additional cluster manager data that is space intensive or takes a long time to get collected.
-co
Collect catalogs for all tables in the database. The default is to collect catalog information only for the tables used in a query that has a problem.
-compenv compilation-environment-file
Specifies the name of the file containing the name of the compilation environment that is used when the db2caem command is executed. The compilation environment (comp_env_desc) is in BLOB data type and is specified through a file as an input. If the parameter is not provided, the default compilation environment is used when executing db2caem.
-cs | -curschema
Specifies 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 file. Archive compression is available only in archive mode, so you must also specify the -A parameter; otherwise, a syntax error is returned.
tar
Specifies that the files are archived using the tar (tape archive) command. The tar parameter is supported on UNIX and Linux operating systems.
tgz
Specifies that files are archived using the tar command and compressed using the gzip command. The tgz parameter is supported on UNIX and Linux operating systems.
-d database_names | -database database_names
Specifies the name of the database for which data is being collected. You can specify multiple database names for collection of data from more than one database. You can specify a maximum of 100 database names for data collection.

By default, an attempt is made to connect to the specified database. To override this behavior, specify the -noconnect or -nco parameter.

If you specify multiple databases, you cannot run the db2support command in optimizer mode or with the -preupgrade parameter.

-nco | -noconnect
Specifies that no attempt to connect to the specified database is to be made.
-c | -connect
Specifies that an attempt to connect to the specified database is to be made. Specifies that an attempt to connect to the specified database is made. This command parameter is included by default when you specify a database.
event-monitor-parameters
The following parameters uniquely identify the SQL statement for which the activity event monitor data is collected. You must specify them 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 ID of the unit of work (uow_id monitor element) whose data is to be collected. The unit of work ID is unique only within a specific application.
-actid activity-id
Specifies the activity ID (activity_id monitor element) whose data is to be collected. The activity ID is unique only within a given unit of work.
-extenddb2batch
Specifies that db2batch command information for all the optimization levels that you specify by using the -ol or -optlevel parameter is to be captured. You must specify at least one value for the -ol parameter and a -cl parameter value of 3 if you specify the -extenddb2batch parameter. Otherwise, the db2support command returns a syntax error.
-fodc
Specifies that only the FODC directories and the db2diag log files are collected. If you do not specify directories, the db2support command shows a list of all the FODC directories for you to choose from. The directories are listed in ascending chronological order, based on usage time stamps, 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. The -host or -member parameters can also be used to collect FODC directories remotely. However, since the FODC directory could contain large files, like core files, it is recommended that the -fodc parameter is run on the host where FODC directories reside.

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 not collect the specified FODC directory. If the -t or -H parameters are not specified, the -fodc parameter will collect FODC directories within 14 days.

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

Trap | Panic | BadPage | Hang | IndexError | Perf | DBMarkedBad
Specifies the category of FODC directories to collect.
list_of_FODC_directories
Specifies a comma-separated list of existing FODC directories.
-fodcpath fodc_path_name
Specifies the name of a full path to an existing directory where the db2support command can search for FODC packages. The db2support command searches the following paths to collect FODC packages:
  • The diagnostic data directory as specified by the diagpath and alt_diagpath database manager configuration parameters
  • The instance-level FODCPATH parameter settings in the DB2FODC registry variable
  • The FODCPATH settings for each member in that machine
  • The db2pdcfg command setting in memory
  • The fodc_path_name variable value that you specify by using the -fodcpath parameter
-F | -full
Specifies that all db2support information and optimizer-specific information are to be captured with nothing excluded.
-fp | -funcpath
Specifies the value of the function path special register to use 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.
-h | -help
Displays help information. When this parameter is specified, all other parameters are ignored, and only the help information is displayed.
-H history_period | -history history_period
Limits the data that is collected to a particular interval of time. You can specify the history_period variable with a number and time type. The available types are as follows:
d
Days.
h
Hours.
m
Minutes.
s
Seconds.

Optionally, you can specify a beginning time value that is separated by a colon.You specify the beginning of time value in time stamp format. The time stamp format is YYYY-MM-DD-hh.mm.ss.nnnnnn

where:
YYYY
Specifies the year.
MM
Specifies the month (01 - 12).
DD
Specifies the day (01 - 31).
hh
Specifies the hours (00 - 23).
mm
Specifies the minutes (00 - 59).
ss
Specifies the seconds (00 - 59).
nnnnnn
Specifies the microseconds on UNIX operating systems or milliseconds on Windows operating systems.

You can omit some or all of the fields that follow the year field. If you omit fields, the default values are used. The default values are 1 for the month and day and 0 for all other fields.

The number and time type can be positive or negative, which you specify with the plus sign (+) or minus sign (-). If you specify only a number and time type, the default is negative. If you specify a number, a time type, and a beginning time value, the default is positive. For example, -history 6d collects data for the past six days, and -history 6d:2013 collects data for the first six days of 2013.

This parameter cannot be used with the -time or -t parameter. The default value is 14 days if the -H or -t parameters are not specified.

-host
Specifies the host or hosts on which the command is issued. If this parameter is not specified, the command is issued on all hosts by default with the exception of the -fodc parameter.
all
Specifies that the command is issued on all hosts. This setting is the default behavior of the db2support command, but does not apply to the -fodc parameter.
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.

If you specify the -host option in an environment that is not a DB2 pureScale® environment or a partitioned database environment, db2support returns an error.

-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.
-install
Collects the diagnostic data that is required to troubleshoot a problem with the DB2 installation process or with the creation of an instance. The diagnostic data is stored in the db2support.zip file. Copy the db2support.exe file to your local system; this ensures that when you issue the db2support command the db2support.zip file is placed into whichever directory that you copied db2support.exe to. For the most complete collection of diagnostic data, issue the command with root authority. Also, another recommendation is to indicate an output path for the db2support.zip file by specifying the output_path variable with the -install parameter.
-host hostname |-host hostname_list
Specifies the host or hosts where diagnostic data is collected. For data collection on remote hosts, an SSH connection is required. If you do not specify a host name, diagnostic data is collected on the local host.

To collect diagnostic data on multiple hosts specify the -host parameter followed by hostname_list, where hostname_list is a comma-separated list of hosts for which you want to collect diagnostic data.

-instance instancename
Specifies the instance name for which the diagnostic data is being collected. If you do not specify this parameter, diagnostic data by default is collected on the instance defined in the DB2INSTANCE environment variable. To collect diagnostic data on a particular instance, specify the -instance parameter followed by instancename, where instancename is the name of the instance for which you want to collect diagnostic data.
-l | -logs
Specifies that active logs are to be captured.
-localhost
Specifies that the command is issued on the local host. If this option is not specified, the command is issued on all hosts.
-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 parameter 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.

The db2support tool runs per host. If multiple members reside on one host, db2support runs only once on the host. If you specify the members on which the command is issued, the member numbers you provide are used only to determine the hosts on which db2support runs.

If you specify the -member option in an environment that is not a DB2 pureScale environment or a partitioned database environment, db2support returns an error.

-n | -number
Specifies the problem management report (PMR) number or identifier for the current problem.
-nc | -nocatalog
Specifies that catalog information is not to be collected. By default, catalog information is collected.
-nl | -nodb2look
Specifies that db2look command information is not to be collected. By default, db2look command information is collected.
-o filename
Specifies a name for the compressed file that is generated after you issue the db2support command. You can specify an absolute or relative path. The path must exist and be accessible before you specify the parameter; otherwise, an error occurs.

If you do not specify this parameter, the name of the compressed file is db2support.zip.

If you use this parameter with the output_path parameter, the path that you specify for the output_path parameter is ignored, and the path that you specify for the -o parameter is 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 can 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 are collected and stored in a separate file along with the initial and end times of the collection for each level.

-op | -optprofile
Specifies the value of the optimization profile special register to use. This value 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 CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION special register, which identifies the types of tables that can be considered when optimizing the processing of dynamic SQL queries. The initial value of the special register is SYSTEM.
-p password | -password password
Specifies the password for the user ID.
-ps | -purescale
Specifies that additional DB2 diagnostic data and additional diagnostic data for cluster file system, cluster manager, and uDAPL is to be collected. This parameter collects only additional diagnostic data that is space intensive or takes a longer time to get collected. Specifying this parameter is equivalent to specifying the -cm, -cfs, and -udapl parameters.
-pf filename | -profile filename
Specifies an alternative profile file. You must specify an absolute path for the file.

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

This profile file is used to collect information that is not included in the standard db2support command execution. The possible templates for the profile file are as follows. You can use 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, a command or file name, an output file name, and a timeout value. This information is used to collect the additional information.
NAME
The name of the data that is being collected.
CMD
The command that is used on the command line to gather the additional information. You must specify either this value or the FILE value, never both.
FILE
The name of the file to collect. You must specify either this value or the CMD value, never both.
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.

The db2support command skips all blank lines when it parses the file.

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

-preupgrade
Collects environment and configuration data before a critical upgrade or update such as upgrading an instance or updating to the next fix pack. This parameter 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. This value applies only if there are materialized query tables (MQTs) that reference tables in the statement. The default value of the CURRENT REFRESH AGE is zero.
-r | -redistribute
Specifies that diagnostic data that is related to data redistribution is captured.
-ro | -reopt
Specifies that EXPLAIN with the REOPT ONCE option is 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.
-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.
-sdir shared directory path | -S shared directory path
Specifies the shared directory that is used for temporary storage while the db2support command is collecting data. If you do not specify this parameter, the default shared directory is used to store data temporarily. The default shared directory is db2_instance_shared_directory/sqllib_shared in DB2 pureScale environments and path/sqllib in partitioned database environments. The data that is temporarily stored is deleted when the execution of the db2support command is complete.
Important: Because the sqllib_shared directory is used as the default shared directory in DB2 pureScale environments, ensure that there is enough space in the sqllib_shared directory to store the data that the db2support command collects. You can use the following formula to calculate the minimum disk space that is required for the sqllib_shared directory:
10 GB + number of member/CF host x 2 GB
-sf SQL file | -sqlfile SQL file
Specifies the file path containing the SQL statement for which data is being collected.
In DB2 pureScale and partitioned database environments, you must specify the absolute file path and ensure that the SQL file is stored in a directory that is accessible by all host. However, for optimizer collections in these multiple host environments it is recommended that you use the -localhost option to collect data on a single host. For example, to collect data on a single host you might run the following command:
 db2support -d <database_name> -sf <filepath> -localhost
Where filepath is the absolute path of the SQL file. When you use the -localhost option, as shown in the preceding example, the file name can be used in place of the absolute path if the file is stored in the current directory.
-st SQL statement | -sqlstmt SQL statement
Specifies the SQL statement for which data is being collected.
-su user_name | -system_user user_name
Specifies the system user name for which data is being collected.
-t time_interval | -time time_interval
Limits the data that is collected to a particular time interval. You can specify the time interval as a start time, end time, or both, in time stamp format separated by a colon. The time stamp format is YYYY-MM-DD-hh.mm.ss.nnnnnn
where:
YYYY
Specifies the year.
MM
Specifies the month (01 - 12).
DD
Specifies the day (01 - 31).
hh
Specifies the hours (00 - 23).
mm
Specifies the minutes (00 - 59).
ss
Specifies the seconds (00 - 59).
nnnnnn
Specifies the microseconds on UNIX operating systems or milliseconds on Windows operating systems.

You can omit some or all of the fields that follow the year field. If you omit fields, the default values are used. The default values are 1 for the month and day and 0 for all other fields.

If you specify only a start time (for example, -t 2012), the db2support command collects files that were modified after the start time. If you specify only an end time (for example, -t :2012), the db2support command collects files that were modified before the end time. If you specify both times (for example, -t 2012:2013), the db2support command collects files that were modified between the start time and end time. There is no default value for this parameter. You must specify at least one of the time stamps.

You cannot use this parameter with the -history or -H parameter.

The default value is 14 days if the -H or -t parameters are not specified.
-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.
-td | -delimiter
Specifies the statement termination character. This command parameter works in the same way as the -td parameter of the db2 command. The default statement termination character is a semicolon.
-timeout N
Specifies the timeout period in seconds after which the db2support tool stops its execution. The N variable must be specified in seconds. timeout specifies the total run time since the start of the execution and not the timeout for each specific collection. If a timeout occurs, the db2support.zip file is created and the error messages are written to the screen and to the db2support.log file.

This parameter can be used with all other parameters.

-u userid | -user userid
Specifies the user ID to use to connect to the database.
-udapl
Specifies that diagnostic data for uDAPL is packaged into the generated .zip file. This parameter collects only additional uDAPL data that is space intensive or takes a long time to collect.
-unzip compressed_file_name
Extracts the contents from the specified compressed file. You must specify an absolute or relative path for the file. Also, the db2support -unzip command recognizes the file name that you specify for the compressed_file_name parameter only if the file has a .ZIP or .zip file extension.

This parameter can extract the db2support.zip file on the system file where extraction utilities are not available.

You cannot combine the -unzip parameter with parameters from other db2support command modes.

If you specify the output_path parameter with the -unzip parameter, the extracted files are placed in the output_path directory. If you do not specify the output_path parameter with the -unzip parameter, a new directory that is named compressed_file_name is created in the current directory, and the extracted files are placed inside the compressed_file_name directory.

list
Specifies that the contents of the compressed file are listed in standard output but not extracted. The file name, size, and date are shown. This parameter can be useful when the db2support.zip file is large and little space is available on the system.
quiet
Prevents the db2support command from prompting you for input regarding extracted files that are already in the output_path directory or in the current directory if output_path was not issued. If you do not issue the quiet parameter, you are prompted with a message asking you whether you want the specified file to be overwritten. If you specify this parameter, it overwrites all the existing files without prompts.
-v | -verbose
Specifies that verbose output is to be used while this tool is running.
-wlm
Specifies that additional data related to DB2 Workload Manager issues is being collected. The data is collected as part of optimizer mode under the collection level 0 (-cl 0) and above.
-x | -xml_generate
Specifies that an XML document containing the entire decision tree logic that is used during the interactive problem analysis mode (-q mode) is to be generated.

Examples

Example 1

The following examples show different ways to invoke the db2support command in optimizer mode:

  • As an SQL statement from a command line:
    db2support output_directory -d database_name -st sql_statement

    The db2support command stores the query in the optimizer directory by copying the query into the bad_query.sql file.

  • As an SQL statement that is stored in a file:
    db2support output_directory -d database_name -sf sql_file
    The command copies the file containing the query into the optimizer directory.
  • As a file containing an embedded static SQL statement with the query that has the problem:
    db2support output_directory -d database_name -se embedded_sql_file
    The command copies the file containing the query into the optimizer directory. The file does not need to be in the current directory but must be readable by an invoking user ID.
  • While returning different levels of performance information:
    db2support output_directory -d database_name -collect 0

    The db2support command collects different levels of performance information based on the level of detail that you request. The values 0 - 3 collect increasing amounts of detail. If you use the 0 option, catalog information and table definitions are collected, which you can use to reproduce the database objects for a production database.

Example 2
The following command collects information to diagnose a slow query by using optimizer-related special registers that were set by default:
db2support . -d sample -st "SELECT * FROM EMPLOYEE"

In this example, the command returns all the data to the db2support.zip file. Diagnostic files are created in the current directory and its subdirectories, because . 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
The following command collects the same information that is shown in the previous example but with multiple user-specified values for the optimizer-related special registers. The command also collects db2batch command information for each optimizer special register value.
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 special registers as follows:
  • Sets the current schema to db2usr
  • Sets the current degree to 3
  • Sets the optimization level to 5
  • Sets the refresh age to ANY
  • Sets the function path to schema MYSCHEMA
  • Sets the optimization profile to MYPROFSCHEMA.MYPROFILE
  • Sets the current maintained table types to ALL
  • Sets the isolation level to CS

These values are set only for the connection that the db2support command establishes to the specified database. The entire environment is not affected. Providing the same special registry variables that were used when the query was run is important when correcting diagnostics.

Example 5
To limit the data collection to files modified in the last three days before the current time, use:
db2support -H 3d
Example 6
To limit the data collection to files modified in the first three 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 section is an example profile file:
<COLLECTION>
<NAME>List</NAME>
<CMD>ls -la $HOME</CMD>
<OUTFILE>list.out</OUTFILE>
</COLLECTION>
With this profile file, db2support collects the information from the ls -la $HOME command and the results are stored in USERCOLLECTION/list.out in the db2supp_system.zip file. The timeout value is not specified because it is not mandatory. In this case, the default timeout value of 180 seconds is used.
Example 10
To extract the contents from the db2support_hostname1.zip file:
db2support -unzip db2support_hostname1.zip 
This command creates a directory named db2support_hostname1 under the current directory, and the extracted files from the db2support_hostname1.zip file is placed in the db2support_hostname1 directory.
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 exist in the destination directory, you are prompted to choose if you want to overwrite a particular file. If you want to avoid the prompts, issue the quiet parameter along with the -unzip parameter:
db2support temp -unzip quiet db2support.zip
Example 11

The following are examples of the -install and-host parameters:

To create the db2support.zip file in the current directory:
db2support -install
To specify an output path temp for the db2support.zip file:
db2support temp -install
To specify a single host on which the diagnostic data is collected:
db2support -install -host myhost1
To specify multiple hosts on which the diagnostic data is collected:
db2support -install -host myhost1,myhost2
Example 12
To specify timeout for the total db2support collection.
db2support -d sample -timeout 3
Example 13
To specify timeout for collection of hardware and operating system information.
db2support -d sample -c -s -timeout 15
Example 14
To specify timeout for the optimizer db2support collection.
db2support -d sample -c -timeout 7 -st "select * from staff"
Example 15
To specify data collection on all databases that are found in the database directory, use:
db2support -alldbs
Example 16
To specify data collection as user guest1 on all databases that are found in the database directory, use:
db2support -alldbs -u guest1 -p password
Example 17
To collect configuration information, including database configuration information for all databases that are found in the database directory, use:
db2support -alldbs -cfg
Example 18
To specify data collection on databases mydb1, mydb2, and mydb3, use:
db2support -d mydb1, mydb2, mydb3
Example 19
To specify system information collection for user name myuser, use:
db2support -su myuser
Example 20
To specify system information collection for group name mygroup, use:
db2support -sg mygroup
Example 21
To specify system information collection for user name myuser and group name mygroup, use:
db2support -su myuser -sg mygroup

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 command starts the db2caem command, which creates the activity event monitor and capture information of details, section, values, and actuals for the SQL statement "select * from staff". The db2support command collects all the db2caem output.

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

    In addition to current collection at -cl 2, this command invokes db2caem, which creates the activity event monitor and capture information of details, section, values, and actuals for the SQL statement specified in the file badquery.sql. The db2support command collects 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 command starts the db2caem command, which captures the activity event monitor information of details, section, values, and actuals for the SQL statement identified by the event monitor options from the existing activity event monitor. The db2caem command does not create an activity event monitor in this case. The db2support command collects all the db2caem output.

Using db2support to collect data that is related to WLM:

For example:
  • db2support –d sample -cl 0 -wlm

    In addition to the current optimizer collection, this command collects additional WLM information for optimizer mode under the collection level 0.

  • db2support –d sample –st "select count (*) from syscat.tables" -wlm

    In addition to the current optimizer collection, this command collects WLM information for optimizer mode for the specified SQL statement.

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

    In addition to the current optimizer collection, this command collects additional WLM information for optimizer mode for the specified SQL file.

db2support examples for collections specific to DB2 pureScale environments

Example 1

On the host run:

host:~$ db2support
  • This command creates a db2support.zip file in the current folder. This file contains the DB2 diagnostic data and additional diagnostic data specific to DB2 pureScale components, such as cluster manager, cluster file system and uDAPL, that is collected from all hosts.
  • The db2support.zip file contains a folder called PURESCALE. The PURESCALE folder has three additional subfolders called CFS, CM, and UDAPL, with the corresponding information files inside.
  • You can specify additional parameters to this command to collect more diagnostic data.
Example 2: Running db2support with -cm option

On the host run:

host:~$ db2support -cm
  • This command creates a db2support.zip file by default and also collects additional cluster manager data that is space intensive or takes a long time to get collected. The additional cluster manager data that is collected by the -cm option is stored in the CM folder that is located inside the PURESCALE folder of the db2support.zip file.
Example 3: Running db2support with -purescale option

On the host run:

host:~$ db2support -purescale
  • This command creates a db2support.zip file by default. This command also collects additional diagnostic data that is specific to DB2 pureScale components, such as cluster manager, cluster file system and uDAPL, and takes a long time to get collected or is space intensive. The additional diagnostic data is stored in the corresponding PURESCALE, CFS, CM, and UDAPL folders located in the db2support.zip file.
  • This command collects diagnostic data that is similar to what is collected by the following command but this command also collects additional diagnostic data that is specific to DB2 pureScale environments:
    host:~$ db2support -cm -cfs -udapl

Usage notes

The db2support command collects bad query-related information only if you specify the -st, -sf, or -se parameter. If there is an error or trap during optimization, use the -cl 0 (collection level zero) parameter to collect all catalog tables and db2look table definitions without trying to explain a bad query. To collect information that is related to an activity event monitor as part of optimizer collection, you can specify the -aem parameter (with the -st or -sf parameter) or event monitor options. You must specify one of these options to work with optimizer problems.

If you specify any of the options for optimizer collection, you must also specify the -d parameter.

If you do not specify the -F or -full parameter, 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 file for the optimizer collections, you must specify the -F or -full parameter.

If you set special registers to values other than the default values during statement execution, pass these values to the db2support command to help ensure correct problem analysis. The special register options are ignored by db2caem command collection.

The -global parameter is discontinued. The -host all parameter is the default behavior of the db2support command; thus, information from all hosts is collected by default.

The db2support command takes a long time to run because it collects most diagnostic data that is specific to DB2 pureScale components by default. If you specify the -purescale, -cm, -cfs, or -udapl parameter, the db2support command collects additional diagnostic data that is space intensive or takes a longer time to collect. However, this information can help speed up the problem determination process in DB2 pureScale environments.

To protect the security of business data, this command does not collect table data, schema (DDL statements), or logs. Some of the parameters do allow for the inclusion of some aspects of schema and data, such as archived logs. Carefully use parameters that expose database schema or data.When you issue the command, a message is displayed that indicates how sensitive data is dealt with.

The db2support command collects data from the machine where the command runs. In a client-server environment, database-related information is from the machine where the database is located, through an instance attachment or connection to the database. For example, operating system or hardware information (-s parameter) and files from the diagnostic directories (diagpath and alt_diagpath) are from the local machine where the db2support command runs. Data such as buffer pool information, database configuration information, and table space information is from the machine where the database is physically located.

The limitations on the type of queries that the db2support command accepts are as follows:

The db2support command 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 is not in a path that is specified by an FODCPATH setting, you must indicate the FODC path to the db2support command by using the -fodcpath parameter. The FODC package is then included in the db2support.zip file.