Re: detecting version of restored database controlfile

From: Jeremy Schneider <jeremy.schneider_at_ardentperf.com>
Date: Mon, 24 Jun 2013 12:18:12 -0500
Message-ID: <CA+fnDAaAurs1bK8Qbzwf0GU7YaOfifSFRZd5_WEba9Gk6CrEww_at_mail.gmail.com>



Interesting - most of the values in v$parameter seem to be instance parameters, not database parameters - but you're saying that "compatible" here is coming from the controlfile rather than the spfile or init.ora? regardless, on my test database compatible is returning 11.2.0 (like yours) which unfortunately doesn't tell me whether it's 11.2.0.2 or 11.2.0.3 and then after waiting for all the 11.2.0.2 datafiles to restore, the open resetlogs fails [ORA-39700: database must be opened with UPGRADE option].  Furthermore, I just dumped the controlfile header from an 11.2.0.3 db that I had handy with oradebug, and it has exactly the same Compatibility Vsn - 0xb200000 ... so i should be able to detect the 10.2 databases but it won't predict whether I'm going to get the open failure on 11.2.0.2 dbs.

raj it's difficult to secure OEM access - i can't hard-code the password into this program because it's a script, and i can't give the operators a password which allows them full access to the OEM backend DB. one possibility might be setting up a special read-only account for the OEM db, but I'd rather hold off on that for the moment.

--
http://about.me/jeremy_schneider


On Mon, Jun 24, 2013 at 11:44 AM, Jonathan Lewis <
jonathan_at_jlcomp.demon.co.uk> wrote:


>
> 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_at_freelists.org [oracle-l-bounce_at_freelists.org] on
> behalf of Jeremy Schneider [jeremy.schneider_at_ardentperf.com]
> 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
>
>
> --
> http://www.freelists.org/webpage/oracle-l
-- http://www.freelists.org/webpage/oracle-l
Received on Mon Jun 24 2013 - 19:18:12 CEST

Original text of this message