Due to a misoperation, the online machine's database program directory is deleted, although it does not affect the normal use of the program, the data is not lost, but after the server outage or database downtime, the database will not start, and the database corresponding to the compilation parameters can not be viewed, so with the development of consent, the database closed, Recompile the database program and try possibly the correct parameters. One of the most important is about the size of the data:
--with-blocksize=blocksize in KB [8] --with-segsize=segsize in GB [1] --with-wal-blocksize=blocksize in KB [8 ] --with-wal-segsize=segsize in MB [+]
If there is an inconsistency, the database program will not be able to start the database.
At first, is based on the common line of several parameters to do the attempt, there are several errors, which block size and Wal blocks size inconsistent can be very simple to identify, but the error reported relseg_size inconsistent, Baidu, Google did not find the corresponding parameter, Fortunately, the data is in, followed by looking at the size of the data table to determine the--with-wal-segsize size of 64,--with-segsize size of 8.
Afterwards, look at the relevant data and find the following correspondence:
Xlog_seg_size ---- --with-wal-segsizerelseg_size ---- --with-Segsizexlog_blcksz ---- --with-wal-blocksizeblcksz ---- --with-blocksize
The feeling of PG data is still less, encountered some error, can only see the code there is no description:
Here are the instructions found in SRC\BACKEND\STORAGE\SMGR\MD.C:
The magnetic disk Storage Manager keeps track of open file
Descriptors in its own descriptor pool. This is the done to make it
Easier to support relations that is larger than the operating
System ' s file size limit (often 2GBytes). In order to do,
We break relations to "segment" files that is each shorter than
The OS file size limit. The segment size is set by the Relseg_size
Configuration constant in Pg_config.h.
Found in src\include\access\xlog_internal.h:
Split by Xlog_seg_size.
The parameters after compiling the database can be viewed through pg_controldata and pg_config. But because there is no application, there is no such channel. Pg_controldata is the information that reads the Pg_control file, but Pg_control is binary and cannot be viewed, using strings to view the display as empty, stating that there is no information that can be printed directly. Before you know how to recover the lost Pg_control file, as for the recovery of configuration information from the Pg_control file, look at the following.
Reference:
Src\backend\storage\smgr\md.c
Src\include\access\xlog_internal.h
The database cluster is initialized with Relseg_size 1048576, but the server is compiled with Relseg_size 8388608