- Cloud Control Database Lifecycle Management Administrator's Guide
- Appendixes
- Using Enterprise Manager Command Line Interface
- WorkFlow Examples Using EM CLI Commands
- Patching WebLogic Server Target
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:
- Run the following command to search for the release ID of the Oracle WebLogic Release 10.3.5:
emcli list_aru_releases -name="10.3.5" Output: Release ID Release Name Long Release Name 8191035020 10.3.5.0.2 WLS 10.3.5.0.2 8191035010 10.3.5.0.1 WLS 10.3.5.0.1 8191035000 10.3.5 WLS 10.3.5 95103500 10.3.5 WLS 10.3.5
- Run the following command to search for the produc ID of Oracle WebLogic:
emcli list_aru_products -name="Oracle WebLogic Server" Output: Product ID Product Name 15991 Oracle WebLogic Server 16725 Oracle WebLogic Server Virtual Edition
- Run the following command to search for the platform ID of a Generic Platform:
emcli list_aru_platform -name="Generic Platform" Output: Platform ID Platform Name 2000 Generic Platform 1204 NLS Generic Platform
- Search for the Patch ID using the product, release, and platform details that you have from the previous steps as followings:
emcli search_patches -product=15991 -release=8191035000 -platform=2000 Output: 9561331 Generic PLATFORM - 10.3.5 Oracle WebLogic Server 10.3.5 Generic American English Recommended Generic Platform
- Create a patch-target map (properties) file using the vi editor, and supply information like Patch ID, Release ID, and Platform ID, Language ID, and so on. Here is a sample properties file:
vi create.props patch.0.patch_id=9561331 patch.0.release_id=8191035000 patch.0.platform_id=2000 patch.0.language_id=0 patch.0.target_name=/Farm01_soa_domain/soa_domain patch.0.target_type=weblogic_domain
- Run the following command to create the plan, and supply the newly created properties file (
create.props
) as input:emcli create_patch_plan -name=demo1 -input_file=data:create.props Output: The Patch Plan "demo1" is successfuly created.
- To view the user-editable fields of an existing plan, and save the output to a properties file run the following command:
emcli get_patch_plan_data -name=demo1 >set.props vi set.props Output: name=demo1 description= deployment_date= planPrivilegeList=VIEWER:ADMIN:VIEW;OPER:ADMIN:VIEW;DESIGNER:ADMIN:VIEW patch.0.patch_id=9561331 patch.0.release_id=8191035000 patch.0.platform_id=2000 patch.0.language_id=0 patch.0.target_name=/Farm01_soa_domain/soa_domain patch.0.target_type=weblogic_domain deploymentOptions.StageLocation=%emd_emstagedir% deploymentOptions.AdvancedOPatchOptions=AllNodes deploymentOptions.StagePatches=true deploymentOptions.rollbackMode=false
- Edit the properties file (
set.props
) using any editor to change the rollback mode totrue
:name=demo1 description= deployment_date= planPrivilegeList=VIEWER:ADMIN:VIEW;OPER:ADMIN:VIEW;DESIGNER:ADMIN:VIEW patch.0.patch_id=9561331 patch.0.release_id=8191035000 patch.0.platform_id=2000 patch.0.language_id=0 patch.0.target_name=/Farm01_soa_domain/soa_domain patch.0.target_type=weblogic_domain deploymentOptions.StageLocation=%emd_emstagedir% deploymentOptions.AdvancedOPatchOptions=AllNodes deploymentOptions.StagePatches=true deploymentOptions.rollbackMode=true
- To save the patch plan with the new edited data, run the following command:
emcli set_patch_plan_data -name=demo1 -input_file=data:set.props Output: It is successfully updating deployment options from the patch plan.
- To verify the status of the patch plan, run the following EM CLI command:
emcli show_patch_plan -name=demo1 -info Output: <plan> <planDetails> <plan_id>EDD74FFF006DD0EE6D28394B8AAE</plan_id> <name>demo1</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><USERNAME></last_updated_by> <grant_priv>yes</grant_priv> <user_plan_privilege>FULL</user_plan_privilege> <see_all_targets>N</see_all_targets> <homogeneousGroupLabel>Oracle WebLogic Domain 10.3.5.0 (Linux x86-64)</homogeneousGroupLabel> <executeGuid/> <executeUrl/> <planDetails/>
- After you have created and updated the patch plan with all the relevant data, you can submit your patch plan in the following sequence of modes. The EM CLI command used to submit the patch plan is:
emcli submit_patch_plan -name=demo1 -action=analyze Output: The action "analyze" is successfully submitted on the Patch Plan "demo1", now "analyze" is in progress.
- To verify the status of the patch plan submitted, run the following EM CLI command:
emcli show_patch_plan -name=demo1 -info Output: <plan> <planDetails> <plan_id>EDD74FFF006DD0EE6D28394B8AAE</plan_id> <name>demo1</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>USERNAME</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>USERNAME</last_updated_by> <grant_priv>yes</grant_priv> <user_plan_privilege>FULL</user_plan_privilege> <see_all_targets>N</see_all_targets> <homogeneousGroupLabel>Oracle WebLogic Domain 10.3.5.0 (Linux x86-64)</homogeneousGroupLabel> <executeGuid/> <executeUrl/> <planDetails/>
- To check if there are any conflicts, run the following command:
emcli show_patch_plan -name=planName -analysisResults Output: <plan_status>CONFLICTS</plan_status>
You can verify the plan you have created by logging in to Enterprise Manager Cloud Control, from Enterprise menu, select Provisioning and Patching, then select Patches and Updates. On the home page, you will see the patch plan demo1 that you have created using the command line as follows:
You can resolve the conflicts using the UI, and then submit the patch plan.
- Run the command
show_patch_plan
after resolving the conflicts to verify the status of the plan as follows:Output: <plan> <planDetails> <plan_id>EDD74FFF006DD0EE6D28394B8AAE</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>INPROGRESS</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>USERNAME</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>USERNAME</last_updated_by> <grant_priv>yes</grant_priv> <user_plan_privilege>FULL</user_plan_privilege> <see_all_targets>N</see_all_targets> <homogeneousGroupLabel>Oracle WebLogic Domain 10.3.5.0 (Linux x86-64)</homogeneousGroupLabel> <executeGuid>BA8E3904DDB36CFFE040F00A5E644D13</executGuid> <executeUrl>/em/console/paf/procedureStatus?executionGUID=BA8E3904DDB36CFFE040F00A5E644D13</executeUrl> <planDetails/>
- Run the following command to determine the status of the patch plan execution:
emcli get_instance_status -instance=BA8E3904DDB36CFFE040F00A5E644D13 Output: BA8E3904DDB36CFFE040F00A5E644D13, PatchOracleSoftware, demo1_Analysis_Tue Mar 06 02:08:02 PST 012, EXECUTING
- After a successful analysis, you can deploy/prepare the patch plan. To do so, run the following command with action deploy:
emcli submit_patch_plan -name=demo1 -action=deploy Output: The action "deploy" is successfully submitted on the Patch Plan "demo1", now "deploy" is in progress
- Use the Cloud Control UI to see of the submitted plan has successfully been deployed. Alternately, you can verify the same using the EM CLI command:
emcli get_job_execution_detail -execution=79CAF6A6DAFCFEE6654C425632F19411 -xml