답변:
V$SESSION
보기를 사용하십시오 .
V$SESSION
각 현재 세션에 대한 세션 정보를 표시합니다.
더 완전한 답변을 보려면 다음을 참조 하십시오 : http://dbaforums.org/oracle/index.php?showtopic=16834
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;
응용 프로그램 서버에서 데이터베이스로 들어오는 연결을 보려면 다음 명령을 사용하십시오.
SELECT username FROM v$session
WHERE username IS NOT NULL
ORDER BY username ASC;
간단하지만 효과적인.
select s.sid as "Sid", s.serial# as "Serial#", nvl(s.username, ' ') as "Username", s.machine as "Machine", s.schemaname as "Schema name", s.logon_time as "Login time", s.program as "Program", s.osuser as "Os user", s.status as "Status", nvl(s.process, ' ') as "OS Process id"
from v$session s
where nvl(s.username, 'a') not like 'a' and status like 'ACTIVE'
order by 1,2
이 쿼리는 모든 백그라운드 프로세스를 필터링하려고합니다.
select
username,
osuser,
terminal,
utl_inaddr.get_host_address(terminal) IP_ADDRESS
from
v$session
where
username is not null
order by
username,
osuser;
select status, count(1) as connectionCount from V$SESSION group by status;