user session ID
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 10 of 10

Thread: user session ID

  1. #1
    Join Date
    Sep 2002
    Posts
    411

    user session ID

    if I have a regular user who only have CONNECT, RESOURCE grant to him, how can he see ONLY his own session ID without seeing any other session ID.

    If SYS grant him SELECT on v$SESSION, he will see all of the session ID in the database which I don't want that.

    what I need to do for that user only see his own session???

    thanks

  2. #2
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    v$mystat

  3. #3
    Join Date
    May 2002
    Posts
    2,645
    SQL> create user mike identified by mike;

    User created.

    SQL> grant connect,resource to mike;

    Grant succeeded.

    SQL> conn mike/mike
    Connected.
    SQL> select * from v$session;
    select * from v$session
    *
    ERROR at line 1:
    ORA-00942: table or view does not exist


    SQL> select * from v$mystat;
    select * from v$mystat
    *
    ERROR at line 1:
    ORA-00942: table or view does not exist


    SQL> conn system/manager
    Connected.
    SQL> grant select on v$mystat to mike;
    grant select on v$mystat to mike
    *
    ERROR at line 1:
    ORA-01031: insufficient privileges


    SQL> conn sys/oracle
    Connected.
    SQL> grant select on v$mystat to mike;
    grant select on v$mystat to mike
    *
    ERROR at line 1:
    ORA-02030: can only select from fixed tables/views

  4. #4
    Join Date
    May 2002
    Posts
    2,645
    Code:
    SQL> conn mike/mike
    Connected.
    SQL> SELECT SYS_CONTEXT('USERENV','SESSIONID') from dual;
    
    SYS_CONTEXT('USERENV','SESSIONID')
    -----------------------------------------------------------
    1388

  5. #5
    Join Date
    Sep 2002
    Posts
    411
    I was going to say and I agree with Stecal and Thank you Pando as always
    Last edited by mike2000; 12-12-2002 at 02:16 PM.

  6. #6
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    Originally posted by stecal
    SQL> create user mike identified by mike;

    User created.

    SQL> grant connect,resource to mike;

    Grant succeeded.

    SQL> conn mike/mike
    Connected.
    SQL> select * from v$session;
    select * from v$session
    *
    ERROR at line 1:
    ORA-00942: table or view does not exist


    SQL> select * from v$mystat;
    select * from v$mystat
    *
    ERROR at line 1:
    ORA-00942: table or view does not exist


    SQL> conn system/manager
    Connected.
    SQL> grant select on v$mystat to mike;
    grant select on v$mystat to mike
    *
    ERROR at line 1:
    ORA-01031: insufficient privileges


    SQL> conn sys/oracle
    Connected.
    SQL> grant select on v$mystat to mike;
    grant select on v$mystat to mike
    *
    ERROR at line 1:
    ORA-02030: can only select from fixed tables/views

    SQL> grant select on v_$mystat to lsc;

    Grant succeeded.

    v$mystat is synonym not table or view

    sessionid is not SID rather AUDSID in v$session, if you want aidsid then fine, if you want sid then it's incorrect

  7. #7
    Join Date
    Oct 2000
    Posts
    139
    Pando you are awesome, wish I know as much as you. As always is joy reading your posts

  8. #8
    Join Date
    May 2002
    Posts
    2,645
    Originally posted by pando
    SQL> grant select on v_$mystat to lsc;

    Grant succeeded.

    v$mystat is synonym not table or view
    I know I knew that; why didn't I do that?

  9. #9
    Join Date
    Jun 2000
    Posts
    41
    Originally posted by Sweetie
    Pando you are awesome, wish I know as much as you. As always is joy reading your posts
    agree, short and precise answers

  10. #10
    Join Date
    Sep 2002
    Posts
    411
    I agree 110% with you guys about Pando's knowledge. They used to have couple guy in here like Pando too but I haven't seen them lately b/c I guess they get discouraged by some silly questions or the laziness of not look into the doc before asking in here.

    I hope guys like Pando Jeff is going to be here for a while

Posting Permissions

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



Click Here to Expand Forum to Full Width