You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Dy...@Sun.COM on 2007/11/01 20:29:57 UTC

Re: Derby Backup

Francisco Trindade <fr...@m3tech.com.br> writes:

> Hi,
>
> Im building a system using Apache Derby, and I couldnt find a way to
> backup the existing data from the database.
> The only procedure I've found in the documentation is to create a
> online/offline backup, that copies the existent database to a
> different location.
> The problem with this approach is that the backup file becomes very
> large (15 - 30 MB) in my case, and that's because Im zipping the
> database after copying it.
>
> I was wondering if it doesn't exist a way to create a backup only of
> the existent data, and not the whole database, like a dump.
>
> Does anyone have a suggestion?

I could not see that anyone else had answered your
question. Appologies if I missed it. 

Not sure I understand the distinction between "existent data" and the
whole database. Are you expecting the backup to be smaller than your
database? I don't think there is any automatic compression of the
backup image so unless you compress the backup yourself it will be the
same size as the database. I don't think Derby supports incremental
backups, so each new backup will have roughly the same size. The size
of each backup image may be reduced if you compress your tables 
before making the backup, (see the manual).

-- 
dt


Re: Derby Backup

Posted by "Dag H. Wanvik" <Da...@Sun.COM>.
Dyre.Tjeldvoll@Sun.COM writes:

> Francisco Trindade <fr...@m3tech.com.br> writes:
>
>> Hi,
>>
>> Im building a system using Apache Derby, and I couldnt find a way to
>> backup the existing data from the database.
>> The only procedure I've found in the documentation is to create a
>> online/offline backup, that copies the existent database to a
>> different location.
>> The problem with this approach is that the backup file becomes very
>> large (15 - 30 MB) in my case, and that's because Im zipping the
>> database after copying it.
>>
>> I was wondering if it doesn't exist a way to create a backup only of
>> the existent data, and not the whole database, like a dump.

Another approach might be to export just the data of the user tables,
cf. see the SYSCS_UTIL.SYSCS_{EXPORT,IMPORT}_* system procedures in
http://db.apache.org/derby/docs/10.3/ref/crefsqlbuiltinsystemprocedures.html
and http://db.apache.org/derby/docs/10.3/tools/ctoolsimport16245.html

The schema can be dumped for recreation using dblook:
http://db.apache.org/derby/docs/10.3/tools/ctoolsdblook.html

Thanks,
Dag