Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2010
    Posts
    3

    Red face Unanswered: How to recover database from WAL

    Because of the DB server reboot, postgres could not be started.
    I dont have latest db dumb. How can i get all data as it is before DB crashed.

    When tried to start the database, it shows following log
    $ LOG: could not resolve "localhost": Name or service not known
    LOG: disabling statistics collector for lack of working socket
    LOG: database system was interrupted while in recovery at 2010-07-26 17:15:36 NPT
    HINT: This probably means that some data is corrupted and you will have to use the last backup for recovery.
    LOG: checkpoint record is at 3/6E31CED0
    LOG: redo record is at 3/6E31CED0; undo record is at 0/0; shutdown FALSE
    LOG: next transaction ID: 62681682; next OID: 2281588
    LOG: next MultiXactId: 2; next MultiXactOffset: 3
    LOG: database system was not properly shut down; automatic recovery in progress
    LOG: redo starts at 3/6E31CF14
    PANIC: could not open relation 1663/988808/2279941: No such file or directory
    LOG: startup process (PID 4550) was terminated by signal 6
    LOG: aborting startup due to startup process failure

  2. #2
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    Your data directory is corrupted.
    There is nothing that you can do apart from restoring your last backup.

    I will never understand why people don't make backups if apparently their data is important...

  3. #3
    Join Date
    Jul 2010
    Posts
    3
    If there any thing can be done from WAL file? How to recover from WAL

  4. #4
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    Quote Originally Posted by zaxmeen View Post
    How to recover from WAL
    Did you archive all your WAL files after the last backup?

  5. #5
    Join Date
    Jul 2010
    Posts
    3
    I dont know the actual steps for archiving.
    There are numbers of archived files stored in \data\pg_xlog.
    I have to archive the latest one. But i dont know the steps for archiving

  6. #6
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    Quote Originally Posted by zaxmeen View Post
    I dont know the actual steps for archiving.
    There are numbers of archived files stored in \data\pg_xlog.
    Those are not archived log files. Postgres will apply them automatically at startup if the base directory is not corrupted.

    I have to archive the latest one.
    You can only archive WAL files if Postgres is running properly.

    But i dont know the steps for archiving
    This is all documented in the manual: http://www.postgresql.org/docs/current/static/continuous-archiving.html#BACKUP-ARCHIVING-WAL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •