参考:
http://*.com/questions/1043096/how-to-list-active-open-connections-in-oracle
以sys身份连接进入,执行如下sql 语句:
SQL> select
substr(a.spid,1,9)
pid,
substr(b.sid,1,5)
sid,
substr(b.serial#,1,5)
ser#,
substr(b.machine,1,6)
box,
substr(b.username,1,10)
username,
--
b.server,
substr(b.osuser,1,8)
os_user,
substr(b.program,1,30)
program
from v$session b, v$process a
where
b.paddr = a.addr
and
type=‘USER‘
order by spid;
**************************
运行结果:
PID SID SER#
BOX USERNAME OS_USER PROGRAM
---------
----- ----- ------ ---------- --------
------------------------------
2744
1 5 localh
SYS oracle
sqlplus@localhost.localdomain
6747
57 8 localh
SYS oracle
rman@localhost.localdomain (TN
7457
60 20 localh SYSMAN
oracle OMS
7489
26 70 localh SYSMAN
oracle OMS
26819 49
6269 localh SYS
oracle rman@localhost.localdomain
(TN
26822 43 3610 localh
SYS oracle
rman@localhost.localdomain (TN
26829
45 4967
localh
oracle oracle@localhost.localdomain
(
6911 61
14 localh SYS
oracle rman@localhost.localdomain
(TN
7553 58
14 localh SYSMAN oracle
OMS
7558 62
3 localh SYSMAN
oracle OMS
26833 56
513
localh
oracle oracle@localhost.localdomain
(
PID SID SER#
BOX USERNAME OS_USER PROGRAM
---------
----- ----- ------ ---------- --------
------------------------------
6781
59 14 localh DBSNMP
oracle
emagent@localhost.localdomain
6828
27 251 localh DBSNMP
oracle
emagent@localhost.localdomain
6936
30 281 localh
SYS oracle
rman@localhost.localdomain (TN
7254
42 367 localh DBSNMP
oracle emagent@localhost.localdomain
15 rows
selected.
SQL>
可以看到,rman是以sys身份连接进入的。