重庆思庄Oracle、、PostgreSQL、Redhat认证学习论坛
标题: pg中 使用 pg_waldump 分析 wal [打印本页]
作者: 郑全 时间: 3 天前
标题: pg中 使用 pg_waldump 分析 wal
1.列出当前有哪些WAL
postgres=# select * from pg_ls_waldir() order by 3;
name | size | modification
----------------------------------+----------+------------------------
00000007.history | 257 | 2024-12-28 20:37:07+08
00000006.history | 214 | 2024-12-28 20:37:07+08
000000060000000000000070 | 16777216 | 2024-12-28 20:37:07+08
000000060000000000000071.partial | 16777216 | 2024-12-28 20:37:07+08
000000070000000000000071 | 16777216 | 2024-12-29 14:59:00+08
000000070000000000000072 | 16777216 | 2024-12-29 15:02:29+08
000000070000000000000073 | 16777216 | 2024-12-29 16:00:32+08
000000070000000000000074.partial | 16777216 | 2024-12-29 16:00:32+08
00000008.history | 300 | 2024-12-29 16:00:54+08
000000080000000000000074 | 16777216 | 2024-12-29 19:36:41+08
000000080000000000000075 | 16777216 | 2025-02-11 10:09:19+08
00000009.history | 343 | 2025-02-11 10:09:21+08
000000080000000000000076 | 16777216 | 2025-02-11 10:09:21+08
000000090000000000000077.partial | 16777216 | 2025-02-11 10:19:39+08
000000090000000000000076 | 16777216 | 2025-02-11 10:19:39+08
0000000A.history | 386 | 2025-02-11 10:20:00+08
0000000A0000000000000077 | 16777216 | 2025-02-11 10:59:10+08
0000000B.history | 430 | 2025-02-11 10:59:12+08
0000000A0000000000000078 | 16777216 | 2025-02-11 10:59:12+08
0000000B0000000000000078 | 16777216 | 2025-02-11 11:09:28+08
0000000B0000000000000079.partial | 16777216 | 2025-02-11 11:09:28+08
0000000C.history | 474 | 2025-02-11 11:09:29+08
0000000C0000000000000079 | 16777216 | 2025-02-11 18:21:44+08
0000000C000000000000007A | 16777216 | 2025-02-11 21:50:32+08
0000000C000000000000007B | 16777216 | 2025-02-11 21:50:35+08
0000000D.history | 518 | 2025-02-11 21:50:35+08
0000000D000000000000007C.partial | 16777216 | 2025-02-11 21:56:55+08
0000000D000000000000007B | 16777216 | 2025-02-11 21:56:55+08
0000000E.history | 562 | 2025-02-11 21:57:09+08
0000000E000000000000007C | 16777216 | 2025-02-12 04:33:10+08
0000000E000000000000007D | 16777216 | 2025-04-13 10:33:15+08
0000000E000000000000007E | 16777216 | 2025-04-13 11:43:27+08
(32 rows)
2.对当前wal 文件进行分析
pg_waldump -p $PGDATA/pg_wal 0000000E000000000000007E