Deploy Operations
For more information on deploy operators within the EM CLI verb db_software_maintenance see db_sm_performoperation_deploy in Enterprise Manager Command Line Interface.
The general layout of a Deploy instruction is as follows:
emcli db_software_maintenance
-performOperation
-name=<User specified Operation name>
-purpose=<Operation Type>
-target_type=<type of target>
-target_list=<list of targets>
-normal_credential=<Named Credential: Credential Owner>
-privilege_credential=<Named Credential: Credential Owner>
[-windows_sec_credential=<Named Credential: Credential Owner>]
-input_file="data:<location of input file>"
[-standbyAutoDeploy=true|false] [-procedure_name_prefix="CustomUpdate"]
name
: This is the unique name of the operation.purpose
: The purpose of the instructions, in this case DEPLOY:DEPLOY_DB_SOFTWARE
DEPLOY_RAC_SOFTWARE
DEPLOY_SIHA_SOFTWARE
DEPLOY_GI_SOFTWARE
DEPLOY_CBD
target_type
: The type of target on which this operation is being performed. Refer to the table EM CLI Command Inputs Based on Entity Type for valid values.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.
- 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 same Oracle home are provided in this list, the stage and deploy operation will be triggered only once and not for all targets.
normal_credential
:Unix only, 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
: Unix only, 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.
Note:
These credentials are used to run scripts as root.windows_sec_credential
: Windows Single Instance database only, 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.
Note:
Starting with Enterprise Manager 13.5 Release Update 2, three different credentials are supported for Windows Single Instance database: Normal/Local account, Virtual account and Built in account.- Normal/Local account:
emcli db_software_maintenance -performOperation -name="Deploy a Patched Home" -purpose=DEPLOY_DB_SOFTWARE -target_type=oracle_database -target_list="ORCL1910.abc.sample.com" -input_file="data:/tmp/deploywin.properties" -normal_credential="LOCALADMIN:SYSMAN" -windows_sec_credential="LOCALUSERCRED:SYSMAN"
- Virtual account:
emcli db_software_maintenance -performOperation -name="Deploy a Patched Home" -purpose=DEPLOY_DB_SOFTWARE -target_type=oracle_database -target_list="ORCL1910.abc.sample.com" -input_file="data:/tmp/deploywin.properties" -normal_credential="LOCALADMIN:SYSMAN" –is_virtual_account="true"
- Built in account:
emcli db_software_maintenance -performOperation -name="Deploy a Patched Home" -purpose=DEPLOY_DB_SOFTWARE -target_type=oracle_database -target_list="ORCL1910.abc.sample.com" -input_file="data:/tmp/deploywin.properties" -normal_credential="LOCALADMIN:SYSMAN" –is_builtin_account="true"
start_schedule
: The date on which the stage and deploy is to be started if it is to be started in the future with the following format: "start_time:yyyy/mm/dd HH:mm". This is an optional parameter. If no date is provided, the fleet operation will start immediately.standbyAutoDeploy
: This is an optional parameter with default value as True. If the target is a primary database, a new Oracle home with the same gold image version as Primary is deployed automatically on the Standby host. This parameter disables the automatic deployment of software on standby host when specified as false. If this value is false, standby staging/deploy can be performed independently using the above EM CLI command.procedure_name_prefix
: This is an optional parameter. It is used to provide a custom name for the deployment procedure Instance name. The supported operations are DEPLOY, UPDATE, CLEANUP and ROLLBACK.input_file
: This file will contain the following entries:NEW_ORACLE_HOME_LIST=<Absolute path to file system location for new Oracle Home>
workingDir=<Name of temp directory>
: This is the location in which the new Oracle Home will be installed on all the hosts. The Credential Owner must have read and write access to this location.When deploying with NFS, NFS uses the working directory as the local mount location. NFS is available with Oracle Enterprise Manager 13.5 Release Update 13 (13.5.0.13) and higher.
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 post deployment. 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).dispatchLoc=<Dispatch location>
: The location in which the scripts will be staged on the host. These scripts can be executed by 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 for identify errors during the prerequisite checks. The actual deployment will not happen when the value is set to “true”.dispatchLoc=<Absolute path to the custom location>
: This parameter has been added for operations that stage and use a dispatcher location, using an existing, read-only location to use pre-staged dispatcher as well as fleet scripts. This is an added security measure to only execute as root through a custom script which is only allowed to execute a reduced number of files.isRootPreStaged=<true/false>
: If this flag is set to true the root components need to be pre-staged into thedispatchLoc
location. This is helpful in skipping the pre-staged step when the components have already been pre-staged manually.In order to pre-stage root, the following components need to be previously staged and submitted:
- Root Dispatcher component (Unix only requirement)
- Root Scripts, requires an additional step of unzipping the scripts in the
dispatchLoc
location. - Common Root component
For detailed instructions on how to pre-stage the Root Components, see Manually Staging the Root Components For Fleet Maintenance (Patching).
Note:
If the flag is set to false and the components pre-staged, the components will be overwrittenRUN_CVU_FROM_OH=<true/false>
: The Cluster Verification Utility runs by default from the Oracle Home. Setting this flag to false will allow you to run the CVU from the Software Library used in conjunction withCUSTOM_CVU_COMPONENT
. This flag will also be set to false in the following two cases:- Database version is 12.1 or below, Cluster Verification Utility is not part of oracle home binaries for these versions.
- Standalone SIDB (Single Instance Database), as Cluster Verification Utility is not part of SIDB oracle home binaries.
CUSTOM_CVU_COMPONENT=<Path of Custom CVU in the Software Library>
: This component used in conjunction withRUN_CVU_FROM_OH=false
allows you to run the CVU from the Software Library instead of the Oracle home by setting a path from where your custom CVU is located.
Deploy an Oracle Home
The following example goes over the deployment of an Oracle Home. The DEPLOY_DB_SOFTWARE
purpose can be used for the creation of a Single Instance Oracle Database and Pluggable Database:
emcli db_software_maintenance
-performOperation
-name="Deploy Home"
-purpose="DEPLOY_DB_SOFTWARE"
-target_type= <oracle_database or oracle_pdb>
-target_list=db1916
-normal_credential="NORMAL:SYSMAN"
-privilege_credential="ROOT:SYSMAN"
-input_file="data:/deploy_OH.txt"
-attach_home=true
Note:
For Container databases and RAC Container database creation use verbDEPLOY_CDB
, instead of DEPLOY_DB_SOFTWARE
.
Deploy RAC Database
The following code snippet shows how to deploy an RAC Database using theDEPLOY_RAC_SOFTWARE
purpose within the db_software_maintenance
emcli verbemcli db_software_maintenance
-performOperation
-name="Deploy Home"
-purpose="DEPLOY_RAC_SOFTWARE"
-target_type= rac_database
-normal_credential="NORMAL:SYSMAN"
-privilege_credential="ROOT:SYSMAN"
-input_file="data:/deploy_OH.txt"
-attach_home=true
Deploy an Oracle Restart
emcli db_software_maintenance
-performOperation -name="Deploy Home"
-name="Deploy Home"
-purpose="DEPLOY_SIHA_SOFTWARE"
-target_type= has
-normal_credential="NC_HOST_CREDS:SYSMAN"
-privilege_credential="HOST_PRIV:SYSMAN"
-input_file="data:/deploy_OH.txt"
-SKIP_CVU_CHECK=<true/false>
SKIP_CVU_CHECK
: This flag allows skipping the CVU check if set to true. This is an optional flag only used for DEPLOY_SIHA
and DEPLOY_GI
operations.
Deploy an Oracle Grid Infrastructure Database
emcli db_software_maintenance
-performOperation
-name="Deploy-1916 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"
SKIP_CVU_Check=<true/false>"
SKIP_CVU_CHECK
: This flag allows skipping the CVU check if set to true. This is an optional flag only used for DEPLOY_SIHA
and DEPLOY_GI
operations.
Use DEPLOY_GI_SOFTWARE
if you are planning to upgrade your Grid Infrastructure from 12.X to 19C or 18C. Once the new 19C or 18C home is deployed, perform UPDATE_GI
. Finally use the DEPLOY_RAC_SOFTWARE
to deploy the RAC home binaries of 19C or 18C
Deploy GIMR Software
Note:
From Oracle Database 21C onward, the GIMR update is now separated from GI update or patching. Performing an update of both GI and GIMR will happen in 2 separate operations. Only use this command on 21C or higher databases.- Create Gold Image: Create a Gold image for RAC home target or SI home target (an SI Oracle home image can be used to deploy RAC software).
- Subscribe the GIMR Target to the Image: GIMR is not discovered in Enterprise Manager as a separate target. You will need to subscribe the cluster target to be configured with GIMR to a RAC or SI home image. To do this use the following command:
emcli db_software_maintenance -subscribeTarget -target_name="GIMR-target-cluster" -target_type=cluster -image_id=<RAC-SI_IMAGE_ID> -gimr=true
- Deploy the GIMR Software:
emcli db_software_maintenance -performOperation -name="Deploy GIMR Home" -purpose=DEPLOY_GIMR_SOFTWARE -target_type=cluster -target_list=den01nr-cluster -normal_credential="NC_HOST_CREDS:TESTSUPERADMIN" -privilege_credential="HOST_PRIV:TESTSUPERADMIN" -inputfile="data:/usr/oracle/deploy.txt"
Deploy Container Databases
DEPLOY_CDB
operation.
Note:
A PDB target may also be patched using an existing Container Database at a higher patch level, in this caseATTACH_CDB
operation must be performed and DEPLOY_CDB
operations must be skipped.
emcli db_software_maintenance -performOperation -name="<name>"
-purpose=DEPLOY_CDB
-target_type=rac_database
-target_list="<CDB Name that is being patched>"
-db_name="<db_name>"
-normal_credential="<normal_credential>"
-privilege_credential="<privilege_credential>"
-database_credential="<database_credential>"
-input_file="<input_file>"
-templateName="<template_path_and_name>"
-dataFileLocation="<dataFileLocation>"
If a container database already exists with the required image, then the same can be attached for housing the PDB when they are updated.emcli db_software_maintenance
-performOperation -purpose="ATTACH_CDB"
-target_list="<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>"
-templateName="<template_path_and_name>"
-dataFileLocation="<dataFileLocation>"