My Oracle Support Banner

DBMS_METADATA.GET_DDL Returns Error When Select Types Ora-31603 (Doc ID 312883.1)

Last updated on NOVEMBER 06, 2019

Applies to:

Oracle Database - Enterprise Edition - Version 10.1.0.3 and later
PL/SQL - Version 10.1.0.3 and later
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - 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 13-Sep-2016***


Symptoms

Using the DBMS_METADATA.GET_DDL command to access an object from another schema fails with an error:

Error:
---------
ORA-31603: object "<object name>" of type TYPE not found in schema "<schema>"

Sample Code:
***************

Connect as User1
============

Create the object
-------------------

SQL> EXECUTE TEST;
BEGIN TEST; END;

*
ERROR at line 1:
ORA-31603: object "OBJECT1" of type TYPE not found in schema "USER1"
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
ORA-06512: at "SYS.DBMS_METADATA", line 628
ORA-06512: at "SYS.DBMS_METADATA", line 1221
ORA-06512: at "USER2.TEST", line 4
ORA-06512: at line 1

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
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.