postgresql wal文件误删恢复
2021/9/11 2:05:04
本文主要是介绍postgresql wal文件误删恢复,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
2021-09-10 17:22:42.417183T @ startup 00000 [2021-09-10 17:22:42 CST] 0 [9298] LOCATION: StartupXLOG, xlog.c:6347 2021-09-10 17:22:42.417206T @ startup XX000 [2021-09-10 17:22:42 CST] 0 [9298] FATAL: XX000: required WAL directory "pg_wal" does not exist 2021-09-10 17:22:42.417206T @ startup XX000 [2021-09-10 17:22:42 CST] 0 [9298] LOCATION: ValidateXLOGDirectoryStructure, xlog.c:4262 2021-09-10 17:22:42.417407T @ postmaster 00000 [2021-09-10 17:22:42 CST] 0 [9296] LOG: 00000: startup process (PID 9298) exited with exit code 1 2021-09-10 17:22:42.417407T @ postmaster 00000 [2021-09-10 17:22:42 CST] 0 [9296] LOCATION: LogChildExit, postmaster.c:3714 2021-09-10 17:22:42.417417T @ postmaster 00000 [2021-09-10 17:22:42 CST] 0 [9296] LOG: 00000: aborting startup due to startup process failure 2021-09-10 17:22:42.417417T @ postmaster 00000 [2021-09-10 17:22:42 CST] 0 [9296] LOCATION: reaper, postmaster.c:2969 2021-09-10 17:22:42.427171T @ postmaster 00000 [2021-09-10 17:22:42 CST] 0 [9296] LOG: 00000: database system is shut down 2021-09-10 17:22:42.427171T @ postmaster 00000 [2021-09-10 17:22:42 CST] 0 [9296] LOCATION: UnlinkLockFiles, miscinit.c:928
执行pg_resetwal -f PGDATA可以wal文件,但是会丢失事务日志以及数据不一致,极端情况下某些数据块丢失。此时回初始化WAL文件如下:
[zjh@lightdb1 pgsql13.2]$ cd data/pg_wal/ [zjh@lightdb1 pg_wal]$ ll total 1048576 -rw------- 1 zjh zjh 1073741824 Sep 10 21:44 00000001000000BB00000001 drwx------ 2 zjh zjh 6 Sep 10 21:42 archive_status
再启动PG,备份、重建。
这篇关于postgresql wal文件误删恢复的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-01-05快速清空 PostgreSQL 数据库中的所有表格,让你的数据库重新焕然一新!
- 2024-01-04在PostgreSQL中创建角色:判断角色是否存在并创建
- 2023-05-16PostgreSQL一站式插件推荐 -- pg_enterprise_views
- 2022-11-22PostgreSQL 实时位置跟踪
- 2022-11-22如何将PostgreSQL插件移植到openGauss
- 2022-11-11PostgreSQL:修改数据库用户的密码
- 2022-11-06Windows 环境搭建 PostgreSQL 物理复制高可用架构数据库服务
- 2022-10-27Windows 环境搭建 PostgreSQL 逻辑复制高可用架构数据库服务
- 2022-10-11PostgreSql安装(Windows10版本)
- 2022-09-13PostgreSQL-Network Address类型操作和函数