lightdb/postgresql pg_control文件的作用
记录了lightdb服务器内部的信息,如最新检查点时间、服务器状态、WAL文件位置,总之和数据库可能损坏相关的信息这里都有维护,还包括LC_CTYPE/LC_COLLATE等信息,和oracle控制文件差不多的。如果该文件被删除,实例将无法启动。运行时,会在共享内存中维护一份pg_control的镜像。
https://blog.csdn.net/lixiaogang_theanswer/article/details/114933301
查看pg_controldata文件的内容
有两种方式,一种是通过SQL查询,如下:
select * from pg_catalog.pg_control_checkpoint(); select * from pg_catalog.pg_control_system(); select * from pg_catalog.pg_control_init(); -- 获取结果和pg_controldata相同 select * from pg_catalog.pg_control_recovery();
还有一种是通过命令行。如下:
[postgres@hs-10-20-30-194 global]$ lt_controldata ../../data pg_control version number: 1300 Catalog version number: 202105121 Database system identifier: 6965242430856727465 Database cluster state: shut down pg_control last modified: Tue 25 May 2021 01:10:07 AM CST Latest checkpoint location: 17/7C6E96E0 Latest checkpoint's REDO location: 17/7C6E96E0 Latest checkpoint's REDO WAL file: 00000001000000170000007C Latest checkpoint's TimeLineID: 1 Latest checkpoint's PrevTimeLineID: 1 Latest checkpoint's full_page_writes: on Latest checkpoint's NextXID: 0:46350725 Latest checkpoint's NextOID: 16818 Latest checkpoint's NextMultiXactId: 1 Latest checkpoint's NextMultiOffset: 0 Latest checkpoint's oldestXID: 727 Latest checkpoint's oldestXID's DB: 1 Latest checkpoint's oldestActiveXID: 0 Latest checkpoint's oldestMultiXid: 1 Latest checkpoint's oldestMulti's DB: 1 Latest checkpoint's oldestCommitTsXid:0 Latest checkpoint's newestCommitTsXid:0 Time of latest checkpoint: Tue 25 May 2021 01:09:54 AM CST Fake LSN counter for unlogged rels: 0/3E8 Minimum recovery ending location: 0/0 Min recovery ending loc's timeline: 0 Backup start location: 0/0 Backup end location: 0/0 End-of-backup record required: no wal_level setting: replica wal_log_hints setting: on max_connections setting: 10000 max_worker_processes setting: 8 max_wal_senders setting: 10 max_prepared_xacts setting: 0 max_locks_per_xact setting: 64 track_commit_timestamp setting: off Maximum data alignment: 8 Database block size: 8192 Blocks per segment of large relation: 131072 WAL block size: 8192 Bytes per WAL segment: 16777216 Maximum length of identifiers: 64 Maximum columns in an index: 32 Maximum size of a TOAST chunk: 1996 Size of a large-object chunk: 2048 Date/time type storage: 64-bit integers Float8 argument passing: by value Data page checksum version: 0 Mock authentication nonce: 11d5c8d76b72e3c68abe49250c775aa8a0a5e50ec275757b002b74d9547674d0
pg_control控制文件中的内容由ControlFileData定义,在initdb/lt_initdb初始化时创建。