Operating System - HP-UX
1830350 Members
1907 Online
110001 Solutions
New Discussion

How to know How many users are working on the system?

 
SOLVED
Go to solution
rveri
Super Advisor

How to know How many users are working on the system?

I'm hoping someone can tell me , how to know that How many active users are working on the system [ non unix users I mean like oracle , SAP etc users].

I wanted to know , how a system administrator can comes to know how many oracle or SAP or users are logged and working/using the system.

Is there any way to find out that.

Thanks in Advance.

RVeri.
-------
8 REPLIES 8
TwoProc
Honored Contributor
Solution

Re: How to know How many users are working on the system?

If your users are direct Oracle connections (no middle tiers in between) - you can just start by examining everything in v$session.
You should be able to make criteria based on machine locations - users names, etc. from
"select * from v$session" pretty easily. If however, you've got a middle tier which is going to "re-handle" the logins for you - well it would be best to visit the SAP support site for the query to give that answer. You should probably do both as a matter of course anyways.
We are the people our parents warned us about --Jimmy Buffett
Uday_S_Ankolekar
Honored Contributor

Re: How to know How many users are working on the system?

use who for unix logins...who -HT will give you idle time also.

-USA..
Good Luck..
Robert Bennett_3
Respected Contributor

Re: How to know How many users are working on the system?

who | wc -l

"All there is to thinking is seeing something noticeable which makes you see something you weren't noticing which makes you see something that isn't even visible." - Norman Maclean
Michael Palmgren
Frequent Advisor

Re: How to know How many users are working on the system?

Hi!

Try this
last | grep still | wc -l

/Michael
Thierry Poels_1
Honored Contributor

Re: How to know How many users are working on the system?

uptime
;-)

regards,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Peter Godron
Honored Contributor

Re: How to know How many users are working on the system?

Hi,
the command
ps -ef |awk -F' ' '{print $1}' | grep -v UID | sort -u
will list all the userids of processes running.
If you want to know how many oracle owned processes are running for example:
ps -ef | grep oracle | grep -v grep | wc -l

Regards
TwoProc
Honored Contributor

Re: How to know How many users are working on the system?

Rveri, One thing to keep in mind is that you *don't* want Oracle Systems processes included in what you're looking for ...

select *
FROM v$session s
WHERE (s.username IS NOT NULL)
AND (NVL (s.osuser, 'x') <> 'SYSTEM')
AND (s.TYPE <> 'BACKGROUND');

Then you can work from the resulting set of data - watching in particular the columns for
username, osuser, machine, module, program, process, action ...
We are the people our parents warned us about --Jimmy Buffett
baiju_3
Esteemed Contributor

Re: How to know How many users are working on the system?

Hi Rveri,

netstat -a |grep -i established

Will give you number of established sessions.


Thanks,
BL

Good things Just Got better (Plz,not stolen from advertisement -:) )