ORA-31631 During Export Using DataPump API
Last updated on NOVEMBER 28, 2016
Applies to:Oracle Database - Enterprise Edition - Version 10.1.0.2 to 184.108.40.206 [Release 10.1 to 11.2]
Information in this document applies to any platform.
***Checked for relevance on 18-APR-2013***
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):
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'')');
When you start the procedure, the following errors are raised:
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.
You newly set the event:
to trace the DM/DW processes.
Sign In with your My Oracle Support account
Don't have a My Oracle Support account? Click to get started
Million Knowledge Articles and hundreds of Community platforms