While testing how to perform a 10.2.0.3 to 11.1.0.6 upgrade I thought I would attempt to flashback through the upgrade back to the 10.2.0.3 database. There is a major caveat to this, you must not change the compatible parameter to be higher than your original release or you will not be able to open the database with the 10.2.0.3 software. I’m sure this will work for other 10.2 (and probably 10.1) releases.
[oracle@testdb ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.3.0 - Production on Thu Jan 17 14:57:45 2008
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning and Data Mining options
SQL> create restore point begin_upgrade guarantee flashback database;
Restore point created.
Best to create a guaranteed restore point, just in case you over run your flashback retention times
SQL> select * from V$restore_point;
SCN DATABASE_INCARNATION# GUA STORAGE_SIZE TIME NAME
———- ———————————- ———– ————– ——— ———
2041092430 2 YES 8192000 17-JAN-08 15.12.47.000000000 BEGIN_UPGRADE
SQL> @/oracle/product/11.1.0/rdbms/admin/utlu111i.sql
Oracle Database 11.1 Pre-Upgrade Information Tool 01-17-2008 14:59:03
.
**********************************************************************
Database:
**********************************************************************
–> name: TESTDB
–> version: 10.2.0.3.0
–> compatible: 10.2.0.3
–> blocksize: 8192
–> platform: Linux 64-bit for AMD
–> timezone file: V4
**********************************************************************
Tablespaces: [make adjustments in the current environment]
**********************************************************************
–> SYSTEM tablespace is adequate for the upgrade.
…. minimum required size: 1021 MB
–> UNDOTBS1 tablespace is adequate for the upgrade.
…. minimum required size: 584 MB
–> SYSAUX tablespace is adequate for the upgrade.
…. minimum required size: 685 MB
–> TEMP tablespace is adequate for the upgrade.
…. minimum required size: 61 MB
**********************************************************************
Update Parameters: [Update Oracle Database 11.1 init.ora or spfile]
**********************************************************************
– No update parameter changes are required.
**********************************************************************
Renamed Parameters: [Update Oracle Database 11.1 init.ora or spfile]
**********************************************************************
– No renamed parameters found. No changes are required.
**********************************************************************
Obsolete/Deprecated Parameters: [Update Oracle Database 11.1 init.ora or spfile]
**********************************************************************
–> “background_dump_dest” replaced by “diagnostic_dest”
–> “user_dump_dest” replaced by “diagnostic_dest”
–> “core_dump_dest” replaced by “diagnostic_dest”
**********************************************************************
Components: [The following database components will be upgraded or installed]
**********************************************************************
–> Oracle Catalog Views [upgrade] VALID
–> Oracle Packages and Types [upgrade] VALID
–> JServer JAVA Virtual Machine [upgrade] VALID
–> Oracle XDK for Java [upgrade] VALID
–> Oracle Workspace Manager [upgrade] VALID
–> Oracle Text [upgrade] VALID
–> Oracle XML Database [upgrade] VALID
–> Oracle Java Packages [upgrade] VALID
–> Oracle interMedia [upgrade] VALID
–> Data Mining [upgrade] VALID
–> Expression Filter [upgrade] VALID
–> Rule Manager [upgrade] VALID
**********************************************************************
Miscellaneous Warnings
**********************************************************************
WARNING: –> Database contains schemas with objects dependent on network
packages.
…. Refer to the 11g Upgrade Guide for instructions to configure Network ACLs.
…. USER FLOWS_020000 has dependent objects.
PL/SQL procedure successfully completed.
You must run the utlu111i script as it populates a table that the upgrade script checks, if this has not been run the upgrade will bomb fairly early. Remember to run this with the Oracle 10g environment, it would not work when i tried to run it with the 11g environment.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
startup the database with the 11g ORACLE_HOME
SQL> startup upgrade pfile=’/home/oracle/init11g.ora’;
ORACLE instance started.
Total System Global Area 784998400 bytes
Fixed Size 2148512 bytes
Variable Size 201328480 bytes
Database Buffers 578813952 bytes
Redo Buffers 2707456 bytes
Database mounted.
Database opened.
run the upgrade script
SQL> @?/rdbms/admin/catupgrd
.
.
.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup pfile=’/home/oracle/init11g.ora’;
ORACLE instance started.
Total System Global Area 784998400 bytes
Fixed Size 2148512 bytes
Variable Size 201328480 bytes
Database Buffers 578813952 bytes
Redo Buffers 2707456 bytes
Database mounted.
Database opened.
We now have an upgraded 11g database
SQL> select * from v$version;
BANNER
——————————————————————————–
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
PL/SQL Release 11.1.0.6.0 - Production
CORE 11.1.0.6.0 Production
TNS for Linux: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Real Application Testing option
go back to the 10g Oracle home
[oracle@testdb ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.3.0 - Production on Thu Jan 17 16:39:17 2008
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup mount pfile=’/home/oracle/init11g.ora’;
ORACLE instance started.
Total System Global Area 788529152 bytes
Fixed Size 2076008 bytes
Variable Size 205521560 bytes
Database Buffers 574619648 bytes
Redo Buffers 6311936 bytes
Database mounted.
flashback to our restore point
SQL> flashback database to restore point begin_upgrade;
Flashback complete.
SQL> alter database open resetlogs;
Database altered.
Now our database is back to it’s 10g version
SQL> select * from v$version;
BANNER
—————————————————————-
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for Linux: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
So this could be useful for testing an 11g upgrade from a 10.X release, it could enable you to quickly downgrade and retry should something go wrong. However the lack of the ability to open the upgraded release with compatible set to 11 does limit somewhat the new features you could test.
I’m not really sure how practical it is really, I was more just curious what what would actually happen if you attempted to flashback through the upgrade.