Consistent IMPDP
First select all the parent table of your desired exported tables.
select
parent.owner || '.' ||
parent.table_name "Parent table",
'is parent of' " ",
child.owner || '.' ||
child.table_name "Child table"
from
dba_constraints child join dba_constraints parent on
child.r_constraint_name = parent.constraint_name and
child.r_owner = parent.owner
where lower(child.table_name) in
(
'tblmcu',
'tblmcup',
'tblmcuy',
'tbltacc',
'tbltdebitdocument');
-------------
Find the distinct table name if you want
select distinct (aa.Parent_table) from
(
select ''''||parent.table_name||''',' Parent_table
from
dba_constraints child join dba_constraints parent on
child.r_constraint_name = parent.constraint_name and
child.r_owner = parent.owner
where lower(child.table_name) in
(
'tblmcu',
'tblmcup',
'tblmcuy',
'tbltacc',
'tbltdebitdocument')) aa;
====================================
create the parfile
userid=user/password@dbname
directory=DATAPUMP_DIR
schemas=testuser
INCLUDE=table:"in('TBLSPR','TBLSCS','TBLMPR','TBLTCON')"
network_link=netlink_test_2_orcl
table_exists_action=replace
logfile=impdp_orcl_table_ddmmyy.log
select
parent.owner || '.' ||
parent.table_name "Parent table",
'is parent of' " ",
child.owner || '.' ||
child.table_name "Child table"
from
dba_constraints child join dba_constraints parent on
child.r_constraint_name = parent.constraint_name and
child.r_owner = parent.owner
where lower(child.table_name) in
(
'tblmcu',
'tblmcup',
'tblmcuy',
'tbltacc',
'tbltdebitdocument');
-------------
Find the distinct table name if you want
select distinct (aa.Parent_table) from
(
select ''''||parent.table_name||''',' Parent_table
from
dba_constraints child join dba_constraints parent on
child.r_constraint_name = parent.constraint_name and
child.r_owner = parent.owner
where lower(child.table_name) in
(
'tblmcu',
'tblmcup',
'tblmcuy',
'tbltacc',
'tbltdebitdocument')) aa;
====================================
create the parfile
userid=user/password@dbname
directory=DATAPUMP_DIR
schemas=testuser
INCLUDE=table:"in('TBLSPR','TBLSCS','TBLMPR','TBLTCON')"
network_link=netlink_test_2_orcl
table_exists_action=replace
logfile=impdp_orcl_table_ddmmyy.log
Comments
Post a Comment