DataPump Export Raises ORA-6502 ORA-39127 When Calling SYS.DBMS_SCHED_JOB_EXPORT.CREATE_EXP (Doc ID 1122665.1)

Last updated on NOVEMBER 28, 2016

Applies to:

Oracle Database - Enterprise Edition - Version 11.1.0.6 to 11.1.0.7 [Release 11.1]
Information in this document applies to any platform.
***Checked for relevance on 08-MAY-2012***

Symptoms

You created a new scheduler job with logging level DBMS_SCHEDULER.LOGGING_FAILED_RUNS. During schema/full database exports, DataPump fails with errors:

...
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
ORA-39127: unexpected error from call to export_string :=
SYS.DBMS_SCHED_JOB_EXPORT.create_exp(457655,'11.01.00.07.00',newblock)
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "SYS.DBMS_SCHED_JOB_EXPORT", line 25
ORA-06512: at line 1
ORA-06512: at "SYS.DBMS_METADATA", line 5569
...

The can be reproduced with the following test:

connect / as sysdba
drop directory tmp;
create directory tmp as '/tmp';

drop user u001 cascade;
create user u001 identified by u001;
grant connect, resource, create job to u001;
grant read, write on directory tmp to u001;

purge dba_recyclebin;

connect u001/u001

begin
  dbms_scheduler.create_job ('JOB001', job_type => 'PLSQL_BLOCK', job_action => 'begin null; end;', repeat_interval => 'NEXT_DAY (LAST_DAY (TO_DATE (''12/31/''||TO_CHAR (SYSDATE, ''YYYY''), ''MM/DD/YYYY'')) - 14, ''Monday'')');
  -- set logging for job
  dbms_scheduler.set_attribute ('JOB001', 'LOGGING_LEVEL', dbms_scheduler.logging_failed_runs);
  commit;
end;
/

host expdp u001/u001 directory=tmp dumpfile=u001.dmp schemas=u001 reuse_dumpfiles=y

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