Skip to main content

Downgrading Oracle Database Without Executing catdwgrd.sql or Backup plan to downgrade oracle db

Downgrading Oracle Database Without Executing catdwgrd.sql or Backup plan to downgrade


When we are upgrading the database, we need to ensure that we have a backup plan to downgrade in case of failure. We can create a guaranteed  restore point.

My Source version: 10.2.0.4
Target version to upgrade 11.2.0.3

Configure Flashback database in the Source version

The Flashback Database feature provides a way to quickly revert entire Oracle database to the state it was in at a past point in time.

To use the Flashback database feature the database must be running in archivelog mode.

Enable flashback feature in the database when it was running in the source release.

Set the environment variables to point to the source Oracle Home (10.2.0.4) and perform a 'startup mount'

SQL> startup mount
ORACLE instance started.

Total System Global Area  918552576 bytes
Fixed Size                  2025072 bytes
Variable Size             239077776 bytes
Database Buffers          675282944 bytes
Redo Buffers                2166784 bytes
Database mounted.

Turn on flashback

SQL> alter database flashback on;

Database altered

Create guaranteed restore point

SQL> CREATE RESTORE POINT before_upgrade GUARANTEE FLASHBACK DATABASE;

Restore point created.

Run the following query to view all guaranteed restore points created.

SQL> SELECT NAME, SCN, TIME, DATABASE_INCARNATION# DI,GUARANTEE_FLASHBACK_DATABASE,
     STORAGE_SIZE FROM V$RESTORE_POINT WHERE GUARANTEE_FLASHBACK_DATABASE='YES';

NAME             SCN     TIME                 DI         GUA     STORAGE_SIZE
----------       --- ------------       -------------    ---    ------------
BEFORE_UPGRADE  34552155 23-JUN-20  10.58.42.000000000 AM  YES    312672256

Query the dba_registry view to see the component status and version before upgrade

SQL> select comp_name, status, version from dba_registry;

COMP_NAME
--------------------------------------------------------------------------------
STATUS      VERSION
----------- ------------------------------
Oracle Database Catalog Views
VALID       10.2.0.4.0

Oracle Database Packages and Types
VALID       10.2.0.4.0


Shutdown the database

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
 

Upgrade the database to the target version(Dont change compatibility parameter to higher version while upgrade)

Set the environment variables to point to the target Oracle Home (11.2.0.4) to which the database will be upgraded to.

compatible-10.2.0.4

Please note that changing COMPATIBLE initialization parameter at this stage will prevent use of the downgrade procedure or the ability to flash back the database to a point prior to this.

Startup the database in upgrade mode using the 11.2.0.4 Oracle Home

SQL> startup upgrade (using 11.2.0.4 Oracle Home)
ORACLE instance started.

Total System Global Area  918552576 bytes
Fixed Size                  2077008 bytes
Variable Size             234884784 bytes
Database Buffers          675282944 bytes
Redo Buffers                6307840 bytes
Database mounted.
Database opened.

Run the upgrade script (catupgrd.sql)

SQL> @?/rdbms/admin/catupgrd.sql


Validate any invalid objects after upgrade if any

SQL> @?/rdbms/admin/utlrp.sql

Query the dba_registry view to see the component status and version after upgrade

SQL> select comp_name, version, status from dba_registry;

COMP_NAME
--------------------------------------------------------------------------------
VERSION STATUS
------------------------------ -----------
Oracle Database Catalog Views
11.2.0.4.0 VALID

Oracle Database Packages and Types
11.2.0.4.0 VALID
 

Downgrading database to previous version using Flashback database

Note that data from any transactions that occur after the point in time to which the database is recovered are lost. Flashback Database is an excellent tool for backing out the database upgrade, Using Flashback Database with sufficient space and creating a guaranteed restore point immediately prior to the upgrade is the fastest method to fallback as compared to a restore operation or a database downgrade.

