Обсуждение: Is my database done for?

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

Is my database done for?

От
Mark Nelson
Дата:
Hi,

Let me explain what I've done and hopefully somebody out there can tell me to
either relax or continue panicking.

I'm running postgres on Red Hat 7.2 and after moving the server to a new
location, I rebooted the machine and noticed that the postgres server wasn't
working. When I tried psql, it said it couldn't because the postmaster wasn't
running. When I tried running the postmaster command, I got:

"postmaster does not know where to find the database system data.  You must
specify the directory that contains the database system either by specifying
the -D invocation option or by setting the PGDATA environment variable."

I found the files in /var/lib/pgsql/data/ but when I tried to run the
postmaster, it would not allow me to do it because of the permissions set. I
switched to user postgres and reissued the command. This time it took. The
postmaster had to be run by user postgres because postgres owns the
directories and files in /var/lib/pgsql/.

Upon issuing the postmaster -D /var/lib/pgsql/data command:

"Found a pre-existing shared memory block (ID 131075) still in use.
If you're sure there are no old backends still running,
delete "/var/lib/pgsql/data/postmaster.pid"."

I wasn't aware of any processes running because I just started the machine and
it told me that postmaster wasn't working. So I removed postmaster.pid, and
then:

DEBUG:  database system was interrupted at 2002-08-15 16:06:01 MDT
DEBUG:  CheckPoint record at (0, 10393040)
DEBUG:  Redo record at (0, 10393040); Undo record at (0, 0); Shutdown TRUE
DEBUG:  NextTransactionId: 47382; NextOid: 36837
DEBUG:  database system was not properly shut down; automatic recovery in
progress...
DEBUG:  ReadRecord: record with zero len at (0, 10393104)
DEBUG:  redo is not required
DEBUG:  database system is in production state

and it has been like that for about 20 minutes. I have not been returned to a
prompt of any kind, it is just holding there. What does that mean? Is it
stuck? Is the data gone? Should I interrupt it or let it finish? How long
should I wake?

Advice, support, consolation all very welcome right now. :)
/mark



Re: Is my database done for?

От
Tom Lane
Дата:
Mark Nelson <mcn@cc.usu.edu> writes:
> DEBUG:  database system is in production state

Looks to me like you're up and running --- although that bit about
pre-existing shared memory block worries me.  Are you *certain* there is
no postmaster already running?  I'd try "ps auxww | grep postmaster" (or
"ps -ef" depending on your Unix flavor) and look for older processes.
It's not at all impossible that your machine is already configured to
start Postgres at bootup.

> I have not been returned to a prompt of any kind

You didn't put the postmaster in background.  You may care to reread
the Admin Guide concerning standard procedures for starting the
postmaster...

            regards, tom lane

Re: Is my database done for?

От
"Aurangzeb M. Agha"
Дата:
Hi Mark --

I'm a complete novice som excuse me if I'm way off base.

From the way I've seen postmaster run normally, when it starts, it stays
in a state where it keeps running and no prompt comes up.  Try to open a
new xterm/dos/cygwin window and connect via psql.

    Rgs,
    Aurangzeb


On Fri, 16 Aug 2002, Mark Nelson wrote:

:Hi,
:
:Let me explain what I've done and hopefully somebody out there can tell me to
:either relax or continue panicking.
:
:I'm running postgres on Red Hat 7.2 and after moving the server to a new
:location, I rebooted the machine and noticed that the postgres server wasn't
:working. When I tried psql, it said it couldn't because the postmaster wasn't
:running. When I tried running the postmaster command, I got:
:
:"postmaster does not know where to find the database system data.  You must
:specify the directory that contains the database system either by specifying
:the -D invocation option or by setting the PGDATA environment variable."
:
:I found the files in /var/lib/pgsql/data/ but when I tried to run the
:postmaster, it would not allow me to do it because of the permissions set. I
:switched to user postgres and reissued the command. This time it took. The
:postmaster had to be run by user postgres because postgres owns the
:directories and files in /var/lib/pgsql/.
:
:Upon issuing the postmaster -D /var/lib/pgsql/data command:
:
:"Found a pre-existing shared memory block (ID 131075) still in use.
:If you're sure there are no old backends still running,
:delete "/var/lib/pgsql/data/postmaster.pid"."
:
:I wasn't aware of any processes running because I just started the machine and
:it told me that postmaster wasn't working. So I removed postmaster.pid, and
:then:
:
:DEBUG:  database system was interrupted at 2002-08-15 16:06:01 MDT
:DEBUG:  CheckPoint record at (0, 10393040)
:DEBUG:  Redo record at (0, 10393040); Undo record at (0, 0); Shutdown TRUE
:DEBUG:  NextTransactionId: 47382; NextOid: 36837
:DEBUG:  database system was not properly shut down; automatic recovery in
:progress...
:DEBUG:  ReadRecord: record with zero len at (0, 10393104)
:DEBUG:  redo is not required
:DEBUG:  database system is in production state
:
:and it has been like that for about 20 minutes. I have not been returned to a
:prompt of any kind, it is just holding there. What does that mean? Is it
:stuck? Is the data gone? Should I interrupt it or let it finish? How long
:should I wake?
:
:Advice, support, consolation all very welcome right now. :)
:/mark
:
:
:
:---------------------------(end of broadcast)---------------------------
:TIP 2: you can get off all lists at once with the unregister command
:    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
:

