The pgpro_datactl utility provides tools for managing Postgres Pro Enterprise data files, including a module for CFS (Compressed File Storage) operations. This module offers the following functionalities:
Retrieving metadata from compressed files, including their compression algorithm and location.
Unpacking CFS files for further analysis.
pgpro_datactl is provided with Postgres Pro Enterprise
as a separate pre-built package pgpro-datactl-ent-16
(for the detailed installation instructions, see Chapter 17).
pgpro_datactl supports the following commands:
pgpro_datactl unpack --source=source_path--target=target_path[--calg=compression_algorithm] [-verbose] [--log-level=logging_level] [--help]
Unpacks CFS files.
-s=source_path--source=source_pathSpecifies the path to a compressed file or directory.
The path must be in the directory named
PG_
that contains the version_datepg_compression file.
-t=target_path--target=target_pathSpecifies the path to a directory where the unpacked files will be placed.
If the source and target directories are the same, files are unpacked
with a .dec extension.
-c=compression_algorithm--calg=compression_algorithm
Specifies the compression algorithm used. If omitted,
the unpack command will take this value from
the pg_compression file.
-v--verboseEnables detailed logging.
--log-level=logging_level
Sets the logging level. Possible values: info,
warning, error.
Example:
pgpro_datactl unpack -s /path/to/archive.cfs -t /path/to/destination -c zstd
In this example, unpack extracts
archive.cfs compressed with the zstd
algorithm into the directory /path/to/destination.
pgpro_datactl probe --source=source_path[--log-level=logging_level] [--help]
Analyzes the specified file and identifies the following:
Compression type: zlib or zstd
compression algorithm.
Fragmentation level: Analyzes the corresponding *.cfm
file (if available) and reports the percentage of unused storage space
in the physical file.
Whether the file belongs to CFS: Checks the presence of an
associated *.cfm file, which indicates whether
the file belongs to a CFS archive.
-s=source_path--source=source_pathSpecifies the path to the target file.
--log-level=logging_level
Sets the logging level. Possible values: info,
warning, error.
Example output:
Probing path: /data/sample.dat Has cfm file: Yes pg_compression: zstd Actual compression: zstd Fragmentation: 5%
In this example, the file is compressed with the zstd
algorithm, is part of a CFS archive, and has a fragmentation level of five
percent.
pgpro_datactl info --source=source_path[--log-level=logging_level] [--help]
Analyzes the file and displays the following information:
The file physical size, virtual size, and utilized file space in bytes.
Whether the garbage collector (GC) is active.
Whether the *.cfm file is present and accessible.
-s=source_path--source=source_pathSpecifies the path to the target file.
--log-level=logging_level
Sets the logging level. Possible values: info,
warning, error.
Example output:
Physical size: 10485760 Virtual size: 9437184 Used size: 7864320 GC active: Yes