Unix Technical Forum

SQL to get IP and OS

This is a discussion on SQL to get IP and OS within the Oracle Database forums, part of the Database Server Software category; --> Hello, I am using Oracle 10gR2 on Windows 2003 Server. Is it possible to retrieve the host's IP address ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-26-2008, 07:49 AM
Jeff B
 
Posts: n/a
Default SQL to get IP and OS

Hello,

I am using Oracle 10gR2 on Windows 2003 Server. Is it possible to
retrieve the host's IP address and its OS version using a sql
statement? I know that I can get the host_name from v$instance, and I
can get the OS from the v$version, but I need more that just "Windows"
for the OS. I'm looking for something like "Windows 2003 Server".

Any ideas?

Thanks in adavance!
Jeff

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-26-2008, 07:49 AM
NetComrade
 
Posts: n/a
Default Re: SQL to get IP and OS

On Thu, 05 Jul 2007 11:54:51 -0700, Jeff B <jbisch1@yahoo.com> wrote:

>Hello,
>
> I am using Oracle 10gR2 on Windows 2003 Server. Is it possible to
>retrieve the host's IP address and its OS version using a sql
>statement? I know that I can get the host_name from v$instance, and I
>can get the OS from the v$version, but I need more that just "Windows"
>for the OS. I'm looking for something like "Windows 2003 Server".
>

Is that client's IP or db IP? db IP and OS are static, u can just
store it in some table.
........
We run Oracle 9iR2,10gR1/2 on RH4/RH3 and Solaris 10 (Sparc)
remove NSPAM to email
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-26-2008, 07:49 AM
sybrandb@hccnet.nl
 
Posts: n/a
Default Re: SQL to get IP and OS

On Thu, 05 Jul 2007 11:54:51 -0700, Jeff B <jbisch1@yahoo.com> wrote:

>Hello,
>
> I am using Oracle 10gR2 on Windows 2003 Server. Is it possible to
>retrieve the host's IP address and its OS version using a sql
>statement? I know that I can get the host_name from v$instance, and I
>can get the OS from the v$version, but I need more that just "Windows"
>for the OS. I'm looking for something like "Windows 2003 Server".
>
> Any ideas?
>
>Thanks in adavance!
>Jeff


Before applying kludges recommended by Netcomrade look into the
sys_context function and the dbms_utility package (or that manual). I
know there are calls in dbms_utility.

--
Sybrand Bakker
Senior Oracle DBA
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-26-2008, 07:49 AM
Mark D Powell
 
Posts: n/a
Default Re: SQL to get IP and OS

On Jul 5, 5:12 pm, sybra...@hccnet.nl wrote:
> On Thu, 05 Jul 2007 11:54:51 -0700, Jeff B <jbis...@yahoo.com> wrote:
> >Hello,

>
> > I am using Oracle 10gR2 on Windows 2003 Server. Is it possible to
> >retrieve the host's IP address and its OS version using a sql
> >statement? I know that I can get the host_name from v$instance, and I
> >can get the OS from the v$version, but I need more that just "Windows"
> >for the OS. I'm looking for something like "Windows 2003 Server".

>
> > Any ideas?

>
> >Thanks in adavance!
> >Jeff

>
> Before applying kludges recommended by Netcomrade look into the
> sys_context function and the dbms_utility package (or that manual). I
> know there are calls in dbms_utility.
>
> --
> Sybrand Bakker
> Senior Oracle DBA


Jeff, you can get the host name and IP via the Oracle supplied package
utl_inaddr.

There are numerous dictionary and v$ views that contain information
that potentially could provide enough information to ID the OS. Take
a look at product_component_version, database_properties, v$version, v
$instance, and v$database.

HTH -- Mark D Powell --


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-26-2008, 07:49 AM
DA Morgan
 
Posts: n/a
Default Re: SQL to get IP and OS

Jeff B wrote:
> Hello,
>
> I am using Oracle 10gR2 on Windows 2003 Server. Is it possible to
> retrieve the host's IP address and its OS version using a sql
> statement? I know that I can get the host_name from v$instance, and I
> can get the OS from the v$version, but I need more that just "Windows"
> for the OS. I'm looking for something like "Windows 2003 Server".
>
> Any ideas?
>
> Thanks in adavance!
> Jeff


SELECT sys_context('USERENV', 'IP_ADDRESS') FROM dual;

SELECT dbms_utility.port_string FROM dual;

If you want something else you'll need to explicitly describe it.
--
Daniel A. Morgan
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:22 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com