My Oracle Support Banner

ORA-1031 When executing DBMS_XMLSCHEMA.RegisterSchema In A Package (Doc ID 248397.1)

Last updated on JANUARY 19, 2024

Applies to:

Oracle Database - Enterprise Edition - Version 9.2.0.3 and later
Information in this document applies to any platform.
- Oracle Server - Enterprise Edition 9.2
- Oracle XML Database - XDB

 


Symptom(s)
~~~~~~~~~~

- ORA-01031: insufficient privileges
- Calling DBMS_XMLSCHEMA.RegisterSchema() in a package
- Calling DBMS_XMLSCHEMA.RegisterSchema() in a PL/SQL block works without error


Cause
~~~~~~~

Executing DBMS_XMLSCHEMA.RegisterSchema() in a PL/SQL procedure or a package
needs additional privileges to be granted to the schema that owns the procedure
or the package. The privileges need to be granted directly and not via a role.


Fix
~~~~

Granting the following privileges allows the schema to be registered when run in
a package or procedure: (replace <USER> with the schema where the package is created)

connect / as sysdba
grant alter session to <USER>;
grant create type to <USER>;
grant create table to <USER>;
grant create procedure to <USER>;
grant create trigger to <USER>;


References
~~~~~~~~~~~

<Note:168168.1> Getting ORA-942 or ORA-1031 and PLS-201 or ORA-28111 in
PL/SQL, works in SQL*Plus









<

Symptoms

- ORA-01031: insufficient privileges

- Calling DBMS_XMLSCHEMA.RegisterSchema() in a package
- Calling DBMS_XMLSCHEMA.RegisterSchema() in a PL/SQL block works without error

 

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!


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