Environment Details: Database: TEST Database Role: Physical Standby(DR) DB Version: 12.1.0.2 EE 64 Bit Operating System: Redhat Enterprise Linux 7.9 64 Bit Version to be upgraded: 19.0.0.0 with latest RU/RUR patches 12c Home: /u01/app/oracle/product/12.1.0.2/dbhome_1 19c Home: /u01/app/oracle/product/19.3.0.0/dbhome_1 Note: In last post, we have upgraded Primary(Production)Database from Oracle 12c to Oracle 19c. In this post, we will upgrade DR(Standby) database. You don't have to put too much efforts to upgrade Standby DB since you have already upgraded Primary(Production)database. You have to just stop the database and listener from 12c HOME and start the same from 19c HOME. Refer my last post: Step by Step Database Upgrade from Oracle 12c to 19c |
Points to be checked before initiating upgrade activity:
|
Step 1: Oracle 19c Binary Installation In last post, we had deferred Standby(DR) destination before upgrading production DB. Now you have to stop the standby database and associated listener from 12c HOME if not stopped already. $su – oracle $lsnrctl stop LISTENER_NAME $sqlplus / as sysdba SQL> shut immediate; Create new directory structure for 19c binaries. Ensure Minimum 100 GB free space is available in /u01 mountpoint at least for installation and future use for patches. $mkdir -p /u01/app/oracle/product/19.3.0.0/dbhome_1 $chown -R oracle:oinstall /u01/app/oracle/product/19.3.0.0/dbhome_1 $chmod -R 755 /u01/app/oracle/product/19.3.0.0/dbhome_1 $ls -ld /u01/app/oracle/product/19.3.0.0/dbhome_1 Source 19c environment variables and start 19c software binary installation: $export ORACLE_SID=TEST $export ORACLE_BASE=/u01/app/oracle $export ORACLE_HOME=/u01/app/oracle/product/19.3.0.0/dbhome_1 $export PATH=$ORACLE_HOME/bin:$PATH $export PATH=$ORACLE_HOME/OPatch:$PATH Now 19c software is gold image copy setup. You have to directly copy setup file to ORACLE_HOME location. If you will unzip the setup then it will unzip all binaries in that location only. Here, you have to install software with applying latest patches. $cd /u01/app/oracle/product/19.3.0.0/dbhome_1/ $unzip setup_file.zip =====> Refer actual setup file name. $ls -ltr $./runInstaller -applyRU PATCH_LOCATION i.e. $cd /u01/app/oracle/product/19.3.0.0/dbhome_1/ ./runInstaller -applyRU /bkp/patch/33192793 -applyRU : This will apply the patches during installation phase before initializing GUI screen and will start GUI screen once patches are applied. |
Step 2: Copy below parameter files from OLD Home to NEW Home. $cp -pr /u01/app/oracle/product/12.1.0.2/dbhome_1/dbs/initORACLE_SID.ora /u01/app/oracle/product/19.3.0.0/dbhome_1/dbs/initORACLE_SID.ora $cp -pr /u01/app/oracle/product/12.1.0.2/dbhome_1/dbs/spfileORACLE_SID.ora /u01/app/oracle/product/19.3.0.0/dbhome_1/dbs/spfileORACLE_SID.ora $cp -pr /u01/app/oracle/product/12.1.0.2/dbhome_1/dbs/orapwORACLE_SID /u01/app/oracle/product/19.3.0.0/dbhome_1/dbs/orapwORACLE_SID $cp -pr /u01/app/oracle/product/12.1.0.2/dbhome_1/network/admin/tnsnames.ora /u01/app/oracle/product/19.3.0.0/dbhome_1/network/admin/tnsnames.ora $cp -pr /u01/app/oracle/product/12.1.0.2/dbhome_1/network/admin/listener.ora /u01/app/oracle/product/19.3.0.0/dbhome_1/network/admin/listener.ora $cp -pr /u01/app/oracle/product/12.1.0.2/dbhome_1/network/admin/sqlnet.ora /u01/app/oracle/product/19.3.0.0/dbhome_1/network/admin/sqlnet.ora $cp -pr crontab -l >> /backup/upgrade_19c/crontab_backup_oracle.txt =====>By oracle user $cp -pr crontab -l >> /backup/upgrade_19c/crontab_backup_root.txt =====>By root user Copy wallet_files from 12_HOME to 19c_HOME |
Step 3: Source the 19c environment variables and start the DB. Login as oracle user: $su - oracle $export ORACLE_SID=TEST $export ORACLE_BASE=/u01/app/oracle $export ORACLE_HOME=/u01/app/oracle/product/19.3.0.0/dbhome_1 $export PATH=$ORACLE_HOME/bin:$PATH $export PATH=$ORACLE_HOME/OPatch:$PATH $sqlplus / as sysdba SQL> startup mount; SQL> select name,open_mode,database_role,controlfile_type from v$database; SQL> alter database recover managed standby database disconnect from session; |
Step 4: Update the listener.ora file in below directory and start the listener from 19c HOME. $cd /u01/app/oracle/product/19.3.0.0/dbhome_1/network/admin $vi listener.ora $lsnrctl start LISTENER_NAME |
Step 5: Enable Standby destination from Primary DB and verify archive log shipping from Primary to Standby DBs. On Primary: SQL> set lines 300 pages 3000 SQL> alter system set log_archive_dest_state_2=enable; SQL> alter system switch logfile;SQL> alter system switch logfile; SQL> alter system switch logfile; SQL> select name,db_unique_name,database_role,log_mode,controlfile_type from v$database; SQL> select max(sequence#) Primary from v$archived_log; On Standby: SQL> set lines 300 pages 3000 SQL> select name,db_unique_name,database_role,log_mode,controlfile_type from v$database; SQL> select max(sequence#) Standby from v$archived_log where applied='YES' and dest_id=2; Check alert log file for any ORA- error messages if any. |
Thanks for reading this post ! Please comment if you like this post ! Click on FOLLOW to get future blog updates !
Very usefull
ReplyDeleteVery Useful and descriptive, Keep up ��
ReplyDeleteGood one Rupesh
ReplyDeleteRupesh Sir, Thanks for posting such a wonderful and helpful blogs.
ReplyDeleteThank you sir for such a crystal clear steps to upgrade Standby database.
ReplyDelete