You can use below workaround.
sync the latest data from production to staging server using oracle datapump utility
impdp username/password@netstr directory=DUMP_DIR TABLES=Parent,Child network_link=prd_racdb table_exists_action=replace
You can INCLUDE =CONSTRAINT option while exporting to include constraints and TABLE_EXISTS_ACTION=REPLACE while importing ,if the table already exists then it replaces the table with the exported table along with the constraints
expdp username/password@dbnameA TABLES=emp,dept DIRECTORY=DMPDIR DUMPFILE=expdp_1.dmp LOGFILE=expdp_1.log INCLUDE=constraint
impdp username/password@dbnameB DIRECTORY=DMPDIR DUMPFILE=expdp_1.dmp LOGFILE=impdp_1.log TABLE_EXISTS_ACTION=REPLACE
Replace will delete the data in database B.
It just need update and insert not delete.
and it should work for parent-child relationship.
Since you having PRIMARY key in the parent and chile table, it checks for unique values when you are importing data from one database to another database. If there exists any duplicate values, then it will "ORA-00001: unique constraint" erorr.
To Avoid this behaviour:
1)Disable the constraint on the target tables before import and then enable the constraint with novalidate option after import
2)Truncate or delete the table by using TABLE_EXISTS_ACTION option during import
CONSTRAINTS import constraints (Y)
Specifies data to load.
Valid keywords are: [ALL], DATA_ONLY and METADATA_ONLY.
Data layer option flags.
Valid keywords are: SKIP_CONSTRAINT_ERRORS.
Action to take if imported object already exists.
Valid keywords are: APPEND, REPLACE, [SKIP] and TRUNCATE.
Predicate clause used to import a subset of a table.
For example, QUERY=employees:"WHERE department_id > 10".
check more options on help main page ...
impdp will replace the table or append the data.
but i need to update the current data as well.
Also child tables needs to updated.
I can update the parent table using merge.
but merging child tables is a problem.
If the merge works for the parent - why is it an issue for the child?
Also - you can maybe use DBMS_COMPARISON for this
But i think realistically you are going to have do some manual coding to do exactly what you want. A lot depends on how you are generating id's and if you are just able to use pk/fk values from the original data source.
Manual coding is the only option feasible here.