0

Can anyone help with this problem? I'm trying to use datapump to load a dump file created but whenever I try, I get the following code:

DECLARE
hdnl NUMBER;
status VARCHAR2(20);
BEGIN
hdnl := dbms_datapump.open (operation => 'IMPORT', job_mode => 'TABLE', version => 'COMPATIBLE');
DBMS_DATAPUMP.ADD_FILE( handle => hdnl, filename => 'import.log', directory => 'DP_DIR', filetype => dbms_datapump.ku$_file_type_log_file);
DBMS_DATAPUMP.ADD_FILE(handle => hdnl, filename => 'latest.dmp', directory => 'DP_DIR', filetype => dbms_datapump.ku$_file_type_dump_file);
DBMS_DATAPUMP.START_JOB(handle => hdnl);
DBMS_DATAPUMP.WAIT_FOR_JOB(hdnl,status);
end;
/

I'm getting this error:

Error report -
ORA-31626: job does not exist
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 79
ORA-06512: at "SYS.DBMS_DATAPUMP", line 1852
ORA-06512: at "SYS.DBMS_DATAPUMP", line 6793
ORA-06512: at line 5
31626. 00000 -  "job does not exist"
*Cause:    An invalid reference to a job which is no longer executing,
           is not executing on the instance where the operation was
           attempted, or that does not have a valid Master Table.
           Refer to any following error messages for clarification.
*Action:   Start a new job, or attach to an existing job that has a
           valid Master Table.

Any idea?

Regards

amir
  • 331
  • 2
  • 9
  • 20
  • Is user - which is running this piece of code - granted IMP_FULL_DATABASE? Moreover, is that privilege granted directly to that user (i.e. not via role)? – Littlefoot Jan 24 '21 at 19:47
  • Hi. Thank you for your message. So yes for both your questions. Even if I don't like it because it's a quite powerful privilege... – amir Jan 24 '21 at 20:22

0 Answers0