Follow

How do I perform maintenance on PostgreSQL?

Created by: Brendan Bone
Created date:
Last Updated date:

Question

How do I perform PostgreSQL maintenance like vacuuming and reindexing?

 

Answer

  1. Launch pgAdmin3 or pgAdmin4. If this is your first time to use pgAdmin, follow the steps in the following link to Configure pgAdmin
  2. Expand "Databases"
  3. For every "adg" and "case" database:
    - Right-click on the database
    - Select 'Maintenance'
    - From here you can run the following
         ~Vacuum (Under Vacuum options use FULL)
         ~Analyze
         ~Reindex
    After each run of the above options move to the next till all three are run on each database.

Keep in mind that any of these maintenance actions can take a while to complete and should not be interrupted, especially if you are trying to repair database corruption.

Overview

Performing maintenance on the database can sometimes help prevent or repair database corruption.  Often times corruption can be identified by seeing error messages like the one below in either the FTK_log.txt file (located "C:\ProgramData\AccessData\Products\Forensic Toolkit\<version>") or the PostgreSQL logs (located "[drive]:\pgData93\pg_log")

Error message:

could not read block 0 in file "pg_tblspc/642005/PG_9.3_201306121/16385/645221": read only 0 of 8192 bytes.

Was this article helpful?
1 out of 2 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk