HiveBrain v1.2.0
Get Started
← Back to all entries
debugMinor

Data Pump throws an error

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
errorthrowsdatapump

Problem

I am trying to do datapump.

DECLARE
hdnl NUMBER;
BEGIN
hdnl := DBMS_DATAPUMP.open( operation => 'EXPORT', job_mode => 'TABLE', job_name=>null);
DBMS_DATAPUMP.ADD_FILE( handle => hdnl, filename => 'tab1.dmp', directory => 'DATA_PUMP_DIR', filetype => dbms_datapump.ku$_file_type_dump_file);
DBMS_DATAPUMP.add_file( handle => hdnl, filename => 'exp.log', directory => 'DATA_PUMP_DIR', filetype => dbms_datapump.ku$_file_type_log_file);
DBMS_DATAPUMP.METADATA_FILTER(hdnl,'SCHEMA_EXPR','IN (''USERS'')');
DBMS_DATAPUMP.METADATA_FILTER(handle => hdnl,name => 'NAME_EXPR',value => 'IN (''CA_FILE'')');
DBMS_DATAPUMP.start_job(hdnl);
END;
/


But this throws an error:

Error report -
ORA-39001: invalid argument value
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 79
ORA-06512: at "SYS.DBMS_DATAPUMP", line 3507
ORA-06512: at "SYS.DBMS_DATAPUMP", line 3756
ORA-06512: at line 5
39001. 00000 -  "invalid argument value"
*Cause:    The user specified API parameters were of the wrong type or
           value range.  Subsequent messages supplied by
           DBMS_DATAPUMP.GET_STATUS will further describe the error.
*Action:   Correct the bad argument and retry the API.


Please help.

Solution

You got the error from line 5. This is line 5:

DBMS_DATAPUMP.ADD_FILE(
  handle => hdnl, filename => 'tab1.dmp',
  directory => 'DATA_PUMP_DIR',
  filetype => dbms_datapump.ku$_file_type_dump_file
);


If the specified dumpfile already exists, this line throws the above error. You can add reusefile => 1 to overwrite the existing file and avoid this error.

DBMS_DATAPUMP.ADD_FILE(
  handle => hdnl, filename => 'tab1.dmp',
  directory => 'DATA_PUMP_DIR',
  filetype => dbms_datapump.ku$_file_type_dump_file,
  reusefile => 1
);

Code Snippets

DBMS_DATAPUMP.ADD_FILE(
  handle => hdnl, filename => 'tab1.dmp',
  directory => 'DATA_PUMP_DIR',
  filetype => dbms_datapump.ku$_file_type_dump_file
);
DBMS_DATAPUMP.ADD_FILE(
  handle => hdnl, filename => 'tab1.dmp',
  directory => 'DATA_PUMP_DIR',
  filetype => dbms_datapump.ku$_file_type_dump_file,
  reusefile => 1
);

Context

StackExchange Database Administrators Q#127393, answer score: 4

Revisions (0)

No revisions yet.