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. Open PgAdmin3.exe from either:
    "C:\Program Files\AccessData\PostgreSQL\bin" (or)
    "C:\Program Files\AccessData\PostgreSQL\<version>\bin"
  2. Go to File > Add Server
    Name = FTK (or any unique name for the new connection)
    Host = localhost
    Port = the port PostgreSQL is running on
    Password = the password chosen while first installing PostgreSQL
  3. 'OK'
  4. Double-click the new "Server" entry created on the left
  5. Expand "Databases"
  6. 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 1 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk