-
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
-
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
-
the second query will work for ur requirement.But it will give you users whos session are idel.
cheese
anandkl
anandkl
-
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?
-
the result from v$sysstat gives recursive process which internally create sessions to do some activites.
cheese
anandkl
anandkl
-
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
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|