ORA-31603 Caused by DBMS_METADATA.GET_DDL To ALL/CDB/DBA/USER_XXXX Views On PDB
(Doc ID 2479803.1)
Last updated on JULY 20, 2024
Applies to:
Oracle Database - Enterprise Edition - Version 12.1.0.1 and laterInformation in this document applies to any platform.
Symptoms
ORA-31603 Caused by DBMS_METADATA.GET_DDL To ALL/CDB/DBA/USER_XXXX Views On PDB
Changes
ORA-31603 Caused by DBMS_METADATA.GET_DDL to ALL/CDB/DBA/USER_XXXX views on PDB, while no error happen on CDB$ROOT:
SQL> alter session set container=pdb1;
Session altered.
SQL> select dbms_metadata.get_ddl('VIEW','ALL_TABLES','SYS') from dual;
ERROR:
ORA-31603: object "ALL_TABLES" of type VIEW not found in schema "SYS"
ORA-06512: at "SYS.DBMS_METADATA", line 5746
ORA-06512: at "SYS.DBMS_METADATA", line 8333
ORA-06512: at line 1
no rows selected
SQL> select dbms_metadata.get_ddl('VIEW','CDB_TABLES','SYS') from dual;
ERROR:
ORA-31603: object "CDB_TABLES" of type VIEW not found in schema "SYS"
ORA-06512: at "SYS.DBMS_METADATA", line 5746
ORA-06512: at "SYS.DBMS_METADATA", line 8333
ORA-06512: at line 1
no rows selected
SQL> select dbms_metadata.get_ddl('VIEW','DBA_TABLES','SYS') from dual;
ERROR:
ORA-31603: object "DBA_TABLES" of type VIEW not found in schema "SYS"
ORA-06512: at "SYS.DBMS_METADATA", line 5746
ORA-06512: at "SYS.DBMS_METADATA", line 8333
ORA-06512: at line 1
no rows selected
SQL> select dbms_metadata.get_ddl('VIEW','USER_TABLES','SYS') from dual;
ERROR:
ORA-31603: object "USER_TABLES" of type VIEW not found in schema "SYS"
ORA-06512: at "SYS.DBMS_METADATA", line 5746
ORA-06512: at "SYS.DBMS_METADATA", line 8333
ORA-06512: at line 1
no rows selected
SQL> alter session set container=cdb$root;
Session altered.
SQL> select dbms_metadata.get_ddl('VIEW','ALL_TABLES','SYS') from dual;
DBMS_METADATA.GET_DDL('VIEW','ALL_TABLES','SYS')
--------------------------------------------------------------------------------
CREATE OR REPLACE FORCE NONEDITIONABLE VIEW "SYS"."ALL_TABLES" ("OWNER", "TAB
SQL> select dbms_metadata.get_ddl('VIEW','CDB_TABLES','SYS') from dual;
DBMS_METADATA.GET_DDL('VIEW','CDB_TABLES','SYS')
--------------------------------------------------------------------------------
CREATE OR REPLACE FORCE NONEDITIONABLE VIEW "SYS"."CDB_TABLES" CONTAINER_DAT
SQL> select dbms_metadata.get_ddl('VIEW','DBA_TABLES','SYS') from dual;
DBMS_METADATA.GET_DDL('VIEW','DBA_TABLES','SYS')
--------------------------------------------------------------------------------
CREATE OR REPLACE FORCE NONEDITIONABLE VIEW "SYS"."DBA_TABLES" ("OWNER", "TAB
SQL> select dbms_metadata.get_ddl('VIEW','USER_TABLES','SYS') from dual;
DBMS_METADATA.GET_DDL('VIEW','USER_TABLES','SYS')
--------------------------------------------------------------------------------
CREATE OR REPLACE FORCE NONEDITIONABLE VIEW "SYS"."USER_TABLES" ("TABLE_NAME"
SQL>
Session altered.
SQL> select dbms_metadata.get_ddl('VIEW','ALL_TABLES','SYS') from dual;
ERROR:
ORA-31603: object "ALL_TABLES" of type VIEW not found in schema "SYS"
ORA-06512: at "SYS.DBMS_METADATA", line 5746
ORA-06512: at "SYS.DBMS_METADATA", line 8333
ORA-06512: at line 1
no rows selected
SQL> select dbms_metadata.get_ddl('VIEW','CDB_TABLES','SYS') from dual;
ERROR:
ORA-31603: object "CDB_TABLES" of type VIEW not found in schema "SYS"
ORA-06512: at "SYS.DBMS_METADATA", line 5746
ORA-06512: at "SYS.DBMS_METADATA", line 8333
ORA-06512: at line 1
no rows selected
SQL> select dbms_metadata.get_ddl('VIEW','DBA_TABLES','SYS') from dual;
ERROR:
ORA-31603: object "DBA_TABLES" of type VIEW not found in schema "SYS"
ORA-06512: at "SYS.DBMS_METADATA", line 5746
ORA-06512: at "SYS.DBMS_METADATA", line 8333
ORA-06512: at line 1
no rows selected
SQL> select dbms_metadata.get_ddl('VIEW','USER_TABLES','SYS') from dual;
ERROR:
ORA-31603: object "USER_TABLES" of type VIEW not found in schema "SYS"
ORA-06512: at "SYS.DBMS_METADATA", line 5746
ORA-06512: at "SYS.DBMS_METADATA", line 8333
ORA-06512: at line 1
no rows selected
SQL> alter session set container=cdb$root;
Session altered.
SQL> select dbms_metadata.get_ddl('VIEW','ALL_TABLES','SYS') from dual;
DBMS_METADATA.GET_DDL('VIEW','ALL_TABLES','SYS')
--------------------------------------------------------------------------------
CREATE OR REPLACE FORCE NONEDITIONABLE VIEW "SYS"."ALL_TABLES" ("OWNER", "TAB
SQL> select dbms_metadata.get_ddl('VIEW','CDB_TABLES','SYS') from dual;
DBMS_METADATA.GET_DDL('VIEW','CDB_TABLES','SYS')
--------------------------------------------------------------------------------
CREATE OR REPLACE FORCE NONEDITIONABLE VIEW "SYS"."CDB_TABLES" CONTAINER_DAT
SQL> select dbms_metadata.get_ddl('VIEW','DBA_TABLES','SYS') from dual;
DBMS_METADATA.GET_DDL('VIEW','DBA_TABLES','SYS')
--------------------------------------------------------------------------------
CREATE OR REPLACE FORCE NONEDITIONABLE VIEW "SYS"."DBA_TABLES" ("OWNER", "TAB
SQL> select dbms_metadata.get_ddl('VIEW','USER_TABLES','SYS') from dual;
DBMS_METADATA.GET_DDL('VIEW','USER_TABLES','SYS')
--------------------------------------------------------------------------------
CREATE OR REPLACE FORCE NONEDITIONABLE VIEW "SYS"."USER_TABLES" ("TABLE_NAME"
SQL>
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 |
References |