Re: From SQL> How to query Oracle version?

From: Michel Cadot <micadot_at_netcourrier.com>
Date: Mon, 13 Sep 1999 11:40:02 +0200
Message-ID: <7rigr0$8ar$1_at_oceanite.cybercable.fr>


In SQL*Plus you have a pre-defined variable _O_RELEASE that gives you the Oracle version.
You can also use the v$version view.

With Oracle 7.3.4:

v734>def

DEFINE _SQLPLUS_RELEASE = "800050000" (CHAR)
DEFINE _EDITOR         = "Notepad" (CHAR)
DEFINE _O_VERSION      = "Oracle7 Server Release 7.3.4.1.0 - Production
With the distributed, replication and parallel query options PL/SQL Release 2.3.4.1.0 - Production" (CHAR) DEFINE _O_RELEASE = "703040100" (CHAR) v734>select * from v$version;

BANNER



Oracle7 Server Release 7.3.4.1.0 - Production PL/SQL Release 2.3.4.1.0 - Production
CORE Version 3.5.4.0.0 - Production
TNS for 32-bit Windows: Version 2.3.4.0.0 - Production NLSRTL Version 3.2.4.0.1 - Production

5 rows selected.

With Oracle 8.0.5:

v805>def

DEFINE _SQLPLUS_RELEASE = "800050000" (CHAR)
DEFINE _EDITOR         = "Notepad" (CHAR)
DEFINE _O_VERSION      = "Oracle8 Enterprise Edition Release 8.0.5.0.0 -
Production
With the Partitioning and Objects options PL/SQL Release 8.0.5.0.0 - Production" (CHAR) DEFINE _O_RELEASE = "800050000" (CHAR) v805>select * from v$version;

BANNER



Oracle8 Enterprise Edition Release 8.0.5.0.0 - Production PL/SQL Release 8.0.5.0.0 - Production
CORE Version 4.0.5.0.0 - Production
TNS for 32-bit Windows: Version 8.0.5.0.0 - Production NLSRTL Version 3.3.2.0.0 - Production

5 rows selected.

Cheong a écrit dans le message <37dcbf13_at_news.lhsgroup.com>...
>Hello:
>
>From SQL> prompt, I had to run the following "script" to get what Oracle
>version I am currently running on (by supplying a known table name).
>
>Is there another simpler select statement (or describe, or whatever within
>SQL>) that can tell what Oracle version I am currently using (without having
>to exit SQL*Plus and invoke SVRMGRL)?
>
>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>COLUMN sysdate NOPRINT HEADING ''
>
>TTITLE 'Oracle Release: ' SQL.RELEASE
>
>SELECT sysdate
>FROM sys.dual
>/
>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
>Thank you all and have a nice day!
>
>Regards,
>Cheong
>
>
Received on Mon Sep 13 1999 - 11:40:02 CEST

Original text of this message