Hi,
Can run code fine when have directory as DATA_PUMP_DIR but get message
ORA-39001 when change directory from DATA_PUMP_DIR to DATA_EXPORTS_DIR
DATA_EXPORTS_DIR defintely exists and user running under has read,write permission on the directory.
using Oracle 11.2.0.3 on AIX Power Series 7 IBM
Any ideas?
declare
h1 number; -- Datapump handle
dir_name varchar2(30); -- Directory Name
begin
dir_name := 'DATA_EXPORTS_DIR';
h1 := dbms_datapump.open(operation =>'EXPORT',
job_mode =>'TABLE',
remote_link => NULL,
job_name =>'POR_TABLE2');
dbms_datapump.add_file(handle =>h1,
filename => 'POR.DMP',
directory => dir_name,
filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_DUMP_FILE,
reusefile => 1); -- value of 1 instructs to overwrite existing file
dbms_datapump.add_file(handle =>h1,
filename => 'por-EXPDAT.LOG',
directory => dir_name,
filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE,
reusefile => 1); -- value of 1 instructs to overwrite existing file
dbms_datapump.metadata_filter(handle =>h1,
name => 'TABLE_FILTER',
value => 'BATCH_AUDIT');
--
-- Start the job.
--
dbms_datapump.set_parameter(h1, 'TRANSPORTABLE', 'ALWAYS');
dbms_datapump.start_job(h1);
begin
dbms_datapump.detach(handle => h1);
end;
end;