Because your privileges to select against DBA_OBJECTS
was granted through a role and role privileges are
disabled in views.  You'll need to have select
privileges explicitly granted on the underlying
objects.

HTH,

-- Anita

--- "Bunyamin K. Karadeniz"
<[EMAIL PROTECTED]> wrote:
> I want to select locked_objects in a view.
> I run 
> CREATE OR REPLACE VIEW V_BUN_LOCKED_OBJECTS AS 
>  SELECT sn.username, m.sid, m.type,
>     DECODE(m.lmode, 0, 'None'
>                   , 1, 'Null'
>                   , 2, 'Row Share'
>                   , 3, 'Row Excl.'
>                   , 4, 'Share'
>                   , 5, 'S/Row Excl.'
>                   , 6, 'Exclusive'
>                   , lmode,
> ltrim(to_char(lmode,'990'))) lmode,
>     DECODE(m.request, 0, 'None'
>                   , 1, 'Null'
>                   , 2, 'Row Share'
>                   , 3, 'Row Excl.'
>                   , 4, 'Share'
>                   , 5, 'S/Row Excl.'
>                   , 6, 'Exclusive'
>                   , request,
> ltrim(to_char(request,'990'))) request,
>           obj1.object_name objname, obj2.object_name
> objname
>  FROM v$session sn, V$lock m, dba_objects obj1,
> dba_objects obj2
>  WHERE sn.sid = m.sid
>  AND m.id1 = obj1.object_id (+)
>  AND m.id2 = obj2.object_id (+)
>    AND lmode != 4 ;
> 
> 
> and  gives error or ora-942. Can not find
> dba_objects .
> But with the same user I can query dba_objects table
> since my user has dba privilege.
> The inside of view runs perfectly. 
> Why can it be??
> 


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: A. Bardeen
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to