DBAsupport.com Forums - Powered by vBulletin
Results 1 to 7 of 7

Thread: No of users logged on

  1. #1
    Join Date
    Nov 2000
    Location
    Birmingham, UK
    Posts
    360
    Can anyone explain the difference in the follwoing two statements (8.1.7.2 on AIX):

    I'm trying to get the number of users logged on (both end users and batch user) at a particular time. We have a script that uses the first method and its being investigated because the number is unusually high for this particular system. I would have thought that the second query would be best but donr understand the different results.

    SQL> select value from v$sysstat where name = 'logons current';

    VALUE
    ----------
    300

    SQL> select count(username) from v$session;

    COUNT(USERNAME)
    ---------------
    75


  2. #2
    Join Date
    Nov 2000
    Location
    Birmingham, UK
    Posts
    360
    These statements are from our production system. What is a little wierd is that the numbers on our UAT system match up:

    SQL> select value from v$sysstat where name = 'logons current';

    VALUE
    ----------
    19

    SQL> select count(username) from v$session;

    COUNT(USERNAME)
    ---------------
    19

  3. #3
    Join Date
    Aug 2001
    Location
    chennai,bangalore
    Posts
    840
    the second query will work for ur requirement.But it will give you users whos session are idel.

    cheese
    anandkl
    anandkl

  4. #4
    Join Date
    Nov 2000
    Location
    Birmingham, UK
    Posts
    360
    I agree that the second query will work well enough for what I want to do, but I'm now more concerned with the difference in the figures from the two statements (especially as its a production system). On the pre-production systems the two different queries give the same result (as I would expect). Guess my question is am I right in the assumption that the two queries should give the same results?

  5. #5
    Join Date
    Aug 2001
    Location
    chennai,bangalore
    Posts
    840
    the result from v$sysstat gives recursive process which internally create sessions to do some activites.

    cheese
    anandkl
    anandkl

  6. #6
    Join Date
    Nov 2000
    Location
    Birmingham, UK
    Posts
    360
    Just to let you all know that the difference is due to an Oracle bug:

    bug:1621984,"LOGINS CURRENT IN V$SYSSTAT CONTINOUSLY GROWS IF RESOURCE_LIMIT=TRUE". The bug is fixed in 9.0.2. The bug is published and you can view the details in the metalink.

    Cheers,
    Fraze

  7. #7
    Join Date
    Sep 2000
    Posts
    384
    SELECT GLOBAL_NAME,to_char(sysdate,'DD-MON-YYYY HH:MI:SS PM')"DATE",SESSIONS_CURRENT FROM
    V$LICENSE,GLOBAL_NAME,DUAL
    Radhakrishnan.M

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