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 157 210 Advertisements Continue reading How to see current utilization of processes/sessions and max utilization?
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 traced $ strace -p 1234 Process 1234 attached – interrupt … Continue reading How to trace a running process?
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 windows it is “:” separated the first # is the … Continue reading How to get current session id, process id, client process id?
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 find the PID (last column) from the above command to … Continue reading How to find the process id listening on a port?
# lists jobs in current session $ jobs # start job 1 (sleeps for 200 seconds) $ sleep 200 # suspended job 1 using control-z  + Stopped sleep 200 # start job 2 (sleeps for 400 seconds) $ sleep 400 # suspended job 2 using control-z  + Stopped sleep 400 # lists jobs in current session shows the jobs are suspended i.e. not … Continue reading process control
— 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 &  2078 $ echo $! 2078 — Print parent process id $ print $PPID 6048 Continue reading ksh – Process
— 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 v$process p, v$session s WHERE p.addr = s.paddr AND s.sid … Continue reading How to get client process id and oracle shadow process id in dedicated server?