v$session 和 v$process关联?
系统层面PID -> v$process.spid -> v$process.addr -> v$session.paddr -> sid
系统层面
终端1
sqlplus / as sysdba
终端2
ps -ef|grep sqlplus
oracle 11423 2708 0 20:44 pts/7 00:00:00 sqlplus as sysdba
ps -ef|grep 11423
oracle 11423 2708 0 20:44 pts/7 00:00:00 sqlplus as sysdba
oracle 11424 11423 0 20:44 ? 00:00:00 oraclemyctest1 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
远程终端1
sqlplus 用户名/密码@IP地址[:端口]/service_name [as sysdba]
终端2
oracle 22810 1 0 20:49 ? 00:00:00 oraclemyctest1 (LOCAL=NO)
ps -ef|grep 22810
oracle 22810 1 0 20:49 ? 00:00:00 oraclemyctest1 (LOCAL=NO)
ps -ef|grep bpxtest2|grep LOCAL=NO
oracle 27139 1 0 16:37 ? 00:00:00 oraclebpxtest2 (LOCAL=NO)
v$process
select * from v$process;
select * from v$process where spid='11423';
select * from v$process where spid='11424';
select * from v$process where spid='22810';
select spid, addr from v$process where spid='22810';
col spid format a20
col addr format a40
select spid, addr, username, program from v$process where spid='&spid';
v$session
col machine format a20
select sid, paddr, sql_id, username, machine from v$session where paddr='00000001387BBA80';
select sid, paddr, sql_id, username, machine from v$session where paddr='&paddr';
v$sql
select sql_id, sql_text from v$sql where sql_id='dz3m54204b44m';
select sql_id, sql_text from v$sql where sql_id='&sql_id';