Обсуждение: Database Server in Recovery mode!
Hi Friends <p>please help. <p>my database server has gone in recovery mode for some <br />reasons i donot know. <p>whatis the possible steps one shud take to bring the database <br />up to an usable state in minimum time. <br /><tt></tt> <tt></tt><p><tt>Belowis the message when i try to connect.</tt><tt></tt><p><tt>the the out put of ps in the databaseserver.</tt><br /><tt></tt> <tt></tt><p><tt>regds</tt><br /><tt>mallah.</tt><br /><tt></tt> <br /><tt></tt> <tt></tt><p><tt>[rmallah@system11rmallah]$ psql -h 130.94.22.209 -Utradein tradein_clients</tt><br /><tt>psql:The Data Base System is in recovery mode</tt><br /><tt>[rmallah@system11 rmallah]$</tt><br /><tt></tt> <br /><tt></tt> <br /><tt></tt> <tt></tt><p><tt>[root@linux10320 data]# ps auxwww | grep post</tt><br /><tt>postgres 1839 0.0 0.0 138992 856 ? S Apr12 2:43 /usr/bin/postmaster -D /var/lib/pgsql/data</tt><br /><tt>postgres 3901 6.0 1.4 141068 15248 ? D 12:05 1:29 postgres: tradein tradein_clients 130.94.20.27 COPY</tt><br /><tt>root 5862 0.0 0.0 1360 512 pts/3 S 12:29 0:00 grep post</tt><br /><tt>[root@linux10320 data]#</tt><br/>
<tt>Hi i tried to stop it later</tt><br /><tt>and following is what is happening</tt><tt></tt><p><tt>regds</tt><br /><tt>mallah.</tt><br/><tt></tt> <tt></tt><p><tt>bash-2.03$ pg_ctl -D /var/lib/pgsql/data stop</tt><br /><tt>waiting forpostmaster to shut down...................................................</tt><br /><tt>............. failed</tt><br/><tt>pg_ctl: postmaster does not shut down</tt><br /><tt>bash-2.03$</tt><tt></tt><p><tt>then i did:</tt><tt></tt><p><tt>bash-2.03$pg_ctl -D /var/lib/pgsql/data stop -m immediate</tt><br /><tt>waiting for postmasterto shut down....done</tt><br /><b><tt><font color="#000099">postmaster successfully shut down</font></tt></b><br/><tt>bash-2.03$ pg_ctl -D /var/lib/pgsql/data start</tt><br /><tt>postmaster successfully started</tt><br/><tt>bash-2.03$ DEBUG: database system was interrupted at 2002-04-25 12:10:43 IST</tt><br /><tt>DEBUG: CheckPoint record at (91, 2768917524)</tt><br /><tt>DEBUG: Redo record at (91, 2768306852); Undo record at(91, 2718752328); Shutdown FALSE</tt><br /><tt>DEBUG: NextTransactionId: 10070150; NextOid: 86521966</tt><br /><b><tt><fontcolor="#990000">DEBUG: database system was not properly shut down; automatic recovery in progress...</font></tt></b><br/><tt>DEBUG: redo starts at (91, 2768306852)</tt><br /><tt>DEBUG: open(logfile 91 seg 166)failed: No such file or directory</tt><br /><tt>DEBUG: redo done at (91, 2785015440)</tt><br /><tt>The Data Base Systemis starting up</tt><tt></tt><p><tt>bash-2.03$</tt><br /><tt></tt> <tt></tt><p><tt>on connesting from a cleint:</tt><tt></tt><p><tt>[rmallah@system11rmallah]$ psql -h 130.94.22.209 -Utradein tradein_clients</tt><br /><tt>psql:The Data Base System is starting up</tt><br /><tt>[rmallah@system11 rmallah]$</tt><br /><tt></tt> <br /><tt></tt> <tt></tt><p>RajeshKumar Mallah wrote: <blockquote type="CITE">Hi Friends <p>please help. <p>my database serverhas gone in recovery mode for some <br />reasons i donot know. <p>what is the possible steps one shud take to bringthe database <br />up to an usable state in minimum time. <br /> <p><tt>Below is the message when i try to connect.</tt><p><tt>thethe out put of ps in the database server.</tt><br /> <p><tt>regds</tt><br /><tt>mallah.</tt><br /> <br /> <p><tt>[rmallah@system11 rmallah]$ psql -h 130.94.22.209 -Utradein tradein_clients</tt><br /><tt>psql: The DataBase System is in recovery mode</tt><br /><tt>[rmallah@system11 rmallah]$</tt><br /> <br /> <br /> <p><tt>[root@linux10320data]# ps auxwww | grep post</tt><br /><tt>postgres 1839 0.0 0.0 138992 856 ? S Apr12 2:43 /usr/bin/postmaster -D /var/lib/pgsql/data</tt><br /><tt>postgres 3901 6.0 1.4 141068 15248 ? D 12:05 1:29 postgres: tradein tradein_clients 130.94.20.27 COPY</tt><br /><tt>root 5862 0.0 0.0 1360 512 pts/3 S 12:29 0:00 grep post</tt><br /><tt>[root@linux10320 data]#</tt><br /> </blockquote>
<br />oops forgot to post the ps auxwww | grep "post" <p><tt><font size="-1">bash-2.03$ ps auxwww| grep post</font></tt><br/><tt><font size="-1">postgres 3901 3.4 1.3 141068 13868 ? D 12:05 1:29 postgres: tradeintradein_clients 130.94.20.27 COPY</font></tt><br /><tt><font size="-1">root 6476 0.0 0.0 2156 888 pts/3 S 12:39 0:00 su - postgres</font></tt><br /><tt><font size="-1">postgres 6478 0.0 0.1 2004 1168 pts/3 S 12:39 0:00 -bash</font></tt><br /><tt><font color="#000099"><font size="-1">postgres 7058 0.0 0.3 1392003780 pts/3 S 12:44 0:00 /usr/bin/postmaster -D /var/lib/pgsql/data</font></font></tt><br /><tt><font color="#000099"><fontsize="-1">postgres 7059 0.3 1.9 140808 19688 pts/3 D 12:44 0:00 /usr/bin/postmaster -D /var/lib/pgsql/data</font></font></tt><br/><tt><font size="-1">postgres 7396 0.0 0.0 2324 696 pts/3 R 12:47 0:00 ps auxwww</font></tt><br /><tt><font size="-1">postgres 7397 0.0 0.0 1360 512 pts/3 S 12:47 0:00grep post</font></tt><br /><tt><font size="-1">bash-2.03$</font></tt><p>hmmm. two postmasters ?? <p>and perhaps the "<font size="-1"><tt>postgres: tradein tradein_clients 130.94.20.27 COPY" </tt>is the guilty one</font><p>how do iget rid of that ... <p>anyway heading for a reboot becoz this is a live server ! <br />(am i risking data loss?? here )<p>regds <br />mallah. <br /> <br /> <p>Rajesh Kumar Mallah wrote: <blockquote type="CITE">Hi Friends <p>please help.<p>my database server has gone in recovery mode for some <br />reasons i donot know. <p>what is the possible steps oneshud take to bring the database <br />up to an usable state in minimum time. <br /> <p><tt>Below is the message wheni try to connect.</tt><p><tt>the the out put of ps in the database server.</tt><br /> <p><tt>regds</tt><br /><tt>mallah.</tt><br/> <br /> <p><tt>[rmallah@system11 rmallah]$ psql -h 130.94.22.209 -Utradein tradein_clients</tt><br/><tt>psql: The Data Base System is in recovery mode</tt><br /><tt>[rmallah@system11 rmallah]$</tt><br/> <br /> <br /> <p><tt>[root@linux10320 data]# ps auxwww | grep post</tt><br /><tt>postgres 1839 0.0 0.0 138992 856 ? S Apr12 2:43 /usr/bin/postmaster -D /var/lib/pgsql/data</tt><br /><tt>postgres 3901 6.0 1.4 141068 15248 ? D 12:05 1:29 postgres: tradein tradein_clients 130.94.20.27 COPY</tt><br /><tt>root 5862 0.0 0.0 1360 512 pts/3 S 12:29 0:00 grep post</tt><br /><tt>[root@linux10320 data]#</tt><br/> </blockquote>
On Thu, 25 Apr 2002, Rajesh Kumar Mallah wrote: > oops forgot to post the ps auxwww | grep "post" > > bash-2.03$ ps auxwww| grep post > postgres 3901 3.4 1.3 141068 13868 ? D 12:05 1:29 postgres: > tradein tradein_clients 130.94.20.27 COPY > root 6476 0.0 0.0 2156 888 pts/3 S 12:39 0:00 su - > postgres > postgres 6478 0.0 0.1 2004 1168 pts/3 S 12:39 0:00 -bash > postgres 7058 0.0 0.3 139200 3780 pts/3 S 12:44 0:00 > /usr/bin/postmaster -D /var/lib/pgsql/data > postgres 7059 0.3 1.9 140808 19688 pts/3 D 12:44 0:00 > /usr/bin/postmaster -D /var/lib/pgsql/data > postgres 7396 0.0 0.0 2324 696 pts/3 R 12:47 0:00 ps auxwww > > postgres 7397 0.0 0.0 1360 512 pts/3 S 12:47 0:00 grep post > > bash-2.03$ > > hmmm. two postmasters ?? > > and perhaps the "postgres: tradein tradein_clients 130.94.20.27 COPY" > is the guilty one > > how do i get rid of that ... I believe you want kill -INT 3901 to get rid of the backend.
Hmm.. was it this simple! thanks what does -INT signal do btw ?? I will try it next time when ( god forbids my database server crashes again ) mallah. Stephan Szabo wrote: > On Thu, 25 Apr 2002, Rajesh Kumar Mallah wrote: > > > oops forgot to post the ps auxwww | grep "post" > > > > bash-2.03$ ps auxwww| grep post > > postgres 3901 3.4 1.3 141068 13868 ? D 12:05 1:29 postgres: > > tradein tradein_clients 130.94.20.27 COPY > > root 6476 0.0 0.0 2156 888 pts/3 S 12:39 0:00 su - > > postgres > > postgres 6478 0.0 0.1 2004 1168 pts/3 S 12:39 0:00 -bash > > postgres 7058 0.0 0.3 139200 3780 pts/3 S 12:44 0:00 > > /usr/bin/postmaster -D /var/lib/pgsql/data > > postgres 7059 0.3 1.9 140808 19688 pts/3 D 12:44 0:00 > > /usr/bin/postmaster -D /var/lib/pgsql/data > > postgres 7396 0.0 0.0 2324 696 pts/3 R 12:47 0:00 ps auxwww > > > > postgres 7397 0.0 0.0 1360 512 pts/3 S 12:47 0:00 grep post > > > > bash-2.03$ > > > > hmmm. two postmasters ?? > > > > and perhaps the "postgres: tradein tradein_clients 130.94.20.27 COPY" > > is the guilty one > > > > how do i get rid of that ... > > I believe you want > kill -INT 3901 > to get rid of the backend. > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster