Patch engine dataguard
Oracle Patch: Update Process
The patching process involves the following steps:
- Check the current patch
- Apply the binary patch on node 2 (standby)
- Switchover
- Apply the binary patch on node 1 (standby)
- Apply the datapatch on node 2 (primary)
- Verify the patch
Check the Current Patch
First, verify the currently installed patches:
export PATH=${ORACLE_HOME}/OPatch:${PATH}
opatch lspatches
35042068;Database Release Update : 19.19.0.0.230418 (35042068)
29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)
Apply the Binary Patch on Node 2 (Standby)
Prepare the environment and stop services:
cd $ORACLE_HOME
mv OPatch/ OPatchbkp/
unzip -oq /u01/sources/p6880880_190000_Linux-x86-64_19_22.zip
cd /u01/sources/
unzip -oq p35943157_190000_Linux-x86-64.zip
sqlplus / as sysdba <<EOF
shutdown immediate;
exit
EOF
lsnrctl stop
cd 35943157
export PATH=${ORACLE_HOME}/OPatch:${PATH}
opatch prereq CheckConflictAgainstOHWithDetail -ph ./
opatch apply -silent
lsnrctl start
sqlplus / as sysdba <<EOF
startup mount;
alter database recover managed standby database using current logfile disconnect;
exit;
EOF
Switchover
Switch to the standby database:
dgmgrl /
switchover to roguebk;
alter system switch logfile;
show configuration verbose
Please complete the following steps to finish switchover:
start up and mount instance "xenos" of database "xenos"
Next, start and mount the "xenos" instance on node 1:
startup mount
Ensure the status is OK (this may take some time):
dgmgrl /
show configuration
Apply the Binary Patch on Node 1 (Standby)
Verify the database role:
select name,open_mode,database_role from v$database;
Apply the binary patch:
cd $ORACLE_HOME
mv OPatch/ OPatchbkp/
unzip -oq /u01/sources/p6880880_190000_Linux-x86-64_19_22.zip
cd /u01/sources/
unzip -oq p35943157_190000_Linux-x86-64.zip
sqlplus / as sysdba <<EOF
shutdown immediate;
exit
EOF
lsnrctl stop
cd 35943157
export PATH=${ORACLE_HOME}/OPatch:${PATH}
opatch prereq CheckConflictAgainstOHWithDetail -ph ./
opatch apply -silent
lsnrctl start
sqlplus / as sysdba <<EOF
startup mount;
alter database recover managed standby database using current logfile disconnect;
exit;
EOF
## Apply the datapatch on Node 2 (Primary)
Update the patch metadata with datapatch:
export PATH=${ORACLE_HOME}/OPatch:${PATH}
datapatch -verbose
Verify the Patch
Ensure the patches are correctly applied:
export PATH=${ORACLE_HOME}/OPatch:${PATH}
opatch lspatches
OLD 35042068;Database Release Update : 19.19.0.0.230418 (35042068)
29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)
New 35943157;Database Release Update : 19.22.0.0.240116 (35943157)
29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)
To verify using SQL:
col comp_id for a10
col version for a11
col status for a10
col comp_name for a37
SELECT TO_CHAR(action_time, 'YYYY-MM-DD') AS action_time,
action,
status,
description,
patch_id
FROM sys.dba_registry_sqlpatch
ORDER by action_time;
Cleanup
Finally, clean up inactive patches:
opatch util listorderedinactivepatches
opatch util deleteinactivepatches
By following these steps, you can effectively apply and verify Oracle patches, ensuring the stability and security of your database.