I need to find the way make an quick and light weight dump export. It is the reason why I want to export only specific scheme and to exclude large tables.
I use Enterprise Manager for it. Data Movement > Move Row Data > Export to Export Files > Schemas > add need schemas > Show Advanced Options > Exclude Only Objects Specified Below > Add Another Row > select table and type need table names > next..next..next
EM generate next PL\SQL
declare
h1 NUMBER;
begin
h1 := dbms_datapump.open(operation =>'EXPORT', declare h1 NUMBER;
begin
h1 := dbms_datapump.open(operation => 'EXPORT',
job_mode => 'SCHEMA',
job_name => 'FAST_TRY_6',
version => 'COMPATIBLE');
dbms_datapump.set_parallel(handle => h1, degree => 1);
dbms_datapump.add_file(handle => h1,
filename => 'efast.LOG',
directory => 'backup',
filetype => 3);
dbms_datapump.set_parameter(handle => h1,
name => 'KEEP_MASTER',
value => 0);
dbms_datapump.metadata_filter(handle => h1,
name => 'SCHEMA_EXPR',
value => 'IN(''MYSCHEMA1'',''MYSCHEMA2'')');
dbms_datapump.add_file(handle => h1,
filename => 'efast181015.DMP',
directory => 'backup',
filetype => 1);
dbms_datapump.set_parameter(handle => h1,
name => 'INCLUDE_METADATA',
value => 1);
dbms_datapump.set_parameter(handle => h1,
name => 'DATA_ACCESS_METHOD',
value => 'AUTOMATIC');
dbms_datapump.metadata_filter(handle => h1,
name => 'EXCLUDE_NAME_EXPR',
value => 'IN (''"MYSCHEMA1"."MYTABLE1"'',''"MYSCHEMA2"."MYTABLE2"'')',
object_type => 'TABLE');
dbms_datapump.set_parameter(handle => h1,
name => 'ESTIMATE',
value => 'BLOCKS');
dbms_datapump.start_job(handle => h1,
skip_current => 0,
abort_step => 0);
dbms_datapump.detach(handle => h1);
end;
/
However, exported whole schemas with MYTABLE1 and MYTABLE2.
Best Answer
Afaik, that syntax never worked like that, I am surprised EM generated this (well, not really...)
This does not work as expected, because the database compares the given strings to
table_name
and that does not include the owner:If you do this:
This excludes the tables, but from all schemas:
What you can do is, specify the
QUERY
parameter with a condition that evaluates to false for the tables to be skipped. This will still export the table, but without any data (0 rows).