Oracle Data Pump Export Fails with ORA-31642

Oracle Data Pump Export Fails with ORA-31642

Recently, I encountered an error chain involving ORA-31642 while performing a full export from an Oracle Database 19c Enterprise Edition database that was recently upgraded from 12c. The same export had been running successfully in 12c using the same export parameters.

At first glance, I can feel like an internal Oracle issue.

The export was running with the parameters provided below.

directory=EXPORT_DIR
logfile=BLTDB_full_20260726_1342_datapump.log
dumpfile=BLTDB_full_20260726_1342_datapump_%U
content=ALL
exclude=audit_trails
job_name=FULL_EXPDP_202607261342
parallel=4
full=Y

The first export started normally, but then stopped while processing the database scheduler-related objects.

The Data Pump log showed.

Processing object type DATABASE_EXPORT/PRE_SYSTEM_IMPCALLOUT/MARKER
Processing object type DATABASE_EXPORT/PASSWORD_VERIFY_FUNCTION
Processing object type DATABASE_EXPORT/PROFILE
>>> ORA-31642: the following SQL statement fails:
BEGIN "SYS"."DBMS_SCHED_EXPORT_CALLOUTS".SCHEMA_CALLOUT(:1,0,1,'19.00.00.00.00'); END;
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
ORA-01031: insufficient privileges
ORA-01031: insufficient privileges
ORA-06512: at line 1
ORA-06512: at "SYS.DBMS_ISCHED", line 9560
ORA-06512: at "SYS.DBMS_SCHED_MAIN_EXPORT", line 2302
ORA-06512: at "SYS.DBMS_SCHED_EXPORT_CALLOUTS", line 16

The interesting part here is that the export was being executed as SYS AS SYSDBA. So, naturally, the first question is:

How can a SYSDBA Data Pump export report “insufficient privileges”?

The error isn’t necessarily saying that the export user itself lacks a privilege. The failure can happen while Oracle is processing objects, but for the underlying operations to export these objects, the owner user may not have the required privileges to process.

In this case, it was failing while procesing scheduler programs. In this case, there was a schema that own a scheduler program but don’t have CREATE TABLE system privilege, I used the following query to detect.

SELECT DISTINCT owner
FROM dba_scheduler_program_args
WHERE owner NOT IN (
SELECT DISTINCT grantee
FROM dba_sys_privs
WHERE privilege LIKE 'CREATE%TABLE'
);
OWNER
--------
DEPLOYER

The export was reaching scheduler-related metadata owned by DEPLOYER.

The first solution was straightforward: grant the required privilege to the affected schema.

GRANT CREATE TABLE TO DEPLOYER;

After applying the grant, I ran the Data Pump export again and this time, the error changed.

Although I still encounterd an error , this change of error can actually be a very good sign. It means we’ve successfully moved past the first problem.

The next export progressed a little bit further. Then Data Pump stopped again at the scheduler export callout.

Processing object type DATABASE_EXPORT/PRE_SYSTEM_IMPCALLOUT/MARKER
Processing object type DATABASE_EXPORT/PASSWORD_VERIFY_FUNCTION
Processing object type DATABASE_EXPORT/PROFILE
Processing object type DATABASE_EXPORT/SCHEMA/USER
Processing object type DATABASE_EXPORT/PRE_INSTANCE_IMPCALLOUT/MARKER
Processing object type DATABASE_EXPORT/TABLESPACE
Processing object type DATABASE_EXPORT/RADM_FPTM
Processing object type DATABASE_EXPORT/SCHEMA/GRANT/SYSTEM_GRANT
Processing object type DATABASE_EXPORT/GRANT/SYSTEM_GRANT/PROC_SYSTEM_GRANT
Processing object type DATABASE_EXPORT/SCHEMA/ROLE_GRANT
Processing object type DATABASE_EXPORT/SCHEMA/DEFAULT_ROLE
Processing object type DATABASE_EXPORT/SCHEMA/ON_USER_GRANT
>>> ORA-31642: the following SQL statement fails:
BEGIN "SYS"."DBMS_SCHED_EXPORT_CALLOUTS".SCHEMA_CALLOUT(:1,0,1,'19.00.00.00.00'); END;
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
ORA-01950: no privileges on tablespace ''
ORA-01950: no privileges on tablespace 'USERS'
ORA-06512: at line 1
ORA-06512: at "SYS.DBMS_ISCHED", line 9560
ORA-06512: at "SYS.DBMS_SCHED_MAIN_EXPORT", line 2302
ORA-06512: at "SYS.DBMS_SCHED_EXPORT_CALLOUTS", line 16
ORA-06512: at line 1

This time, the message was much more specific:

ORA-01950: no privileges on tablespace ‘USERS’

So we had moved from a system privilege issue to a tablespace quota issue. Granting create table was not enough, tablespace quota was also required to be able to use the USERS tablespace.

ALTER USER DEPLOYER
QUOTA UNLIMITED ON USERS;

After applying the quota, the Data Pump export was successful.

In this case, the error chain looked something like this:

ORA-31642
|
+– DBMS_SCHED_EXPORT_CALLOUTS
|
+– ORA-01031
| |
| +– DEPLOYER
| |
| +– Missing CREATE TABLE
|
+– After fixing that:
|
+– ORA-01950
|
+– No quota on USERS

Hope it helps.


Discover More from Osman DİNÇ


Comments

Leave your comment