有时需要找到oracle在客户端对应的进程,这时分两种情况。
情况一
客户端不是通过connection pool等发起的连接。这时可以通过v$session这个视图查到客户端进程。如下所示,
SQL> SELECT SID,SERIAL# ,USERNAME,OSUSER,PROCESS,MACHINE,PORT,SQL_ID FROM V$SESSION WHERE MACHINE='myserver' and USERNAME='SUMSAPP';
SID SERIAL# USERNAME OSUSER PROCESS MACHINE PORT SQL_ID
---------- ---------- ------------------------------ ------------------------------ ------------ -------------------- ---------- -------------
126 42 SUMSAPP sumsadm 1234 myserver 49748
140 30 SUMSAPP root 4691 myserver 39751
209 10358 SUMSAPP sumsadm 1234 myserver 60177
21