Depurar de Postgres el FS de Wals

From Zabbix-ES
Jump to navigation Jump to search

Loguearnos como Postgres y cargar entorno

[root@zbxssoo01 ~]# su - postgres
[postgres@zbxssoo01 ~]$ pg12
Environment Postgres 12 cargado!

Forzamos un Checkpoint

[postgres@zbxssoo01 ~]$ psql –d postgres 

Recuperar el ultimo Wal generado

[postgres@zbxssoo01 pg_wal]$ pg_controldata -D $PGDATA
pg_control version number:            1201
Catalog version number:               201909212
Database system identifier:           6831258203631478219
Database cluster state:               in production
pg_control last modified:             Thu 02 Jul 2020 01:02:57 PM CEST
Latest checkpoint location:           83DA/F10E8288
Latest checkpoint's REDO location:    83DA/D9503068
Latest checkpoint's REDO WAL file:    00000001000083DA000000D9    <--- Ultimo checkpoint

Verificar los wals que se va a cargar

[postgres@zbxssoo01 pg_wal]$ pg_archivecleanup -n $PGDATA/pg_wal/ 00000001000083DA000000D9

Eliminar los Wals

[postgres@zbxssoo01 pg_wal]$ pg_archivecleanup -d $PGDATA/pg_wal/ 00000001000083DA000000D9