Using flashback database rather than the conventional downgrade procedure is far quicker. This is only practical when only the database upgrade has been done and no application data changes have occurred.

The steps for flashing back the database after upgrade or after a failed upgrade are

Set the environment variables to the 11.2.0.4 Oracle Home

Shut down the upgraded database

SQL> shutdown immediate

Startup mount the 11.2.0.4 database using the 11.2.0.4 Oracle Home and flashback the database to the guaranteed restore point which was created prior to the upgrade.

SQL> startup mount

SQL> flashback database to restore point before_upgrade;

SQL> shutdown immediate

Set the environment variable to point to the old Oracle Home (10.2.0.4)

SQL> startup mount

SQL> alter database open resetlogs;

query the dba_registry view to see the database component status and version

SQL> select comp_name, version, status from dba_registry;

COMP_NAME
--------------------------------------------------------------------------------
VERSION STATUS
------------------------------ -----------
Oracle Database Catalog Views
10.2.0.4.0 VALID

Oracle Database Packages and Types
10.2.0.4.0 VALID



Comments

Popular posts from this blog

WebLogic migration to OCI using WDT tool

WebLogic migration to OCI using WDT tool Oracle WebLogic Deploy Tool (WDT) is an open-source project designed to simplify and streamline the management of Oracle WebLogic Server domains. With WDT, you can export configuration and application files from one WebLogic Server domain and import them into another, making it a highly effective tool for tasks like migrating on-premises WebLogic configurations to Oracle Cloud. This blog outlines a detailed step-by-step process for using WDT to migrate WebLogic resources and configurations. Supported WLS versions Why Use WDT for Migration? When moving Oracle WebLogic resources from an on-premises environment to Oracle Cloud (or another WebLogic Server), WDT provides an efficient and reliable approach to: Discover and export domain configurations and application binaries. Create reusable models and archives for deployment in a target domain. Key Pre-Requisites Source System: An Oracle WebLogic Server with pre-configured resources such as: Applica...

Rename a PDB in Oracle Database Multitenant Architecture in TDE and Non TDE Environment

Rename a PDB in Oracle Database Multitenant Architecture I am sharing a step-by-step guide to help you rename a PDB. This approach uses SQL commands. Without TDE or encryption Wallet Initial Check Check the Current Database Name and Open Mode: SQL > SELECT NAME, OPEN_MODE FROM V$DATABASE; NAME OPEN_MODE --------- -------------------- BEECDB READ WRITE List Current PDBs: SQL > SHOW PDBS; CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 FUAT READ WRITE NO We need to RENAME FUAT to BEE  Steps to Rename the PDB Step 1: Export ORACLE_SID Set the Oracle SID to the Container Database (CDB): export ORACLE_SID=BEECDB Step 2: Verify Target PDB Name Availability If the target PDB name is different from the current PDB name, ensure no service exists with the target PDB name. Run SQL to Check Exi...

How to make flash work on IE or Edge with IE Compatibility

How to make flash work on IE or Edge with IE Compatibility With flash been ended from 1-Jan-2021, many applications using flash have stopped working the way they were built (like OEM, OBIEE, etc). The option you have to upgrade.  This method will give a workaround in IE or Edge in IE compatibility mode without upgrading. 1. Verify you have installed flash.ocx on your desktop. Typically, flash.ocx file is located in C:\Windows\System32\Macromed\Flash or C:\Windows\SysWOW64\Macromed\Flash according to your laptop OS system. 2. Edit mms.cfg from the location as a System Administrator In the case of the 64bit system, it might have mms.cfg under C:\Windows\SysWOW64\Macromed\Flash 3. Add below options into mms.cfg file. Note: AllowListUrlPattern list is an example. The URLs need to be replaced to your hosts those have Flash pages. SilentAutoUpdateEnable=0 AutoUpdateDisable=1 EOLUninstallDisable=1 EnableAllowList=1 AllowListUrlPattern=http://www.google.com/ AllowListUrlPattern=http://goo...