gpdetective

A newer version of this documentation is available. Click here to view the most up-to-date release of the Greenplum 4.x documentation.

gpdetective

Collects diagnostic information from a running Greenplum Database system.

Synopsis

gpdetective [-h hostname] [-p port] [-U username] [-P password] 
     [--start_date number_of_days | YYYY-MM-DD] 
     [--end_date YYYY-MM-DD]
     [--diagnostics a|n|s|o|c] 
     [--logs a|n|dbid [,dbid,... | -dbid]] 
     [--cores t|f]
     [--pg_dumpall t|f] [--pg_dump_options option[,...]] 
     [--tempdir temp_dir] 
     [--connect t|f]

gpdetective -v 

gpdetective -?

Description

The gpdetective utility collects information from a running Greenplum Database system and creates a bzip2-compressed tar output file. This output file can then be sent to Greenplum Customer Support to help with the diagnosis of Greenplum Database errors or system failures. The gpdetective utility runs the following diagnostic tests:

  • gpstate to check the system status
  • gpcheck to make sure the recommended OS settings are set on all hosts
  • gpcheckcat and gpcheckdb to check the system catalog tables for inconsistencies

gpdetective captures the following files and Greenplum system information:

  • postgresql.conf configuration files (master and segments)
  • log files (master and segments)
  • Greenplum Database system configuration information
  • (optional) Core files
  • (optional) Schema DDL dumps for all databases and global objects (using pg_dumpall)

A bzip2-compressed tar output file containing this information is created in the current directory with a file name of gpdetective<timestamp>.tar.bz2.

Options

--connect t|f
Specifies if gpdetective should connect to the database to obtain system information. The default is true (t). If false (f), gpdetective only gathers information it can obtain without making a connection to the database. This information includes (from the master host):
  • Log files
  • The master_data_directory/postgresql.conf file
  • The ~/gpAdminLogs directory
  • gpcheck output
  • Core files
--cores t|f
Determines whether or not the utility retrieves core files. The default is true (t).
--diagnostics a|n|s|o|c
Specifies the diagnostic tests to run: all (a), none (n), operating system (o) diagnostics, or catalog (c) diagnostics. The default is all (a).
--end_date YYYY-MM-DD
Sets the end date for the diagnostic information collected. The collected information ends at 00:00:00 of the specified date.
-h hostname
The host name of the machine on which the Greenplum master database server is running. If not specified, reads from the environment variable PGHOST or defaults to localhost.
--logs a|n|dbid_list
Specifies which log file(s) to retrieve: all (a), none (n), a comma separated list of segment dbid numbers, or a range of dbid numbers divided by a dash (-) (for example, 3-6 retrieves logs from segments 3, 4, 5, and 6). The default is all (a).
-P password
If Greenplum Database is configured to use password authentication, you must also supply the database superuser password. If not specified, reads from ~/.pgpass if it exists.
--pg_dumpall t|f
Determines whether or not the utility runs pg_dumpall to collect schema DDL for all databases and global objects. The default is true (t).
--pg_dump_options option[,...]
If --pg_dumpall is true, specifies a comma separated list of dump options to use when the pg_dumpall utility is called. See pg_dumpall for a valid list of dump options.
-p port
The TCP port on which the Greenplum master database server is listening for connections. If not specified, reads from the environment variable PGPORT or defaults to 5432.
--start_datenumber_of_days | YYYY-MM-DD
Sets the start date for the diagnostic information collected. Specify either the number of days prior, or an explicit past date.
--tempdir temp_dir
Specifies the temporary directory used by gpdetective. The default value is determined by the $TEMP, $TMP and $TMPDIR environment variables.
-U gp_superuser
The Greenplum database superuser role name to connect as (typically gpadmin). If not specified, reads from the environment variable PGUSER or defaults to the current system user name.
-v (show utility version)
Displays the version of this utility.
-? (help)
Displays the utility usage and syntax.

Examples

Collect all diagnostic information for a Greenplum Database system and supply the required connection information for the master host:

gpdetective -h mdw -p 54320 -U gpadmin -P mypassword

Run diagnostics and collect all logs and system information for the past two days:

gpdetective --start_date 2

Do not run diagnostic tests or schema dumps, just collect the log files of the master and segment 3:

gpdetective --diagnostics n --logs -1,3 --pg_dumpall f