Обсуждение: postgres doesn't start after crash

Поиск
Список
Период
Сортировка

postgres doesn't start after crash

От
Patrick Brückner
Дата:
Hi,

after a computer crash my postgres 8.2.14 installation under Windows XP
SP3 doesn't start anymore. Here is the log file:

C:\Dokumente und Einstellungen\Admin>2009-10-21 23:57:09 LOG: database
system was interrupted while in recovery at 2009-10-21 22:21:14
2009-10-21 23:57:09 HINT: This probably means that some data is
corrupted and you will have to use the last backup for recovery.
2009-10-21 23:57:09 LOG: checkpoint record is at 24B/DD08FFA0
2009-10-21 23:57:09 LOG: redo record is at 24B/DD08FFA0; undo record is
at 0/0; shutdown FALSE
2009-10-21 23:57:09 LOG: next transaction ID: 0/296859064; next OID: 712969
2009-10-21 23:57:09 LOG: next MultiXactId: 1; next MultiXactOffset: 0
2009-10-21 23:57:09 LOG: database system was not properly shut down;
automatic recovery in progress
2009-10-21 23:57:09 LOG: redo starts at 24B/DD090010
2009-10-21 23:57:10 FATAL: could not count blocks of relation
1663/68065/68157: Permission denied
2009-10-21 23:57:10 CONTEXT: xlog redo insert: rel 1663/68065/68157; tid
165304 9/10
2009-10-21 23:57:10 LOG: startup process (PID 3860) exited with exit code 1
2009-10-21 23:57:10 LOG: aborting startup due to startup process failure

I assume it has something to do with the FATAL: could not count blocks
of relation 1663/68065/68157: Permission denied error. Is there any
chance that I can repair the data without doing a backup?



Re: postgres doesn't start after crash

От
Scott Marlowe
Дата:
2009/10/21 Patrick Brückner <payday81@gmail.com>:
> Hi,
>
> after a computer crash my postgres 8.2.14 installation under Windows XP SP3
> doesn't start anymore. Here is the log file:
>
> 2009-10-21 23:57:10 FATAL: could not count blocks of relation
> 1663/68065/68157: Permission denied

> I assume it has something to do with the FATAL: could not count blocks of
> relation 1663/68065/68157: Permission denied error. Is there any chance that
> I can repair the data without doing a backup?

Yep.  Most common cause is antivirus software.  Don't disable it,
uninstall it and try again (antivir often leaves hooks in the OS that
do "bad things" (TM) and you have to actually uninstall it to fix
this.)  Note that sometimes uninstalling doesn't work because many
pieces of bad antivir don't actually uninstall when you tell them to.

The second most common cause is someone clicking around as an admin
changing permissions or copying files about.

Re: postgres doesn't start after crash

От
Sam Jas
Дата:

Did you find what the reason of crash was?

Log seems that the data is corrupted as the system was crashed. Smart way it to reload data from the valid backup and start your work. If you don’t have a valid backup then at last touch the file (68157) and try to restart your db.
--
Thanks
Sam DJ




--- On Thu, 22/10/09, Patrick Brückner <payday81@gmail.com> wrote:


From: Patrick Brückner <payday81@gmail.com>
Subject: [GENERAL] postgres doesn't start after crash
To: pgsql-general@postgresql.org
Date: Thursday, 22 October, 2009, 1:19 AM

Hi,

after a computer crash my postgres 8.2.14 installation under Windows XP SP3 doesn't start anymore. Here is the log file:

C:\Dokumente und Einstellungen\Admin>2009-10-21 23:57:09 LOG: database system was interrupted while in recovery at 2009-10-21 22:21:14
2009-10-21 23:57:09 HINT: This probably means that some data is corrupted and you will have to use the last backup for recovery.
2009-10-21 23:57:09 LOG: checkpoint record is at 24B/DD08FFA0
2009-10-21 23:57:09 LOG: redo record is at 24B/DD08FFA0; undo record is at 0/0; shutdown FALSE
2009-10-21 23:57:09 LOG: next transaction ID: 0/296859064; next OID: 712969
2009-10-21 23:57:09 LOG: next MultiXactId: 1; next MultiXactOffset: 0
2009-10-21 23:57:09 LOG: database system was not properly shut down; automatic recovery in progress
2009-10-21 23:57:09 LOG: redo starts at 24B/DD090010
2009-10-21 23:57:10 FATAL: could not count blocks of relation 1663/68065/68157: Permission denied
2009-10-21 23:57:10 CONTEXT: xlog redo insert: rel 1663/68065/68157; tid 165304 9/10
2009-10-21 23:57:10 LOG: startup process (PID 3860) exited with exit code 1
2009-10-21 23:57:10 LOG: aborting startup due to startup process failure

I assume it has something to do with the FATAL: could not count blocks of relation 1663/68065/68157: Permission denied error. Is there any chance that I can repair the data without doing a backup?



-- Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Keep up with people you care about with Yahoo! India Mail. Learn how.

Re: postgres doesn't start after crash

От
Craig Ringer
Дата:
Sam Jas wrote:
>
> Did you find what the reason of crash was?
>
> Log seems that the data is corrupted as the system was crashed.

The "permission denied" error would suggest that if anything was
corrupted, it was file-system metadata. That shouldn't happen on NTFS,
though.

It's more likely that for some reason (as previously suggested: quite
possibly AV software) the WAL file creation hit disk, but the result of
the system call setting its permissions never did.

It's quite likely that if you get "properties" on the postgresql data
directory and use the security tab to grant "full control" to the
postgresql user account then apply that change recursively you may be
able to start PostgreSQL.

--
Craig Ringer