Re: How do I extract "vsnnum" from oracle binaries or libraries (was Version of Oracle Database without connecting to the database.)

  • From: Dennis Yurichev <dennis@xxxxxxxxxx>
  • To: "Fowler, Kenneth R" <Kenneth.R.Fowler@xxxxxxxxxx>
  • Date: Tue, 11 Nov 2008 17:48:00 +0200

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Fowler, Kenneth R wrote:
> This thread was of great interest to me as I am currently working on a
> project to gather server and database metadata for servers and databases
> in our farm.  One part of the project requires the ability to
> automatically gather data on oracle installations so I was trying to
> figure out how to get hold of the "vsnnum" value from oracle binaries or
> libraries.
> 
> I can find evidence of "vsnnum" using elfdump (Solaris 10)...
> 
> 
> amrndhs014-ora9i $ uname -a
> SunOS amrndhs014 5.10 Generic_118833-36 sun4u sparc SUNW,Sun-Fire-V490
> amrndhs014-ora9i $ pwd
> /app/oracle/product/9.2.0.8_64
> amrndhs014-ora9i $ /usr/ccs/bin/elfdump bin/oracle | grep vsnnum
>    [44804]  0x000102f87748 0x000000000004  OBJT GLOB  D    0 .rodata
> vsnnum
>   [136007]  0x000102f87748 0x000000000004  OBJT GLOB  D    0 .rodata
> vsnnum
>             [44804]     vsnnum
> amrndhs014-ora9i $ /usr/ccs/bin/elfdump lib/libcommon9.a | grep vsnnum
>      [674]  0x00155e84  (vsndef.o):vsnnum
>       [18]  0x000000000000 0x000000000004  OBJT GLOB  D    0 .rodata
> vsnnum
> 
> 
> But I am having no luck extracting the correct (expected) value.  Anyone
> have any experience with this sort of thing?

Try this:

$ uname -a
Linux ... 2.6.9-34.EL #1 Fri Feb 24 16:44:51 EST 2006 i686 i686 i386
GNU/Linux

$ ar -x $ORACLE_HOME/lib/libcommon10.a vsndef.o

$ objdump -D vsndef.o | grep -A 2 '<vsnnum>'
00000020 <vsnnum>:
  20:   00 04 20                add    %al,(%eax)
  23:   0a 00                   or     (%eax),%al

Take first four bytes and reverse.
You'll get: 0x0A, 0x20, 0x04, 0x00.
Now version number is more or less obvious.
This was from 10.2.0.4 Linux ...
For 11.1.0.7.0 Linux it will be: 0x0B, 0x10, 0x07, 0x00


- --
My PGP public key: http://yurichev.com/dennis.yurichev.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkkZqTAACgkQ1YPmFmJG++OtXwCeMjonGRQff+vGmhfAdI9G4GL5
3jEAn0wGLIhwEAX8HvSLavQl5sBGbpJr
=Vy1v
-----END PGP SIGNATURE-----
--
//www.freelists.org/webpage/oracle-l


Other related posts: