gp_filedump
A newer version of this documentation is available. Use the version menu above to view the most up-to-date release of the Greenplum 4.x documentation.
gp_filedump
Synopsis
gp_filedump [options] [-R startblock [endblock]] [-S blocksize] file gp_filedump -h
Description
The gp_filedump utility displays the formatted output of binary Greenplum heap, index, and control files. gp_filedump can generally determine the file type automatically, and format the output accordingly. Options are provided to force the utility to try and interpret the file as a particular file type, for control files (-c is required), or for cases where the file type cannot be determined.
Always execute gp_filedump against a copy of the Greenplum control files; do not run against the original files used for your cluster.
By default, gp_filedump attempts to display the full contents of the specified file. You can optionally display information for a specified range of blocks, or a even single block, using the -R option.
Certain file types support unique options to format the file output. For example, heap and index files support options to display binary block images or to interpret the binary data. Heap files for append-optimized tables support options to specify the compression type and storage orientation model of the table (column or row).
Options for Heap and Index Files
- -a
- Display absolute addresses when formatting the output. Block-relative addressing is used by default.
- -b
- Display binary block images within a range. Using this option turns off all other formatting options.
- -d
- Display formatted block content dump. Using this option turns off all other formatting options.
- -f
- Display formatted block content dump along with interpretation.
- -h
- Display the command-line help.
- -i
- Display interpreted item details.
- -R startblock [endblock]
- Display information for specific block ranges within the file. Blocks are always indexed from block 0. startblock defines the starting block. If you specify only startblock, then the utility displays information for a single block. Include endblock to specify the end of the block range.
- -S blocksize
- Force the block size to the specified blocksize value. Use this option if block 0 of the file is corrupt and prevents the utility from interpreting the contents.
- -x
- Force the utility to interpret the formatting of the files block items as index items.
- -y
- Force the utility to interpret the formatting of the files block items as heap items.
- -p
- Try to deparse heap data in the file.
- -M
- Checksum option for mirror files. By default, gp_filedump assumes that checksums are not present.
Options for Append-Optimized Table Files
- -z
- Interpret the file as an append-optimized table file.
- -T zlib | quicklz
- Specify the compression type as zlib or quicklz. The default is zlib.
- -L level
- Specify the compression level (1-4). The default compression level is 1.
- -M
- Checksum option for append-optimized files. By default, gp_filedump assumes that checksums are not present.
- -O row | column
- Specify the table storage orientation model as row or column. The default is column.
- -B
- Deparse the input block directory file.
- -D
- Disable dead tuple info while deparsing the block directory file. You must include the -B option with -D.
Options for Control Files
- -c
- Interpret the file as a control file.
- -f
- Display formatted block content dump along with interpretation.
- -S blocksize
- Force the block size to the specified blocksize value. Use this option if block 0 of the file is corrupt and prevents the utility from interpreting the contents.
Examples
Greenplum segments store data for heap tables and indexes in files named after the relfilenode for the relation. For example, to find the relfilenode associated with a table named "articles":
=# select relname, relfilenode from pg_class where relname='articles'; relname | relfilenode ----------+------------- articles | 17162 (1 row)
To locate the associated file on a segment, search the segment data directory. For example:
$ find /gpdata1 -name 17162 /gpdata1/gpsne0/base/17149/17162
$ cp /gpdata1/gpsne0/base/17149/17162 .
You can then use gp_filedump to display formatted data in the file:
$ ./gp_filedump -f ./17162 ******************************************************************* * Greenplum File/Block Formatted Dump Utility - Version 8.2.1 * * File: /gpdata1/gpsne0/base/17149/17162 * Options used: -f * * Dump created on: Wed Sep 12 13:15:00 2018 ******************************************************************* Block 0 ******************************************************** <Header> ----- Block Offset: 0x00000000 Offsets: Lower 68 (0x0044) Block: Size 32768 Version 4 Upper 760 (0x02f8) LSN: logid 0 recoff 0x04cff188 Special 32768 (0x8000) Items: 12 Free Space: 692 Length (including item array): 68 0000: 00000000 88f1cf04 01000000 4400f802 ............D... 0010: 00800480 60fb3409 a0f4760d d8ee8a0b ....`.4...v..... 0020: 40dc3025 c8d5ee0c 68cfbc0c a0cd8c03 @.0%....h....... 0030: b0b7de2b f0ae7611 b09a7a28 98922a10 ...+..v...z(..*. 0040: f882341f ..4. <Data> ------ Item 1 -- Length: 1178 Offset: 31584 (0x7b60) Flags: USED 7b60: fc030000 00000000 00000000 00000000 ................ 7b70: 01000500 06081800 100c0d00 00000000 ................ 7b80: 009233b4 d4fa0100 90466f72 77617264 ..3......Forward 7b90: 206f736d 6f736973 80140000 f2420000 osmosis.....B.. 7ba0: f4220000 60440000 0c430000 0000044e ."..`D...C.....N 7bb0: 3d3d5265 66657265 6e636573 3d3d0a7b ==References==.{ 7bc0: 7b726566 6c697374 7c327d7d 0a0a3d3d {reflist|2}}..== ...
Display output for indexes provides additional metadata:
$ cp /gpdata1/gpsne0/base/17149/17423 . $ ./gp_filedump -f -y ./17423 ******************************************************************* * Greenplum File/Block Formatted Dump Utility - Version 8.2.1 * * File: /gpdata1/gpsne0/base/17149/17423 * Options used: -f -y * * Dump created on: Wed Sep 12 13:41:15 2018 ******************************************************************* Block 0 ******************************************************** <Header> ----- Block Offset: 0x00000000 Offsets: Lower 44 (0x002c) Block: Size 32768 Version 4 Upper 32752 (0x7ff0) LSN: logid 0 recoff 0x04d01710 Special 32752 (0x7ff0) Items: 6 Free Space: 32708 Length (including item array): 44 BTree Meta Data: Magic (0x00053162) Version (2) Root: Block (1) Level (0) FastRoot: Block (1) Level (0) 0000: 00000000 1017d004 01000000 2c00f07f ............,... 0010: f07f0480 62310500 02000000 01000000 ....b1.......... 0020: 00000000 01000000 00000000 00000000 ................ 0030: 00000000 00000000 00000000 00000000 ................ 0040: 00000000 .... <Special Section> ----- BTree Index Section: Flags: 0x0008 (META) Blocks: Previous (0) Next (0) Level (0) CycleId (0) 7ff0: 00000000 00000000 00000000 08000000 ................ Block 1 ******************************************************** <Header> ----- Block Offset: 0x00008000 Offsets: Lower 164 (0x00a4) Block: Size 32768 Version 4 Upper 32176 (0x7db0) LSN: logid 0 recoff 0x04d78e70 Special 32752 (0x7ff0) Items: 36 Free Space: 32012 Length (including item array): 164 0000: 00000000 708ed704 01000000 a400b07d ....p..........} 0010: f07f0480 80ff2000 80fe2000 70ff2000 ...... ... .p. . ...
$ cp /gpdata1/gpsne0/global/pg_control . $ ~/gp_filedump -c ./pg_control ******************************************************************* * Greenplum File/Block Formatted Dump Utility - Version 8.2.1 * * File: /gpdata1/gpsne0/global/pg_control * Options used: -c * * Dump created on: Wed Sep 12 13:48:34 2018 ******************************************************************* <pg_control Contents> ********************************************* CRC: Correct (crc32c) pg_control Version: 8220430 Catalog Version: 201310150 System Identifier: 6597520486355114989 State: IN PRODUCTION Last Checkpoint: Wed Sep 12 12:58:25 2018 Current Log File: 0 Next Log Segment: 2 Last Checkpoint Record: Log File (0) Offset (0x0518fb00) Previous Checkpoint Record: Log File (0) Offset (0x0518f8f0) Last Checkpoint Record Redo: Log File (0) Offset (0x0518fb00) |- Undo: Log File (0) Offset (0x00000000) |- TimeLineID: 1 |- Next XID: 1468 |- Next OID: 26108 |- Next Multi: 1 |- Next MultiOff: 0 |- Time: Wed Sep 12 12:58:25 2018 Backup Start Record: Log File (0) Offset (0x00000000) End-of-Backup Record Required: no Maximum Data Alignment: 8 Floating-Point Sample: 1234567 Database Block Size: 32768 Blocks Per Segment: 32768 XLOG Segment Size: 67108864 Maximum Identifier Length: 64 Maximum Index Keys: 32 Date and Time Type Storage: 64 bit Integers Locale Buffer Length: 128 lc_collate: en_US.utf8 lc_ctype: en_US.utf8