In the last article, we performed downgrade of Oracle Standalone Database from 12c to 11gR2. In this article, we can downgrade the 2 node RAC 12.1.0.2 database to 11.2.0.4, downgraded the database only and not the grid home.

Assume all commands are being run on node 1, any commands that need to be run on node 2 will be explicitly stated.

Initially set ORACLE_HOME to current 12.1.0.2 environment.

[oracle@host ~]$ export ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/dbhome_1

1. Stop database using srvctl on from 1st node

[oracle@host ~] srvctl config database -d ORCL
Database unique name: ORCL
Database name:
Oracle home: /u01/app/oracle/product/12.1.0.2/dbhome_1
Oracle user: oracle
Spfile: +DATA/ORCL/spfileORCL.ora
Domain: localdomain
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: ORCL
Database instances: ORCL1,ORCL2
Disk Groups:
Mount point paths:
Services:
Type: RAC
Database is administrator managed

[oracle@host ~] srvctl stop database -d ORCL

2. Create pfile from spfile

[oracle@host ~] sqlplus / as sysdba

SQL>create pfile='/tmp/ORCL_downgrade/ORCL_clusterdisable.ora' from spfile='+DATA/ORCL/spfileORCL.ora';

3. edit pfile CLUSTER_DATABASE parameter to FALSE

*.cluster_database=FALSE
*.compatible='11.2.0.4.0'

4. Recreate spfile with new parameter

[oracle@host ~] sqlplus / as sysdba
SQL>create spfile'+DATA/ORCL/spfileORCL.ora' from pfile='/tmp/ORCL_downgrade/ORCL_clusterdisable.ora';

5. Startup database in downgrade mode using new spfile

[oracle@host ~]cd $ORACLE_HOME/rdbms/admin
[oracle@host ~]sqlplus / as sysdba
SQL>startup downgrade
Total System Global Area 5027385344 bytes
Fixed Size 2298736 bytes
Variable Size 1040190608 bytes
Database Buffers 3976200192 bytes
Redo Buffers 8695808 bytes
Database mounted.
Database opened

6. Execute Oracle downgrade script from the 12.1.0.2 Oracle Home.

SQL>spool /tmp/ORCL_downgrade/downgrade.log
SQL>@catdwg.sql
.........
PL / SQL procedure successfully completed.
SQL>
SQL> - lrg 7259350: objects created in this script need their flags that will not fit
SQL> - in a ub2 cleared
<<<< OUTPUT TRUNCATED >>>
SQL>spool off
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

7. Change environment variables and restore config files. Execute these steps on both nodes.

[oracle@host ~]export ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/dbhome_1

Note: Copy password files and config files from current ORACLE_HOME to a downgraded directory. Also, change the entry in ORATAB file on all nodes.

8. After that start to upgrade mode, execute the catrelod script from the downgraded version $ORACLE_HOME/rdbms/admin directory.

[oracle@host ~] sqlplus / as sysdba
SQL> startup upgrade
ORACLE instance started.
 
Total System Global Area 5027385344 bytes
Fixed Size 2261888 bytes
Variable Size 1191185536 bytes
Database Buffers 3825205248 bytes
Redo Buffers 8732672 bytes
Database mounted.
Database opened.
SQL> spool /tmp/ORCL_donwgrade/reload.log
SQL> $ORACLE_HOME/rdbms/admin/catrelod.sql
SQL> @catrelod.sql
SQL> spool off

9. Now execute utlrp.sql script Recompile all existing PL/SQL modules in the INVALID state. Also set CLUSTER_DATABASE parameter to TRUE  and Shutdown the database.

SQL> shutdown immediate
SQL> startup
SQL> @?/rdbms/admin/utlrp.sql
SQL> alter system set cluster_database=true scope=spfile ;
SQL> Shutdown immediate ;
SQL> exit

10. Downgrade cluster services,Now we need to change database configuration in the cluster to our old ORACLE_HOME and version

SYNTAX

srvctl downgrade database -d db-unique-name -o old_ORACLE_HOME –t to_old_versnum

in our case this was the following:

[oracle@host ~]$ srvctl downgrade database -d ORCL -o /u01/app/oracle/product/11.2.0.4/dbhome_1 -t 11.2.0.4
[oracle@host ~]$ srvctl config database -d ORCL
Database unique name: ORCL
Database name:
Oracle home: /u01/app/oracle/product/11.2.0.4/dbhome_1
Oracle user: oracle
Spfile: +DATA/ORCL/spfileORCL.ora
Domain: localdomain
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: ORCL
Database instances: ORCL1,ORCL2
Disk Groups:
Mount point paths:
Services:
Type: RAC
Database is administrator managed

Please start database once and stop again for confirmation :

[oracle@host ~]$ srvctl stop database –d ORCL–o immediate
[oracle@host ~]$ srvctl start database –d ORCL

Here our Database down gradation completed successfully.

Stay Tuned for Downgrade the Oracle Grid Infrastructure.

Thank you for giving your valuable time to read the above information.

If you want to be updated with all our articles send us the Invitation or Follow us:

Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/

Joel Perez’s LinkedIn: Joel Perez’s Profile

Anuradha’s LinkedIn: Anuradha’s Profile

LinkedIn Group: Oracle Cloud DBAAS

Facebook Page: OracleHelp

Comments

  1. Pingback: Downgrading a RAC database from 12.1.0.2 to 11.2.0.4 - SSWUG.ORG

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.