Product Documentation

Database Integrity Utilities

Previous Topic

Next Topic

ctdmpidx - Index Dump Utility

ctdmpidx is available to dump an index. This utility is useful for viewing index header details, viewing nodes and key values. The syntax is shown below:

ctdmpidx [-<page size>] [-listkeys] <filename> <member #> [<rflg>]

  • The optional parameter -page size equals sector size * 128 (third parameter in InitCtree()). If page size is not entered, a default value of 16 will be used. filename specifies the index file targeted for analysis.
  • The member # refers to the index member number. A physical index file can contain one or more indexes. Each index has a member number (0, 1, 2, 3, etc.). For example, the sample index file custordr.idx provided with the FairCom ODBC Driver contains a total of two indexes. Depending on whether you specify 0 or 1 you will be looking at either the order number index or the customer number index.
  • rflg represents an optional recovery flag switch and is only applicable when compiled with TRANPROC. Any character will enable rflg, which will result in c-tree skipping automatic recovery.
  • If this utility detects the index file is using advanced encryption, it turns on c-tree's advanced encryption support and prompts for the master encryption password.
  • The -listkeys, option is available in V10.3 and later. It lists all the key values and their associated record offsets in an index.
  • filename specifies the index file targeted for analysis.

As of V12, ctdmpidx also checks for a transaction mark whose position in the node precedes the first mark position recorded in the node header. It also checks if the number of marks in the node differs from the mark count in the node header. In these cases, it outputs these messages:

ERROR: Found mark at element <n> but expected first mark at element <m>

ERROR: Found <n> marks but expected <m> marks

Example

Below is an example of launching ctdmpidx along with output showing the header and prompt for an index node address.

# ctdmpidx -2048 custmast.idx 0

header info for file #0 [custmast.idx]:

configuration version: 81x index root ptr: 1000x

node size: 2048 superfile last member#: 0

data record length: 0 extend file size: 0

max bytes per leaf node: 1348 max bytes per non-leaf: 2030

file mode: 16392 key length: 4

file type: 1 # of additional members: 0

update flag: 0x index member number: 0

key type: 0 file id number: 0

duplicate flag: 0 server id number: 0

# of active entries: 4 current node ptr: 0x

delete stack ptr: 0x index high transaction #: 0

last byte used: 1800x serial number: 0x

last physical byte: 1800x delete type: 0

permanent file mode flags: 0 superfile type: 0

leaf anchor ptr: 1000x superfile member #: 0

file flavor: 2 file alignment: 8

key padding byte: 20x maximum name length: 255

header record ptr: 0x resource header ptr: 800x

Enter node address in hex: 1000

NODE: 1000x

trans active: no

predecessor node: 0x

successor node: 0x

# of entries: 4

# of bytes: 32

leaf flag: 1 (0 => non-leaf / 1 => leaf)

member #: 0

element offset key value

1 101fx 31303030

1 0 0 0

2 105ex 31303031

1 0 0 1

3 1099x 31303032

1 0 0 2

4 10d9x 31303033

1 0 0 3

TOCIndex