- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Counting Online Oracle Users
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2002 09:59 AM
тАО04-19-2002 09:59 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2002 10:40 AM
тАО04-19-2002 10:40 AM
Re: Counting Online Oracle Users
At the Unix level ... Yes,
do this:
prompt>ps -ef|grep oracle
you will see all the oracle daemons and connections... look for the one with (LOCAL=NO ... or Description) ... those are the actual application/user connections ...then grab that particular PID and then do a:
prompt> lsof -p
you will see who is connected ...
Hope this helps !
Thanks,
Shabu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2002 10:45 AM
тАО04-19-2002 10:45 AM
Re: Counting Online Oracle Users
Something like this:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2002 10:52 AM
тАО04-19-2002 10:52 AM
Re: Counting Online Oracle Users
select unique process, osuser from v$session where osuser <> 'oracle';
You can script this up and then call from within a shell script if you like. You should probably execute sqlpus (or svrmgrl) abd do a 'desc v$session' to see what other data you are interested in such as connections from a particular host.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2002 01:05 PM
тАО04-19-2002 01:05 PM
Re: Counting Online Oracle Users
I wonder though, doesn't Oracle pre-process a number of Oracle connections that may not necessarily have a live user connected to the port. The port is open but is there a user on it?
Mr. Stephenson,
This will require a bit of effort on my part, because there are several instances on my server, that I don't think anyone is using, so I would like to get rid of them. However, in order to script this out I suspect I have to log in as each individual oracle admin for that instance.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2002 01:17 PM
тАО04-19-2002 01:17 PM
Re: Counting Online Oracle Users
How about getting lsof itself for the box , there are binaries availabe for both 32 bit and 64 bit version of HPUX at :
ftp://vic.cc.purdue.edu/pub/tools/unix/lsof
and you are good to go.
Manoj Srivastava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2002 01:47 PM
тАО04-19-2002 01:47 PM
Re: Counting Online Oracle Users
We have lsof 4.61 loaded, but I think that is 32-bit only.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2002 01:49 PM
тАО04-19-2002 01:49 PM
Re: Counting Online Oracle Users
There is 64 bit binary there , but incase you want i can email you the compiled one from one of our system as an attachment . I am at msrivast@telecorp1.com .
Manoj Srivastava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2002 03:42 PM
тАО04-19-2002 03:42 PM
Re: Counting Online Oracle Users
You are Welcome !
I see what you are saying ..
You could script this as follows:
for PID in `ps -ef|grep oracle| awk '/LOCAL/{print $2}' | grep -v grep`
do
lsof -p"${PID}" | grep TCP
done
You could further enhance this script with more validations ..
Hope this helps !
Thanks,
-Shabu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2002 03:55 PM
тАО04-19-2002 03:55 PM
Re: Counting Online Oracle Users
Try this:
prompt>cat oracle_active_users
#!/bin/ksh
for PID in `ps -ef|grep oracle| awk '/LOCAL/{print $2}' | grep -v grep`
do
lsof -p"${PID}" | grep TCP | grep -v -i "idle"
done
prompt>chmod 755 oracle_active_users
prompt>./oracle_active_users | wc -l
should give you the total active/established connections to your oracle
database. This can take very long ...
As Clay mentioned earlier doing it at the Database level is much easier and efficient.
Good Luck.
Thanks,
Shabu