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 ?
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 ?