Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: How to find osuser and machine name connected to database

Re: How to find osuser and machine name connected to database

From: Mohammad Rafiq <rafiq9857_at_hotmail.com>
Date: Tue, 22 Aug 2000 14:59:20 EDT
Message-Id: <10597.115285@fatcity.com>


Nice script.
Regards
Rafiq

From: "Ron Rogers" <RROGERS_at_galottery.org> Reply-To: ORACLE-L_at_fatcity.com
To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> Subject: Re: How to find osuser and machine name connected to database Date: Tue, 22 Aug 2000 07:24:50 -0800

I don't know is this will work when using a form but it does with a VB application.



COLUMN SU FORMAT A8 HEADING 'ORACLE|USER ID' JUSTIFY LEFT COLUMN OSU FORMAT A8 HEADING 'SYSTEM|USER ID' JUSTIFY LEFT COLUMN STAT FORMAT A8 HEADING 'SESSION|STATUS' JUSTIFY LEFT COLUMN SSID FORMAT 999999 HEADING 'ORACLE|SESSION|ID' JUSTIFY RIGHT COLUMN SSER FORMAT 999999 HEADING 'ORACLE|SERIAL|NO' JUSTIFY RIGHT COLUMN SPID FORMAT A9 HEADING 'ORACLE|SESSION|ID' JUSTIFY RIGHT COLUMN TXT FORMAT A28 HEADING 'CURRENT STATEMENT' JUSTIFY CENTER WORD COLUMN LOGTIME FORMAT A10 HEADING 'LOGIN|TIME' JUSTIFY RIGHT SELECT
S.USERNAME SU,
S.OSUSER OSU,
to_char(S.LOGON_TIME,'MM-DD-YYYY HH:MI:SS') LOGTIME,
S.STATUS STAT,
S.SID SSID,
S.SERIAL# SSER,

LPAD(P.SPID,9) SPID,
SUBSTR(SA.SQL_TEXT,1,540) TXT
FROM V$PROCESS P,
V$SESSION S,
V$SQLAREA SA
WHERE P.ADDR=S.PADDR
AND S.USERNAME IS NOT NULL
AND S.SQL_ADDRESS=SA.ADDRESS (+)
AND S.SQL_HASH_VALUE=SA.HASH_VALUE (+)

ORDER BY 1,3,6

I have this query in a script that I run when connected to sqlplus. Hope this helps,
Ron Rogers
DBA OCP
ATl.GA

>>> abhivapure_at_YAHOO.COM 08/22/00 05:59AM >>>
Hi folks,

        I want to know the operating system username and machine name of the user who is connected to database.

I tried v$session view, But In case of user connected through forms 4.5 I am getting the os_user as 'OraUser'
and machine = NULL .
I also tried to find it from the Listener.log on the server, but same problem.

can anybody help me out.

Thanks in advance.



Do You Yahoo!?
Yahoo! Mail * Free email you can access from anywhere! http://mail.yahoo.com/
--
Author: Abhijit Bhivapure
   INET: abhivapure_at_yahoo.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

--
Author: Ron Rogers
   INET: RROGERS_at_galottery.org

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

________________________________________________________________________
Received on Tue Aug 22 2000 - 13:59:20 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US