Hi folks,
I have a little problem.
I am creating a big DB by merging several almost identical DB into one.
The relevant tables have a column which discriminates the DB from which they come (thanks to the original DBA I haven't to be worried about this), but some "almost static" tables haven't this fields because they are almost identical for all the DBs, the difference are in some more or less rows.
I decided to import the biggest of the DBs and then to import table by table of the followings.
The problem is static table's import produces lots of error rows in log file which are difficult to analyze in order to find a real error.
To avoid this problem I decided to create another user, to import those static tables from in this schema and then to insert the difference between the MAIN tables and these "PARKING" ones. Subsequently to TRUNCATE the parking tables in order to populate them with the data of another DB and repeat the operation.
So the question is:
Is the sql statement to use to insert the difference something like:
insert into MAIN_USER.MAIN_TABLE
(select * from SCRATCH_USER.SCRATCH_TABLE
minus
select * from MAIN_USER.MAIN_TABLE);
I have a little problem.
I am creating a big DB by merging several almost identical DB into one.
The relevant tables have a column which discriminates the DB from which they come (thanks to the original DBA I haven't to be worried about this), but some "almost static" tables haven't this fields because they are almost identical for all the DBs, the difference are in some more or less rows.
I decided to import the biggest of the DBs and then to import table by table of the followings.
The problem is static table's import produces lots of error rows in log file which are difficult to analyze in order to find a real error.
To avoid this problem I decided to create another user, to import those static tables from in this schema and then to insert the difference between the MAIN tables and these "PARKING" ones. Subsequently to TRUNCATE the parking tables in order to populate them with the data of another DB and repeat the operation.
So the question is:
Is the sql statement to use to insert the difference something like:
insert into MAIN_USER.MAIN_TABLE
(select * from SCRATCH_USER.SCRATCH_TABLE
minus
select * from MAIN_USER.MAIN_TABLE);