Determine a time period with low business load when aggressive freeze for tuples will have minaimal impact.
Copy the script that implements aggressive freeze for tuples and set the connection information, multiplicity, and timeout value parameters.
For streaming replication configuration, specify multiple connection destinations in PGHOST and PGPORT, and specify "read-write" or "primary" in PGTARGETSESSIONATTRS to connect to the primary server.
The scripts are stored in the following location under the Fujitsu Enterprise Postgres installation directory:
<Install directory>/share/execute_freeze.sh.sample
Register the script from step 2 in the job scheduler.
Specify the execution timing according to the planned time period.
Example: Use cron to run a script called execute_freeze.sh at 2:05 AM
5 2 * * 0 sh /path/to/execute_freeze.sh
When a schedule review is required
Even after aggressive freeze for tuples is scheduled, continue to monitor the trend in transaction ID usage. If you determine that the freezing process is not keeping up, the schedule must be reviewed. To collect the statistical information required for the review, enable the extended functionality for aggressive freeze for tuples using the following procedure.
Modify the shared_preload_libraries parameter in postgresql.conf
shared_preload_libraries = 'pgx_stat_vacuum_freeze'
Execute the following SQL
SELECT datname FROM pg_database WHERE datallowconn = true;
Execute the following CREATE EXTENSION for all databases to be output and define the extension.
CREATE EXTENSION pgx_stat_vacuum_freeze;
Monitor the trends in transaction usage, and if you determine that the freezing process is not keeping up, refer to "9.7.3 Tuning the Allocation Time for Aggressive Freeze for Tuples" to calculate the time required for freezing tuples and add more allocation time.