db_software_maintenance

Image and Subscriptions

createImage

Description

Creates a new image.

Format

emcli db_software_maintenance -createImage
  -image_name= "image_name"
  -description= "description"
  -type= "type"
  -target_type= "target_type"
  -version= "version" 
  -platform_id= "platform_id"
  -status= "status"

Options

  • image_name

    The name of the image.

  • description

    The description of the image.

  • type

    The type of the image, for example SWLIB if the image version will be in the Software Library.

  • target_type

    The target type of the image. For example, if the image is being created to manage single instance Oracle Database then the target type is 'oracle_database.

  • version

    The RDBMS version of the product, for example 11.2.0.4.0.

  • platform_id

    The platform id, for example 226 for Linux x86_64.

  • status

    The image status, for example PRODUCTION.

Examples

The following example creates a new image with the name GI_11204.

emcli db_software_maintenance -createImage
  -image_name="GI_11204" 
  -description="GI_11204" 
  -type="SWLIB" 
  -target_type=cluster -version=11.2.0.4.0 
  -platform_id=226 -status=PRODUCTION 

getImages

Description

Returns the list of images which are created in the cloud flow. The gold image that is created as a part of profile creation will not be listed here. Images which failed or are inactive won't appear on the list.

Format

emcli db_software_maintenance -getImages
[-all]

Options

  • all

    Lists all available images.

Examples

The following example returns a list of images present in production.

emcli db_software_maintenance -getImages

To get a list of all created images, use the -all parameter:

emcli db_software_maintenance -getImages -all

deleteImage

Description

Deletes an image.

Format

emcli db_software_maintenance -deleteImage            
  -image_id= "image_id"
  [-force= "force"]
  [-reportOnly="<true/false>"]

[ ]  indicates that the parameter is optional.
  • image_id

    The ID of the image to be deleted.

  • force

    Deletes forcibly even if the image has subscribed targets.

  • reportOnly

    This is used when the user wishes to view candidates for deletion, but does not want to perform the actual delete operation.

Examples

The following example deletes the image with the ID 01B5F14FD57D7B89E05313B2F00A739F.

emcli db_software_maintenance -deleteImage 
  -image_id="01B5F14FD57D7B89E05313B2F00A739F

subscribeTarget

Description

Creates new target or modifies the target subscription.

Format

