Unix Technical Forum

version awareness in sql script.

This is a discussion on version awareness in sql script. within the Oracle Database forums, part of the Database Server Software category; --> Hello. I have a simple script, but I want the script to alter it's behavior depending on whether it's ...


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

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-25-2008, 03:23 AM
DaLoverhino
 
Posts: n/a
Default version awareness in sql script.

Hello. I have a simple script, but I want the script to alter it's
behavior depending on whether it's being run against a 10, 9 or an 8
instance. The patch level doesn't matter.

I can use V$VERSION and parse the output:
SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
PL/SQL Release 9.2.0.6.0 - Production
CORE 9.2.0.6.0 Production
TNS for Solaris: Version 9.2.0.6.0 - Production
NLSRTL Version 9.2.0.6.0 - Production


I would need to grab "Oracle9i", but I'm wondering if there's an easier
way to do this?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-25-2008, 03:23 AM
Mark C. Stock
 
Posts: n/a
Default Re: version awareness in sql script.


"DaLoverhino" <DaLoveRhino@hotmail.com> wrote in message
news:1143671383.228741.265170@i40g2000cwc.googlegr oups.com...
: Hello. I have a simple script, but I want the script to alter it's
: behavior depending on whether it's being run against a 10, 9 or an 8
: instance. The patch level doesn't matter.
:
: I can use V$VERSION and parse the output:
: SQL> select * from v$version;
:
: BANNER
: ----------------------------------------------------------------
: Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
: PL/SQL Release 9.2.0.6.0 - Production
: CORE 9.2.0.6.0 Production
: TNS for Solaris: Version 9.2.0.6.0 - Production
: NLSRTL Version 9.2.0.6.0 - Production
:
:
: I would need to grab "Oracle9i", but I'm wondering if there's an easier
: way to do this?
:

select version from v$instance

not sure if it's also available via SYS_CONTEXT -- might check that out

++ mcs


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-25-2008, 03:23 AM
Michel Cadot
 
Posts: n/a
Default Re: version awareness in sql script.


"DaLoverhino" <DaLoveRhino@hotmail.com> a écrit dans le message de news: 1143671383.228741.265170@i40g2000cwc.googlegroups. com...
| Hello. I have a simple script, but I want the script to alter it's
| behavior depending on whether it's being run against a 10, 9 or an 8
| instance. The patch level doesn't matter.
|
| I can use V$VERSION and parse the output:
| SQL> select * from v$version;
|
| BANNER
| ----------------------------------------------------------------
| Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
| PL/SQL Release 9.2.0.6.0 - Production
| CORE 9.2.0.6.0 Production
| TNS for Solaris: Version 9.2.0.6.0 - Production
| NLSRTL Version 9.2.0.6.0 - Production
|
|
| I would need to grab "Oracle9i", but I'm wondering if there's an easier
| way to do this?
|

dbms_utility.db_version

Regards
Michel Cadot


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-25-2008, 03:27 AM
Sybrand Bakker
 
Posts: n/a
Default Re: version awareness in sql script.

On Thu, 30 Mar 2006 13:20:06 +0400, "Vladimir M. Zakharychev"
<bob--nospam--@dynamicpsp.com> wrote:

>Since 9i, SQL*Plus exposes built-in _O_RELEASE variable,



Incorrect, available since Oracle 6 at least, and maybe Oracle 5.
Could you also *please* refrain from top-posting?

--
Sybrand Bakker, Senior Oracle DBA
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-25-2008, 03:28 AM
Vladimir M. Zakharychev
 
Posts: n/a
Default Re: version awareness in sql script.

>>Since 9i, SQL*Plus exposes built-in _O_RELEASE variable,

>
> Incorrect, available since Oracle 6 at least, and maybe Oracle 5.


Indeed, my bad. For some reason I thought it's not available
in pre-9i, no idea why.


> Could you also *please* refrain from top-posting?


Sorry, won't happen anymore. Bad habits die hard, ya know...

Regards,
Vladimir M. Zakharychev
N-Networks, makers of Dynamic PSP(tm)
http://www.dynamicpsp.com
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 02:05 PM.


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