Tuesday, September 25, 2018

Script to Get OS user name with terminal name

--22. Script to Get OS user name with terminal name

SELECT

DBA_USERS.USERNAME USERNAME,

DECODE(V$SESSION.USERNAME, NULL, 'NOT CONNECTED', 'CONNECTED') STATUS,

NVL(OSUSER, '-') OSUSER,

NVL(TERMINAL,'-') TERMINAL,

SUM(DECODE(V$SESSION.USERNAME, NULL, 0,1)) SESSIONS

FROM

DBA_USERS, V$SESSION

WHERE DBA_USERS.USERNAME = V$SESSION.USERNAME (+)

GROUP BY

DBA_USERS.USERNAME,

DECODE(V$SESSION.USERNAME, NULL, 'NOT CONNECTED', 'CONNECTED'),

OSUSER,

TERMINAL

ORDER BY 1 ;

No comments:

Post a Comment

[ERROR]: The value of s_patch_service_name is not set correctly in atleast one of the context files.

[ERROR]: The value of s_patch_service_name is not set correctly in atleast one of the context files. I got the issue below wh...