emcli db_software_maintenance -subscribeTarget      
  -target_name= "target_name"
  -target_type= "target_type"
  -[parent_target_name= "parent_target_name"]
  -[parent_target_type= "parent_target_type"]
  -image_id= "image_id"
  -[version_id= "version_id']
  -[standbyAutoSubscribe=true/false]

[ ]  indicates that the parameter is optional.

Options

  • target_name

    The name of the target.

  • target_type

    The target type.

  • parent_target_name

    The parent target name.

  • parent_target_type

    The parent target type.

  • image_id

    The image id.

  • version_id

    The version id.

  • standbyAutoSubscribe

    For Data Guard only, values are true/false

Examples

The following example modifies the Oracle Cloud Zone target POOL NAME.

emcli db_software_maintenance -subscribeTarget
  -target_name="POOL NAME" 
  -target_type=oracle_cloud_zone 
  -image_id=FE55AD7AB28974EFE04313B2F00AD4A0

Dataguard Subscription examples

The following databases are used for these examples:
  • orcl1913 : Primary DB
  • orcl19131: Standby
Subscribe primary and standby databases together:
emcli db_software_maintenance -subscribeTarget
-target_name=orcl1913
-target_type=oracle_database
-image_id=F8FA65CA06916523E05324124B6447BA
Subscribe only the primary database:
emcli db_software_maintenance -subscribeTarget 
-target_name=orcl1913
-target_type=oracle_database 
-image_id=F8FA65CA06916523E05324124B6447BA
-standbyAutoSubscribe=false
Subscribe only the standby database
emcli db_software_maintenance -subscribeTarget 
-target_name=orcl19131
-target_type=oracle_database
-image_id=F8FB28A8E5A5381FE05324124B64A0FA

describeImage

Description

Returns the list of patches and bugs of an image. It shows the current version of the given image by default unless a specific version_id is provided.

Format

emcli db_software_maintenance –describeImage –image_id=<Image Id> [-version_id=<version id>] [-bugs=true]

Options

  • image_id

    The ID of the image to be searched for patches

  • version_id

    Version id number.

  • bugs

    True/False, default is false. When set to true lists the bugs associated with the image.

Examples

The following example returns a description of patches present in an image.

emcli db_software_maintenance –describeImage –image_id=83727129537

The following example returns a description of patches present in an image, adding the bugs flag will also list all associated bugs.

emcli db_software_maintenance –describeImage –image_id=8372712953 -bugs=true

getTargetSubscriptions

Description

Returns a list of subscriptions for the specified target.

Format

emcli db_software_maintenance -getTargetSubscriptions
  -target_name= "target_name"
  -target_type= "target_type"
  [-image_type= "image_type"] 

[ ]  indicates that the parameter is optional.
  • target_name

    The name of the target.

  • target_type

    The target type.

  • image_type

    The image type.

Examples

The following example returns a list of subscriptions for the Oracle Cloud Zone target with the name POOL NAME.

emcli db_software_maintenance -getTargetSubscriptions
  -target_name="POOL NAME" 
  -target_type="oracle_cloud_zone"

unsubscribeTarget

Description

Unsubscribes the specified target.

Format

emcli db_software_maintenance -subscribeTarget      
  -target_name= "target_name" 
  -target_type= "target_type"
  -image_id= "image_id" 
  [-version_id= "version_id']

[ ]  indicates that the parameter is optional.
  • target_name

    The name of the target.

  • target_type

    The target type.

  • image_id

    The image id.

  • version_id

    The version id.

Examples

The following example unsubscribes the Oracle Cloud Zone target with the name POOL NAME and the image ID FE55AD7AB28974EFE04313B2F00AD4A0.

emcli db_software_maintenance -unsubscribeTarget
  -target_name="POOL NAME"
  -target_type=oracle_cloud_zone 
  -image_id=FE55AD7AB28974EFE04313B2F00AD4A0

createSoftwareImage

Description

Creates a new software image for the specified the Oracle home. The createSoftwareImage verb either takes data from a text file or uses the getInputVariableList command.

Format

emcli db_software_maintenance -createSoftwareImage
[-input_file="data:<file_location>"]
[-getInputVariableList= "getInputVariableList"]
[-workDir= "Work Directory Location"]

[ ]  indicates that the parameter is optional.

Options

  • input_file

    The path of the txt input file in the format: data:input_file_path

  • getInputVariableList

    Provides the list of variables to be specified in the input file.

  • workDir

    Specify the working directory to be used. This is an optional parameter.

Examples

Example 1

To get the list of all of the parameters to be passed inside the data file, run the following command:

emcli db_software_maintenance -createSoftwareImage
  -getInputVariableList=true

Example 2

Create a new text file called input_rac.txt and paste the following:
IMAGE_NAME=DbGoldImage
IMAGE_DESCRIPTION=Gold Image for 11g db
REF_TARGET_NAME=ORACLE_HOME
IMAGE_SWLIB_LOC=Oracle Home Provisioning Profiles/11.2.0.3.0/linux_x64
REF_HOST_CREDENTIALS=ZONE_CREDS:TESTSUPERADMIN
WORKING_DIRECTORY=/tmp
DESTN_SAME_AS_SRC=<True/False>
STORAGE_TYPE_FOR_SWLIB=OmsShared
STORAGE_NAME_FOR_SWLIB=swlib
VERSION_NAME=Version1

Run the following example to create a new image and a version.

emcli db_software_maintenance -createSoftwareImage 
  -input_file="data:/input_rac.txt"

searchImage

Description

Searches the image based on the filters provided. Use '%' for wildcards. If there is no filter specified, it returns all the images present in the system.

Format

emcli db_software_maintenance -searchImage
  [-name_pattern= "name_pattern"]
  [-version_pattern= "version_pattern"]
  [-description_pattern= "description_pattern"]
  [-owner= "owner"]
  [-target_type= "target_type"]
  [-platform_id= "platform_id"]

[ ]  indicates that the parameter is optional.
  • name_pattern

    The name pattern.

  • version_pattern

    The version pattern.

  • description_pattern

    The description pattern.

  • version_pattern

    The version pattern.

  • target_type

    The target type.

  • platform_id

    The platform id, for example 226 for Linux x86_64.

Examples

Example 1

The following example searches the database image for names that contain GI.

emcli db_software_maintenance -searchImage
  -name_pattern="%GI%"

Example 2

The following example searches the database image for platform id 226.

emcli db_software_maintenance -searchImage
  -platform_id="226"

createVersion

Description

Creates a new version in an existing image using an existing software library component.

Format

emcli db_software_maintenance -updateVersionStatus
  -version_name= "version_name"       
  -image_id= "image_id"       
  -external_id= "external_id"          
  -status= "status"  

Options

  • version_name

    The name of the version.

  • image_id

    The ID of the image.

  • external_id

    The external ID of the version. For example, it will be the Uniform Resource Name (URN) of the Software Library gold image.

  • status

    The status of the version, for example DRAFT, ACTIVE, CURRENT, RESTRICTED.

Examples

The following example creates a version Version1.

emcli db_software_maintenance -createVersion
  -version_name="Version1"
  -image_id="01B5F14FD57D7B89E05313B2F00A739F" 
  -external_id="oracle:defaultService:em:provisioning:1:cmp:COMP
  Component:SUB_OracleDB:0191172464DD36B6E05313B2F00AB90A:0.1" 
  -status=CURRENT

updateVersionStatus

Description

Updates the version status of the image.

Format

emcli db_software_maintenance -updateVersionStatus
  [-version_id= "version_id"]
  -status= "status"

[ ]  indicates that the parameter is optional.

Options

  • version_id

    The version id.

  • status

    The status of the version, for example DRAFT, ACTIVE, CURRENT, RESTRICTED.

Examples

The following example updates the version of the image with the version ID 02A635AOD8D904A4E05362F3E40ADFD8 to CURRENT.

emcli db_software_maintenance -updateVersionStatus 
  -version_id=02A635AOD8D904A4E05362F3E40ADFD8
  -status=CURRENT

getVersions

Description

Returns a list of the versions for the specified image.

Format

emcli db_software_maintenance -getVersions
  -image_id= "image_id"
  [-version_status= "version_status"]

[ ]  indicates that the parameter is optional.
  • image_id

    The name of the image.

  • version_status

    The status filter for the version.

Examples

The following example returns a list of versions for the image with the ID 01B5F14FD57D7B89E05313B2F00A739F.

emcli db_software_maintenance -getVersions
      -image_id="01B5F14FD57D7B89E05313B2F00A739F" 
      -version_status=CURRENT

getImageSubscriptions

Description

Returns the list of subscribed targets.

Format

emcli db_software_maintenance -getImageSubscriptions
  -image_id= "image_id" 
  • image_id

    The ID of the image.

Examples

The following example returns a list of targets for the image with the ID ID01B5F14FD57D7B89E05313B2F00A739F.

emcli db_software_maintenance -getImageSubscriptions
  -image_id="01B5F14FD57D7B89E05313B2F00A739F"

getSubscriptionsForContainer

Description

Returns the subscriptions for the container target, for example database pool.

Format

emcli db_software_maintenance -getSubscriptionsForContainer      
  -image_id= "image_id"   
  -target_name= "target_name"  
  -target_type= "target_type" 
  • image_id

    The image id.

  • target_name

    The name of the target in Oracle Enterprise Manager.

  • target_type

    The target type.

Examples

The following example returns the subscriptions for the Oracle Cloud Zone target with the name POOL NAME and the image ID FE55AD7AB28974EFE04313B2F00AD4A0.

emcli db_software_maintenance -getSubscriptionsForContainer
  -target_name="POOL NAME" 
  -target_type=oracle_cloud_zone 
  -image_id=FE55AD7AB28974EFE04313B2F00AD4A0

Fleet Management Software

performOperation -Deploy

Description

The deploy command automatically uses the current version of the subscribed image while creating the new Oracle Home.

Format

emcli db_software_maintenance -performOperation
  -name=""
  -purpose=""
  [-description=""]
  [-reportOnly="<true|false>"]
  [-workDir=""]
  [-start_schedule=""]
  [-inputfile="data:<file_location>"]
  [-target_type=""]
  [-target_list=""]
  [-normal_credential="<cred_name:cred_owner>"]
  [-privilege_credential="<cred_name:cred_owner>"]
  [-sql_sec="<sql_sec>"]
  [-rolling="true|false"]
  [-node_list=""]  [-standbyAutoDeploy="<true|false>"]
  [-blackoutguid="<true|false>"]
  [-migrate_non_cdb_pdb="<true|false>"]
  [-templateName="<template_path_and_name>"]
  [-dataFileLocation="<dataFileLocation>"]
[ ]  indicates that the parameter is optional.
  • name

    This is the unique name of the operation.

  • purpose
    There are standard purposes that can be performed by fleet operations which can be:
    • DEPLOY_DB_SOFTWARE
    • DEPLOY_RAC_SOFTWARE
    • DEPLOY_SIHA_SOFTWARE
    • DEPLOY_GI_SOFTWARE
    • DEPLOY_CBD_SOFTWARE
    • DEPLOY_GIMR_SOFTWARE

      Note:

      Only for Oracle Database 21C onward.
  • description

    Description of the operation.

  • reportOnly

    This is used in case of CLEANUP_SOFTWARE where the user wishes to clean Oracle Homes that are candidates for deletion, but does not want to perform the actual cleanup operation.

  • workDir

    Work directory location.

  • target_type

    The type of target on which this operation is being performed.

  • target_list

    This is a comma separated list of targets that need to be patched.

  • normal_credential

    This must be entered in the format <Named Credential: Credential Owner> where:

    • <Named Credential>: Named credential for the host where new Oracle home will be deployed.
    • <Credential Owner>: The Enterprise Manager user who owns this Named Credential.
    For EXACC RAC use the OPC user for Normal Host credentials.
  • privilege_credential

    This must be entered in the format <Named Credential: Credential Owner> where:

    • <Named Credential>: Named credential for the host where new Oracle home will be deployed.
    • <Credential Owner>: The Enterprise Manager user who owns this Named Credential.

      These credentials are used to run scripts as root.

  • start_schedule

    The date on which the stage and deploy is to be started if it is to be started in the future.

    Format: "start_time:yyyy/mm/dd HH:mm"

    Note:

    This is an optional parameter. If no date is provided, the fleet operation will start immediately.
  • Input_file

    This file contains the following entries:

    • start_schedule=<Schedule for the operation start>
    • NEW_ORACLE_HOME_LIST= <path of new Oracle home>

      This is the location where the new Oracle Home will be installed on all the hosts. The Credential Owner must have read / write access to this location.

    • homeNamePrefix=<User defined Oracle Home name>: Allows you to define a custom Oracle Home name prefix, allowing for the ability to discover Oracle Homes with custom name in deployment command. If the home name prefix is not specified, the default value will be used. This variable is available starting with Oracle Enterprise Manager 13.5 Release update 20 (13.5.0.20).
    • workingDir=<Name of temp directory>
    • dispatchLoc=<Dispatch location>

      This is the location where all scripts will be staged on the host. These scripts will be executed as a “root” user.

    • isRootPreStaged=<True/False>
    • SKIP_PREREQUISITE_CHECKS=<true|false>- The default value is false.
    • SKIP_CVU_CHECK=<true|false>- The default value is false.
    • PREREQS_ONLY=<true|false>- The default value is false. This can be used to detect any errors during pre-requisites checks. The actual deployment will not happen when the value is set to “true”.
    • STANDYBY_START_OPTION=<OPEN | MOUNT | NOMOUNT | READ ONLY | READ ONLY WITH APPLY> - If this option is provided while patching the standby database, it will be started in the specified mode after patching. If the value is READ ONLY WITH APPLY, the MRP process will be started automatically. If this option is not provided:
      • Rolling applicable patch: The existing open_mode for the standby database will be archived before patching and it will be stored for the standby database after patching. If the open_mode for the standby database can not be retrieved, the standby database will be started in the default mode and a warning message will be shown. The process will not be stopped for any failure.
      • Non-rolling applicable patch: The standby database will be started in default mode and MRP process will not be started up.

    Note:

    This verb submits a procedure which must be completed before you can proceed with the next steps.
  • sql_sec

    Sequence of CPU/PSU/EXA

  • rolling

    Flag to indicate if the patches can be applied in rolling mode.

  • node_list

    Comma separated list of hosts where the patching needs to be (e.g. rac_node1,rac_node2).

  • standbyAutoDeploy

    If the target is a primary database, a new Oracle home using the same gold image version as the Primary is deployed automatically on the Standby host. This parameter disables the automatic deployment of software on the standby host when set to False. Standby staging and deploy can be performed independently using EM CLI.

    This is an optional parameter, its default value is True.

  • blackoutguid

    Blackout guid to be passed to perform operation of UPDATE_RACDB purpose parameter node_list is passed. When passed, the update procedure will not create a new blackout on the database instance and with blackoutguid.

  • OSDBA_GROUP_GIMR= <group name>

    Only applicable for GIMR upgrades from a lesser than to a 21C or greater version.

  • OSDBA_GROUP_GIMR=dba

    Only applicable for GIMR upgrades from a lesser than to a 21C or greater version.

  • OSOPER_GROUP_GIMR = <group name>

    Only applicable for GIMR upgrades from a lesser than to a 21C or greater version.

  • OSBACKUPDBA_GROUP_GIMR = <group name>

    Only applicable for GIMR upgrades from a lesser than to a 21C or greater version.

  • OSDGDBA_GROUP_GIMR = <group name>

    Only applicable for GIMR upgrades from a lesser than to a 21C or greater version.

  • OSKMDBA_GROUP_GIMR = <group name>

    Only applicable for GIMR upgrades from a lesser than to a 21C or greater version.

  • OSRACDBA_GROUP_GIMR = <group name>

    Only applicable for GIMR upgrades from a lesser than to a 21C or greater version.

  • OSINSTALL_GROUP_GIMR = <group name>

    Only applicable for GIMR upgrades from a lesser than to a 21C or greater version.

  • IS_REDEPLOY=true

    Applicable for redeploying corrupt Oracle Homes.

  • templateName=<template_path_and_name>

    Allows the use of a previously created template in the Software Library for deploy.

  • dataFileLocation=<dataFileLocation>

    Allows for specifying a custom data file location for the deploy to perform.

Examples

The following example goes over the deployment of Oracle Home.

Attach Oracle Home:

To merge Oracle Homes of two databases, provide the flag attach_home=true and type the same location in the input_file where the same version of the image is already deployed.

For more information, see Attach Oracle Homes in Enterprise Manager Lifecycle Management Administrator's Guide.

emcli db_software_maintenance -performOperation -name="Deploy Home"
 -purpose="DEPLOY_DB_SOFTWARE"
 -target_type=oracle_database
 -target_list=db1221
 -normal_credential="NORMAL:SYSMAN"
 -privilege_credential="ROOT:SYSMAN"
 -input_file="data:/deploy_OH.prop"
 -attach_home=true

Deploy GI Software

emcli db_software_maintenance -performOperation -name="Deploy
 -1120407 GI Home"
 -purpose=DEPLOY_GI_SOFTWARE
 -target_type=input_file
 -target_list="CLUSTER1"
 -normal_credential="NC_HOST_CREDS:TESTSUPERADMIN"
 -privilege_credential="HOST_PRIV:TESTSUPERADMIN"
 -inputfile="data:/usr/oracle/deploy.txt"

Deploy Container Databases

emcli db_software_maintenance -performOperation
-purpose="DEPLOY_CDB"
-target_name="<>CDB Name that is being patched"
-target_type="<target type>
-name="Operation Name”
-description="Operation description"
-db_prefix | db_name ="<DB Name prefix or DB name>"
–normal_credential="<credential name>"
–privilege_credential="<credential name>"
–database_credential="SYSDBA credential name>"

If you are using existing container:

emcli db_software_maintenance -performOperation 
-purpose="ATTACH_CDB"
-target_name="<CDB Name that is being patched>"
-target_type="<target type>"
-name="Operation Name”
-description="Operation description"
-destinationCDB ="<Container database to which PDBs will be migrated>"
–normal_credential="<credential name>"
–privilege_credential=”<credential name>"
–database_credential="<SYSDBA credential name>"
Deploy GIMR for Oracle Database 21C
emcli db_software_maintenance 
-performOperation -name="Deploy GIMR Home"
-purpose=DEPLOY_GIMR_SOFTWARE 
-target_type=cluster   
-target_list=GI-SAMPLE-cluster 
-normal_credential="NC_HOST_CREDS:SYSMAN"
-privilege_credential="HOST_PRIV:SYSMAN"
-input_file="data:/scratch/<userid>/fleetData/deployGIMRHOME"

performOperation -Update

Description

The Update command is used for migrating listeners and updating Oracle Homes with the least amount of downtime:

Format

emcli db_software_maintenance -performOperation
  -name=""
  -purpose=""
  -database_credential="SYS_WELCOME:SYSMAN" *
  [-description=""]
  [-workDir=""]
  [-start_schedule=""]
  [-inputfile="data:<file_location>"]
  [-target_type=""]
  [-target_list=""]
  [-normal_credential="<cred_name:cred_owner>"]
  [-privilege_credential="<cred_name:cred_owner>"]
  [-sql_sec="<sql_sec>"]
  [-rolling="true|false"]
  [-node_list=""]
  [-startupDBAAfterSwitch="<true|false>"]
  [-skipSwitchDatabase="<true|false>"]
  [-startupDatabase="<true|false>"]
  [-ignoreStandbyPrereq="<true|false>"]
  [-blackoutguid="<true|false>"]
  [-migrate_non_cdb_pdb="<true|false>"]
  [-drain_timeout=<seconds>]**

[ ]  indicates that the parameter is optional.
* Only for non-cdb to PDB upgrades.
** Only for Grid Infrastructure updates.
  • name

    This is the unique name of the operation.

  • purpose
    There are standard purposes that can be performed by fleet operations which can be:
    • MIGRATE_LISTENER
    • UPDATE_DB for single instance and SIHA
    • UPDATE_RACDB for RAC database and RAC one-node
    • UPDATE_GI for cluster
    • UPDATE_SIHA
    • UPDATE_GIMR for Oracle Database 21C onward, updates the GIMR independent from the GI update
    • UPGRADE_DB only for non-CDB to PDB migration
    • UPGRADE_RACDB only for non-CDB to PDB migration
  • target_type

    The type of target on which this operation is being performed. This can be "rac_database" for RAC and "oracle_database" for single instance databases.

  • target_list

    This is a comma separated list of targets which are to be migrated.

  • normal_credential

    This must be entered in the format <Named Credential: Credential Owner> where:

    • <Named Credential>: Named credential for the host where new Oracle home will be deployed.
    • <Credential Owner>: The Enterprise Manager user who owns this Named Credential.
    For EXACC RAC use the OPC user for Normal Host credentials.
  • privilege_credential

    This must be entered in the format <Named Credential: Credential Owner> where:

    • <Named Credential>: Named credential for the host where new Oracle home will be deployed.
    • <Credential Owner>: The Enterprise Manager user who owns this Named Credential.

      These credentials are used to run scripts as root.

  • rolling

    This is an optional flag with the default value as true. The update procedure works in "Rolling Patch" mode by default but you can override this if necessary.

  • start_schedule

    The date on which the stage and deploy is to be started if it is to be started in the future.

    Format: "start_time:yyyy/mm/dd HH:mm"

    Note:

    This is an optional parameter. If no date is provided, the fleet operation will start immediately.
  • Input_file

    This file contains the following entries:

    • NEW_ORACLE_HOME_LIST= <path of new Oracle home>

      This is the location where the new Oracle Home will be installed on all the hosts. The Credential Owner must have read / write access to this location.

    • workingDir=<Name of temp directory>
    • dispatchLoc=<Dispatch location>

      This is the location where all scripts will be staged on the host. These scripts will be executed as a “root” user.

    • SKIP_PREREQUISITE_CHECKS=<true|false>- The default value is false.
    • SKIP_CVU_CHECK=<true|false>- The default value is false.
    • PREREQS_ONLY=<true|false>- The default value is false. This can be used to detect any errors during pre-requisites checks. The actual deployment will not happen when the value is set to “true”.
    • STANDYBY_START_OPTION=<OPEN | MOUNT | NOMOUNT | READ ONLY | READ ONLY WITH APPLY> - If this option is provided while patching the standby database, it will be started in the specified mode after patching. If the value is READ ONLY WITH APPLY, the MRP process will be started automatically. If this option is not provided:
      • Rolling applicable patch: The existing open_mode for the standby database will be archived before patching and it will be stored for the standby database after patching. If the open_mode for the standby database can not be retrieved, the standby database will be started in the default mode and a warning message will be shown. The process will not be stopped for any failure.
      • Non-rolling applicable patch: The standby database will be started in default mode and MRP process will not be started up.
    • OSDBA_GROUP_GIMR= <group name>

      Only applicable for GIMR upgrades from a lesser than to a 21C or greater version.

    • OSDBA_GROUP_GIMR=dba

      Only applicable for GIMR upgrades from a lesser than to a 21C or greater version.

    • OSOPER_GROUP_GIMR = <group name>

      Only applicable for GIMR upgrades from a lesser than to a 21C or greater version.

    • OSBACKUPDBA_GROUP_GIMR = <group name>

      Only applicable for GIMR upgrades from a lesser than to a 21C or greater version.

    • OSDGDBA_GROUP_GIMR = <group name>

      Only applicable for GIMR upgrades from a lesser than to a 21C or greater version.

    • OSKMDBA_GROUP_GIMR = <group name>

      Only applicable for GIMR upgrades from a lesser than to a 21C or greater version.

    • OSRACDBA_GROUP_GIMR = <group name>

      Only applicable for GIMR upgrades from a lesser than to a 21C or greater version.

    • OSINSTALL_GROUP_GIMR = <group name>

      Only applicable for GIMR upgrades from a lesser than to a 21C or greater version.

    Note:

    This verb submits a procedure which must be completed before you can proceed with the next steps.
  • migrate_non_cdb_pdb

    Only applicable for UPGRADE_DB and UPGRADE_RACDB purposes. This optional flag is only used when you want to migrate a database to a pluggable database where the source version is lower than 20c.

  • drain_timeout

    Only applicable for Grid Infrastructure updates. Specify the drain time in seconds allowing for resource draining to complete and services to stop. When specified accepted drain time values are 0, or any positive integer; if set to 0 draining occurs immediately. If DRAIN_TIMEOUT is not specified the default drain timeout specified at database service creation will be used.

For UPGRADE_DB and UPGRADE_RACDB purposes the following mandatory parameters need to be added into the input file:
SRC_WORK_DIR= <source host work directory location>
DEST_PDB_NAME=<Name of the PDB clone>
DEST_CDB_CRED="CRED_NAME:OWNER"
DEST_HOST_CRED="CRED_NAME:OWNER"
For UPGRADE_DB and UPGRADE_RACDB purposes the following optional parameters can be added into the input file:
SRC_WALLET_PWD=<SourceTDE wallet password>
DEST_WALLET_PWD=<Destination TDE wallet password>
DB_LINK_NAME=<DBLINK name>
DATAFILES_LOCATION=<Datafile location path>
STORAGE_MAX_SIZE=<Size of PDB tablespace in mb>
DEST_PDB_DISPLAY_NAME=<PDB Display name>
STORAGE_MAX_SHARED_TEMP_SIZE= <Amount of storage in the default temporary PDB tablespace in mb>
LOGGING_TYPE=<LOGGING | NO_LOGGING>
EXCLUDE_STANDBYS=<Y | N>
MASKING_DEFINITION_NAME=<PDB Masking definition>
PRE_SCRIPT_URN=<URN location>
POST_SCRIPT_URN=<URN location>
POST_SQL_SCRIPT_URN=<URN location>
POST_SQL_RUN_AS_USER=<User name>
POST_SQL_RUN_AS_USER_PWD=<User Password>
DEST_WORK_DIR=<Temporary work directory>
PDB_ADMIN_NAME=<PDB Admin>
PDB_ADMIN_PWD=<PDB Admin Password>
DELETE_SRC_DB=<true|false> [TRUE default]

Examples

Migrating the Listeners

If there are listeners running from the database home, use the following verb to migrate them to the parallel Oracle Home, you can use this command to migrate the listeners running from Oracle database homes. Grid Infrastructure homes are automatically migrated during the GI update process.

emcli db_software_maintenance -performOperation
-name="Update Listener"
-purpose=migrate_listener
-target_type=oracle_database
-target_list="DB1"
-normal_credential="NC_HOST_CREDS:SYSMAN"
-privilege_credential="HOST PRIV:SYSMAN"
start_schedule

Updating the Database / Cluster

After the stage and deploy operations are completed, the grid infrastructure instances should be migrated to the newly deployed Grid Infrastructure Homes.

emcli db_software_maintenance -performOperation
-name="Update Cluster"
-purpose=UPDATE_GI
-target_type=cluster
-target_list=CLUSTER1
-normal_credential="NC_HOST_CREDS:SYSMAN"
-privilege_credential="HOST PRIV:SYSMAN"
[-rolling=<true/false]

To update an Oracle Database, database credentials can be provided using the flag -database_credential="DB_SYS_CREDS:SYSMAN". If the credentials are not provided with this flag, the preferred set credentials will be used instead.

The TDE wallet password must be provided in the input file -input_file="data:<INPUT.PROPERTIES>". If the TDE configuration fails or database credentials are not provided, the database update will continue without TDE configuration.

For UPDATE_PDB:
  • TDE must already be configured in the destination CDB.
  • Source and destination passwords must be included in the input file.

    Example:

    srcWalletPassword=<SOURCE_PASSWORD>

    destWalletPassword=<DESTINATION_PASSWORD>

Node Wise RAC Database / Cluster Update

A cluster update always requires that all the RAC database instances running on that node be shut down during the switch process of the cluster instance. Hence, a cluster update followed by a RAC database updates results in an instance getting restarted twice.

There may be several situations where the administrator may require more control over the switch process. For example, the administrator may choose to perform a node-wise update of the cluster and RAC databases in order to avoid multiple restarts of the database instances. The administrator may also need to perform node specific pre-post steps.

emcli db_software_maintenance -performOperation -name="Update Cluster"
-purpose=UPDATE_GI
-target_type=cluster
-target_list=CLUSTER1
-normal_credential="NC_HOST_CREDS:SYSMAN"
-privilege_credential="HOST_PRIV:SYSMAN"
-rolling=true 
-node_list="host1.example.com"
–startupDatabase=false
-drain_timeout=10
This option provides this control by enabling the user to perform the following tasks for each node:
  • Switch the cluster instance.
  • Leave the RAC database instances shutdown.

    For example, consider RAC databases RACDB_112 and RACDB_121 are running on this cluster. The instances RACDB_112_1 and RACDB_121_1 running on this specific node will continue to remain shut down after the cluster instance is switched.

  • Switch all the RAC database instances on the same node.
  • This step will switch the instances RACDB_112_1 and RACDB_121_1 to the new home and will restart the same.

    For example, consider RAC databases RACDB_112 and RACDB_121 are running on this cluster. The instances RACDB_112_1 and RACDB_121_1 running on this specific node will continue to remain shut down after the cluster instance is switched.

emcli db_software_maintenance -performOperation
-name="Update RAC DB"
-purpose=UPDATE_RACDB
-target_type=rac_database
-target_list=RACDB
-normal_credential="NC_HOST_CREDS:SYSMAN"
-privilege_credential="HOST_PRIV:SYSMAN"
-rolling=true
-node_list="host1.example.com"

Update GIMR for Oracle Database 21C

This example should only be used for GIMR updates on Oracle 21C or above databases. Starting in 21C the GIMR component is separate from the Grid Infrastructure and needs to be updated separately.
emcli db_software_maintenance 
-performOperation -name="Update GIMR Home"
-purpose=UPDATE_GIMR 
-target_type=cluster   
-target_list=GI-SAMPLE-cluster 
-normal_credential="NC_HOST_CREDS:SYSMAN"
-privilege_credential="HOST_PRIV:SYSMAN"
-input_file="data:/scratch/<userid>/fleetData/deployGIMRHOME"
For this use case the following input file parameters outlined above need to be added: OSDBA_GROUP_GIMR, OSDBA_GROUP_GIMR, OSOPER_GROUP_GIMR, OSBACKUPDBA_GROUP_GIMR, OSDGDBA_GROUP_GIMR, OSKMDBA_GROUP_GIMR, OSRACDBA_GROUP_GIMR, OSINSTALL_GROUP_GIMR.

Upgrade a non-CDB to PDB

This example moves a non-CDB database to a new PDB clone:
emcli db_software_maintenance -performOperation 
-name="TEST1" 
-purpose=UPGRADE_DB 
-target_type=oracle_database 
-target_list="source3" 
-normal_credential="SOURCE_ORACLE:SYSMAN" 
-privilege_credential="SOURCE_ROOT:SYSMAN" 
-database_credential="SOURCE_SYS:SYSMAN"
-input_file="data:/scratch/test1.txt"
Input file content:
SRC_WORK_DIR=/tmp
DEST_PDB_NAME=pdbmigrate2
DEST_PDB_DISPLAY_NAME =pdbmigrate2
        DEST_CDB_CRED = SYS_WELCOME:SYSMAN
        DEST_HOST_CRED = CUSER:SYSMAN
        DEST_WORK_DIR = /tmp
PDB_ADMIN_NAME = PDBADMIN
PDB_ADMIN_PWD = welcome

performOperation -Rollback

Description

This command is used to switch the database back to the previous Oracle home after the Update operation has been completed.

Format

emcli db_software_maintenance -performOperation
  -name=""
  -purpose=""
  [-description=""]
  [-workDir=""]
  [-start_schedule=""]
  [-inputfile="data:<file_location>"]
  [-target_type=""]
  [-target_list=""]
  [-normal_credential="<cred_name:cred_owner>"]
  [-privilege_credential="<cred_name:cred_owner>"]
  [-sql_sec="<sql_sec>"]
  [-rolling="true|false"]
  [-node_list=""]
  [-startupDBAAfterSwitch="<true|false>"]
  [-skipSwitchDatabase="<true|false>"]
  [-startupDatabase="<true|false>"]
  [-ignoreStandbyPrereq="<true|false>"]
  [-standbyAutoDeploy="<true|false>"]
  [-blackoutguid="<true|false>"]

[ ]  indicates that the parameter is optional.
  • name

    This is the unique name of the operation.

  • purpose

    There are standard purposes that can be performed by Fleet Operations which can be:

    • ROLLBACK_DB

    • ROLLBACK_RACDB

    • ROLLBACK_GI

    • ROLLBACK_SIHA

    • ROLLBACK_LISTENER
  • target_type

    The type of target being provided in this operation which can "rac_database" or "oracle_database”.

  • target_list

    This is a comma separated list of targets which need to be patched.

    • Targets of homogenous types are supported in a single fleet operation.

    • A unique list of hosts based on this target list is displayed and start stage of Oracle home software on those hosts.

    • If targets running from the same Oracle home are provided in this list, the stage and deploy operation will be started only once and not for all targets.

  • normal_credential

    This must be entered in the format <Named Credential: Credential Owner> where:
    • <Named Credential>: Named credential for the host where new Oracle home will be deployed.

    • <Credential Owner>: The Enterprise Manager user who owns this Named Credential.

    For EXACC RAC use the OPC user for Normal Host credentials.
  • privilege_credential
    This must be entered in the format <Named Credential: Credential Owner> where:
    • <Named Credential>: Named credential for the host where new Oracle home will be deployed.

    • <Credential Owner>: The Enterprise Manager user who owns this Named Credential.

      These credentials are used to run scripts as root.

  • non_rolling

    By default, rollback is performed on all nodes. If the non_rolling back flag is enabled, you can select the list of nodes (using the node_list command) that are to be rolled back.

  • rolling

    By default rollback is performed in rolling fashion. This flag is used when the current Oracle home has patches that were applied in non-rolling mode (OJVM) and need to be rolled back.

  • node_list

    This is a comma separated list of hosts on which the instances need to be updated.

    For example: If RACDB is running on a 4 node cluster host1, host2, host3, and host4 and you choose to update the instances in only 2 hosts at a time, the value of this parameter needs to be specified as node_list="host1, host2".

  • Input_file

    This file contains the following entries:

    • NEW_ORACLE_HOME_LIST= <path of new Oracle home>

      This is the location where the new Oracle Home will be installed on all the hosts. The Credential Owner must have read / write access to this location.

    • workingDir=<Name of temp directory>

    • dispatchLoc=<Dispatch location>

      This is the location where all scripts will be staged on the host. These scripts will be executed as a “root” user.

    • SKIP_PREREQUISITE_CHECKS=<true|false>- The default value is false.

    • SKIP_CVU_CHECK=<true|false>- The default value is false.

    • PREREQS_ONLY=<true|false>- The default value is false. This can be used to detect any errors during pre-requisites checks. The actual deployment will not happen when the value is set to “true”.

    • STANDYBY_START_OPTION=<OPEN | MOUNT | NOMOUNT | READ ONLY | READ ONLY WITH APPLY> - If this option is provided while patching the standby database, it will be started in the specified mode after patching. If the value is READ ONLY WITH APPLY, the MRP process will be started automatically. If this option is not provided:
      • Rolling applicable patch: The existing open_mode for the standby database will be archived before patching and it will be stored for the standby database after patching. If the open_mode for the standby database can not be retrieved, the standby database will be started in the default mode and a warning message will be shown. The process will not be stopped for any failure.
      • Non-rolling applicable patch: The standby database will be started in default mode and MRP process will not be started up.

    Note:

    This verb submits a procedure which must be completed before you can proceed with the next steps.

Examples

Rollback RAC DB

emcli db_software_maintenance -performOperation
 -name="Rollback RAC DB"
 -purpose=ROLLBACK_RACDB
 -target_type=rac_database
 -target_list=RACDB
 -normal_credential="NC_HOST_CREDS:SYSMAN"
 -privilege_credential="HOST_PRIV:SYSMAN"
 [-rolling=true/false]
 [-node_list="host1.example.com"]

Rollback Listener

emcli db_software_maintenance -performOperation
 -name="Rollback Listener"
 -purpose=ROLLBACK_LISTENER
 -target_type=oracle_database
 -target_list=SAMPLEDB
 -normal_credential="NC_HOST_CREDS:SYSMAN"
 -privilege_credential="HOST_PRIV:SYSMAN"

Rollback GI

emcli db_software_maintenance -performOperation 
-name="RollbackGI" 
-description="Rollback GI"
-purpose=ROLLBACK_GI
-normal_credential="NC_HOST_CREDS:SYSMAN"
-privilege_credential="HOST_PRIV:SYSMAN" 
-force=true

Note:

If the previous grid update or patching failed, Enterprise Manager will ask you to provide the -force flag when using ROLLBACK_GI. The -force is not required for the rollback grid operation, if the previous grid update succeeded.

performOperation -Cleanup

Description

User can cleanup a Oracle Home by providing the target name in -target_list and -target_type=oracle_home.

Format

emcli db_software_maintenance -performOperation 
-name="cleanup"
-purpose="CLEANUP_SOFTWARE"
  [-description=""]
  [-reportOnly="<true|false>"]
  [-workDir=""]
  [-start_schedule=""]
  [-target_type=""]
  [-target_list=""]
  [-normal_credential="<cred_name:cred_owner>"]
  [-privilege_credential="<cred_name:cred_owner>"]
  [-force=true]
  

Note:

The user can perform a cleanup in two ways:
  • The user can pass the database in -target_list and pass -target_type=<oracle_database/rac_database> and the script will perform the cleanup to the attached Oracle Home.
  • The user can pass the Oracle Home as a target in -target_list and the script will validate and perform the cleanup.

If any target is associated with the given home, Cleanup will be not done for the given home. User has to provide homes on all the nodes for a RAC before Cleanup can be done.

  • description

    Description of the operation.

  • reportOnly

    This is used in case of CLEANUP_SOFTWARE where the user wishes to clean Oracle Homes that are candidates for deletion, but does not want to perform the actual cleanup operation.

    Note:

    Credentials are not required when using reportOnly.
  • workDir

    Work directory location.

  • target_type

    The type of target on which this operation is being performed.

  • target_list

    This is a comma separated list of targets that need to be patched.

  • normal_credential

    This must be entered in the format <Named Credential: Credential Owner> where:

    • <Named Credential>: Named credential for the host where new Oracle home will be deployed.

    • <Credential Owner>: The Enterprise Manager user who owns this Named Credential.

  • privilege_credential

    This must be entered in the format <Named Credential: Credential Owner> where:

    • <Named Credential>: Named credential for the host where new Oracle home will be deployed.

    • <Credential Owner>: The Enterprise Manager user who owns this Named Credential.

      These credentials are used to run scripts as root.

    For EXACC RAC use the OPC user for Normal Host credentials.
  • start_schedule

    The date on which the stage and deploy is to be started if it is to be started in the future.

    Format: "start_time:yyyy/mm/dd HH:mm"

    Note:

    This is an optional parameter. If no date is provided, the fleet operation will start immediately.
  • force
    Optional flag, its default value is false. Cleanup of Oracle home affects the databases running from that home, by default the cleanup is skipped if processes (databases, listeners, cluster) are found running from this home. You can provide the force=true flag to skip the verification and remove all processes running from this home. This removes all processes running from the home which were not discovered in Enterprise Manager as well.

    Note:

    This is a severely destructive operation, the procedure will start after a 5 minute delay, providing you with the opportunity to abort the procedure. .

Example

emcli db_software_maintenance -performOperation 
-name="cleanup"
-purpose="CLEANUP_SOFTWARE" 
-target_list=OraDB12Home_host.com:1111
-target_type=oracle_home 
-normal_credential=NORMAL:SYSMAN
-privilege_credential=ROOT:SYSMAN
-workDir=/tmp