top of page

Oracle 18c to 19c Data Guard Upgrade

Upgrade Data Guard configurations from 18c to 19c.

During oracle data guard upgrade, the standby database(s) can be upgraded implicitly via the redo from the primary database, and there is no need to rebuild the standby database after upgrade.

Install the new Oracle Home on both primary and standby

Before Upgrade


Stop Data Guard: On primary database, defer the redo log transport to the standby

On Primary:
===========

SQL> show parameter log_archive_dest_2 
SQL> alter system set log_archive_dest_state_2='defer' scope=both;

Cancel redolog apply on standby and shutdown the database

On Standby:
===========

SQL> alter database recover managed standby database cancel;
SQL> Shut immediate;


Upgrade Primary Database


Install the 19c pre-install package on both primary & standby server

On Primary & Standby:
=====================

yum install -y oracle-database-preinstall-19c

Install Oracle 19c on Primary


Unzip the 19c software under 19c home and start the runInstaller

cd /u01/app/oracle/product/19.3/db_home
unzip LINUX.X64_193000_db_home.zip

./runinstaller
oracle database 19c installer - set up software only
oracle database 19c installer edition - database edition
oracle database 19c installer - installation location
oracle database 19c installer - operating system groups
oracle database 19c installer - root script execution
oracle database 19c installer - summary

oracle database 19c installer - install product
oracle database 19c installer - finish

Purge the RECYCLEBIN and also check the pre-upgrade summary

oracle dataguard upgrade 18c to 19c - before upgrade

Create a guaranteed restore point

oracle dataguard upgrade 18c to 19c - show parameter compatible

Start DBUA on Primary


We wills tart DBUA from 19c home to upgrade 18c database to 19c version

database upgrade assistant - prerequisite checks
database upgrade assistant - select database
database upgrade assistant - prerequisite checks
database upgrade assistant - select upgrade options
database upgrade assistant - select recovery options
database upgrade assistant - configure network
database upgrade assistant - configure management
database upgrade assistant - database upgrade summary
database upgrade assistant - oracle database upgrade in progress
database upgrade assistant - upgrade results


Post Oracle Data Guard Upgrade


Install new home in standby, Update the listener on the standby host. Be sure to update the Oracle Home information in the listener.ora

vi $ORACLE_HOME/network/admin/listener.ora
lsnrctl reload
export OLD_HOME=/u01/app/oracle/product/18.3/db_home
export NEW_HOME=/u01/app/oracle/product/19.3/db_home
export ORACLE_HOME=$NEW_HOME
export ORACLE_SID=prod
#Set ORACLE_UNQNAME to DB_UNIQUE_NAME
export ORACLE_UNQNAME=standby

Copy TNS

#Back up files
cp $NEW_HOME/network/admin/tnsnames.ora
$NEW_HOME/network/admin/tnsnames.ora.backup

#Copy from old to new home
cp $OLD_HOME/network/admin/tnsnames.ora
$NEW_HOME/network/admin

Now, you can edit /etc/oratab and update the information about the

Oracle Home to match the new Oracle Home

vi /etc/oratab

Copy SPFile and password file to the new Oracle Home

cp $OLD_HOME/dbs/orapw $ORACLE_SID $ORACLE_HOME/dbs
cp $OLD_HOME/dbs/spfile $ORACLE_SID.ora
$ORACLE_HOME/dbs

Start the database

SQL> startup mount


Enable Redo Log Transport and Apply


On the primary database re-enable redo log transport to standby

database

SQL> alter system set log_archive_dest_state_2='enable'
scope=both;

On the standby database restart redo apply

SQL> alter database recover managed standby database
disconnect from session;

Thank You!!

Become a top notch dba with DBA Genesis
Start your DBA career today
bottom of page