2

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.

3

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
);
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.