ROCESS 发出sql命令 所在主机的进程 可以不在数据库主机上发出
SPID 对应数据库的服务进程id
select a.PROCESS,b.SPID From v$session a , v$process b where a.PADDR=b.ADDR and a.USERNAME='SYS'
SQL> !ps -ef|grep sqlplus
oracle 385 2792 0 21:01 pts/0 00:00:00 sqlplus
oracle 399 385 0 21:01 pts/0 00:00:00 /bin/bash -c ps -ef|grep sqlplus
oracle 401 399 0 21:01 pts/0 00:00:00 grep sqlplus
SQL> !ps -ef | grep 385
oracle 385 2792 0 21:01 pts/0 00:00:00 sqlplus
oracle 386 385 0 21:01 ? 00:00:00 oraclecdb1 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 475 385 0 21:01 pts/0 00:00:00 /bin/bash -c ps -ef | grep 385
oracle 477 475 0 21:01 pts/0 00:00:00 grep 385
----------------------不在数据库主机发出 spid 主是1
oracle 3485015 1 51 21:19 ? 00:01:10 oracle (LOCAL=NO)
--------------------
select a.PROCESS,b.SPID From v$session a , v$process b where a.PADDR=b.ADDR and a.USERNAME='SYS'
SQL> !ps -ef|grep sqlplus
oracle 3442 2792 0 21:06 pts/0 00:00:00 sqlplus
oracle 3496 3442 0 21:06 pts/0 00:00:00 /bin/bash -c ps -ef|grep sqlplus
oracle 3498 3496 0 21:06 pts/0 00:00:00 grep sqlplus
SQL> !ps -ef | grep 3442
oracle 3442 2792 0 21:06 pts/0 00:00:00 sqlplus
oracle 3450 3442 0 21:06 ? 00:00:00 oraclecdb1 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 3578 3442 0 21:06 pts/0 00:00:00 /bin/bash -c ps -ef | grep 3442
oracle 3580 3578 0 21:06 pts/0 00:00:00 grep 3442