Patching Exadata Cloud at customer(ExaCC) using exadbcpatchmulti
Dear readers in today’s post , I will be showing you how to patch database home or grid home installed on ExaCC systems .
There are two ways to patch the db/grid home in ExaCC.
1.Using ExaCC console http://parwezexa.com/patching-exadata-cloudcustomer-exacc-using-console/
2.Using exadbcpatchmulti utility from back end .
In today’s post we will be using method 2 i.e patching with the help of exadbcpatchmulti. Exadbcpatchmulti
utility to perform assisted patching operations for Oracle Grid Infrastructure and Oracle Database on Exadata Cloud at Customer. The exadbcpatchmulti
utility is located under /var/opt/oracle/exapatch
on every compute node
Few consideraion before using exadbpatchmulti
- The
exadbcpatchmulti
command requires root administration privileges. Therefore, you need to connect to the compute node as theopc
user and then start a root-user command shell to perform patching operations - The
exadbcpatchmulti
command uses the cloud-specific tooling , specific patches may require functionality provided by a specific version of the tools . Try to use the latest update for the tooling.
This patch is a three part patch which include
1.Listing the available patch on you local object storage url , you can check if the object storage url is configured or not using
[root@parwezExaCC dbinput]# cat /var/opt/oracle/exapatch/exadbcpatch.cfg |grep oss_con oss_container_url="https://storage.region.cust_id.oraclecloudatcustomer.com/v1/Storage-idcs-cloudinfra-sa2/dbaas_patch"
2.Running prerequisites before applying a patch.
3.Applying the patch
- Listing the available patch
[root@ parwezExaCC ~]# /var/opt/oracle/exapatch/exadbcpatchmulti -list_patches -oh= parwezExaCC:/u02/app/oracle/product/12.2.0/dbhome_2 INFO: cmd is: /var/opt/oracle/exapatch/exadbcpatch -list_patches -patch_homes=/u02/app/oracle/product/12.2.0/dbhome_2 -dbnames=DBCDB Starting EXADBCPATCH Logfile is /var/opt/oracle/log/exadbcpatch/exadbcpatch_2020-04-19_12:09:52.162474172912.log Config file is /var/opt/oracle/exapatch/exadbcpatch.cfg INFO: dbversion detected : 12201 INFO: patching type : psu INFO: images available for patching INFO: patch_all_dbs is set to $VAR1 = { 'last_async_precheck_txn_id' => '19', 'last_async_apply_txn_id' => '23', 'errmsg' => '', 'err' => '', 'current_version' => '12.2.0.1.180717', 'last_async_precheck_patch_id' => '30501894', 'current_patch' => '28183653', 'last_async_apply_patch_id' => '30501894', 'patches' => [{ 'patchid' => '28714316', 'last_precheck_txnid' => '', 'description' => 'DB 12.2.0.1.181016 DATABASE RELEASE UPDATE (Oct 2018)' }, { 'patchid' => '28828733', 'last_precheck_txnid' => '', 'description' => 'DB 12.2.0.1.190115 DATABASE RELEASE UPDATE (Jan 2019)' }, { 'patchid' => '29301687', 'last_precheck_txnid' => '', 'description' => 'DB 12.2.0.1.190416 DATABASE RELEASE UPDATE (Apr 2019)' }, { 'patchid' => '29708720', 'last_precheck_txnid' => '', 'description' => 'DB 12.2.0.1.190716 DATABASE RELEASE UPDATE (Jul 2019)' }, { 'patchid' => '30116802', 'last_precheck_txnid' => '', 'description' => 'DB 12.2.0.1.191015 DATABASE RELEASE UPDATE (Oct 2019)' }, { 'patchid' => '30501932', 'last_precheck_txnid' => 12, 'description' => 'DB 12.2.0.1.200114 DATABASE RELEASE UPDATE (Jan 2020)' } ] }; {"last_async_precheck_txn_id":"19","last_async_apply_txn_id":"23","err":"","errmsg":"","current_version":"12.2.0.1.180717", "last_async_precheck_patch_id":"30501894","current_patch":"28183653","last_async_apply_patch_id":"30501894", "patches":[{"patchid":"28714316","last_precheck_txnid":"", "description":"DB 12.2.0.1.181016 DATABASE RELEASE UPDATE (Oct 2018)"}, {"patchid":"28828733","last_precheck_txnid":"","description":"DB 12.2.0.1.190115 DATABASE RELEASE UPDATE (Jan 2019)"}, {"patchid":"29301687","last_precheck_txnid":"","description":"DB 12.2.0.1.190416 DATABASE RELEASE UPDATE (Apr 2019)"}, {"patchid":"29708720","last_precheck_txnid":"","description":"DB 12.2.0.1.190716 DATABASE RELEASE UPDATE (Jul 2019)"}, {"patchid":"30116802","last_precheck_txnid":"","description":"DB 12.2.0.1.191015 DATABASE RELEASE UPDATE (Oct 2019)"}, {"patchid":"30501932","last_precheck_txnid":"12","description":"DB 12.2.0.1.200114 DATABASE RELEASE UPDATE (Jan 2020)"}]}
The above command will give you list of available patches for the specified DB or Grid home( whichever you want to patch , I am patching my db home in this example) available in you object storage . After the list phase , you need to check the prereq if there is any issue ot conflicting patch is there which might cause the patch to fail .
2. PreCheck before applying the actual patch
/var/opt/oracle/exapatch/exadbcpatchmulti -precheck_async 30501932 -instance1= parwezExaCC:/u02/app/oracle/product/11.2.0/dbhome_3 [root@parwezExaCC dbinput]# /var/opt/oracle/exapatch/exadbcpatchmulti -precheck_async 30501932 -instance1=parwezExaCC:/u02/app/oracle/product/11.2.0/dbhome_3 INFO: Master transaction id is : 79 79 INFO: Acquired ohome lock for /u02/app/oracle/product/11.2.0/dbhome_3. Proceeding to acquire local provisioning lock INFO: Acquired local provisioning lock in exadbcpatchmulti INFO: sshkey being used is /home/opc/.ssh/id_rsa for parwezexa.oraclecloudatcustomer.com INFO: Successfully released ohome lock. Proceeding to release local provisioning lock INFO: Successfully released local provisioning lock INFO: -precheck_async completed on all nodes For me DBCDB is using the specified db home , so patch_id 30501932 will apply DB 12.2.0.1.200114 DATABASE RELEASE UPDATE (Jan 2020) to my db.
3. Apply the patch
[root@parwezExaCC dbinput]# /var/opt/oracle/exapatch/exadbcpatchmulti -apply_async 30501932 -instance1= parwezExaCC:/u02/app/oracle/product/11.2.0/dbhome_3 -run_datasql=1 executes the SQL commands associated with the patch or rollback operation. -run_datasql=0 does not execute the SQL commands associated with the patch or rollback operation. INFO: Master transaction id is : 81 81 INFO: Acquired ohome lock for /u02/app/oracle/product/11.2.0/dbhome_3. Proceeding to acquire local provisioning lock INFO: Acquired local provisioning lock in exadbcpatchmulti INFO: sshkey being used is /home/opc/.ssh/id_rsa for parwezexa.oraclecloudatcustomer.com INFO: status of slave txn###: Patching completed on parwezexa.region.oraclecloudatcustomer.com INFO: -apply_async completed on e parwezexa.region.oraclecloudatcustomer.com:/u02/app/oracle/product/11.2.0/dbhome_3 INFO: Successfully released ohome lock. Proceeding to release local provisioning lock INFO: Successfully released local provisioning lock INFO: -apply_async completed on all nodes
To check the status during the patch of after completion , please note the Master transaction id, which was displayed when we run precheck or apply_async . In our case the Master transaction id was 81. [parwezExaCC]# /var/opt/oracle/exapatch/exadbcpatchmulti -get_status 81 -oh=parwezexa.region.oraclecloudatcustomer.com:/u02/app/oracle/product/11.2.0/dbhome_ INFO: transaction id given : 81 {"msg":"","status":"Patching completed","ts":"1589914966","errmsg":"","err":"","patchnum":"30805507","patch_homes":"/u02/app/oracle/product/11.2.0/dbhome_3","action":"apply_async","module":"exadbcpatch"}
logs of apply_async : [root@parwezExaCC ~]#cat /var/opt/oracle/log/exadbcpatch/exadbcpatch_2020-02-24_09:47:47.724187214975.log 2020-02-24 09:47:47.727834 - DBAAS Tooling Log [444241415320546f6f6c696e67204c6f67]:/var/opt/oracle/log/exadbcpatch 2020-02-24 09:47:47.749850 - Output from cmd /u02/app/oracle/product/12.2.0/dbhome_2/srvctl config database run on localhost is: 2020-02-24 09:47:48.235410 - EDGEXTT fsdb 2020-02-24 09:47:48.235584 - cmd took 0.48514986038208 seconds 2020-02-24 09:47:48.517593 - RPM: dbaastools_exa-1.0-1+19.1.1.1.0_191011.0301.x86_64 2020-02-24 09:47:48.517795 - Starting EXADBCPATCH 2020-02-24 09:47:48.517934 - Logfile is /var/opt/oracle/log/exadbcpatch/exadbcpatch_2020-02-24_09:47:47.724187214975.log 2020-02-24 09:47:49.788508 - User args to process are -list_upg_patches -patch_homes=/u01/app/12.2.0.1/grid -dbnames=DBCDB 2020-02-24 09:47:49.788743 - processing line -list_upg_patches 2020-02-24 09:47:49.788970 - WARN : No data found for input variable list_upg_patches 2020-02-24 09:47:49.789343 - processing line patch_homes=/u01/app/12.2.0.1/grid 020-02-24 09:47:49.789566 - found match for patch_homes, saving data /u02/app/oracle/product/12.2.0/dbhome_2 2020-02-24 09:47:49.789725 - processing line dbnames= DBCDB 2020-02-24 09:47:49.789898 - found match for dbnames, saving data DBCDB 2020-02-24 09:47:49.794566 - Dump of command line params is 2020-02-24 09:47:49.794696 - $VAR1 = { 'patch_homes' => '/u02/app/oracle/product/12.2.0/dbhome_2 ', 'dbnames' => 'DBCDB ' }; OPatch succeeded. 2020-02-24 09:47:56.635143 - cmd took 1.59244704246521 seconds 2020-02-24 09:47:56.635441 - INFO: version detected of /u02/app/oracle/product/12.2.0/dbhome_2: 12.2.0.1.180717 2020-02-24 09:47:56.635687 - INFO: edition found of /u02/app/oracle/product/12.2.0/dbhome_2: upg 2020-02-24 09:47:56.969779 - INFO: curpatchid is 2020-02-24 09:47:56.974138 - filter1 in last_patchid_for_action 2020-02-24 09:47:56.974263 - $VAR1 = { 'action' => 'equals', 'string' => 'precheck_async', 'element' => 'action' }; 2020-02-24 09:47:56.974595 - filter2 in last_patchid_for_action 2020-02-24 09:47:56.974718 - $VAR1 = { 'action' => 'matches', 'string' => ' /u02/app/oracle/product/12.2.0/dbhome_2', 'element' => 'patch_homes' };
4.If you want to rollback the applied patch use the below command
[root@parwezExaCC ~] /var/opt/oracle/exapatch/exadbcpatchmulti -rollback_async 30501932 -dbnames=DBCDB -run_datasql=(0|1) -sshkey=/home/opc/.ssh/id_rsa
1,246 total views, 2 views today