Re: dbms_metadata.get_ddl Error

  • From: Nigel Thomas <nigel_cl_thomas@xxxxxxxxx>
  • To: ebadi01@xxxxxxxxx, oracle-l <oracle-l@xxxxxxxxxxxxx>
  • Date: Mon, 15 Oct 2007 13:07:16 -0700 (PDT)

From SQL*Plus, as a regular user you can find out what is visible to you using 
the ALL_xxx family of views (eg ALL_OBJECTS, ALL_TABLES etc). If you want to 
know how they have been granted to you, try selecting from the (confusingly 
named, for historical reasons) ALL_TAB_PRIVS_RECD (confusing because it 
includes all objects) 

eg: 
select grantee, table_name, grantor from all_tab_privs_recd where 
table_name='DBMS_METADATA'
/

GRANTEE                        TABLE_NAME                     GRANTOR           
             
------------------------------ ------------------------------ 
------------------------------ 
PUBLIC                         DBMS_METADATA                  SYS               
             

If the grant is directly to you - or to PUBLIC (everyone - PUBLIC is not a 
"normal" role) then you should be able to use the privilege from PL/SQL. If the 
grant is to a proper role which has itself been granted to you, you won't be 
able to use the privilege from PL/SQL.

Try the same with your table and index...

Regards Nigel

----- Original Message ----
From: A Ebadi <ebadi01@xxxxxxxxx>
To: Robert Freeman <robertgfreeman@xxxxxxxxx>; Ghassan Salem 
<salem.ghassan@xxxxxxxxx>

Understand that, but the issue is what grant(s) am I missing?  That's the 
question Oracle Support can't answer yet either.

Thanks!

Robert Freeman <robertgfreeman@xxxxxxxxx> wrote:
Grant to role vs. direct grant? Anytime something
"works from SQL*Plus" but does not work from PL/SQL
that is one of the first questions to ask.

...

Other related posts: