Database Maintenance

Proper database maintenance ensures that the system will always function optimally and that problems can be handled effectively. There are three main areas of database maintenance:

  • Monitoring log files.

  • Scheduling regular VACUUM and VACUUM ANALYZE events.

  • Routinely backing up.

Regular monitoring of log files can tip off administrators to potential issues that can be corrected long before they become major problems. Some administrators even write small custom scripts to parse log files and automatically mail any suspicious entries to an email address so that the administrator can take further action.

cron is also a useful database maintenance tool, especially for performing routine tasks like vacuumdb and log rotation. One ...

Get PostgreSQL Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.