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 project:

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

Thanks,
-Rick

Cheers
Ari



Reply via email to