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)
PGDATARequiredPostgreSQL data directory path. Required for initialization and data extraction.
PGDATA=/var/lib/pgsql/14/dataARCHIVE_DESTRequiredWAL source directory used by PDU. Use the archive directory when archiving is enabled, or a checked copy of PGDATA/pg_wal when it was not enabled.
ARCHIVE_DEST=/data/pdu-backup/incident/pg_walDISK_PATHDisk device path for dropscan. Required for recovering dropped/truncated tables through disk fragment scanning.
DISK_PATH=/dev/mapper/centos-rootBLOCK_INTERVALNumber of data blocks to skip during dropscan. Smaller values provide more comprehensive coverage but slower speed.
BLOCK_INTERVAL=20PGDATA_EXCLUDERequiredRequired for ds idx. List every PostgreSQL data directory located on DISK_PATH so existing database pages are excluded from the ISO image. Use comma-separated absolute paths with no spaces.
PGDATA_EXCLUDE=/home/15pg/data,/home/16pg/data,/home/17pg/dataWAL 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: emptyStart time for filtering recovery data. Only records after this time will be recovered.
p starttime 2025-01-01 00:00:00;endtimetimestampDefault: emptyEnd time for filtering recovery data. Only records before this time will be recovered.
p endtime 2025-01-15 23:59:59;Recovery Mode
resmodeenumDefault: timeData restoration mode. Determines how recovered data is grouped and displayed.
timeTime Range Mode - Recover all records within specified time rangetxTransaction Mode - Recover records by specific transaction IDp resmode tx;restypeenumDefault: deleteType of data to recover. Specifies whether to recover deleted or updated records.
deleteRecover deleted records (from DELETE operations)updateRecover pre-update records (original data before UPDATE)p restype update;Export Settings
exmodeenumDefault: csvData export format. Determines the output file format for exported data.
csvExport as CSV files (comma-separated values)sqlExport as SQL INSERT statementsp exmode sql;encodingenumDefault: utf8Character encoding for exported files. Choose based on your data's encoding.
utf8UTF-8 encoding (recommended for most cases)gbkGBK encoding (for Chinese legacy systems)p encoding gbk;DropScan Parameters
dsoffnumberDefault: 0DropScan start offset. Byte offset on disk to start scanning from. Useful for resuming interrupted scans.
p dsoff 1073741824;blkiternumberDefault: 20Block intervals during disk scanning. Lower values are slower but more thorough. Same as BLOCK_INTERVAL in pdu.ini.
p blkiter 5;itmpcsvnumberDefault: 100Maximum records per CSV file during dropscan. Controls file splitting for large recoveries.
p itmpcsv 1000;idxmodeenumDefault: onIndex mode for dropscan. When enabled, uses pre-built disk index for faster scanning.
onUse the saved disk index (standard flow: configure PGDATA_EXCLUDE, then run ds idx directly)offDirect disk scanning without indexp idxmode off;isomodeenumDefault: onImage isolation mode. It is enabled by default. After DISK_PATH and the required PGDATA_EXCLUDE list are configured, run ds idx directly to save restore/.dsiso/pgiso for later ds iso scanning.
onSave disk fragments as image files during ds idxoffScan directly from disk without saving imagesp isomode off; # Only when image saving is intentionally disabledTypical Configuration Example
# PostgreSQL 数据目录 PGDATA=/var/lib/pgsql/14/data # WAL 归档目录 ARCHIVE_DEST=/var/lib/pgsql/archive # 磁盘路径(用于 dropscan) DISK_PATH=/dev/sda1 # DISK_PATH 磁盘上的全部 PostgreSQL 数据目录(必填) PGDATA_EXCLUDE=/var/lib/pgsql/14/data,/home/pg16/data # 块间隔 BLOCK_INTERVAL=20
p resmode tx; p startwal 000000010000000100000047; scan orders; restore del 1360536457;
# pdu.ini DISK_PATH=/dev/sda1 PGDATA_EXCLUDE=/var/lib/pgsql/14/data,/home/pg16/data ds idx; ds iso; ds repair; ds copy;