Data Pump throws an error
You got the error from line 5. This is line 5:

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


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

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