java - Copy new records from one database to another -


i have local , remote database. local database replica of remote database. have insert new records remote database local database. there 14 tables in remote database, need track changes in 14 tables.

i know can select every table in remote database , check if record exists in local database if not insert it.

is there way it? in java maybe? approach best?

let's start dblink remote db

create public database link remo connect <user_name> identified <password> using '<service_name>'; 

then insert loop on tables user schema. or if want insert tables please define proper condition 14 tables.

begin  x in (select table_name user_tables) loop execute immediate 'insert ' || x.table_name || ' (select * ' || x.table_name || '@remo minus select * ' || x.table_name || ')';  commit; end loop; end; / 

this insert new records (in fact records exists (or changed) on remote , not exists on local). if taht's need work. if need synchronisation not solution.


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -