db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Hillegas <rick.hille...@oracle.com>
Subject Re: derbydump equivalent of mysqldump
Date Fri, 14 Dec 2012 13:50:15 GMT
On 12/13/12 10:58 PM, Aristedes Maniatis wrote:
> I understand that such a thing does not exist, and I need to write one 
> for my own needs. Does anyone have any pointers on where to start with 
> this? What I want is output of SQL commands to create the database, 
> tables, indices, etc and also insert statements for all the data. We 
> need to migrate some Derby data to another database and this appears 
> the simplest approach.
> Would such a feature be a useful contribution toward the project, or 
> should we just work on this outside Apache?
Hi Ari,

This would definitely be a useful contribution. Doing your work in the 
open in the community means that other contributors can warn you about 
edge-cases you might not otherwise consider--and we will all learn from 
your experience. Even if the committers don't incorporate your tool in 
the product, you can still attach it to a JIRA for use by other developers.

If I understand correctly, you want to write a tool which copies one 
Derby database to another. As I see it, there are 2 big pieces to this 

1) Generating the DDL to create all of the schema objects (tables, 
views, UDTs, etc.). The existing dblook program does much of this work 
already. However, more work needs to be done, particularly in the 
following areas:

a) Generating DDL for GRANTs.

b) Sorting the table DDL by foreign key dependencies.

c) Dumping database properties.

d) Dumping NATIVE credentials.

2) Siphoning the data out of the source database into the target 
database. The most efficient tool we have for that task is the 
ForeignTableVTI attached to DERBY-4962. I recommend that you study that 
JIRA. (Note that I hope to be able to check a version of ForeignTableVTI 
into the product soon.) You will still need to generate INSERT 
statements in the correct order; hopefully you will be able to re-use 
the logic you write for (1b).

Before you start contributing, you will want to familiarize yourself 
with the processes described here 
http://db.apache.org/derby/derby_comm.html. In particular, you will want 
to file an individual contributor license agreement (to protect Apache) 
and you will want your company to file a corporate contributor license 
agreement (to protect you). See http://www.apache.org/licenses/#clas

> Cheers
> Ari

View raw message