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_DIRlogfile=BLTDB_full_20260726_1342_datapump.logdumpfile=BLTDB_full_20260726_1342_datapump_%Ucontent=ALLexclude=audit_trailsjob_name=FULL_EXPDP_202607261342parallel=4full=Y
The first export started normally, but then stopped while processing the database scheduler-related objects.
The First Error: ORA-31642 and ORA-01031: insufficient privileges
The Data Pump log showed.
Processing object type DATABASE_EXPORT/PRE_SYSTEM_IMPCALLOUT/MARKERProcessing object type DATABASE_EXPORT/PASSWORD_VERIFY_FUNCTIONProcessing 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 86ORA-01031: insufficient privilegesORA-01031: insufficient privilegesORA-06512: at line 1ORA-06512: at "SYS.DBMS_ISCHED", line 9560ORA-06512: at "SYS.DBMS_SCHED_MAIN_EXPORT", line 2302ORA-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 ownerFROM dba_scheduler_program_argsWHERE 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 First Error: ORA-31642 and ORA-01950
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/MARKERProcessing object type DATABASE_EXPORT/PASSWORD_VERIFY_FUNCTIONProcessing object type DATABASE_EXPORT/PROFILEProcessing object type DATABASE_EXPORT/SCHEMA/USERProcessing object type DATABASE_EXPORT/PRE_INSTANCE_IMPCALLOUT/MARKERProcessing object type DATABASE_EXPORT/TABLESPACEProcessing object type DATABASE_EXPORT/RADM_FPTMProcessing object type DATABASE_EXPORT/SCHEMA/GRANT/SYSTEM_GRANTProcessing object type DATABASE_EXPORT/GRANT/SYSTEM_GRANT/PROC_SYSTEM_GRANTProcessing object type DATABASE_EXPORT/SCHEMA/ROLE_GRANTProcessing object type DATABASE_EXPORT/SCHEMA/DEFAULT_ROLEProcessing 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 86ORA-01950: no privileges on tablespace ''ORA-01950: no privileges on tablespace 'USERS'ORA-06512: at line 1ORA-06512: at "SYS.DBMS_ISCHED", line 9560ORA-06512: at "SYS.DBMS_SCHED_MAIN_EXPORT", line 2302ORA-06512: at "SYS.DBMS_SCHED_EXPORT_CALLOUTS", line 16ORA-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 DEPLOYERQUOTA 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.


Leave your comment