It is not often that I see a database downgrade activity performed and so I thought it would be worthwhile just noting how it was done.
2 node RAC 11.2.0.4 database to 11.2.0.3, downgraded the database only and not the grid home.
Downgrade taking place on HP-UX, any downgrades taking place on Windows OS have several additional steps and won’t be covered in this post.
This database does not use Database Vault and pre-requisite compatibility checks were carried out
Assume all commands are being run on node 1, any commands that need to be run on node 2 will be explicitly stated. Any commands will be formatted in italics.
Set ORACLE_HOME to current 11.2.0.4 environment.
export ORACLE_HOME= /app/oracle/product/11.2.0.4/dbhome_SOA1
Tail alert log of both nodes in separate windows
tail -f /app/oracle/diag/rdbms/soapre2a/SOAPRE2A1/trace/alert_SOAPRE2A1.log
1. Stop database using srvctl on primary node
srvctl stop database -d SOAPRE2A
Monitor the alert logs to confirm when database has successfully shutdown.
2. Create pfile from spfile
sqlplus / as sysdba
SQL>create pfile=’/home/oracle/SOAPRE2_downgrade/SOAPRE2_clusterdisable.ora’ from spfile=’+DATA/SOAPRE2A/spfilesoapre2a.ora’;
3. Alter pfile CLUSTER_DATABASE parameter to FALSE
*.cluster_database=FALSE
*.compatible=’11.2.0.0.0′
4. Recreate spfile with new parameter
sqlplus / as sysdba
SQL>create spfile=’+DATA/SOAPRE2A/spfilesoapre2a.ora’ from pfile=’/home/oracle/SOAPRE2_downgrade/SOAPRE2_clusterdisable.ora’;
5. Startup database in downgrade mode using new spfile
cd $ORACLE_HOME/rdbms/admin
sqlplus / as sysdba
SQL>startup downgrade
6. Execute Oracle downgrade script
From the original OH – 11.2.0.4
SQL>spool /home/oracle/SOAPRE2_downgrade/downgrade.log
SQL>@catdwg.sql
SQL>spool off
SQL>shutdown immediate;
SQL>exit
This script can be run multiple times, in the event any errors are encountered correct them and rerun until completion.
7. Change environment variables and restore config files
Execute these steps on both nodes.
Alter ORACLE_HOME and PATH environment variable to point to downgraded directories, in our case for example:
export ORACLE_HOME=’/app/oracle/product/11.2.0.3/dbhome_SOA1_1‘
Ensure any entries in your oratab file are also altered to reference the downgraded directory.
Copy password files and config files from current ORACLE_HOME to downgraded directory.
8. Reload version specific components
change to downgraded release home – 11.2.0.3
cd /app/oracle/product/11.2.0.3/dbhome_SOA1_1/rdbms/admin
SQL> sqlplus / as sysdba
SQL> startup upgrade
SQL>spool /home/oracle/SOAPRE2_donwgrade/reload.log
SQL>@catrelod.sql
SQL>spool off
This step can take quite some time to complete, in our case ~2.5 hours
9. Recompile invalid objects
SQL> shutdown immediate
SQL> startup
SQL> @utlprp.sql
SQL> exit
10. Downgrade cluster services
The final step was to downgrade cluster services to our old ORACLE_HOME and version, using the following srvctl command:
srvctl downgrade database -d db-unique-name -o old_ORACLE_HOME –t to_old_versnum
in our case this was the following:
srvctl downgrade database -d SOAPRE2A -o /app/oracle/product/11.2.0.3/dbhome_SOA1_1 -t 11.2.0.3
