Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

script to find top users on system

Status
Not open for further replies.

billy1

Technical User
Sep 16, 2002
73
IE
Can anyone help me out with this. When our system is running slow we usually run the 'top' command to see who's running heavy processes. However 'top' is a snapshot and can give me the processes at a certain time. If the processes are on our databases it just shows up as an 'oracle' process. Therefore I have to go into worksheet and try and find who that oracle process belongs to 'at that time'. This procedure alone is time consuming so the process itself may have moved on so is no longer at that time. Basically I need a script that will run 'top', grab the times of the top processes and go into oracle running the command :
select sid,serial#,username,osuser,TO_CHAR(logon_time, 'HH24:MI:SS' ) VTIME
from v$session
where TO_CHAR(logon_time, 'HH24:MI:SS' ) like ',TIME%'

Where TIME is the time of the process. Basically I need to combine 'top' with this command to find the persons name.

Does anybody know of such a script ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top