Re: SQLPlus version tracking

  • From: Andy Klock <andy@xxxxxxxxxxxxxxx>
  • To: William.Blanchard@xxxxxxxxxxxxx
  • Date: Thu, 19 Jan 2012 16:38:31 -0500

I don't know, my luck with that view has been sort of hit and miss. As the
others have noted the information is just not there or a place holder of
some sort.  It's really up to the client software that you are using to
pass that information on to the server.  For instance if I access 11.2 from
a 9i client the client_verson is populated with 0.0.0.0.
However, if I access 11.2.0.3 from a 11.2.0.1 (windows) client I get the
following:

$ sqlplus andy/andy@oimt1

SQL*Plus: Release 11.2.0.1.0 Production on Thu Jan 19 16:13:27 2012

Copyright (c) 1982, 2010, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing
options


SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE    11.2.0.3.0      Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production

SQL> select client_driver, client_version from v$session_connect_info where
sid = sys_context('USERENV','SID');

CLIENT_DR CLIENT_VERSION
--------- ----------------------------------------
SQL*PLUS  11.2.0.1.0
SQL*PLUS  11.2.0.1.0
SQL*PLUS  11.2.0.1.0

SQL> create table logger (tstamp date, msg varchar2(100));

Table created.

SQL> CREATE OR REPLACE TRIGGER andy.after_logon_trg
  2  AFTER LOGON ON andy.SCHEMA
  3  BEGIN
  4    for rec in (select client_driver, client_version from
v$session_connect_info where sid = sys_context('USERENV','SID')  and rownum
= 1)
  5    loop
  6  --   dbms_application_info.set_action('using '|| rec.client_driver ||
' ' || rec.client_version);
  7     insert into logger values (sysdate, 'using '|| rec.client_driver ||
' ' || rec.client_version);
  8    end loop;
  9  END;
 10  /

Trigger created.

SQL> conn andy/andy@oim1t
Connected.
SQL> select * from logger;

TSTAMP
---------
MSG
--------------------------------------------------------------------------------
19-JAN-12
using SQL*PLUS 11.2.0.1.0


On Thu, Jan 19, 2012 at 2:50 PM, Blanchard, William G <
William.Blanchard@xxxxxxxxxxxxx> wrote:

> Andy,
> Thank you.  The v$session_connect_info view has a client_driver which may
> give me what I'm looking for.  It's obvious that Oracle has the information
> but how do I get it in a logon trigger?  I tried client_driver with
> sys_context with no luck.
>
>
> WGB
>
>
> From: andyklock@xxxxxxxxx [mailto:andyklock@xxxxxxxxx] On Behalf Of Andy
> Klock
> Sent: Thursday, January 19, 2012 1:33 PM
> To: Blanchard, William G
> Cc: oracle-l@xxxxxxxxxxxxx
> Subject: Re: SQLPlus version tracking
>
> There is a view v$session_connect_info that may give you what you are
> looking for.
> On Thu, Jan 19, 2012 at 2:19 PM, Blanchard, William G <
> William.Blanchard@xxxxxxxxxxxxx<mailto:William.Blanchard@xxxxxxxxxxxxx>>
> wrote:
> Does anyone know if there's a way to track the version of sqlplus that is
> connecting to the database?  I looked at sys_context and system events but
> haven't found anything.
>
> WGB
>
> _____________
> The information contained in this message is proprietary and/or
> confidential. If you are not the intended recipient, please: (i) delete the
> message and all copies; (ii) do not disclose, distribute or use the message
> in any manner; and (iii) notify the sender immediately. In addition, please
> be aware that any message addressed to our domain is subject to archiving
> and review by persons other than the intended recipient. Thank you.
>
> --
> //www.freelists.org/webpage/oracle-l
>
>
>


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


Other related posts: