amp834
asked on
Combine SQL (Derby) databases
I have several (Derby) databases with the same structure (populated by different machines), and want to combine them into one large database (using Java programming). The tables like tClient, tTransaction, etc. in each database have records that the other databases don't contain.
What are some fast ways of combining the databases into one large database "in a bulk fashion"?
Once I have a large database B and a little database L comes along later, I would like to write all of L's data into B.
I am comparing this "several-databases separately" with using a client-server version of Derby (several databases, each machine can work independently using its own fast resources; client-server, each machine writes to a centralized derby database)
Any and all tips and tricks would be appreciated, I will split the points between all the useful answers.
What are some fast ways of combining the databases into one large database "in a bulk fashion"?
Once I have a large database B and a little database L comes along later, I would like to write all of L's data into B.
I am comparing this "several-databases separately" with using a client-server version of Derby (several databases, each machine can work independently using its own fast resources; client-server, each machine writes to a centralized derby database)
Any and all tips and tricks would be appreciated, I will split the points between all the useful answers.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The way i'd do it is to use exactly the method i posted
ASKER
If you're populating a table for the first time, for example, you may remove all (or most) of the indexes, populate the table, and then add the indexes. It's also tips and tricks like this I was looking for, that's why I also posted to the general database topic, and not just the java topic.
I wanted to hear from people who actually do things like this. Do you think I should submit the question differently?
I wanted to hear from people who actually do things like this. Do you think I should submit the question differently?
>>remove... indexes, populate the table, and then add the indexes.
You could do that, but bear in mind that if there are duplicates, you will need to write another query to find them, as you won't be *able* to add the indexes
You could do that, but bear in mind that if there are duplicates, you will need to write another query to find them, as you won't be *able* to add the indexes
ASKER
I was just using an example (and that's why I added "Most indexes")
I was more interested in...
>I wanted to hear from people who actually do things like this. Do you think I should submit the question differently?
I was more interested in...
>I wanted to hear from people who actually do things like this. Do you think I should submit the question differently?
>>Do you think I should submit the question differently?
Not really: there are not many options if you want to do it in Java
Not really: there are not many options if you want to do it in Java
getting rid of indexes is a good idea
generally simpler to do it with a database import tool or script instead of using java
generally simpler to do it with a database import tool or script instead of using java
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This looks promising.
ASKER
Thanks for your help and comments. I am finally getting around to closing some of the questions I asked!
ASKER