Bacula-users

Re: [Bacula-users] Reducing the size of the database.

2008-10-21 12:19:22
Subject: Re: [Bacula-users] Reducing the size of the database.
From: Hemant Shah <hjrrs AT yahoo DOT com>
To: dassing AT fs.wettzell DOT de
Date: Tue, 21 Oct 2008 09:15:50 -0700 (PDT)


--- On Tue, 10/21/08, SystemManagement <dassing AT fs.wettzell DOT de> wrote:

> From: SystemManagement <dassing AT fs.wettzell DOT de>
> Subject: Re: [Bacula-users] Reducing the size of the database.
> To: hjrrs AT yahoo DOT com
> Cc: "baculausers" <bacula-users AT lists.sourceforge DOT net>
> Date: Tuesday, October 21, 2008, 1:34 AM
> Hi,
> 
> by experience I found that the command
> echo "16" | dbcheck -f workingdir  bacula-db
> bacula-user bacula-password
> will reduce the database.
> The vacuum will be done automatically in PostGreSQL or you
> have to call 
> it manually.
> 
> Regards,
> Reiner

  dbcheck will delete the rows, but PostgreSQL does not release the diskspace. 
I found out that vacuumdb will release the diskspace, but it builds new nodes 
in index but does not remove the entries fo deleted rows. You have to run 
reindexdb command to reclaim that space.

You have to run:

echo "16" |dbcheck -b -f -c /path/to/bacula-dir.conf -C dbname workingdir
vacuumdb -q -d dbname -z -f
reindexdb -q dbname

After running these commands my database size was reduced from 10 GB to 8.0 GB.

dbcheck does not have "-q" option so that it would not print the "Checking for 
...." messages. I think it should be added so that when you run it from cron 
you do not get e-mails with the messages.

> 
> Hemant Shah schrieb:
> > This is probably a question for a PostgreSQL group,
> but I though users using bacula may have come across this
> problem.
> >
> > I am using PostgreSQL for the database, last week when
> I checked, my database size was 10GB. I removed one month
> worth of volumes from the bacula database and ran dbcheck
> command. It deleted about 40,000 rows from the database, but
> the database size was still 10GB. Next, I ran postgresql
> vacuumdb (vacuumdb -q -d bacula -z -f)command to reclaim the
> space used by deleted rows, but the database size is still
> 10GB. How do I reduce the size of the database?
> >
> > I also backup the catalog every night using pgdump
> command. Before I deleted the 40,000 rows the backup file
> size was 800MB, after deleting 40,000 rows the backup file
> size is still 800MB.
> >
> >
> > # df -h /baculaDB
> > Filesystem            Size  Used Avail Use% Mounted on
> > /dev/mapper/VolGroup01-baculaDB
> >                       99G   11G   83G  12% /baculaDB
> >
> >
> > bacula=# select pg_database.datname,
> pg_size_pretty(pg_database_size(pg_database.datname)) as
> size from pg_database;
> >  datname  |  size   
> > -----------+---------
> > template1 | 4272 kB
> > template0 | 4272 kB
> > postgres  | 4272 kB
> > bacula    | 10 GB
> > (4 rows)
> >
> >
> > Hemant Shah
> > E-mail: hjrrs AT yahoo DOT com
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> > http://mail.yahoo.com 
> >
> >
> -------------------------------------------------------------------------
> > This SF.Net email is sponsored by the Moblin Your Move
> Developer's challenge
> > Build the coolest Linux based applications with Moblin
> SDK & win great prizes
> > Grand prize is a trip for two to an Open Source event
> anywhere in the world
> >
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> > _______________________________________________
> > Bacula-users mailing list
> > Bacula-users AT lists.sourceforge DOT net
> >
> https://lists.sourceforge.net/lists/listinfo/bacula-users
> >
> >
> >



Hemant Shah
E-mail: hjrrs AT yahoo DOT com


      

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users