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: Question about import of foreignViews
Date Fri, 22 Mar 2013 15:56:50 GMT
On 3/22/13 6:50 AM, Katherine Marsden wrote:
> I have been playing with the foreignViews optional tool in buddy 
> testing Derby -> Derby  which is very convenient! I was wondering, 
> would there be some quick trick to importing/migrating that data given 
> the views are in place or would that require another tool?
> The reason I ask is that from time to time I have to migrate data from 
> one (usually corrrupt) Derby db to another.  I use dblook and 
> import/export but it would be nice to have something builtin to 
> rebuild/migrate a database  for which I could give instructions and 
> not a java program or do it myself.   I think the foreignViews will 
> make the data portion much easier as I can run  dblook to create the 
> schema the foreignViews tool for the views, and then INSERT INTO 
> <LocalTAble>  SELECT * FROM <Foreign Table> without creating the 
> external files of import/export but I wonder if there is a trick to do 
> the INSERT INTO step  for all the tables in the existing tool 
> structure.  I think maybe an importForeignViews tool would be needed 
> for this, but thought I would check if I am missing something.
> Kathey
Hi Kathey,

I agree with you that it would be nice to have an importFromForeignViews 
tool. And you are correct that this functionality is not included in the 
current foreignViews optional tool. One tricky bit about 
importFromForeignViews is that it will want to sort the external tables 
by their foreign key dependencies to make sure that the tables are 
imported in the right order.

There is an undocumented optional tool called customTool described in 
the 2013-01-10 comment on DERBY-6022. This may be useful as you develop 
importFromForeignViews. This is the development rhythm which customTool 

1) Create a custom tool.

2) Gain experience with the custom tool in the wild.

3) Then productize the custom tool, adding it to Derby as a full-fledged 
optional tool with its own name.


View raw message