OEM Fleet Maintenance

Fleet Maintenance is a way to manage Oracle Database Patching. See “About Fleet Maintenance” at the link to the product documentation below

Documentation – https://docs.oracle.com/cd/cloud-control-13.3/EMLCM/GUID-60B39D16-322B-435F-85F0-C39AFC80E96B.htm

Support Notes:
Enterprise Manager Fleet Maintenance FAQ (Doc ID 2272569.1)

The support note below shows step by step how to do this.

How To Patch Or Upgrade Standalone Database Using Fleet Maintenance (Doc ID 2434260.1)

Here is a step by step –

First, create the Software Image

emcli login -username=sysman
emcli db_software_maintenance -createSoftwareImage -input_file="data:/home/oracle/scripts/input12c" 

The input12c file is –

 IMAGE_NAME=12c
IMAGE_DESCRIPTION=12c
REF_TARGET_NAME=OraDB12Home1_1_db1.dbtier.demo.oraclevcn.com_1532
REF_HOST_CREDENTIALS=ORACLE:SYSMAN
WORKING_DIRECTORY=/u01/working
STORAGE_TYPE_FOR_SWLIB=OmsShared
STORAGE_NAME_FOR_SWLIB=default_loc
IMAGE_SWLIB_LOC=_FLEET/12.1.0.2/Testing
VERSION_NAME=12.2-170423-01

Get a list of the software images –

emcli db_software_maintenance -getImages 

Next, I installed a database on db2, then pushed an OEM agent, and discovered the database and listener. I also tested this with an Oracle Home provisioned using Oracle Enterprise Manager database provisioning. When using database provisioning, I selected this image as the image to deploy.

Next, patch the Gold Image

Apply a Patch to DB1

cd /u01/stage/patchdir
$ORACLE_HOME/OPatch/opatch apply

...
Patching component oracle.sdo, 12.2.0.1.0…
Patch 28790640 successfully applied.


$ORACLE_HOME/OPatch/opatch lsinventory

...

Patch 28790640 : applied on Wed Apr 24 03:39:43 GMT 2019
Unique Patch ID: 22633787
Patch description: "Database Jul 2018 Release Update Revision : 12.2.0.1.190115 (28790640)"
Created on 18 Dec 2018, 09:25:32 hrs PST8PDT

...

Now check the second DB (DB2) for applicability for the OEM image we previously created from DB1.

emcli db_software_maintenance -checkApplicability -image_id=87313772D0AF17F2E0530402320A85BD -target_list=orcl2.dbtier.demo.oraclevcn.com  -target_type=database

Subscribe the target to the image

Get the image subscriptions

Next Create a New Image. Note the IMAGE_ID used in the input file to indicate this will be another version of that image.

input12c_p1 file contents

IMAGE_ID=87313772D0AF17F2E0530402320A85BD REF_TARGET_NAME=OraDB12Home1_1_db1.dbtier.demo.oraclevcn.com_1532 REF_HOST_CREDENTIALS=ORACLE:SYSMAN WORKING_DIRECTORY=/u01/working STORAGE_TYPE_FOR_SWLIB=OmsShared STORAGE_NAME_FOR_SWLIB=default_loc IMAGE_SWLIB_LOC=_FLEET/12.1.0.2/TestingP1 VERSION_NAME=12.2-190425-p01 

Get Images and then the image versions of the 12c image.

Get Image Version Information. See what patches are in the image.

Describe the image version. See the patch that was applied.

Set the New Image Version Current

Then, we push the software, migrate the listener, and move the database to the new home. This is the same steps and commands we use when we patch. Below are the commands. Commands with screenshots are including in the post on patching.

Push the software.

File dbp1.txt contains

NEW_ORACLE_HOME_LIST=/u01/app/oracle/app/product/12.2.0.1.0p1/db
workingDir=/u01/working
dispatchLoc=/u01/root
emcli db_software_maintenance -performOperation -name=deploydbsw2 -purpose=DEPLOY_DB_SOFTWARE -target_type=oracle_database -target_list=orcl3.dbtier.demo.oraclevcn.com -normal_credential="ORACLE:SYSMAN" -privilege_credential="ROOT2:SYSMAN" -input_file="data:/home/oracle/scripts/dbp1.txt"

Move the listener.

emcli db_software_maintenance -performOperation -name=MigrateListener -purpose=migrate_listener -target_type=oracle_database -target_list=orcl3.dbtier.demo.oraclevcn.com -normal_credential="ORACLE:SYSMAN" -privilege_credential="ROOT2:SYSMAN

Move the database to the new home.

emcli db_software_maintenance -performOperation -name=UpdateDB -purpose=UPDATE_DB -target_type=oracle_database -target_list=orcl3.dbtier.demo.oraclevcn.com -normal_credential="ORACLE:SYSMAN" -privilege_credential="ROOT2:SYSMAN" -database_credential="SYS:SYSMAN"

If something goes wrong, you will need to view in Enterprise Manager to see the problem. When the procedure is launched, a link to OEM will be provided to get the screen for specific procedure as shown below. Alternatively, you can navigate to Enterprise->Provisioning and Patching->Procedure Activity to review deployment procedures logs.

Leave a Reply

Your email address will not be published. Required fields are marked *