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: return hostname in PL/SQL

Re: return hostname in PL/SQL

From: <Winnie_Liu_at_infonet.com>
Date: Tue, 23 May 2000 14:47:54 -0700
Message-Id: <10506.106438@fatcity.com>


In Oracle 8i, you can get the hostname from

select host_name from v$instance;

Winnie

"Charlie Mengler" <charliem_at_mwh.com> on 05/23/2000 07:11:16 AM

Please respond to ORACLE-L_at_fatcity.com

To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> cc: (bcc: Winnie Liu/HQ/ISC)

Subject: Re: return hostname in PL/SQL

Here is what I did just yesterday -

HTH! DECLARE
   CURSOR machine_cur IS

      select machine from v$session
      where program like '%PMON%';

   v_Host                         VARCHAR2(16);

BEGIN
   DBMS_OUTPUT.ENABLE(100000);
   FOR machine_rec IN machine_cur LOOP

      v_Host := machine_rec.machine;
   END LOOP;
   DBMS_OUTPUT.PUT_LINE(v_Host);
   gen_host_env(v_Host);

EXCEPTION
   WHEN OTHERS THEN RAISE;
END; John Dunn wrote:
>
> How can I get hold of the machine hostname via PL/SQL?
>
> John
>
> --
> Author: John Dunn
> INET: john.dunn_at_sefas.co.uk
>
> 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).

--
Charlie Mengler                       Maintenance Warehouse
charliem_at_mwh.com                      5505 Morehouse Drive
858-552-6229                          San Diego, CA 92121
If you don't use vi, then you shouldn't be working on UNIX!
--
Author: Charlie Mengler
  INET: charliem_at_mwh.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).
Received on Tue May 23 2000 - 16:47:54 CDT

Original text of this message

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