Subject Re: [firebird-support] gbak /tmp minimum disk space
Author Alexandre Benson Smith
officialz wrote:
> Recently I have noticed gbak failing to complete a backup/restore when
> the disk space in my temporary folder is low and the database size is
> large. I would like to add some automatic disk space checking before I
> start up the backup/restore process. But, of course, I need to know
> the minimum safe amount of disk space required for a backup/restore
> for a database of a certain size.
> Are there any specific guidelines I should be following?
> I can probably assume a safe minimum is free_space>=database_size but
> since the database could be fairly large, it would be nice to know if
> gbak would not use more than a specific amount of free space, or a
> specific percent of the database size, or maybe the size of the
> largest table.
>
> Thanks
>

Assuming you are not trying to back-up to the temp space :-)

I think the back-up process will not use a lot of temp space (since it
just read all data on the table and there is no need for sorting), I
think the problem is on the restore process, more precisely on the
creation of the indices, to create the indices FB need to sort the data,
if the sort data could not fit on the RAM or reach the limit defined on
firebird.conf it would use disk space for sort, the files are stored on
the temp space, so I think the maximum size of free temp space you will
need would be the amount of space to sort the table whose indices is
bigger (number of records * index size), but how much space it will need
I don't know, and I don't know if there is a formula to calculate it
precisely.

Hope others jump in and clarify more than I could.

see you !

--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br