Professional Documents
Culture Documents
Patching Oracle Database Physical Standby With Enterprise Manager 12c
Patching Oracle Database Physical Standby With Enterprise Manager 12c
However, the following are the limitations with patching of primary and standby
databases:
■ There is no support for orchestrated patching between a primary database and its standby
database. Although the default database patching deployment procedures automatically identify
the primary and the standby databases, they do not recognize the association between them. As a
result, you must manually identify the primary database and its associated standby database, and
patch them separately in such a way that the standby database switches over to production
mode while the primary database is being patched.
■ There is no support automatically stopping and starting log shipping. You must manually
stop and start the log shipping either directly or via a broker. The deployment procedures do not
handle this by default. However, if you want, you can customize the deployment procedure to
include additional steps that will handle this issue.
To patch the primary and the standby database, follow these steps:
1. If you want to handle the Log shipping, customize the database patching deployment
procedure to include additional steps to handle stopping and starting of log shipping with or
without a broker.
2. Identify the primary and standby database.
3. Patch the standby database via the patch plan and select the procedure created in Step #1.
4. Patch the primary database via the patch plan and select the procedure created in Step #1.
Customization of Patching Deployment Procedure:
You require to customize the procedure to insert two steps, one to stop the log shipping on the
Primary and then other to start the log shipping back at the end of the patching process.
1) From the Enterprise Menu, select Procedure Library under Provisioning and Patching.
2) Select the Deployment Procedure based on the target type and the patching option. Either
“Patch Oracle Database”, “Clone and Patch Oracle Database” for Oracle Databases or
“Patch Oracle RAC Rolling” procedure for the Oracle RAC Databases.
3) Do ‘Create Like’ of the procedure and select the ‘Procedure Steps’. Note: The EM user
needs to have the role of a Patch Designer to perform this operation.
4) Select the steps ‘Pre-Shutdown Custom Host Command Step’ and ‘Post-Apply SQL
Custom Host Command Step’ and click “Enable”
5) Select and Edit the step ‘ Pre-Shutdown Custom Host Command Step’. Copy paste the
following script below into the step. Refer to the picture below for details.
# Script for Stopping Log Shipping on Primary Database, Insert before Shutdown Database step
PRIMDB_LIST=${target.primaryDBSIDs}
DGMGRL_CMD=${target.oraHome}/bin/dgmgrl
STATE='LOG-TRANSPORT-OFF'
if [ -z $PRIMDB_LIST ]
then
echo " Selected Databases are not Primary Databases found. Step will be skipped"
exit 0
fi
6) Select and Edit the step ‘Post-Apply SQL Custom Host Command Step’. Copy paste the
following script below into the step. Refer to the picture below for details.
# Script for Starting Log Shipping on Primary Database, Insert after Apply Post SQL step
PRIMDB_LIST=${target.primaryDBSIDs}
DGMGRL_CMD=${target.oraHome}/bin/dgmgrl
STATE=' ONLINE '
if [ -z $PRIMDB_LIST ]
then
echo " Selected Databases are not Primary Databases found. Step will be skipped "
exit 0
fi
7) Save the procedure with the new name, say ‘Patch Oracle Database in Physical Standby
Configuration’.
8) While creating a Patch plan for patching the Primary and Standby Oracle Databases,
select the procedure under deployment options.