Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2004
    Posts
    8

    Unanswered: Privilege for create view of v$session

    I need to create a view of v$session.
    But the oracle report insufficient privilege.
    Can anyone tell me what privilege I should grant to user?

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Would this help? Create a view as user "sys" (or another privileged user that can select data from v$session), grant select on this view to another user, and create a synonym that will look at the newly created view.

    As I'm not a DBA, I couldn't tell if there's another (and better) way. But, this one will work until you find something else
    Code:
    Akon_> grant select on v$session to sasa;
    grant select on v$session to sasa
                    *
    ERROR at line 1:
    ORA-02030: can only select from fixed tables/views
    
    Akon_> create view my_session as select * From v$session;
    
    View created.
    
    Akon_> grant select on my_session to sasa;
    
    Grant succeeded.
    
    Akon_> connect sasa/pwd
    Connected.
    Akon_> create synonym sasa_session for sys.my_session;
    
    Synonym created.
    
    Akon_> select * from sasa_session;
    
    SADDR           SID    SERIAL#     AUDSID PADDR         USER#
    -------- ---------- ---------- ---------- -------- ----------
    USERNAME                          COMMAND TADDR    LOCKWAIT STATUS   SERVER
    ------------------------------ ---------- -------- -------- -------- ---------
       SCHEMA# SCHEMANAME                     OSUSER          PROCESS
    ---------- ------------------------------ --------------- ---------
    MACHINE                                                          TERMINAL
    ---------------------------------------------------------------- --------
    PROGRAM                                                          TYPE
    ---------------------------------------------------------------- ----------
    SQL_ADDR SQL_HASH_VALUE
    -------- --------------
    0107DCF0          1          1          0 01069500          0
                                            0                   ACTIVE   DEDICATED
             0 SYS

  3. #3
    Join Date
    Dec 2003
    Posts
    1,074
    grant select on v_$session;

    v_$session is the underlying table/view for v$session.

    -cf

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •