Tag: process

How to see current utilization of processes/sessions and max utilization?

Using the following SQL one can find the current number of processes and sessions connected and also max utilization so one can check if you need to increase the values of the parameter SQL> select resource_name, current_utilization, max_utilization from v$resource_limit where resource_name in ('processes','sessions'); Output: RESOURCE_NAME CURRENT_UTILIZATION MAX_UTILIZATION ------------------------------ ------------------- --------------- processes 146 196 sessions … Continue reading How to see current utilization of processes/sessions and max utilization?

How to trace a running process?

Using strace one can trace the system calls being executed by a running process. To stop the strace press control-C To display the system calls being executed $ strace -p <pid> or To display a summary of system calls being executed $ strace -cfo <logfile> -p <pid> Example: In this example smon process was being … Continue reading How to trace a running process?

How to get current session id, process id, client process id?

SQL> select b.sid, b.serial#, a.spid processid, b.process clientpid from v$process a, v$session b where a.addr = b.paddr and b.audsid = userenv('sessionid'); SID SERIAL# PROCESSID CLIENTPID ---------- ---------- --------- --------- 43 52612 420734 5852:5460 V$SESSION.SID and V$SESSION.SERIAL# are database process id V$PROCESS.SPID - Shadow process id on the database server V$SESSION.PROCESS - Client process id, on … Continue reading How to get current session id, process id, client process id?

How to find the process id listening on a port?

On Windows - Example trying to find which process is listening on port 1433 Show if any process is listening on port 1433 for example c:\temp> netstat -ano | find /I "1433" | find /I "LISTEN" Proto Local Address Foreign Address State PID TCP 0.0.0.0:1433 0.0.0.0:0 LISTENING 6244 Using tlist or task manager one can … Continue reading How to find the process id listening on a port?

process control

# lists jobs in current session $ jobs # start job 1 (sleeps for 200 seconds) $ sleep 200 # suspended job 1 using control-z [1] + Stopped sleep 200 # start job 2 (sleeps for 400 seconds) $ sleep 400 # suspended job 2 using control-z [2] + Stopped sleep 400 # lists jobs … Continue reading process control

ksh – Process

-- Get process id of current process $ echo $$ 6113 -- shows process id $ ps PID TTY TIME CMD 2050 pts/2 00:00:00 ps 6113 pts/2 00:00:00 ksh Useful when creating a unique temp file example TEMPFILE=/tmp/tmpfile.$$ -- Get process id of last background id $ sleep 10 & [1] 2078 $ echo $! … Continue reading ksh – Process

How to get client process id and oracle shadow process id in dedicated server?

-- note this will work when not logged in as SYS, as the session id is the same for all background processes SELECT p.spid oracle_dedicated_process, s.process clientpid FROM v$process p, v$session s WHERE p.addr = s.paddr AND s.audsid = userenv('sessionid'); Or for SYS you can use the following SQL> SELECT p.spid oracle_dedicated_process, s.process clientpid FROM … Continue reading How to get client process id and oracle shadow process id in dedicated server?