DocsFull Usage GuideParameter Reference

Parameter Reference

Complete guide to configuration and runtime parameters

Setting Parameters

Use param <name> <value>; or p <name> <value>; to set parameters. Use show; to view current values.

Configuration File (pdu.ini)

PGDATARequired

PostgreSQL data directory path. Required for initialization and data extraction.

PGDATA=/var/lib/pgsql/14/data
ARCHIVE_DESTRequired

WAL archive directory path. Required for recovering deleted/updated data and scanning dropped tables.

ARCHIVE_DEST=/var/lib/pgsql/archive
DISK_PATH

Disk device path for dropscan. Required for recovering dropped/truncated tables through disk fragment scanning.

DISK_PATH=/dev/mapper/centos-root
BLOCK_INTERVAL

Number of data blocks to skip during dropscan. Smaller values provide more comprehensive coverage but slower speed.

BLOCK_INTERVAL=20
PGDATA_EXCLUDE

PGDATA paths to exclude during dropscan. Use comma-separated paths if multiple PostgreSQL instances exist on the server.

PGDATA_EXCLUDE=/home/16pg/data,/home/17pg/data

WAL Scan Range

startwalstringDefault: empty (first file in archive)

Starting WAL file for scanning. Use when archive directory has too many files (>250) to improve efficiency.

p startwal 000000010000000100000047;
endwalstringDefault: empty (last file in archive)

Ending WAL file for scanning. Limits the scan range to specific WAL files.

p endwal 0000000100000001000000DC;

Time Range

starttimetimestampDefault: empty

Start time for filtering recovery data. Only records after this time will be recovered.

p starttime 2025-01-01 00:00:00;
endtimetimestampDefault: empty

End time for filtering recovery data. Only records before this time will be recovered.

p endtime 2025-01-15 23:59:59;

Recovery Mode

resmodeenumDefault: time

Data restoration mode. Determines how recovered data is grouped and displayed.

Valid Values
timeTime Range Mode - Recover all records within specified time range
txTransaction Mode - Recover records by specific transaction ID
p resmode tx;
restypeenumDefault: delete

Type of data to recover. Specifies whether to recover deleted or updated records.

Valid Values
deleteRecover deleted records (from DELETE operations)
updateRecover pre-update records (original data before UPDATE)
p restype update;

Export Settings

exmodeenumDefault: csv

Data export format. Determines the output file format for exported data.

Valid Values
csvExport as CSV files (comma-separated values)
sqlExport as SQL INSERT statements
p exmode sql;
encodingenumDefault: utf8

Character encoding for exported files. Choose based on your data's encoding.

Valid Values
utf8UTF-8 encoding (recommended for most cases)
gbkGBK encoding (for Chinese legacy systems)
p encoding gbk;

DropScan Parameters

dsoffnumberDefault: 0

DropScan start offset. Byte offset on disk to start scanning from. Useful for resuming interrupted scans.

p dsoff 1073741824;
blkiternumberDefault: 20

Block intervals during disk scanning. Lower values are slower but more thorough. Same as BLOCK_INTERVAL in pdu.ini.

p blkiter 5;
itmpcsvnumberDefault: 100

Maximum records per CSV file during dropscan. Controls file splitting for large recoveries.

p itmpcsv 1000;
idxmodeenumDefault: on

Index mode for dropscan. When enabled, uses pre-built disk index for faster scanning.

Valid Values
onUse disk index for scanning (faster, requires ds idx first)
offDirect disk scanning without index
p idxmode off;
isomodeenumDefault: off

Image isolation mode. When enabled, saves disk fragments as image files during index scan to prevent data loss from overwrites.

Valid Values
onSave disk fragments as image files during ds idx
offScan directly from disk without saving images
p isomode on;

Typical Configuration Example

pdu.ini
# PostgreSQL 数据目录
PGDATA=/var/lib/pgsql/14/data
# WAL 归档目录
ARCHIVE_DEST=/var/lib/pgsql/archive
# 磁盘路径(用于 dropscan)
DISK_PATH=/dev/sda1
# 块间隔
BLOCK_INTERVAL=20
Recover Deleted Data in Transaction Mode
p resmode tx;
p startwal 000000010000000100000047;
scan orders;
restore del 1360536457;
Dropped Table Recovery Configuration
p isomode on;
ds idx;
ds;
ds repair;
ds copy;