Received: from web20602.mail.yahoo.com (web20602.mail.yahoo.com [216.136.226.158]) by postgresql.org (8.11.3/8.11.4) with SMTP id fAU46Zm47536 for ; Thu, 29 Nov 2001 23:06:35 -0500 (EST) (envelope-from trajakumar@yahoo.com) Message-ID: <20011130040639.5822.qmail@web20602.mail.yahoo.com> Received: from [203.197.179.23] by web20602.mail.yahoo.com via HTTP; Thu, 29 Nov 2001 20:06:39 PST Date: Thu, 29 Nov 2001 20:06:39 -0800 (PST) From: raja kumar thatte Subject: Re: Vaccum To: "Leong, Fushan" , pgsql-admin@postgresql.org In-Reply-To: <2DFBC8374F5A0F4E954C07C158844F323886D8@milton.sonosite.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1215423618-1007093199=:1189" X-Archive-Number: 200111/189 X-Sequence-Number: 2714 --0-1215423618-1007093199=:1189 Content-Type: text/plain; charset=us-ascii No problem, we are doing vaccume different tables at different times. Because if you do vaccume it will decrease the performace of data base you can write scripts like this. -----cleanTable.sh-------------------- #!/sbin/sh echo "############## START:## Clean Table $1 ##" /usr/local/pgsql/bin/psql -U xxxxx -d xxxxxxx << end vacuum verbose analyze $1; \q end echo "############## END:## Clean Table $1 ##" -----cleanDB.sh-------------------------- #!/sbin/sh #the following entry should be made in crontab of postgresql account #5 * * * * $HOME/cleanDB.sh echo "############## START:## Clean DB ## "`date '+%d/%m/%y %H:%M:%S'` HOR=`date '+ %H'` if [ $HOR -eq 19 ]; then /sbin/sh $HOME/cleanTable.sh aaaaaaaaaaa /sbin/sh $HOME/cleanTable.sh bbbbbbbbbbbb elif [ $HOR -eq 20 ]; then /sbin/sh $HOME/cleanTable.sh cccccccccccc elif [ $HOR -eq 21 ]; then /sbin/sh $HOME/cleanTable.sh dddddd /sbin/sh $HOME/cleanTable.sh eeeeeee elif [ $HOR -eq 22 ]; then /sbin/sh $HOME/cleanTable.sh ffffffff /sbin/sh $HOME/cleanTable.sh ggggggggggggg elif [ $HOR -eq 03 ]; then /sbin/sh $HOME/cleanTable.sh hhhhhhhhh else echo "-------Nothing to vacuum--------" fi echo "############## END :## Clean DB ## "`date '+%d/%m/%y %H:%M:%S'` __________________________________ "Leong, Fushan" wrote: Hi : Want to get your opinion. I am thinking to schedule to run Vaccum everynight. 1) As I understand, Vaccum is the command to delete old data, right? 1) Do I have to stop the postmaster before run the Vaccum command? 2) Should I run it everynight? How often should I run it? thanks Fushan ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? http://archives.postgresql.org --------------------------------- Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. --0-1215423618-1007093199=:1189 Content-Type: text/html; charset=us-ascii

No problem, we are doing vaccume different tables at different times.

Because if you do vaccume it will decrease the performace of data base

you can write scripts like this.

-----cleanTable.sh--------------------

#!/sbin/sh
echo "############## START:## Clean Table  $1 ##"
/usr/local/pgsql/bin/psql -U xxxxx -d xxxxxxx << end
vacuum  verbose  analyze $1;
\q
end
echo "############## END:## Clean Table  $1 ##"

-----cleanDB.sh--------------------------

#!/sbin/sh

#the following entry should be made in crontab of postgresql account
#5      *       *       *       *       $HOME/cleanDB.sh

echo "############## START:## Clean DB ## "`date '+%d/%m/%y %H:%M:%S'`
HOR=`date '+ %H'`
if [ $HOR -eq 19 ]; then
        /sbin/sh $HOME/cleanTable.sh aaaaaaaaaaa
        /sbin/sh $HOME/cleanTable.sh bbbbbbbbbbbb

elif [ $HOR -eq 20 ]; then
        /sbin/sh $HOME/cleanTable.sh cccccccccccc

elif [ $HOR -eq 21 ]; then
        /sbin/sh $HOME/cleanTable.sh dddddd
        /sbin/sh $HOME/cleanTable.sh eeeeeee

elif [ $HOR -eq 22 ]; then
        /sbin/sh $HOME/cleanTable.sh ffffffff
        /sbin/sh $HOME/cleanTable.sh ggggggggggggg


elif [ $HOR -eq 03 ]; then
        /sbin/sh $HOME/cleanTable.sh hhhhhhhhh


else
        echo "-------Nothing to vacuum--------"
fi
echo "############## END  :## Clean DB ## "`date '+%d/%m/%y %H:%M:%S'`    
                                                          

__________________________________                    

  "Leong, Fushan" <fushan.leong@SonoSite.com> wrote:

Hi :

Want to get your opinion.

I am thinking to schedule to run Vaccum everynight.

1) As I understand, Vaccum is the command to delete old data, right?
1) Do I have to stop the postmaster before run the Vaccum command?
2) Should I run it everynight? How often should I run it?

thanks
Fushan

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org



Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. --0-1215423618-1007093199=:1189--