Database Administration (MOSC)

MOSC Banner

Getting errors ORA-31603, ORA-06512 when generating DDL for view

edited Sep 17, 2010 2:52AM in Database Administration (MOSC) 3 commentsAnswered ✓
When I am trying to get DDL for view owner by other user using DBMS_METADATA.GET_DDL, it is giving errors ERROR:
ORA-31603: object "V1" of type VIEW not found in schema "USER1"
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
ORA-06512: at "SYS.DBMS_METADATA", line 3912
ORA-06512: at "SYS.DBMS_METADATA", line 5678
ORA-06512: at line 1

This can be reproduced with a simple test case (I can reproduce it on both 10.2 and 11.2)

SQL> create user user1 identified by password1;

User created.

SQL> grant connect, resource to user1;

Grant succeeded.

SQL> grant create view to user1;

Grant succeeded.

SQL> create user user2 identified by password2;

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center