running bacula 2.0.3 with mysql 4.1.13 on SuSE 10.0

Hello,

just a few days ago i had similar problems with dbcheck.
I had to run it because bacula was complaining about duplicate filenames.
It took just a few minutes to find about 800 duplicate filenames but 12
hours to erase them.

Checks for orphaned Path or Filename records did not complete within 6
hours so i stopped them.

On 19.04.2007 23:41, Ryan Novosielski wrote:
> Arno Lehmann wrote:
> 
>> On 4/19/2007 8:23 PM, Ryan Novosielski wrote:
>>>
>>> Hello, this is the database check/correct program.
>>> [...]
>>> Checking for orphaned File entries. This may take some time!
>>> Found 103804 orphaned File records.
>>> Checking for orphaned Path entries. This may take some time!
>>>
>>> ...before this begins to take an inordinate amount of time? My total DB
>>> size is only 110MB or so -- doesn't seem like this should be a big deal
>>> to my machine.
>>>
>>> That run right there, incidentally, included -d999 and -v -- neither
>>> seemed to make any difference right there, only in the beginning before
>>> the prompt appeared.

Thats right. If you want see a little more output you have to give more "v":
dbcheck -vvv

At least, you will see the sql-statements which are executed.

>>> Appreciate any pointers you could give. I suppose I could add that last
>>> index, but it just doesn't sound like one that matters given the problem
>>> I'm having.
>> There was recently a report that dbcheck loops infinitely when checking. 
>> To me, it sounded like the change to have checks done in batches, not 
>> for the whole database at once, doesn't quite work... if you set dbcheck 
>> to fix problems it encounters, does it finish? (Make a dump before...)

I don't think that this is the same problem, because allowing dbcheck to
modify the database made no difference.

> I ran a catalog backup and just kicked this thing off, so we'll find
> out. Now that you mention it, I read that one too. I didn't ever use it
> at the time so I didn't put two and two together. Interestingly enough,
> though, is that there's a -b switch that controls batch mode. I don't
> use it -- I wonder if it works with it on? I'm not willing to try it,
> since I don't really know what it does. :-P

-b does the very same you did with the interactive version. It just runs
all the tests.

> 
> I guess this might be time for a bug report -- between the two postings
> and the relatively idiot-proof nature of dbcheck, doesn't seem like
> user-error.

After some search in the mailinglist i found the solution:


On 12.02.2007 11:29, Yann Cezard wrote:
> Hi,
>
> Personnaly I resolved this problem by creating indexes before dbchecking.
> This solution was given on this list some month ago.
> Without them, dbchecking was taking hours (or days ? I don't know,
> I stopped the dbcheck before its end :-) ).
> With them, it just takes minutes, even with very huge databases (40 GB) !
>
> Here are they :
> $ mysql -u bacula database_name
>
> mysql> create index File_PathId_idx on File(PathId);
>
> mysql> create index File_FilenameId_idx on File(FilenameId);
>
> And then just run dbcheck (in batch mode here) :
> /usr/sbin/dbcheck -f -b -C CatalogName -c /etc/bacula/bacula-dir.conf
>
> Than don't forget to remove the indexes, cause it will slow down
> insertions when
> backing up :
> mysql> drop index File_FilenameId_idx on File;
>
> mysql> drop index File_PathId_idx on File;
>
> Personnaly, I then run an OPTIMIZE :
> mysql> OPTIMIZE TABLE File, Path, Filename;
>
> Hope this will help you to clean your bases faster !
>
> Cheers,
>

I think, this should be included in the documentation to spare others
the headache.


Andreas



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to