GET HOST NAME & IP IN ORACLE 10G

2008 May 11

Use the Oracle 10g utility “UTL_INADDR” to get the Local Host Name and IP of the machine your Oracle 10g is running on. You can do this by executing the following commands:

SQL> SET serveroutput on
SQL> BEGIN
2 DBMS_OUTPUT.PUT_LINE(UTL_INADDR.GET_HOST_NAME); — Local machine/host name
3 DBMS_OUTPUT.PUT_LINE(UTL_INADDR.GET_HOST_ADDRESS); — IP address of host
4 END;
5 /
DEVSTATION
192.168.1.3

PL/SQL procedure successfully completed.

Just a note.

-Marlon RIbunal

kick it on DotNetKicks.com

3 Responses leave one →
  1. 2008 June 25
    Amit permalink

    Really good one , Thanks.

  2. 2009 February 11
    Jack permalink

    helpful information.
    What is the command in sql plus or if I am to execute it from a stored procedure?

  3. 2009 December 12
    Mohammad Al-Masri permalink

    Still oracle the best!!!

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS

  • Archives



  • RSS SQLServerPedia

  • RSS SQL Crunch – Hot SQL Links

  • My Bookmarks

  • Category Cloud

    Business Career DBA Tool Events free ebook Humor IT News Members Only Microsoft MySQL Operating System Oracle Personal Reporting Services SQL Server SSIS TSQL Tutorial Uncategorized Video