RE: get the computer name (without the domain name)?

  • From: "Taylor, Chris David" <ChrisDavid.Taylor@xxxxxxxxxxxxxxx>
  • To: "'wellmetus@xxxxxxxxx'" <wellmetus@xxxxxxxxx>, "'oracle-l@xxxxxxxxxxxxx'" <oracle-l@xxxxxxxxxxxxx>
  • Date: Thu, 20 May 2010 10:07:45 -0500

Did you try the TERMINAL column from v$session?

Most of mine show the machine only in that column vs the MACHINE column.

Chris Taylor
Sr. Oracle DBA
Ingram Barge Company
Nashville, TN 37205
Office: 615-517-3355
Cell: 615-354-4799
Email: chris.taylor@xxxxxxxxxxxxxxx<mailto:chris.taylor@xxxxxxxxxxxxxxx>

CONFIDENTIALITY NOTICE: This e-mail and any attachments are confidential and 
may also be privileged. If you are not the named recipient, please notify the 
sender immediately and delete the contents of this message without disclosing 
the contents to anyone, using them for any purpose, or storing or copying the 
information on any medium.
From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On 
Behalf Of Roger Xu
Sent: Thursday, May 20, 2010 10:03 AM
To: oracle-l@xxxxxxxxxxxxx
Subject: get the computer name (without the domain name)?

Hi expert,

How can I only get the computer name (without the domain name)?

SQL> select machine from v$session where sid=41;
MACHINE
--------------------
Domain1\BB011499
SQL>


In UNIX, I would do this but I need it to be done inside SQL

# echo 'Domain1\BB011499' | awk -F\\ '{print $NF}'
BB011499

Thanks,

Roger Xu

Other related posts: