Follow

Reset PostgreSQL transaction logs (xlogs)

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

Introduction:  If the PostgreSQL won't start, and you have verified that the PostgreSQL service "ImagePath" is correct, there may be minor database corruption.  Resetting the transaction logs will allow PostgreSQL to start again.
If there is corruption in the database, the PostgreSQL error logs, found in the "pg_log" folder within the PostgreSQL data folder, may show errors like "database system was interrupted while in recovery", "This probably means that some data is corrupted and you will have to use the last backup for recovery.", "database system was not properly shut down; automatic recovery in progress", or "could not remove symbolic link "pg_tblspc/****": Permission denied."

Procedure:

  1. Open a Command Prompt (as Administrator).
  2. CD into the PostgreSQL bin folder (usually "C:\Program Files\AccessData\PostgreSQL\[version]\bin").
  3. Run the following command:
    pg_resetxlog.exe "[pgData folder location]"

    If you receive a message saying the server was not shut down cleanly and that you will need to force the reset, you may run the following command but you risk the chance of data loss:
    pg_resetxlog.exe -f "[pgData folder location]"

  4. Wait to receive the message "Transaction log reset".
  5. Start the PostgreSQL service.
  6. Open FTK.
  7. Confirm that you are able to create new cases (it may take several attempts to successfully create a new case after resetting the transaction logs).  If you are unable to create new cases, you will need to backup all existing cases, completely reinstall the database, and restore your cases.

Note: After resetting transaction logs you might no longer have access to the case(s) you were working on close to the time the database corruption occurred.

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

Comments

Powered by Zendesk