--
Aurangzeb M. Agha    | Email : aagha@bigfoot.com
                     | Home  : +3 010 8959.558
34 Nafsika St.       | Direct: +3 010 8995.875
Voula 16673          | Mobile: TBD
Greece               | Voice : 415 412 4234 (US Only)
                     | e-Fax : 978 246.0770
PGP ID: 0x68B3A763   |

"Those who would give up essential liberty to purchase a little
 temporary safety deserve neither liberty nor safety."

                    - Benjamin Franklin


Re: Is my database done for?

От
douggorley@shaw.ca
Дата:
From what you're saying, it sounds like you simply didn't run postmaster
in the background.  Try starting postmaster with the following command:

/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 &

(Adjust the paths to your particular system.)

Doug Gorley | douggorley@shaw.ca


----- Original Message -----
From: Mark Nelson <mcn@cc.usu.edu>
Date: Friday, August 16, 2002 6:52 am
Subject: [NOVICE] Is my database done for?

> Hi,
>
> Let me explain what I've done and hopefully somebody out there can
> tell me to
> either relax or continue panicking.
>
> I'm running postgres on Red Hat 7.2 and after moving the server to
> a new
> location, I rebooted the machine and noticed that the postgres
> server wasn't
> working. When I tried psql, it said it couldn't because the
> postmaster wasn't
> running. When I tried running the postmaster command, I got:
>
> "postmaster does not know where to find the database system data.
> You must
> specify the directory that contains the database system either by
> specifying
> the -D invocation option or by setting the PGDATA environment
> variable."
> I found the files in /var/lib/pgsql/data/ but when I tried to run
> the
> postmaster, it would not allow me to do it because of the
> permissions set. I
> switched to user postgres and reissued the command. This time it
> took. The
> postmaster had to be run by user postgres because postgres owns the
> directories and files in /var/lib/pgsql/.
>
> Upon issuing the postmaster -D /var/lib/pgsql/data command:
>
> "Found a pre-existing shared memory block (ID 131075) still in use.
> If you're sure there are no old backends still running,
> delete "/var/lib/pgsql/data/postmaster.pid"."
>
> I wasn't aware of any processes running because I just started the
> machine and
> it told me that postmaster wasn't working. So I removed
> postmaster.pid, and
> then:
>
> DEBUG:  database system was interrupted at 2002-08-15 16:06:01 MDT
> DEBUG:  CheckPoint record at (0, 10393040)
> DEBUG:  Redo record at (0, 10393040); Undo record at (0, 0);
> Shutdown TRUE
> DEBUG:  NextTransactionId: 47382; NextOid: 36837
> DEBUG:  database system was not properly shut down; automatic
> recovery in
> progress...
> DEBUG:  ReadRecord: record with zero len at (0, 10393104)
> DEBUG:  redo is not required
> DEBUG:  database system is in production state
>
> and it has been like that for about 20 minutes. I have not been
> returned to a
> prompt of any kind, it is just holding there. What does that mean?
> Is it
> stuck? Is the data gone? Should I interrupt it or let it finish?
> How long
> should I wake?
>
> Advice, support, consolation all very welcome right now. :)
> /mark
>
>
>
> ---------------------------(end of broadcast)-----------------------
> ----
> TIP 2: you can get off all lists at once with the unregister command
>    (send "unregister YourEmailAddressHere" to
> majordomo@postgresql.org)