views:

1324

answers:

1

(Excuse any ignorance of mine here - I'm not a seasoned Oracle user.)

I'm attempting to use the DBMS_METADATA.GET_DDL function (in conjunction with ALL_OBJECTS or some such) to get the DDL for all of the tables in a particular schema. When I do this (either for all objects or for a single specific object) I get an ORA-31603 error ("object "FOO" of type TABLE not found in schema "SCHEMA").

I assume this means that the user I'm logged in with doesn't have whatever privilege is necessary to read the metadata needed for GET_DDL. What privilege is this that's needed? Is there a way when logged in to confirm that the current user does/does not have this privilege?

thanks! Lee

+1  A: 

Read this document, but basically, you need SELECT_CATALOG_ROLE

http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_metada.htm#i1016867

Joseph Bui