2.10. Setting up PTRACK Backups #
The PTRACK backup mode can be used only for Postgres Pro Standard and Postgres Pro Enterprise installations, or patched vanilla PostgreSQL.
If you are going to use PTRACK backups, complete the steps below.
Note
The permissions required for the role that will perform PTRACK backups (the backup role in the examples below) are listed in Section 2.6. The role must have permissions only in the database used for connection to the Postgres Pro server.
Add
ptrackto theshared_preload_librariesvariable in thepostgresql.conffile:shared_preload_libraries = 'ptrack'
To enable tracking page updates, set the
ptrack.map_sizeparameter to a positive integer and restart the server.For optimal performance, it is recommended to set
ptrack.map_sizeto, whereN/ 1024Nis the size of the Postgres Pro cluster, in MB. If you set this parameter to a lower value, PTRACK is more likely to map several blocks together, which leads to false-positive results when tracking changed blocks and increases the incremental backup size as unchanged blocks can also be copied into the incremental backup. Settingptrack.map_sizeto a higher value does not affect PTRACK operation, but it is not recommended to set this parameter to a value higher than 1024.Note
If you change the
ptrack.map_sizeparameter value, the previously created PTRACK map file is cleared, and tracking newly changed blocks starts from scratch. Thus, you have to retake a full backup before taking incremental PTRACK backups after changingptrack.map_size.Create PTRACK extension:
CREATE EXTENSION ptrack;