Downgrading Oracle Restart

Use this procedure to deconfigure and downgrade Oracle Restart, or to troubleshoot Oracle Restart installation errors.

  1. As the oracle user, create a backup of the SPFILE to a PFILE from 23ai Oracle home to 21c Oracle home.
    $ CREATE PFILE='/u01/app/oracle/product/21.0.0/dbhome_1/dbs/SIDinit.ora' FROM SPFILE
    
    You can use this PFILE during the database downgrade process.
  2. List all Oracle Databases on the server with their version, unique name of the database, and Oracle home information.
    $ srvctl config database -home
  3. Downgrade Oracle Database. Refer to Oracle Database Upgrade Guide for more information about required pre-downgrade tasks, downgrade tasks, post-downgrade tasks, and compatibility information.

    Note:

    Downgrade Oracle Database only if the Oracle Database version is higher than the Oracle Restart version to which you are downgrading Oracle Restart.
  4. As the oracle user, downgrade the Oracle Restart resources corresponding to the Oracle Database, only if you have downgraded your Oracle Database.
    $ srvctl downgrade database -d db_unique_name -oraclehome $ORACLE_HOME -t to_version
  5. Inspect the Oracle Restart configuration of each database, service, and listener.
    $ srvctl config database -db db_unique_name
    $ srvctl config service -db db_unique_name
    $ srvctl config listener -listener listener_name
    Make a note of the configuration information and use this information when adding the components back to Oracle Restart.
  6. Stop all databases and listeners that are running before you downgrade Oracle Restart.
    $ srvctl stop database -db db_unique_name
    $ srvctl stop listener [-listener listener_name]
  7. Deinstall Oracle Restart while retaining the existing Oracle Automatic Storage Management (Oracle ASM) disk group.
    $ cd /u01/app/oracle/product/23.0.0/dbhome_1/deinstall
    $ ./deinstall
    If you want to retain the existing diskgroups and associated ASM filter driver labels 
    or if any of the information detected is incorrect, you can modify by entering 'y'. 
    Do you want to modify above information  (y|n) [n]: y
    Specify the ASM Diagnostic Destination [ASM_diagnostic_destination]: 
    Specify the diskstring [AFD_diskstring]: 
    Specify the diskgroups that are managed by this ASM instance [+DATA]:
    De-configuring ASM will drop the diskgroups and clear the AFD labels at cleanup time. 
    Do you want deconfig tool to drop the diskgroups and  all AFD labels (y|n) [y]: n
  8. As the grid user, download the Oracle Grid Infrastructure 21c image files and extract the files to the Grid home.
    $ mkdir -p /u01/app/grid/product/21.0.0/grid
    $ chown grid:oinstall /u01/app/grid/product/21.0.0/grid
    $ cd /u01/app/grid/product/21.0.0/grid
    $ unzip -q download_location/grid_home.zip

    download_location/grid_home.zip is the path of the downloaded Oracle Grid Infrastructure image file.

    Note:

    You must extract the image software into the directory where you want your new Grid home to be located.
  9. Start the Oracle Grid Infrastructure installation wizard.
    $ /u01/app/grid/product/21.0.0/grid/gridSetup.sh
  10. Select the Configuration Option as Set Up Software Only and select the installation options as prompted.
  11. As the grid user, update the Oracle central inventory (oraInventory).
    $ /u01/app/oracle/product/21.0.0/grid/oui/bin/runInstaller -updateNodeList ORACLE_HOME=downgraded_Grid_home CRS=TRUE
  12. As the root user, run roothas.sh to configure Oracle Restart without Oracle ASM.
    # /u01/app/oracle/product/21.0.0/grid/crs/install/roothas.sh
  13. As the grid user, start Oracle ASM Configuration Assistant (Oracle ASMCA).
    $ /u01/app/oracle/product/21.0.0/bin/asmca
  14. Create a new temporary Oracle ASM disk group.

    Note:

    Configure Oracle ASM to use the new disk group and provide /.../.* as the disk string so that Oracle ASM can discover the new disk.
  15. Mount the existing Oracle ASM disk group and click Exit to close Oracle ASMCA.
  16. Move the password file from the temporary disk group to the existing disk group.
    $ /u01/app/oracle/product/21.0.0/bin/asmcmd
    ASMCMD> pwmove --asm new_diskgroup/orapwasm existing_diskgroup/orapwasm -f
  17. Remove the SPFILE from the existing Oracle ASM disk group.
    ASMCMD> rm existing_diskgroup/ASM/ASMPARAMETERFILE/REGISTRY.253.1075263285
  18. Copy the SPFILE from the new Oracle ASM disk group to the existing disk group.
    ASMCMD> spcopy -u +new_diskgroup/asm/ASMPARAMETERFILE/registry.253.722601213 +existing_diskgroup/spfile
    ASMCMD> exit
  19. Restart the high availability stack to verify that Oracle ASM starts with SPFILE from the existing disk group.
  20. Start Oracle ASMCA and delete the new temporary disk group.
  21. As the oracle user, add the components back to Oracle Restart with the same attributes that you noted in earlier steps.
    1. Add Oracle Database to the Oracle Restart configuration.
      $ srvctl add database -db db_unique_name -oraclehome Oracle_home -spfile spfile_name
      For the -spfile parameter, provide the SPFILE that you noted in Step 5.
    2. Add the listener to the Oracle Restart configuration.
      $ srvctl add listener -listener listener_name -oraclehome Oracle_home
      For the -oraclehome parameter, provide the Oracle home from where the listener was running before the downgrade.
    3. Add each service to the database using the srvctl add service command.
      $ srvctl add service -db db_unique_name -service service_name_list
  22. Start the components that you have added back to Oracle Restart.
    1. Start the Oracle database.
      $ srvctl start database -db db_unique_name
    2. Start the listener.
      $ srvctl start listener -listener listener_name
    3. Start each service using the srvctl start service command.
  23. Connect to Oracle Database and start the pluggable database (PDB).
    $ sqlplus / as sysdba
    SQL> ALTER PLUGGABLE DATABASE pdb_name OPEN;
    SQL> exit
  24. Verify that the Oracle Restart resources are running after the downgrade.
    $ /u01/app/oracle/product/21.0.0/bin/crsctl stat res -t