A Using Enterprise Manager Command Line Interface
This appendix explains how to use Enterprise Manager Command Line Interface (EM CLI) to deploy patches using Patch Plans, provision procedures, and perform some of the Software Library tasks.
Note:
For information about Enterprise Manager 13c verb usage, syntax, and examples, see Oracle Enterprise Manager Command Line Interface
In particular, this appendix covers the following:
Note:
The entire EM CLI implementation for running the various Deployment Procedures has been revamped in Oracle Enterprise Manager Cloud Control (Cloud Control).
Overview
Enterprise Manager Command Line Interface (EM CLI) is a command line utility available for power users in Oracle Enterprise Manager Cloud Control (Cloud Control) that enables you to perform most of the console-based operations. It enables you to access Cloud Control functionality from text-based consoles (shells and command windows) for a variety of operating systems.
-
Perform various command line operations such as monitoring and managing targets, jobs, running deployment procedures, patching Enterprise Manager targets, and so on.
-
Use the functions available with EM CLI called verbs, to build your custom scripts on various programming environments like Operating System shell, Perl, Python, and so on. This in turn allows you to closely integrate Oracle Enterprise Manager functionality with your own enterprise business process.
-
Carry out operations with the same security and confidentiality as the Cloud Control console.
Prerequisites
Before using EM CLI, ensure that you meet the following requirements:
-
EM CLI client must be set up. To do so, see Oracle Enterprise Manager Command Line Interface.
-
Targets that will be supplied to the Deployment Procedures should be managed by Enterprise Management 13c Management Agents.
-
If you are patching in the offline mode, with no internet connectivity, then ensure that the patches are available in the Software Library before running the EM CLI commands.
Enterprise Manager Command Line Interface Verbs
This section primarily lists all the EM CLI verbs used for accomplishing the various patching and provisioning tasks. Primarily, it contains:
Provisioning EM CLI Verbs
The table below contains a list of all the EM CLI verbs used for running deployment procedures:
Table A-1 EM CLI Provisioning Verbs and their Usage
Verb | Usage | Example |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Patching EM CLI Verbs
Support for patching any number of targets from the same single patch plan using command line interface is now supported. Following are some of the important EM CLI verbs used for patching.
Table A-2 EM CLI Patching Verbs and their Usage
Verbs | Usage | Example |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Software Library EM CLI Verbs
Configuring Software Library, creating entities, and using them is supported in Oracle Enterprise Manager Cloud Control.
Note:
You can either use Enterprise Manager UI or the command line utility (EM CLI) to retrieve the folder id and the entity revision id. To do so, and for a comprehensive example on how to effectively use the EM CLI verbs to perform a number of Software Library tasks listed in the following table, see the workflow example Creating a New Generic Component by Associating a Zip File.
Following are some of the important EM CLI verbs used to perform some Software Library actions:
Table A-3 Software Library EM CLI Verbs and Their Usage
Verb | Usage | Example |
---|---|---|
(Adding a Software Library storage location) |
|
|
(Creating a Software Library folder) |
|
|
(Creating a Software Library entity) |
|
|
(Listing the Software Library entities) |
|
|
(Listing Software Library entity subtypes) |
|
|
(Listing Software Library entity types) |
|
|
(Listing Software Library folders) |
|
|
(Listing Software Library storage locations) |
|
|
(Referring files from a Software Library entity) |
|
|
(Re-Importing Software Library metadata) |
|
|
(Removing a Software Library storage location) |
|
|
(Modifying a Software Library entity) |
|
|
(Uploading files to a Software Library entity) |
|
|
Provisioning Using EM CLI
Deployment Procedures can be run from the command line using EM CLI or from Cloud Control UI. Launching a procedure either from command line or from GUI requires a set of inputs to be provided. However, the mode of entering these inputs differ in both the cases. While running a Deployment Procedure from the UI, you can use a wizard to enter all the inputs required to run the procedure. However, in EM CLI, you use Properties File for entering the inputs. Properties File is a file which contains all the inputs required to run a Deployment Procedure. The following sections describe how to create properties file from scratch and use it in procedures, how to use properties file of a procedure that has already been executed, and how to create a template using a properties file and a few other attributes to run the deployment procedures.
Note:
-
You cannot provision pluggable databases by running Deployment Procedures using EM CLI. For information on how to provision pluggable databases using EM CLI, view Provisioning Pluggable Databases.
-
The
-swlib
argument works for cloning only Oracle Database 9i Release 2. Do NOT use this argument for later releases.
This section covers the following scenarios:
Creating the Properties File to Submit a Deployment Procedure
This graphic illustrates how to create a template properties file, update values into the file, and then submit the procedure with the updated properties file as the input.
Step1: Create Template Properties File From a Procedure Definition
All the details required for the selected Deployment Procedure like variable names, targets, credentials, and so on are provided in this step to successfully submit the procedure from the command line. Generating the Properties file is a two-step process as follows:
This EM CLI verb describes the input data of a deployment procedure or a procedure configuration in a name-value pair format, which is also called as the properties file format. The advantage of this name-value file format for a procedure is that it is flexible enough to accept multiple destination targets.
Step 2: Entering New Values in The Properties File
Use any editor to open the properties file and enter values against the names. After updating all the fields, save and close the properties file.
The main goal of this step is to create a library of property files where the most common input values have been set as defaults, this in turn reduces the chances of operator errors, and also reduces the number of inputs expected from the operators.
For example, vi procConfiguration.properties
Note:
For example properties file, see section Provisioning Oracle Database Software or Provisioning Oracle WebLogic Server.
Step 3: Submitting the Procedure With The Updated Properties File as Input
After the properties file is ready with the correct name-value pair required to run the Deployment procedure, you must use the EM CLI verb submit_procedure, which accepts the edited properties file as the input.
emcli submit_procedure [-name={name of the procedure}] [-owner={owner of the procedure}] [-procedure={guid of the procedure}] -input_file={data:{file_path}/file name" [-instance_name={name for the procedure instance}] [-notification={procedure status}] [-grants={users and their corresponding accessing levels}] [-schedule=start_time:yyyy/MM/dd HH:mm; tz:{java timezone ID}]
Starting with Cloud Control 12c, you can submit the procedure either using the procedure GUID or using the procedure name/owner pair, as described in the following example:
-
Submitting the properties file using the GUID of the procedure:
emcli submit_procedure -input_file=data:procConfiguration.properties -procedure=B35E10B1F427B4EEE040578CD78179DC -schedule="start_time:2006/6/21 21:23; tz:America/New_York" -grants="user1:VIEW_JOB; user2:FULL_JOB" -notification="scheduled, action required, running"
-
Submitting the properties file using the procedure name/owner pair:
emcli submit_procedure -input_file=data:procConfiguration.properties -name=SIHA_SIDB_PROC -owner=sysman -schedule="start_time:2006/6/21 21:23; tz:America/New_York" -grants="user1:VIEW_JOB; user2:FULL_JOB" -notification="scheduled, action required, running"
Output:
Verifying parameters ...
B35E10B1F427B4EEE040578CD78179DC
Deployment procedure submitted successfully
Note: The instanceId is B35E10B1F427B4EEE040578CD78179F1
This verb functions in a non-waiting mode, which means it submits the procedure for execution and returns without waiting for it to complete. The output of this verb indicates if the submission of the procedure was successful or if any errors were encountered. A successful submission displays the Instance GUID as the output.
Step 4: Verifying The Status Of the Procedure
The final step lets you to track the progress and status of the procedure. This is especially important since the submit procedure verb does not wait for the completion of the Deployment Procedure:
emcli get_instance_status [-instance={instance guid}] [-exec=execution guid] [-xml [-details] [-showJobOutput] [-tailLength={last N characters}]]] Example: emcli get_instance_status -instance=B35E10B1F427B4EEE040578CD78179F1 -details -showJobOutput Output: B35E10B1F427B4EEE040578CD78179F1, WEBLOGIC_WSM, DANS_SCALEUP_WSM12, FAILED
Using Properties File from an Existing Execution of a Deployment Procedure
This graphic illustrates how to retrieve the properties file of a deployment procedure that has already been executed, update values into the file, and then submit the procedure with the updated properties file as the input.
Retrieving Properties File From an Existing Execution
All the inputs required for the selected Deployment Procedure like variable names, targets, credentials, and so on are provided in this step to successfully submit the procedure from the command line. Generating the Properties file is a two-step process as follows:
Launching a Procedure using an Existing Saved Procedure
Procedures that are used repeatedly can be saved along with the properties file, job grants, schedules, and notifications, and so on with a unique name. This specially packaged procedure can be run using the unique name whenever required. This is especially useful when the procedure must be executed multiple number of times, and helps in saving a lot of time and effort. Running the verb emcli get_procedures
fetches all the procedures which also include the Procedure Configurations.
To launch a procedure using an Existing Procedure Configuration File, do the following:
Saving a Procedure Configuration of a Procedure
If you have to use a properties file repeatedly to run a procedure, then Oracle recommends that you save this Procedure with the properties file and give the saved procedure a name. Every time you want to run the procedure with the same properties file, you can run the saved Procedure by giving its name. To save the procedure, run the following command:
emcli save_procedure_input -name={name of procedure configuration} -procedure={Procedure name} [-owner={owner of procedure}] -input_file=data:/file path/file name [-grants={users and their corresponding accessing levels}] [-notification={procedure status}] [-schedule=start_time:yyyy/MM/dd HH:mm;tz:{java timezone id};grace_period:xxx] Example: emcli save_procedure_input -name=procConfiguration -procedure=ComputeStepTest -input_file=data:/tmp/instanceData.properties -grants="user1:VIEW_JOB; user2:FULL_JOB" -notification="scheduled, action required, running" -schedule="start_time:2012/12/25 00:00;tz:American/New York;grace_period:60"
Updating the Procedure Configuration of a Procedure
To update the existing values in a saved procedure, run the following command:
emcli update_procedure_input -name={name of procedure configuration} -input_file="data:/file path/file name" [-notification={procedure status}] [-grants={users and their corresponding accessing levels}] [-schedule=start_time:yyyy/MM/dd HH:mm;tz:{java timezone id};grace_period:xxx] Example: emcli update_procedure_input -name=procConfiguration -input_file=data:/tmp/instanceData.properties -grants="user1:VIEW_JOB;user2:FULL_JOB" -notification="scheduled, action required, running" -schedule="start_time:2012/12/25 00:00;tz:American/New York;grace_period:60"
Provisioning Pluggable Databases
This section provides information on how to provision pluggable databases (PDBs) using EM CLI. It contains the following:
Provisioning a Pluggable Database Using a Snapshot Profile
When a PDB is cloned using the Snap Clone method, you can choose to create a snapshot profile out of the created snapshot, save the snapshot profile in Software Library, then use the snapshot profile later to provision PDBs. Using this method, you can provision a stable, standardized, and up-to-date PDB on a large number of hosts, without having to create a snapshot of the source PDB during each provisioning operation.
This section consists of the following:
Prerequisites for Provisioning a Pluggable Database Using a Snapshot Profile
Ensure that you meet the following prerequisites before provisioning a PDB using a snapshot profile:
-
The 12.1.0.6 Enterprise Manager for Oracle Database plug-in, or a higher version, must be downloaded and deployed in your system.
-
The prerequisites for cloning a PDB using the Snap Clone method, (described in Prerequisites for Cloning a Pluggable Database) must be met.
Migrating a Non-Container Database as a Pluggable Database
To migrate a non-container database (CDB) as a PDB, follow these steps:
Patching Using EM CLI
This section contains the following:
Before You Begin Patching
Keep the following points in mind before patching the targets using EM CLI:
-
Target information like: target name, target type, target version, release number, platform, product and so on ready.
-
Patch information like: Patch Name (Patch Number), Release ID, Platform ID, and Language ID ready.
-
Set at least one of the following credentials on the Oracle home of the target host machines before beginning the patching process:
-
Oracle Home Named Credentials
-
Privileged Oracle Home Named Credentials
-
-
Setup Privilege Delegation through Sudo or PowerBroker, and apply the templates to the host target when you do not have the access (Username/Password) for the
Oracle
account orroot
account. -
Set one of the following modes before patching:
-
Online Mode: This mode is helpful when you have internet connectivity. However, to search and download the patches from My Oracle Support, you need to set the preferred credentials for My Oracle Support.
-
Offline Mode: This mode can be used for patching provided you have already downloaded the patches to the Software Library. You can then search for them on Software Library.
-
Patching Using EM CLI
Targets can be patched using Enterprise Manager Command Line Interface. You do not necessarily need Cloud Control to download and apply patches.
The following table describes EM CLI patching scenarios:
Table A-4 EM CLI Patching Scenarios
Case No | Scenario | Hign Level Steps |
---|---|---|
Case 1 |
Creating a new properties file for patching targets. |
To patch targets using a fresh properties file, follow these steps:
For details about how to use the EM CLI commands to perform each of the steps see Creating a New Properties File for Patching Targets. |
Case 2 |
Updating the properties file of an existing patch plan to patch the targets. |
To update a properties file retrieved from an existing patch plan, follow these steps:
For details about how to use the EMCLI commands to perform each of the steps see Using the Properties File of an Existing Patch Plan to Patch the targets. |
Creating a New Properties File for Patching Targets
If you are creating the patch plan from scratch, then you need to create the properties file afresh, and submit this properties file as input for creating the plan. To do so, follow these steps:
-
Select the targets that need to be patched. To do so, run the following EM CLI command:
emcli get_targets [-targets="[name1:]type1;[name2:]type2;..."] For example: emcli get_targets -targets=oracle_emd Output: Displays all the Management Agent targets.
Status ID Status Target Type Target Name 2
Metric collection on Error
oracle_emd
h1.us.example.com:5125
2
Metric collection on Error
oracle_emd
h2.us.example.com:5125
1
Up
oracle_emd
slc01nha.us.example.com:11852
1
Up
oracle_emd
slc00bng.us.example.com:1833
1
Up
oracle_emd
adc2101349.us.example.com:1832
-
Search for the patches that you want to apply. To find the relevant patches for your plan, you either need to use the Patch ID (Basic Search), or use a combination of Release ID, Platform ID, and Product ID (Advanced Search) and drill down to the patches required. To do so, run the following EM CLI command:
emcli search_patches [-swlib] [-patch_name="patch_name"] [-product="product id" [-include_all_products_in_family]] [-release="release id"] [-platform="platform id" | -language="language id"] [-type="patch | patchset"] [-noheader] [-script | -xml | -format= [name:<pretty|script|csv>]; [column_separator:"column_sep_string"]; [row_separator:"row_sep_string"]; ]
Note:
You can search for patches in one of the following locations:
• ARU Site
• Software Library
If you have internet connectivity, then you are in online mode, and by default can look for patches on the ARU site. However, if you are in offline mode, then you must ensure that the patches are already uploaded to Software Library so you can use them.
You can perform searches in one of the following modes using EM CLI:
• Simple Search: This mode allows you to search the ARU site or Software Library using the patch ID information.
• Advanced Search: This mode allows you to provide a combination of key values like platform ID, Language ID, Release ID, and/or product ID to drill down to the patch that you are looking for.
You can use the following syntax, and the corresponding examples to perform simple and advanced search using EM CLI commands:
-
(Basic Search) To search for the patches using the Patch ID, do the following:
emcli search_patches [-swlib] [-patch_name="patch_name"] [-product="product id" [-include_all_products_in_family]] [-release="release id"] [-platform="platform id" | -language="language id"] [-type="patch | patchset"] [-noheader] [-script | -xml | -format= [name:<pretty|script|csv>]; [column_separator:"column_sep_string"]; [row_separator:"row_sep_string"]; ]
Example 1: Basic Search (Online Mode) To search for patches on My Oracle Support using the Patch ID: emcli search_patches -patch_name=11993573 Output: 11993573 Agent Plugin PATCH Cloud Control (Agent) 12.1.0.1.0 Linux x86-64 American English General Enterprise Manager Base Platform - Plugin Example 2: Basic Search (Offline Mode) To search for patches on Software Library using the patch ID: emcli search_patches -patch_name=11993573 -swlib -script Output: 11993573 Agent Plugin PATCH Cloud Control (Agent) 12.1.0.1.0 Linux x86-64 American English General Enterprise Manager Base Platform - Plugin
-
(Advanced Search) Use the Product ID, Release ID, and Plaform ID (or Language ID) to get the patch details that you want to add to the patch plan.
Example: To search for patches using a combination of Product ID, Release ID, and Platform ID (obtained from the earlier steps): emcli search_patches -product=12383 -release=9800371121010 -platform=226 Output: 13491785 ENTERPRISE MANAGER BASE PLATFORM - AGENT 12.1.0.1.0 BP1 (PORT) Cloud Control (Agent) 12.1.0.1.0 Linux x86-64 American English Recommended Enterprise Manager Base Platform13481721 WRONG ERROR MESSAGE RETURNED FROM NMO Cloud Control (Agent) 12.1.0.1.0 Linux x86-64 American English General Enterprise Manager Base Platform
-
-
Create a patch-target map (stored in the properties file) using any editor, and supply information like Patch ID, Release ID, Platform ID, and Language ID. Here is a sample properties file:
vi demo.props patch.0.patch_id=13426630 patch.0.release_id=9800371121010 patch.0.platform_id=2000 patch.0.language_id=0 patch.0.target_name=abc1.example.com:1836 patch.0.target_type=oracle_emd patch.1.patch_id=13426630 patch.1.release_id=9800371121010 patch.1.platform_id=2000 patch.1.language_id=0 patch.1.target_name=abc2.us.example.com:1839 patch.1.target_type=oracle_emd
-
Run the create_patch_plan command to create the plan, and supply the newly created properties file (
demo.props
) as input:emcli create_patch_plan -name="name" -input_file=data:"file_path" [-impact_other_targets="add_all | add_original_only | cancel"] Example: emcli create_patch_plan -name=demo_agent -input_file=data:demo.props -impact_other_targets=add_all
Note:
If the selected target impacts other targets, then you need to add
impact_other_targets with the value "add_all"
. For example, if one of the agents running on the NFS home is selected for patching, other agent based on the same NFS home will also be impacted while patching, so they are all required to present in the patch plan. -
After you have created the patch plan with all the relevant data, you can submit your patch plan in the Analyze mode to verify if the plan is deployable or not. To do so, run the follwing command:
emcli submit_patch_plan -name=demo_agent -action=analyze Output: The action "analyze" is successfully submitted on the Patch Plan "demo_agent", now "analyze" is in progress.
The Analyze mode facilitates the plan to perform all the validations to ensure that the plan is deployable. Only once the analysis is successful you should deploy the plan.
-
To verify the status of the patch plan, run the following EM CLI command:
emcli show_patch_plan -name=demo_agent -info | grep plan_status Output: <plan_status>CONFLICTS</plan_status>
If you see any conflicts, then you must resolve them before deploying the plan. You can use the User Interface to resolve the issues, and then rerun the plan until the status is CLEAN.
-
After a successful analysis, you can deploy the patch plan. To do so, run the following command with action deploy:
emcli submit_patch_plan -name=agent_demo -action=deploy Output: The action "deploy" is successfully submitted on the Patch Plan "demo_agent", now "deploy" is in progress
-
To verify the status of the plan, run the EM CLI command
show_patch_plan
as mentioned in step 6. Only when the output of the command isDEPLOY_SUCCESS,
it means that the plan has been successfully deployed, and the targets mentioned in the patch plan have been patched.emcli show_patch_plan -name=demo_agent -info Output: <plan> <planDetails> <plan_id>79CAF6A6DAFCFEE6654C425632F19411</plan_id> <name>demo</name> <type>PATCH</type> <description/> <conflict_check_date>Tue Feb 21 18:04:04 PST 2012</conflict_check_date> <conflict_check_date_ms>1329876244000</conflict_check_date_ms> <is_deployable>1</is_deployable> <plan_status>CONFLICTS</plan_status> <review_status>CONFLICT_FREE</review_status> <created_date>Tue Feb 21 17:40:47 PST 2012</created_date> <created_date_ms>1329874847000</created_date_ms> <created_by>SYSMAN</created_by> <last_updated_date>Tue Feb 21 17:58:29 PST 2012</last_updated_date> <last_updated_date_ms>1329875909000</last_updated_date_ms> <last_updated_by>SYSMAN</last_updated_by> <grant_priv>yes</grant_priv> <user_plan_privilege>FULL</user_plan_privilege> <see_all_targets>N</see_all_targets> <homogeneousGroupLabel>Database Instance 10.2.0.1.0 (Linux x86-64)</homogeneousGroupLabel> <executeGuid/> <executeUrl/> <planDetails/>
-
To get the details of the patching procedure/job that you submitted, use the GUID of the execution in the command get_job_execution_details as follows:
emcli get_job_execution_detail -execution={execution_id} [-xml [-showOutput [-tailLength={length}]]] For Example: emcli get_job_execution_detail -execution=79CAF6A6DAFCFEE6654C425632F19411 -xml
WorkFlow Examples Using EM CLI Commands
The following sections describe some of the provisioning, patching, and Software Library tasks that can be performed using EM CLI commands:
Provisioning Oracle Database Software
This use case describes how to provision an Oracle Database Software using the EM CLI commands available in Cloud Control. The first step is to filter out the database procedures running in your enterprise, from the list, select the Single Instance Database procedure and its corresponding GUID. For the SI DB procedure, a new properties file is created from scratch. Initially, the name-value pair in the template will be empty, you must edit the attributes in the properties file to update the values. Following which the procedure is submitted with the updated properties file as the input, and tracked to completion.
Note:
The following verb clones only Oracle Database 9i Release 2: emcli clone_database_home -swlib true.
Here is the step-by-step procedure with the outputs:
Provisioning Oracle WebLogic Server
This use case describes how to provision an Oracle WebLogic Server, and how to Scale up and Scale out Middleware procedures using the EM CLI commands available in Cloud Control.
Cloud Control supports the following usecases for provisioning Oracle WebLogic Server using EM CLI commands:
Prerequisites for Provisioning Oracle WebLogic Server
-
Ensure that you have setup a WebLogic Domain with Administrator Server and Managed Server, and registered your targets with the OMS so that your host target is discovered on the Middleware Provisioning Page.
-
Create the WebLogic Domain Provisioning Profile, this ensures that the domain selected and its Middleware Home are archived and stored in the software library for future cloning operations. You can use this profile while cloning a WebLogic domain.
Provisioning Oracle WebLogic Server Using the Provisioning Profile
The first step is to filter out the FMW procedures running in your enterprise, from the list, select the FMWPROV
procedure and its corresponding GUID. For the FMWPROV
procedure, a new properties file template is created from scratch. Initially, the name-value pair in the template will be empty, you must edit the attributes in the properties file to update the values. Following which the procedure is submitted with the updated properties file as the input, and tracked to completion.
Follow these steps:
Scaling Up or Scaling Out Middleware Deployment Procedure
The process of increasing a cluster's capacity by adding additional server instances to the cluster on an existing machine, or adding machines to the cluster to host the new server instance, is called Scaling up. Scaling Up and Scaling Out Managed Server can be achieved through the command line using EM CLI commands available in Enterprise Manager 13c.
In this use case, the Instance GUID of the SCALEUP
procedure is retrieved, which in turn is used to retrieve the input properties file of this instance of the procedure. After making necessary updates to the properties file, like adding another user-friendly so on, the procedure is submitted with the updated properties file as the input:
Here is the step-by-step process:
Provisioning User Defined Deployment Procedure
This use case describes how to provision a User Defined Deployment Procedure (UDDP) using the EM CLI commands available in Cloud Control. This use case essentially covers, creating the UDDP using the Cloud Control UI, and then submitting the UDDP using the EM CLI commands.
In this use case, a User Defined Deployment Procedure to provision JRE6 on a Linux host abc.example.com
is created using the Cloud Control UI. Steps like Transfer JRE and Check JRE Version are added to the procedure, and the procedure is submitted with a unique submission name. EM CLI command is then used to retrieve the instance GUID of the procedure submitted. Minor modifications are made to the properties file, and then submitted through EM CLI.
Prerequisites for Provisioning User Defined Deployment Procedure
Ensure that you meet the following prerequisites:
-
Log in to Cloud Control as a designer.
-
Create Software Library directive to install JRE6 on Linux in the following directory:
/software_library/provisioning/install_jre6_linux32
. Note, you can choose any directory that you want. -
Create Software Library component containing hotspot JRE6 for Linux in the following directory:
/software_library/provisioning/hotspot_jre6_linux32
.
Adding Steps and Phases to User Defined Deployment Procedure Using GUI
To add phases and steps to User Defined Deployment Procedure (UDDP), log in to Cloud Control as a Designer, and follow these steps:
-
In Cloud Control, from the Enterprise menu, select Provisioning and Patching, then select Procedure Library.
-
On the Provisioning page, from the Actions menu select Create New, and click Go.
-
Provide a unique name for your procedure UDDPTest , and click Procedure Steps tab.
-
On the Procedure Variables tab, add a procedure variable called
destination_path
. -
Select the Default Phase, and click Insert to add a new step to the phase. On the Create wizard select Type as Library:Component. The page refreshes, and a five-step wizard appears.
-
On the Create page, enter a unique name Transfer JRE, and then click Next.
-
On the Select Component page, select the Component hotspot_jre6_linux32.
-
On the Select Directive page, select the directive install_jre6_linux32.
-
On the Map Properties page, map the directive properties with the variables defined. For example, set the
destination_path
directive property toChoose Variable
, and then choose the procedure variable that you setdestination_path.
-
On the review page, review the details, and click Finish.
-
-
Select the step Transfer JRE, and click Insert. On the Create Wizard, select Type Host Command. The page refreshes, and a three-step wizard appears.
-
On the Create page, enter a unique name Check JRE Version, and then click Next.
-
On the Enter Command page, enter the following command:
${data.destination_path}/jre1.6.0_23/bin/java -version
-
On the review page, review the details, and click Finish.
-
-
Go back to the Procedure Library page, and select the UDDPTest procedure that you just created, and click Launch. To complete the wizard enter the following details: target where you want to provision your procedure, variable (destination path:
/tmp
), credential info, and notification information. -
Once you have provided all the details, click Submit. Enter the a unique Submission name FirstUDDP.
-
After the procedure has run, verify the output of the Check JRE Version step. Ideally the version should be
JRE6.
Patching WebLogic Server Target
This procedure describes how to create a patch plan, update the values in them, and submit them to deploy patches on the selected targets. This workflow captures end-to-end steps on patching WLS targets. The process of patching is the same irrespective of the targets selected.
To patch WebLogic Server targets, follow these steps:
Creating a New Generic Component by Associating a Zip File
To upload a zip file as a new component, follow these steps:
Step 1: Identifying the Parent Folder in Software Library
Any new entity created in Software Library must be placed in a folder. You can either choose an existing folder, or create a new one. To do so, follow these sections:
Creating a New Folder
To create a new folder, the parent folder should be identified. If the parent folder is the root folder (displayed as the top level "Software Library" folder), then use the following EM CLI verb:
emcli create_swlib_folder -name="myFolder" -desc="myFolder description" -parent_id=ROOT
Output:
Folder myFolder
is created in Software Library
folder, identifier is oracle:defaultService:em:provisioning:1:cat:C771B5A38A484CE3E40E50AD38A69D2
.
You can use the identifier of the newly created folder that is part of the output message when creating or modifying entities, or for creating other sub-folders.
Choosing an Existing Folder
To choose an existing folder, you can use either of the following approaches:
Approach 1: Using Enterprise Manager UI
Follow these steps:
- From the Enterprise menu, select Provisioning and Patching, then select Software Library.
- On the Software Library home page, from View menu select Columns, and then select Internal ID. By default, the Internal ID column is hidden.
- Copy the Internal ID column value of the folder you want.
Approach 2: Using Enterprise Manager Command Line Interface
Use the following EM CLI verb:
emcli list_swlib_folders -parent_id=ROOT -show_folder_id
Output:
Java EE Provisioning,Java EE Application Provisioning Entities,oracle:defaultService:em:provisioning:1:cat:C771B5AAF4A4EED9E040E50AD38A6E98
MultiOMS,List of Oracle shipped Directives,oracle:defaultService:em:provisioning:1:cat:C771B5AAF1ACEED9E040E50AD38A6E98
myFolder,myFolder description,oracle:defaultService:em:provisioning:1:cat:C771B5A38A484CE3E040E50AD38A69D2
OSBProvisioning,OSBProvisioning Entities,oracle:defaultService:em:provisioning:1:cat:C771B5AAF3F1EED9E040E50AD38A6E98
..........
If the folder you want to access is a sub-folder of myFolder
, then use the following verb to list the sub-folders by specifying the identifier of myFolder
, as follows:
emcli list_swlib_folders -parent_id='oracle:defaultService:em:provisioning:1:cat:C771B5A38A484CE3E040E50AD38A69D2' -show_folder_id
Output:
mySubFolder,mySubFolder description,oracle:defaultService:em:provisioning:1:cat:C771B5A38A494CE3E040E50AD38A69D2
Step 2: Creating a Generic Component Entity
To create an entity of type Component
and subtype Generic Component
under mySubFolder
folder, follow these sections:
Step 1a. Identifying the Entity Type
To list all the available types in Software Library, use the following verb:
emcli list_swlib_entity_types -show_type_id
Output:
Component, COMP_Component Directives, COMP_Directives Bare Metal Provisioning, BMPType Virtualization, Virtualization
Step 1b. Identifying the Entity Subtype
To list all the subtypes for the component
type, use the following verb:
emcli list_swlib_entity_subtypes -entity_type_id=COMP_Component -show_subtype_id
Output:
Generic Component, SUB_Generic
Oracle Database Software Clone, SUB_OracleDB
Configuration Template, SUB_ConfigTmpl
SUB_OracleAS
Self Update, SUB_SelfUpdate
Oracle Clusterware Clone, SUB_OracleCRS
Service Bus Resource, SUB_OSBResource
Oracle Software Update, SUB_OraSoftUpdate
Java EE Application, SUB_JavaEEApplication
Installation Media, SUB_InstallationMedia
Database Template, SUB_DbCreateTemplate
Database Provisioning Profile, SUB_DbProfile
WebLogic Domain Provisioning Profile, SUB_FMWBundle
WebLogic Domain Clone, SUB_WLSTemlpate
Oracle Middleware Home Gold Image, SUB_FMWImage
Step 2. Creating a Generic Component Entity
To create a generic component, run the following verb:
emcli create_swlib_entity -name=myEntity -type=COMP_Component -subtype=SUB_Generic -folder_id='oracle:defaultService:em:provisioning:1:cat:C771B5A38A494CE3E040E50AD38A69D2' -desc='myEntity description' -attr="PRODUCT:Example" -attr="PRODUCT_VERSION:3.1" -attr="VENDOR:Example Corp" -note='first comment for myEntity
Note:
The type and subtype options are optional when creating a Generic Component, but has been used explicitly for this illustration.
Output:
Entity 'myEntity' is created in 'mySubFolder' folder, identifier is 'oracle:defaultService:em:provisioning:1:cmp:COMP_Component:SUB_Generic:C77200CA9DC1E7AAE040E50AD38A1599:0.1'
Note:
You can use the identifier of the newly created entity that is part of the output message when uploading files or modifying the entity.
To verify the newly created entity, use the following verb:
emcli list_swlib_entities -name=myEntity -folder_id='oracle:defaultService:em:provisioning:1:cat:C771B5A38A494CE3E040E50AD38A69D2'
Output:
myEntity,0.1,myEntity description,Ready,Component,Generic Component,Untested,SYSMAN
Step 3: Associating a Zip File to the Generic Component
To upload a zip file to an existing entity myEntity
, use the following verb:
emcli upload_swlib_entity_files -entity_rev_id='oracle:defaultService:em:provisioning:1:cmp:COMP_Component:SUB_Generic:C77200CA9DC1E7AAE040E50AD38A1599:0.1' -file="/scratch/user1/patch13653908.zip;newfile1.zip" -host="host.us.example.com" -credential_name=mycred11 -credential_owner=sysman
Note:
A new revision of the entity myEntity
will be created after the upload is complete.
Output:
Upload of file(s) initiated, this may take some time to complete... Upload of file(s) completed successfully. Entity 'myEntity (0.2)' in 'mySubFolder' folder has been created, identifier is 'oracle:defaultService:em:provisioning:1:cmp:COMP_Component:SUB_Generic:C77200CA9DC1E7AAE040E50AD38A1599:0.2'.
Alternately, to refer to a zip file present in an HTTP reference location, say myScripts
, use the following verb:
emcli refer_swlib_entity_files -entity_rev_id='oracle:defaultService:em:provisioning:1:cmp:COMP_Component:SUB_Generic:C77200CA9DC1E7AAE040E50AD38A1599:0.1' -file='scripts/perl/script1.pl;new_script.pl' -refer_storage='myScripts;Http'
Output:
Entity 'myEntity (0.2)' in 'mySubFolder' folder has been created, identifier is 'oracle:defaultService:em:provisioning:1:cmp:COMP_Component:SUB_Generic:C77200CA9DC1E7AAE040E50AD38A1599:0.2'.
Step 4: Verifying the Newly Created Entity
To verify the newly created entity, use the following verb:
emcli list_swlib_entities -name=myEntity -folder_id='oracle:defaultService:em:provisioning:1:cat:C771B5A38A494CE3E040E50AD38A69D2'
Output:
myEntity,0.1,myEntity description,Ready,Component,Generic Component,Untested,USERNAME
Migrate and Remove a Software Library Storage Location
This use case describes how to Migrate and Remove an existing storage location. In the following example, a Software Library Upload File storage location has already been configured. Files can be migratedfrom one storage location to another, of the same or different storage type.
In the following example, the first storage location is named 'firstLoc' and is an OMS Agent File System storage type. The second storage location is an OMS Shared File System storage location, named 'secondLoc'.
Step 1: Adding a Destination Storage Location for Migrating Files
Any file associated with an entity in Software Library can exist in only one storage location. Removal of an Upload File storage location is always preceded by migration of files to another existing Upload File storage location. As part of this step, a destination storage location of OMS Shared File System storage type is created with sufficient disk space for keeping a copy of all the files in the source storage location, 'firstLoc'.
Add Destination OMS Shared File System Storage Location
emcli add_swlib_storage_location
-name=secondLoc
path=/u01/swlib
type=OmsShared
Sample Output:
Location configuration initiated, this may take some time to complete...
Location 'secondLoc' created.
List OMS Shared File System Storage Location
To verify the creation of the new storage location use the following command.
emcli list_swlib_storage_locations
type=OmsShared
Sample Output:
secondLoc, /u01/swlib/, Active
Step 2: Migrate and Remove an existing storage location
To remove the storage location 'firstLoc' and migrate all the files to storage location 'secondLoc', use the following command.
emcli remove_swlib_storage_location
name=firstLoc
type=OmsAgent
migrate_to_loc=secondLoc
-migrate_to_type=OmsShared
Sample Output:
Job 'MigrateEntityFiles_1352113174929' has been successfully submitted for migrating the files.
The location 'firstLoc' will be removed on successful execution of the job. You can see the detail of the job execution by navigating to Enterprise, Jobs, and then, Activity Page.
Verifying the Status of Source OMS Agent File System Storage Location
Immediately after initiating the migrate and remove operation for storage location 'firstLoc', the location will be marked 'Inactive' to stop any new file uploads to this location. To verify the status of the location, use the following command.
emcli list_swlib_storage_locations
-type=OmsAgent
Sample Output:
firstLoc, /u01/swlib/, Inactive
Once the migrate job is complete, the 'firstLoc' location is not listed, as it is removed.
Adding ATS Service Test from Using EM CLI
This use case describes how you can customize an existing ATS Service Test instance, available in the Test Repository, using custom databank.
Note:
Ensure that you have uploaded an ATS Service Test type to the Test Repository before proceeding with this procedure. For more information on this, see Configuring and Using Services chapter of the Oracle Enterprise Manager Cloud Control Administrator's Guide.
To create an ATS Test instance using the service test available in the repository, and to customize the test by applying a custom databank, follow these steps:
Limitations of Using Enterprise Manager Command Line Interface
Following are the limitations of using EM CLI for running the deployment procedures:
-
You cannot add or edit steps and phases using EM CLI commands. To do so, you must log in to Cloud Control, and follow the steps described in the section Section 33.2.1.
-
You cannot define new variables to be used in the deployment procedures through EM CLI, this can be done only through the Cloud Control UI. For more information about procedure variables, see Section 32.3.2.
-
You cannot track the detailed execution info (such as failures) of an instance through EM CLI, which is possible through the Cloud Control UI.
-
To set the My Oracle Support preferred credentials, you must log in to the Enterprise Manager Cloud Control. There is no command line option to do so.