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 157 210 Advertisements 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 traced $ strace -p 1234 Process 1234 attached – interrupt … 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 windows it is “:” separated the first # is the … 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 find the PID (last column) from the above command to … Continue reading How to find the process id listening on a port?

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