Get the App
SLTechnology News&Howtos  ›  Database  › 

Postgres 9.6.5 rebuild Control Fil

Shulou Source: shulou.com Published: 2022-06-01 15:37:19 11月14日 Update

The parameters of the new version of pg_resetlog have changed. Before looking for Dege's article on the Internet, I looked at the method of rebuilding the control file, and then compared the actual change parameters to make it easier for everyone to solve the problem.

Postgresql9.2

Options:

-l TLI,FILE,SEG force minimum WAL starting location for new transaction log

-l timelineid,fileid,seg

Specify the minimum WAL start location for the new transaction log, which should be larger than any WAL log file name that currently exists in pg_xlog. The name is expressed in hexadecimal and is divided into three parts. the first part is the timeline, which generally keeps the value of that part unchanged. The value of the third part cannot exceed 255. that is, 0xFF. If this is the value, add 1 to the second part and change the third part to 0.

-m XID set next multitransaction ID

The security setting should be the largest file name under pg_multixact/offsets, then add 1, and then multiply by 65536. The file name and parameters should be in hexadecimal format. If there is no data in the pg_multixact/offsets directory, get-m 0x10000

Pg_resetxlog-l 0x10x10000 0x0jue 0x4-x 0x000100000-m 0x10000-O 0x10000-f $PGDATA

Postgresql 9.4 plus

Options:

-l XLOGFILE force minimum WAL starting location for new transaction log

-l XLOGFILE

Specify the location of the next xlog log

-m MXID,MXID set next and oldest multitransaction ID

The latest parameters need to be set for both the next transaction and the oldest transaction ID

Pg_resetxlog-l 00000001000000000000000006-x 0x100000-m 0x10000 PGDATA 0x10000-O 0x0 $PGDATA-f

Reference:

Https://yq.aliyun.com/articles/59113

Tags: File parameter transaction log part location hexadecimal file name change control maximum minimum security three score at the same time name name actual data Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Huawei macOS Shulou Information MySQL