ondebug is a single-file C front-end over the ondebug library, modelled after the Oninit reference tools ondump and onpatch. One invocation reads one encrypted page from a chunk file and emits the plaintext — either as a hex dump on stdout or as raw bytes to a file. With -w it also patches a single plaintext byte and writes the re-encrypted page back to the chunk in place.
ondebug -P <page_index> [-C <chunk_id>] [-p <page_size>]
[-O | -x | -o <out.bin>
| -w --row <hex> --col <hex> --value <hex>
| -w --offset <hex> --value <hex>] <chunk_file>
# alternative key-material forms (no SEK file required at decrypt time):
ondebug --keystore <base> --dbsnum <N> -P <page_index> … <chunk_file>
ondebug --mek <file> --dbsnum <N> -P <page_index> … <chunk_file>
# minimal form when $INFORMIXDIR is set (keystore + dbsnum auto-detected):
ondebug -P <page_index> -C <chunk_id> <chunk_file>
The standard read invocation reduces to the page address (-P / -C) and the chunk file. Page size auto-detects by decrypting page 1 at each candidate size and validating the post-decrypt storage-identity stamp; the cipher and mode default to Informix EAR's values. Each can be overridden when the situation calls for it.
For invocations that read the live keystore directly (instead of the default cached-SEK lookup — see the Examples — reading page §"Key material" for the two flows side-by-side):
With -o FILE, the page's plaintext bytes are written to FILE verbatim (exactly page_size bytes).
Without -o, the page is hex-dumped to stdout in the standard 16-bytes-per-row format with a column-index header (00 01 02 … 0f), the row offset prefix, and an ASCII gutter:
00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
00000000 36 00 00 00 04 00 e1 1b 02 00 01 00 e8 00 0c 07 |6...............|
00000010 00 00 00 00 00 00 00 00 00 00 00 01 49 6e 66 6f |............Info|
00000020 72 6d 69 78 20 69 73 20 70 75 72 65 20 64 65 61 |rmix is pure dea|
…
The header row makes a byte position addressable as row R, col C — e.g. the page-header nslots field at row 0x00, col 08–09 reads as 0x0002.
With -w, no stdout output is produced — the page is modified on disk in place. A confirmation line goes to stderr:
ondebug: patched chunk=4 page=54 offset=0x32 (row=0x30 col=0x2): 0x62 -> 0x42
The default mode (page decrypt + optional patch, documented above) is the unnamed primary invocation. ondebug also accepts named subcommands for operations that don't fit the per-page read/write model.
ondebug rm-dbspace --dbsnum <N> [--apply] [--backup] <rootdbs>
See Examples — dropping a dbspace for the full worked run.
ondebug unload-page -P <page_index> [-C <chunk_id>] [-p <page_size>]
[--unload-to <path>] <chunk_file>
Read-only render: decrypts the page, prints its slot table (always), and prints each slot's body in oncheck-format hex+ASCII when the page is a DATA page (header flag = 1). For any other page type (chunk reserved, freelist, bitmap, …) the slot table is shown and the slot bodies are skipped with a one-line non-DATA page (flag=N); slot bodies suppressed note. The render is byte-identical to the legacy -O mode on DATA pages.
Mutually exclusive with -w / -O / -x / -o: pick one render per invocation.
ondebug rm-page --partpage <P> --target <T> [-C <chunk_id>]
[-p <page_size>] [--unload-to <path>]
[--apply] [--backup] <chunk_file>
Removes one page from a table by editing the owning partition page's extent map and aggregate counters. The operator looks up the partition page address via oncheck -pT <db>:<tab> (Physical Address column) and passes it as --partpage; the page to remove is --target. Before any edit, the target page is rendered via the same render unload-page produces (slot table + DATA bodies) so the operator sees what content is being orphaned.
The four edit cases (sole-page extent, first page, last page, interior split) are detected automatically from the target's position within its extent. Descriptor counters (npused, npdata, nrows) are recomputed; chksum is recomputed per the V14 5-XOR formula. Engine MUST be offline.
See Examples — removing a page for the full worked run.
With key material in place and page size auto-detected, the standard form is just the page address and the output flag:
ondebug -P 54 -C 4 -O /home/informix/data/encryptdbs
ondebug -P 54 -C 4 /home/informix/data/encryptdbs
ondebug -P 54 -C 4 -o /tmp/page54_plain.bin \
/home/informix/data/encryptdbs
xxd /tmp/page54_plain.bin | head
ondebug --keystore /home/informix/live/etc/db_keystore \
--dbsnum 4 \
-P 54 -C 4 -O /home/informix/data/encryptdbs
ondebug reads the key in-process from the live keystore; no ~/.ondebug/sek.bin cache file is required at decrypt time. See the Examples — reading page §"Key material" for the two key-source flows side-by-side.
ondebug -P 54 -C 4 -O /home/informix/data/encryptdbs
With $INFORMIXDIR and $ONCONFIG set, ondebug reads the keystore path from $ONCONFIG's DISK_ENCRYPTION line and reads the dbspace number from the rootdbs chunk descriptor table by matching the target chunk's basename. The bare form is equivalent to the explicit --keystore + --dbsnum form above when both sources are available; pass either flag explicitly to override.
ondebug unload-page -P 54 -C 4 /home/informix/data/encryptdbs
Renders the page's slot table and (since flag=1, DATA) each slot's row bytes in hex+ASCII to stderr. With $INFORMIXDIR set the keystore + dbsnum auto-detect; otherwise pass --keystore + --dbsnum or -k explicitly.
ondebug unload-page -P 54 -C 4 \
--unload-to /tmp/page54_unload.txt \
/home/informix/data/encryptdbs
cat /tmp/page54_unload.txt
oncheck -pT testdb:test_enc # → Physical Address 4:5
# → Extent at logical 0: 4:53 size 8
ondebug rm-page --partpage 5 --target 54 -C 4 \
/home/informix/data/encryptdbs
Renders the target page (slot table + DATA rows) to stderr, then prints the planned edit: case (d) interior split of extent {start=53, count=8} into {start=53, count=1} + {start=55, count=6}; descriptor counters npused 2→1, npdata 1→0, nrows 2→0. No write happens without --apply.
onmode -ky # take the engine offline first
ondebug rm-page --partpage 5 --target 54 -C 4 \
--apply --backup \
/home/informix/data/encryptdbs
oninit -vw # bring the engine back up
--backup writes a 2 KB sidecar of the original partition page next to the chunk file (path <chunk_file>.rm-page-<P>.<timestamp>); rollback is dd if=<sidecar> of=<chunk_file> bs=<page_size> seek=<P> conv=notrunc.
onmode -ky # take the engine offline first
ondebug -P 54 -C 4 \
-w --row 0x30 --col 0x02 --value 0x42 \
/home/informix/data/encryptdbs
oninit -vw # bring the engine back up
Decrypts page 54, flips the byte at row 0x30, column 0x02 to 0x42, re-encrypts the page, and writes the new ciphertext back to the chunk file in place. See the Patching examples page for the full round trip with dbaccess verification.
To discuss how Oninit ® can assist please call on +1-913-732-8892 or alternatively just send an email specifying your requirements.
You get all this for free.. think about what you get if you pay us