DBMS_DATAPUMP fails with ora-39001 when file exist. (Doc ID 307634.1)

Last updated on NOVEMBER 28, 2016

Applies to:

PL/SQL - Version 10.1.0.2 and later
Oracle Database - Enterprise Edition - Version 10.1.0.2 and later
Information in this document applies to any platform.
***Checked for relevance on 10-Apr-2013***

Symptoms

You started a DataPump export using the API as in example below:

create or replace procedure schema_exp_imp (prun_id in number, pdo_type in varchar2) is
  not_valid_schema_dp_type exception;
  ndp_handle number;
  ndeg_para number default 2;

begin
  if (upper (pdo_type) not in ('IMPORT', 'EXPORT')) then
    raise not_valid_schema_dp_type;
  end if;

  ndp_handle := dbms_datapump.open (pdo_type, 'SCHEMA');
  dbms_datapump.set_parallel (ndp_handle, ndeg_para);
  dbms_datapump.add_file (ndp_handle, user||'.dmp' , 'ORADUMP');
  dbms_datapump.start_job (ndp_handle);

exception
  when others then
    insert_log (prun_id, 'Error', substr((sqlcode||' - '||sqlerrm), 1, 255));
end schema_exp_imp;
/


You started this procedure with:

SQL> exec schema_exp_imp (4272005, 'EXPORT');


and this ended with errors:

ORA-39001: invalid argument value
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 79
ORA-06512: at "SYS.DBMS_DATAPUMP", line 2486
ORA-06512: at "SYS.DBMS_DATAPUMP", line 2718
ORA-06512: at "COMMON.SCHEMA_EXP_IMP", line 28
ORA-06512: at line 1

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms