简体   繁体   English

定期删除 postgres 12 中存档的 Wal 文件

[英]Periodically deletion of archived Wal files in postgres 12

I am working on postgres 12 with windows 10. It is a standalone system.我正在使用 windows 10 开发 postgres 12。它是一个独立的系统。 I am using archiveWal for creating a postgres backup & point in time recovery.我正在使用 archiveWal 创建 postgres 备份和时间点恢复。 My archived Wal files are getting huge after few days.几天后,我存档的 Wal 文件变得越来越大。 I want to delete archived Wal files periodically(For eg every hour).我想定期删除存档的 Wal 文件(例如每小时)。 I tried using pg_archivecleanup with command:-我尝试将 pg_archivecleanup 与命令一起使用:-

pg_archivecleanup.exe C:\PostgreSQL\archiveWal 00000001000000000000003B

For pg_archivecleanup we have to provide the archived Wal file name in postges.conf so that it can delete files created before this file & postgres restart is required after the update.对于 pg_archivecleanup,我们必须在 postges.conf 中提供存档的 Wal 文件名,以便它可以删除在此文件之前创建的文件,更新后需要重新启动 postgres。

Is there any other way or command to do periodically deletion of archived Wal files?有没有其他方法或命令定期删除存档的 Wal 文件?

Deleting WAL archives every few hours defies the purpose.每隔几个小时就删除一次 WAL 档案违背了目的。 You need to keep them as long as the oldest base backup you want to restore.只要要恢复的最旧的基础备份,您就需要保留它们。

I would get more storage and create a job that deletes WAL archive files older than your backup retention time.我会获得更多的存储空间并创建一个作业来删除早于您的备份保留时间的 WAL 归档文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM