pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedAuto-Vacuum?
6+ messages / 4 participants
[nested] [flat]
* Auto-Vacuum?
@ 1999-01-28 18:46 Tim Perdue <tim_perdue@yahoo.com>
0 siblings, 2 replies; 6+ messages in thread
From: Tim Perdue @ 1999-01-28 18:46 UTC (permalink / raw)
To: pgsql-sql@hub.org
Just curious if anyone has written an vacuum shell script.
At this point, I have been going in weekly and issuing the VACUUM;
command manually.
Now that tons of records are being inserted hourly, I want to vacuum
1-2 times a day.
I could do this pretty easily with a simple Java/JDBC proram, but
would rather just have a shell script go into psql. Unfortunately, I
know nothing about shell scripting.
Any tips or samples are appreciated.
Tim
==
______________________________________________________
Tim Perdue
tim@perdue.net
_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [SQL] Auto-Vacuum?
@ 1999-01-28 19:04 Brian <signal@shreve.net>
parent: Tim Perdue <tim_perdue@yahoo.com>
1 sibling, 0 replies; 6+ messages in thread
From: Brian @ 1999-01-28 19:04 UTC (permalink / raw)
To: tim@dmcity.net; +Cc: pgsql-sql@hub.org
On Thu, 28 Jan 1999, Tim Perdue wrote:
> Just curious if anyone has written an vacuum shell script.
>
Just use cron:
00 01 * * * /usr/local/pgsql/bin/psql shrevenet_users -c "vacuum;"
01 01 * * * /usr/local/pgsql/bin/psql shrevenet_ftp -c "vacuum;"
02 01 * * * /usr/local/pgsql/bin/psql shrevenet_counter -c "vacuum;"
etc. Also before I vacuum, I dump each night (never can be too safe :)
00 00 * * * /usr/local/pgsql/bin/pg_dump shrevenet_users > /usr/local/pgsql/backups/shrevenet_users.dump
01 00 * * * /usr/local/pgsql/bin/pg_dump shrevenet_ftp > /usr/local/pgsql/backups/shrevenet_ftp.dump
02 00 * * * /usr/local/pgsql/bin/pg_dump shrevenet_counter > /usr/local/pgsql/backups/shrevenet_counter.dump
> At this point, I have been going in weekly and issuing the VACUUM;
> command manually.
>
> Now that tons of records are being inserted hourly, I want to vacuum
> 1-2 times a day.
>
> I could do this pretty easily with a simple Java/JDBC proram, but
> would rather just have a shell script go into psql. Unfortunately, I
> know nothing about shell scripting.
>
> Any tips or samples are appreciated.
>
> Tim
>
>
> ==
> ______________________________________________________
>
> Tim Perdue
> tim@perdue.net
>
>
> _________________________________________________________
> DO YOU YAHOO!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
--------------------------------------------------------------------------
Brian Feeny (BF304) | ShreveNet Inc. - Premium Internet Service Provider
Network Administrator | Shreveport, Louisiana - http://www.shreve.net/
signal@shreve.net | Web Hosting, Virtual Domains, Storefronts,
(318)222-2NET x 109 | Database/Web Integration, 56k, ISDN, T1
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [SQL] Auto-Vacuum?
@ 1999-01-28 19:10 Tim Perdue <tim_perdue@yahoo.com>
0 siblings, 1 reply; 6+ messages in thread
From: Tim Perdue @ 1999-01-28 19:10 UTC (permalink / raw)
To: Brian <signal@shreve.net>; pgsql-sql@hub.org
Thanks - I didn't know it was that easy.
What does the "dump" do? I have been just tarring the
/usr/local/pgsql/data/base/ directory and burning that onto a CD...
Do you worry about getting a fragmented Hard Disk? I would think if
there were a large number of adds/deletes you could end up with a
fragged disk.
Thanks a bunch,
Tim
---Brian <signal@shreve.net> wrote:
>
> On Thu, 28 Jan 1999, Tim Perdue wrote:
>
> > Just curious if anyone has written an vacuum shell script.
> >
>
> Just use cron:
>
> 00 01 * * * /usr/local/pgsql/bin/psql shrevenet_users -c "vacuum;"
> 01 01 * * * /usr/local/pgsql/bin/psql shrevenet_ftp -c "vacuum;"
> 02 01 * * * /usr/local/pgsql/bin/psql shrevenet_counter -c
"vacuum;"
>
> etc. Also before I vacuum, I dump each night (never can be too safe
:)
>
> 00 00 * * * /usr/local/pgsql/bin/pg_dump shrevenet_users >
/usr/local/pgsql/backups/shrevenet_users.dump
> 01 00 * * * /usr/local/pgsql/bin/pg_dump shrevenet_ftp >
/usr/local/pgsql/backups/shrevenet_ftp.dump
> 02 00 * * * /usr/local/pgsql/bin/pg_dump shrevenet_counter >
/usr/local/pgsql/backups/shrevenet_counter.dump
==
______________________________________________________
Tim Perdue
tim@perdue.net
_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [SQL] Auto-Vacuum?
@ 1999-01-28 21:48 Bryan White <bryan@arcamax.com>
0 siblings, 0 replies; 6+ messages in thread
From: Bryan White @ 1999-01-28 21:48 UTC (permalink / raw)
To: tim@dmcity.net; Brian <signal@shreve.net>; pgsql-sql@hub.org
>What does the "dump" do? I have been just tarring the
>/usr/local/pgsql/data/base/ directory and burning that onto a CD...
pg_dump writes to stdout the sql code needed to recreate the database. As I
remember there are a couple of catches (it does not recreate views?...).
To restore the database, start with a blank database and do:
psql dbname < mydatabase.db
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [SQL] Auto-Vacuum?
@ 1999-01-28 22:23 D'Arcy J.M. Cain <darcy@druid.net>
parent: Tim Perdue <tim_perdue@yahoo.com>
1 sibling, 0 replies; 6+ messages in thread
From: "D'Arcy" "J.M." Cain @ 1999-01-28 22:23 UTC (permalink / raw)
To: tim@dmcity.net; +Cc: pgsql-sql@hub.org
Thus spake Tim Perdue
> Just curious if anyone has written an vacuum shell script.
Yah, it's called vacuumdb and it's in your PostgreSQL path.
--
D'Arcy J.M. Cain <darcy@{druid|vex}.net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 424 2871 (DoD#0082) (eNTP) | what's for dinner.
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [SQL] Auto-Vacuum?
@ 1999-01-28 22:26 D'Arcy J.M. Cain <darcy@druid.net>
parent: Tim Perdue <tim_perdue@yahoo.com>
0 siblings, 0 replies; 6+ messages in thread
From: "D'Arcy" "J.M." Cain @ 1999-01-28 22:26 UTC (permalink / raw)
To: tim@dmcity.net; +Cc: signal@shreve.net; pgsql-sql@hub.org
Thus spake Tim Perdue
> Do you worry about getting a fragmented Hard Disk? I would think if
> there were a large number of adds/deletes you could end up with a
> fragged disk.
Don't worry about it unless you are running on the new NT version.
Fragmented disks was a "feature" of DOS and Windows. It really
doesn't apply to most modern Unix systems which is where you should
be running the server.
--
D'Arcy J.M. Cain <darcy@{druid|vex}.net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 424 2871 (DoD#0082) (eNTP) | what's for dinner.
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~1999-01-28 22:26 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-01-28 18:46 Auto-Vacuum? Tim Perdue <tim_perdue@yahoo.com>
1999-01-28 19:04 ` Brian <signal@shreve.net>
1999-01-28 22:23 ` D'Arcy J.M. Cain <darcy@druid.net>
1999-01-28 19:10 Re: [SQL] Auto-Vacuum? Tim Perdue <tim_perdue@yahoo.com>
1999-01-28 22:26 ` D'Arcy J.M. Cain <darcy@druid.net>
1999-01-28 21:48 Re: [SQL] Auto-Vacuum? Bryan White <bryan@arcamax.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox