declare
h1 NUMBER;
l1 varchar2(20);
begin
h1 := dbms_datapump.open (operation => 'EXPORT', job_mode => 'SCHEMA', job_name => 'JOB_EXP1', version => 'COMPATIBLE');
dbms_datapump.set_parallel(handle => h1, degree => 1);
dbms_datapump.add_file(handle => h1, filename => 'EXPDAT_20220329.LOG', directory => 'EXPDP_DIR', filetype => 3);
dbms_datapump.set_parameter(handle => h1, name => 'KEEP_MASTER', value => 0);
dbms_datapump.metadata_filter(handle => h1, name => 'SCHEMA_EXPR', value => 'IN(''CDATABASE'')');
dbms_datapump.add_file(handle => h1, filename => 'CDATABASE_20220329.DMP', directory => 'EXPDP_DIR', 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.set_parameter(handle => h1, name => 'ESTIMATE', value => 'BLOCKS');
dbms_datapump.start_job(handle => h1, skip_current => 0, abort_step => 0);
dbms_datapump.wait_for_job(handle => h1, job_state => l1);
dbms_datapump.detach(handle => h1);
end;
-- EXPDAT_20220329.LOG 日志文件
-- CDATABASE_20220329.DMP 备份文件
-- EXPDP_DIR 备份目录
-- CDATABASE 备份用户
|