My Oracle Support Banner

ORA-31631 During Export Using DataPump API (Doc ID 1053432.1)

Last updated on AUGUST 01, 2019

Applies to:

Oracle Database - Enterprise Edition - Version 10.1.0.2 to 11.2.0.3 [Release 10.1 to 11.2]
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Information in this document applies to any platform.
***Checked for relevance on 18-APR-2013***

NOTE: In the document content below, the user information and data used represents fictitious data .Any similarity to actual persons, living or dead, is purely coincidental and not intended in any manner.

Symptoms

You created a user (ASDBA) and granted the roles CONNECT, RESOURCE, EXP_FULL_DATABASE and IMP_FULL_DATABASE to that user.

Then, as user ASDBA, you created the following procedure that uses DataPump API to export different database objects (in my example a schema):

create or replace procedure myexp as
   d1 number;

begin
  d1 := dbms_datapump.open ('EXPORT', 'SCHEMA');
  dbms_datapump.add_file (d1, 'test.dmp', 'DPU');
  dbms_datapump.add_file (d1, 'test.log', 'DPU', NULL, DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE);
  dbms_datapump.metadata_filter (d1, 'SCHEMA_EXPR', 'IN (''TEST'')');
  dbms_datapump.start_job (d1);
  dbms_datapump.detach (d1);
end;
/

When you start the procedure, the following errors are raised:

SQL> exec myexp;
BEGIN myexp; END;

*
ERROR at line 1:
ORA-31631: privileges are required
ORA-06512: at "SYS.KUPF$FILE", line 7266
ORA-06512: at "SYS.KUPP$PROC", line 644
ORA-06512: at "SYS.DBMS_DATAPUMP", line 1032
ORA-06512: at "SYS.DBMS_DATAPUMP", line 4631
ORA-06512: at "ASDBA.MYEXP", line 5
ORA-06512: at line 1

The errors occur during the call to DBMS_DATAPUMP.OPEN.

Changes

You newly set the event:

alter system set events '39089 trace name context forever, level 0x480300';

to trace the DM/DW processes.

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.