Patching Oracle Data Guard Database Automatically

Starting with Oracle Grid Infrastructure 23ai, Oracle FPP enables you to automatically patch Oracle Data Guard standby databases before patching their primary databases.

Oracle Fleet Patching and Provisioning (Oracle FPP) automatically discovers the standby databases, associated with primary databases, and patches the standby databases before patching the primary database using a single command.

Note:

If the Oracle Database Guard databases are registered on a different client, which can be in different data center, then those servers must be register peers of each other.
  1. Check the Oracle Data Guard configuration of a database to identify the primary database and its standby databases.
    rhpctl query workingcopy -workingcopy dbwc2360 -details
    DataGuard Configuration:
    Primary Database : orcl : (Site name)
    Standby Database : orcl_stby : stbm000040-vm19 ...
  2. Schedule a job for each standby database associated with the primary database using a single job ID.
    rhpctl move database -dbname orcl -sourcewc dbwc2330 -patchedwc dbwc2360 -patchdataguard YES -schedule NOW
    The above command provides a parent job ID, which you can use as a single point of reference to monitor the progress of standby and primary database patching.
  3. Monitor the progress of the entire patching operation.
    rhpctl query job -jobid 73
    Wed Jun 26 15:11:07][giusr@grid:bin] $ ./rhpctl query job -jobid 73
    server1: Audit ID: 871
    Job ID: 73
    User: grid
    Client: client1
    Scheduled job command: "rhpctl move database -dbname orcl -sourcehome /u01/app/oracle/product/23.0.0/dbhome_1 -patchedwc
    dbwc2360 -patchdataguard YES -schedule NOW"
    ...
    ...
    Job execution start time: 2024-06-26 12:41:43
    Job execution end time: 2024-06-26 13:29:18
    Job execution elapsed time: 47 minutes 35 seconds
    ...
    ...
  4. Optionally, you can monitor the progress of the individual standby database patching operations.
    rhpctl query job -jobid 53