My Oracle Support Banner

ORA-31050: Access Denied Trying to Create a Resource in XDB Repository (Doc ID 762425.1)

Last updated on APRIL 29, 2020

Applies to:

Oracle Database - Enterprise Edition - Version 10.2.0.1 and later
Information in this document applies to any platform.

Symptoms

NOTE: In the images and/or the document content below, the user information and environment data used represents fictitious data from the Oracle sample or bulit-in schema(s), Public Documentation delivered with an Oracle database product or other training material. Any similarity to actual environments, actual persons, living or dead, is purely coincidental and not intended in any manner.

 

When trying to create a resource in a folder which is owned by another user, it fails with error when done in a PL/SQL procedure, even if the XDBADMIN role has been granted.

create or replace procedure test is
  retb BOOLEAN;
BEGIN
  retb := DBMS_XDB.createresource('/common/new.xml',
                                  '<emp_name>Clark</emp_name>');
  commit;
END;
/
Procedure created.

execute test
*
ERROR at line 1:
ORA-31050: Access denied
ORA-6512: at "XDB.DBMS_XDB", line 73
ORA-6512: at "TESTUSER.TEST", line 4
ORA-6512: at line 1

Changes

The error only occurs when trying to create a resource in a PL/SQL procedure. Creating the resource in SQL*Plus directly works:

DECLARE
  retb BOOLEAN;
BEGIN
  retb := DBMS_XDB.createresource('/common/new2.xml',
                                  '<emp_name>Clark</emp_name>');
  commit;
END;
/
PL/SQL procedure successfully completed.

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.