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

Home -> Community -> Usenet -> c.d.o.server -> Re: - determine Operating system using pl/sql??

Re: - determine Operating system using pl/sql??

From: Howard J. Rogers <hjr_at_dizwell.com>
Date: Wed, 28 Apr 2004 17:31:34 +1000
Message-ID: <408f5dcf$0$439$afc38c87@news.optusnet.com.au>


Herman de Boer wrote:

> Andre wrote:
> 
> 

>>Hello all,
>>
>>I've written a pl/sql package. Within this package I want to know if
>>the Operating system on which the Database is running is UNIX or
>>Windows-based.
>>
>>Is there a way to do this?
>>
>>regards,
>>Anneke
>>The Netherlands
> 
> 
> Hello Anneke,
> 
> what about a simple:
> 
> select dbms_utility.port_version from dual;

Nice idea. Shame it doesn't work in 8i or 9i or 10g.

Did you perhaps mean port_STRING??

And if you did, how do you account for this:

SQL> select dbms_utility.port_string from dual;

PORT_STRING


IBMPC/WIN_NT-8.1.0 SQL> select * from v$version;

BANNER



Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production PL/SQL Release 9.2.0.1.0 - Production
CORE 9.2.0.1.0 Production
TNS for 32-bit Windows: Version 9.2.0.1.0 - Production NLSRTL Version 9.2.0.1.0 - Production

Now I realise that, regardless of version, the string is telling you that you're running on Windows NT (although this particular example happens to come from Windows 2000), which might be all that the original poster requires, but the wrong version number there is a bit of a worry, and makes me unconvinced that this is always going to be a reliable mechanism. Indeed, it reports "8.1.0" on 8.1.7, 9.2.0 and 10g, on both Windows and Linux.

Regards
HJR Received on Wed Apr 28 2004 - 02:31:34 CDT

Original text of this message

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