Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to create a DDL for a schema

Re: How to create a DDL for a schema

From: Grizmi <Grizmi_at_yahoo.com>
Date: 10 Nov 2005 03:51:14 -0800
Message-ID: <1131623474.212797.82240@z14g2000cwz.googlegroups.com>


When I run under system everythings work fine with dbms_metadata.get_ddl.

But under user A I want to see metadata from user B, there is always the error ORA_31603. Cannot find the object in schema B. Even gave user dba roles ...
Eample: select dbms_metadata.get_ddl('INDEX','DIM_ACTION_IDX01',B) from dual;

When I run this under B, there is no problem. I am using dbms_metadata.get_ddl in a package, and want different users to use this.

Is system the only option?

gareth_at_jamms.org wrote:
> Don't top-post please, people don't like it :)
>
> Anyway, a bit of lateral thinking produces:
>
> select dbms_metadata.get_ddl('TABLE',table_name,'<schema_name>')
> from all_tables
> where owner='<schema_name>';
>
> And:
>
> select dbms_metadata.get_ddl('INDEX',index_name,'<schema_name>')
> from all_indexes
> where owner='<schema_name>';
>
> Run as SYSTEM rather than SYS.
>
> HTH
>
> -- g
Received on Thu Nov 10 2005 - 05:51:14 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US