RE: detecting version of restored database controlfile

  • From: Jonathan Lewis <jonathan@xxxxxxxxxxxxxxxxxx>
  • To: "jeremy.schneider@xxxxxxxxxxxxxx" <jeremy.schneider@xxxxxxxxxxxxxx>, Oracle-L <oracle-l@xxxxxxxxxxxxx>
  • Date: Mon, 24 Jun 2013 16:44:40 +0000

The control file itself holds the COMPATIBLE version.
If you can do an "oradebug dump controlf 1" you should get something like:

DUMP OF CONTROL FILES, Seq # 18595 = 0x48a3
 V10 STYLE FILE HEADER:
        Compatibility Vsn = 186646528=0xb200000
        Db ID=2575036341=0x997befb5, Db Name='TESTDB11'
 
(This was an 11.2 database with compatible = 11.2.0.0 , which you can see the 
in b 20 00 00)

In my case the controlfile blocks were 16KB, and the compatible field was in 
block 2, bytes 25 - 28 (with endianness:  27, 28, 25, 26).

If you can see v$controlfile, though, you can see v$parameter, so could simply 
check the compatible parameter.

Regards
Jonathan Lewis


________________________________________
From: oracle-l-bounce@xxxxxxxxxxxxx [oracle-l-bounce@xxxxxxxxxxxxx] on behalf 
of Jeremy Schneider [jeremy.schneider@xxxxxxxxxxxxxx]
Sent: 24 June 2013 16:13
To: Oracle-L
Subject: detecting version of restored database controlfile

Just curious, does anyone know an easy way to detect what version a
controlfile is?  I'm writing a program that needs to restore from a backup,
and the original source database could be one of several versions.  Of
course if you try to open a DB with the wrong software version then it
errors out -- so I'd like to detect and correct this condition as early as
possible (ideally before restoring and recovering all the datafiles).
So far haven't figured out a way to get the version from the RMAN recovery
catalog or v$controlfile or v$database or anywhere else.  Of couse
v$version and v$instance show the software I'm using to do the restore, not
the software of the control & data files I'm restoring.  Anybody know a way
to figure this out?  Seems like the sort of thing that really should have
been in the controlfile and recovery catalog...

-J


--
http://about.me/jeremy_schneider


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


Other related posts: