PG库清理pg_wal日志
本文最后更新于 227 天前,其中的信息可能已经有所发展或是发生改变,纠正错误请发送邮件到<baigeixiangcai@gmail.com>。

参考文章:

https://zhuanlan.zhihu.com/p/383485177

https://blog.csdn.net/allway2/article/details/96625252


以下内容谨慎操作,确保有备份的情况下再进行,避免数据丢失的风险。

到pg的bin目录下执行,有全局可以在任意位置执行

./pg_controldata "/home/pgsql/data"

pg_control version number:            1100
Catalog version number:               201809051
Database system identifier:           7309312695639404260
Database cluster state:               in production
pg_control last modified:             Mon 01 Apr 2024 05:07:02 PM CST
Latest checkpoint location:           47/539276C8
Latest checkpoint's REDO location:    47/52DE1280
Latest checkpoint's REDO WAL file:    000000010000004700000052
Latest checkpoint's TimeLineID:       1
Latest checkpoint's PrevTimeLineID:   1
Latest checkpoint's full_page_writes: on
Latest checkpoint's NextXID:          0:504581747
Latest checkpoint's NextOID:          700050
Latest checkpoint's NextMultiXactId:  1
Latest checkpoint's NextMultiOffset:  0
Latest checkpoint's oldestXID:        345658413
Latest checkpoint's oldestXID's DB:   16384
Latest checkpoint's oldestActiveXID:  504581747
Latest checkpoint's oldestMultiXid:   1
Latest checkpoint's oldestMulti's DB: 16385
Latest checkpoint's oldestCommitTsXid:0
Latest checkpoint's newestCommitTsXid:0
Time of latest checkpoint:            Mon 01 Apr 2024 05:04:32 PM CST
Fake LSN counter for unlogged rels:   0/1
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:                off
max_connections setting:              512
max_worker_processes setting:         8
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
Float4 argument passing:              by value
Float8 argument passing:              by value
Data page checksum version:           0
Mock authentication nonce:            dae2842b6b7e45f1b12fe36c5ce061cc1b7c7aae35c3d1a910f5d565dfa674dc

使用pg_archivecleanup 工具,复制Latest checkpoint’s REDO WAL file入参进行删除

./pg_archivecleanup -d /home/pgsql/data/pg_wal/  000000010000004700000052

Last Updated on 2024 1 4 月

暂无评论

发送评论 编辑评论

|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