My Oracle Support Banner

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

Last updated on AUGUST 04, 2018

Applies to:

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


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

ORA-39127: unexpected error from call to export_string :=
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

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

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


To view full details, 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 a vibrant support community of peers and Oracle experts.