RE: SQLPlus version tracking

  • From: Yong Huang <yong321@xxxxxxxxx>
  • To: mark.powell2@xxxxxx
  • Date: Sat, 13 Oct 2012 08:14:39 -0700 (PDT)

That was an old message. My test, see
//www.freelists.org/post/oracle-l/SQLPlus-version-tracking,7
did take into account that well known bug. That's why I say the client version 
detection only works if the client is 11g (and above).

But even if you know the client is 11g, v$session_connect_info.client_version 
is still not right, because of the problem with function sys_op_version. That's 
why a query on x$ksusecon directly is needed.

Yong Huang

-----Original Message-----
However, I believe there is a bug such that the client version displayed is the 
client version of the querying user rather than that of the session client that 
should be displayed.  You might want to connect using two different client 
versions then query for those two SID's and see what you get.


-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On 
Behalf Of Yong Huang
Sent: Friday, January 20, 2012 5:57 PM
To: oracle-l@xxxxxxxxxxxxx
Subject: Re: SQLPlus version tracking

> With some experiment, I think the widths of the numbers are 2, 1, 2,
> 1, 2 bytes, respectively. So we can use the following SQL to check the
> client version (run as sys):
> ...

A better SQL for an 11g database to check its client version:

with x as (select distinct to_char(ksuseclvsn,'xxxxxxx') v  from x$ksusecon 
where ksusenum = &sid)
select decode(v, '       0', '10g or lower',
to_number(substr(v,1,2),'xx') || '.' || --maj_rel
to_number(substr(v,3,1),'x') || '.' || --mnt_rel
to_number(substr(v,4,2),'xx') || '.' || --ias_rel
to_number(substr(v,6,1),'x') || '.' || --ptc_set
to_number(substr(v,7,2),'xx')) client_version -- port_mnt from x;

Have a good weekend!

Yong Huang
--
//www.freelists.org/webpage/oracle-l


Other related posts: