In this post, we will perform patching on BM (Bare Metals) and VM ( Virtuals Machine) database systems by using DBCLI on the 2-Node RAC running on Oracle Database 19c.
Note: This tool is not applicable to Exadata DB systems.
Prerequisites
- The /u01 directory has at least 15 GB of free space.
- The Oracle Clusterware is up and running on the DB system.
- All nodes of the DB system are up and running.
Before starting the patching, we need to upgrade the DBCLI utility. For that perform the below steps
- Login to OPC user with Public IP/Private IP by using private key. Switch the user to root.
login as: opc Authenticating with public key "rsa-key-20200220" Last login: Fri Feb 28 02:53:09 2020 from 183.83.146.62 [opc@skantdr1 ~]$ sudo su - [root@skantdr1 ~]#
- Update the CLI by using the cliadm update-dbcli command.
[root@skantdr1 bin]# export PATH=/opt/oracle/dcs/bin:$PATH [root@skantdr1 bin]# cliadm update-dbcli Job details ---------------------------------------------------------------- ID: 5e290489-2ec9-4b2b-919b-5c82ddbd489a Description: DcsCli patching Status: Created Created: February 28, 2020 4:40:08 AM UTC Message: Dcs cli will be updated Task Name Start Time End Time Status ------------------------------------------------------------------------ ----------------------------------- ----------------------------------- ---------- [root@skantdr1 bin]#
- Wait for the update job to complete successfully. Check the status of the job by using the dbcli list-jobs command.
[root@skantdr1 bin]# dbcli list-jobs ID Description Created Status ---------------------------------------- --------------------------------------------------------------------------- ----------------------------------- ---------- 9cd00f1c-38c6-4cd5-99b7-513b60f7deb4 Provisioning service creation February 27, 2020 5:31:12 PM UTC Success 4439c4c8-aa73-4974-a44c-21b6496009f2 Authentication key update for DCS_ADMIN February 27, 2020 6:14:08 PM UTC Success 2639eca4-c0ee-4e5f-9eab-d0c77620150e Authentication key update for DCS_ADMIN February 27, 2020 6:15:59 PM UTC Success 07128924-bdd0-4445-b577-54d11f38ef98 DG Config service creation February 27, 2020 6:23:16 PM UTC Success 67ba7f6b-dcd7-420b-8ab9-662f96644d56 DG Status service creation February 27, 2020 6:39:59 PM UTC Success 9062d19f-0b8a-4fd1-b2d8-a711d2af5936 SSH keys update February 27, 2020 6:44:02 PM UTC Success cb7c59a9-4be5-4180-8c2a-75ceb63729d0 SSH key delete February 27, 2020 6:44:23 PM UTC Success 4983e150-3876-4342-af60-5c2b791a9098 SSH key delete February 27, 2020 6:44:24 PM UTC Success 5e290489-2ec9-4b2b-919b-5c82ddbd489a DcsCli patching February 28, 2020 4:40:08 AM UTC Success
- Display the installed patch versions by using the dbcli describe-component command.
[root@skantdr1 bin]# dbcli describe-component System Version --------------- 19.4.3.3.0 Component Installed Version Available Version ---------------------------------------- -------------------- -------------------- GI 19.5.0.0.191015 19.6.0.0.200114 DB 19.5.0.0.191015 19.6.0.0.200114 [root@skantdr1 bin]#
- Display the latest patch versions available in Object Storage by using the dbcli describe-latestpatch command.
[root@skantdr1 bin]# dbcli describe-latestpatch componentType availableVersion --------------- -------------------- gi 12.2.0.1.200114 gi 12.1.0.2.200114 gi 18.9.0.0.200114 gi 19.6.0.0.200114 db 11.2.0.4.200114 db 12.2.0.1.200114 db 12.1.0.2.200114 db 18.9.0.0.200114 db 19.6.0.0.200114 [root@skantdr1 bin]#
- Now, we can perform the prechecks on the server components (Grid InfraStruture) by using the dbcli update-server command with -p argument. Note the Job Id.
[root@skantdr1 bin]# dbcli update-server -p { "jobId" : "ed8f348e-c7e5-4cf7-9bfa-23a0b54dbc8d", "status" : "Created", "message" : null, "reports" : [ ], "createTimestamp" : "February 28, 2020 04:42:15 AM UTC", "resourceList" : [ ], "description" : "Server Patching Prechecks", "updatedTime" : "February 28, 2020 04:42:15 AM UTC", "percentageProgress" : null } [root@skantdr1 bin]#
- Check the job output by using the dbcli list-job command.
[root@skantdr1 bin]# dbcli list-jobs ID Description Created Status ---------------------------------------- --------------------------------------------------------------------------- ----------------------------------- ---------- 9cd00f1c-38c6-4cd5-99b7-513b60f7deb4 Provisioning service creation February 27, 2020 5:31:12 PM UTC Success 4439c4c8-aa73-4974-a44c-21b6496009f2 Authentication key update for DCS_ADMIN February 27, 2020 6:14:08 PM UTC Success 2639eca4-c0ee-4e5f-9eab-d0c77620150e Authentication key update for DCS_ADMIN February 27, 2020 6:15:59 PM UTC Success 07128924-bdd0-4445-b577-54d11f38ef98 DG Config service creation February 27, 2020 6:23:16 PM UTC Success 67ba7f6b-dcd7-420b-8ab9-662f96644d56 DG Status service creation February 27, 2020 6:39:59 PM UTC Success 9062d19f-0b8a-4fd1-b2d8-a711d2af5936 SSH keys update February 27, 2020 6:44:02 PM UTC Success cb7c59a9-4be5-4180-8c2a-75ceb63729d0 SSH key delete February 27, 2020 6:44:23 PM UTC Success 4983e150-3876-4342-af60-5c2b791a9098 SSH key delete February 27, 2020 6:44:24 PM UTC Success 5e290489-2ec9-4b2b-919b-5c82ddbd489a DcsCli patching February 28, 2020 4:40:08 AM UTC Success ed8f348e-c7e5-4cf7-9bfa-23a0b54dbc8d Server Patching Prechecks February 28, 2020 4:42:15 AM UTC Running
- Apply the patch by using the dbcli update-server command. Note the Job Id.
[root@skantdr1 log]# dbcli update-server { "jobId" : "fa0996a6-7f99-48b2-92dc-5c1fb8e20481", "status" : "Created", "message" : null, "reports" : [ ], "createTimestamp" : "February 28, 2020 05:03:24 AM UTC", "resourceList" : [ ], "description" : "Server Patching", "updatedTime" : "February 28, 2020 05:03:24 AM UTC", "percentageProgress" : null } [root@skantdr1 log]#
- Check the job output by using the dbcli describe-job command with the job ID.
[root@skantdr1 log]# dbcli describe-job -i fa0996a6-7f99-48b2-92dc-5c1fb8e20481 Job details ---------------------------------------------------------------- ID: fa0996a6-7f99-48b2-92dc-5c1fb8e20481 Description: Server Patching Status: Running Created: February 28, 2020 5:03:24 AM UTC Message: Task Name Start Time End Time Status ------------------------------------------------------------------------ ----------------------------------- ----------------------------------- ---------- Create Patching Repository Directories[skantdr1] February 28, 2020 5:03:24 AM UTC February 28, 2020 5:03:24 AM UTC Success Create Patching Repository Directories[skantdr2] February 28, 2020 5:03:24 AM UTC February 28, 2020 5:03:24 AM UTC Success Download latest patch metadata[skantdr1] February 28, 2020 5:03:24 AM UTC February 28, 2020 5:03:45 AM UTC Success Download latest patch metadata[skantdr2] February 28, 2020 5:03:45 AM UTC February 28, 2020 5:04:05 AM UTC Success Update Patching Repository[skantdr1] February 28, 2020 5:04:06 AM UTC February 28, 2020 5:06:40 AM UTC Success Update Patching Repository[skantdr2] February 28, 2020 5:06:40 AM UTC February 28, 2020 5:06:40 AM UTC Running
- Once the patching has been completed on Grid Infrastructure of 2-Node RAC. You can verify by using list-jobs, describe-component and describe-job with DBCLI utility.
[root@skantdr1 log]# dbcli describe-job -i fa0996a6-7f99-48b2-92dc-5c1fb8e20481 Job details ---------------------------------------------------------------- ID: fa0996a6-7f99-48b2-92dc-5c1fb8e20481 Description: Server Patching Status: Running Created: February 28, 2020 5:03:24 AM UTC Message: Task Name Start Time End Time Status ------------------------------------------------------------------------ ----------------------------------- ----------------------------------- ---------- Create Patching Repository Directories[skantdr1] February 28, 2020 5:03:24 AM UTC February 28, 2020 5:03:24 AM UTC Success Create Patching Repository Directories[skantdr2] February 28, 2020 5:03:24 AM UTC February 28, 2020 5:03:24 AM UTC Success Download latest patch metadata[skantdr1] February 28, 2020 5:03:24 AM UTC February 28, 2020 5:03:45 AM UTC Success Download latest patch metadata[skantdr2] February 28, 2020 5:03:45 AM UTC February 28, 2020 5:04:05 AM UTC Success Update Patching Repository[skantdr1] February 28, 2020 5:04:06 AM UTC February 28, 2020 5:06:40 AM UTC Success Update Patching Repository[skantdr2] February 28, 2020 5:06:40 AM UTC February 28, 2020 5:08:29 AM UTC Success Opatch updation[skantdr2] February 28, 2020 5:08:32 AM UTC February 28, 2020 5:08:36 AM UTC Success Opatch updation[skantdr1] February 28, 2020 5:08:32 AM UTC February 28, 2020 5:08:36 AM UTC Success Patch conflict check[skantdr1] February 28, 2020 5:08:36 AM UTC February 28, 2020 5:10:30 AM UTC Success Patch conflict check[skantdr2] February 28, 2020 5:10:30 AM UTC February 28, 2020 5:12:22 AM UTC Success apply clusterware patch[skantdr1] February 28, 2020 5:12:22 AM UTC February 28, 2020 5:41:58 AM UTC Success apply clusterware patch[skantdr2] February 28, 2020 5:41:58 AM UTC February 28, 2020 6:10:57 AM UTC Success Updating GiHome version[skantdr1] February 28, 2020 6:10:58 AM UTC February 28, 2020 6:11:22 AM UTC Success Updating GiHome version[skantdr2] February 28, 2020 6:10:58 AM UTC February 28, 2020 6:11:27 AM UTC Success [root@skantdr1 log]# dbcli list-jobs ID Description Created Status ---------------------------------------- --------------------------------------------------------------------------- ----------------------------------- ---------- 9cd00f1c-38c6-4cd5-99b7-513b60f7deb4 Provisioning service creation February 27, 2020 5:31:12 PM UTC Success 4439c4c8-aa73-4974-a44c-21b6496009f2 Authentication key update for DCS_ADMIN February 27, 2020 6:14:08 PM UTC Success 2639eca4-c0ee-4e5f-9eab-d0c77620150e Authentication key update for DCS_ADMIN February 27, 2020 6:15:59 PM UTC Success 07128924-bdd0-4445-b577-54d11f38ef98 DG Config service creation February 27, 2020 6:23:16 PM UTC Success 67ba7f6b-dcd7-420b-8ab9-662f96644d56 DG Status service creation February 27, 2020 6:39:59 PM UTC Success 9062d19f-0b8a-4fd1-b2d8-a711d2af5936 SSH keys update February 27, 2020 6:44:02 PM UTC Success cb7c59a9-4be5-4180-8c2a-75ceb63729d0 SSH key delete February 27, 2020 6:44:23 PM UTC Success 4983e150-3876-4342-af60-5c2b791a9098 SSH key delete February 27, 2020 6:44:24 PM UTC Success 5e290489-2ec9-4b2b-919b-5c82ddbd489a DcsCli patching February 28, 2020 4:40:08 AM UTC Success ed8f348e-c7e5-4cf7-9bfa-23a0b54dbc8d Server Patching Prechecks February 28, 2020 4:42:15 AM UTC Success fa0996a6-7f99-48b2-92dc-5c1fb8e20481 Server Patching February 28, 2020 5:03:24 AM UTC Success [root@skantdr1 log]# dbcli describe-component System Version --------------- 19.4.3.0.0 Component Installed Version Available Version ---------------------------------------- -------------------- -------------------- GI 19.6.0.0.200114 up-to-date DB 19.5.0.0.191015 19.6.0.0.200114
- Before run the precheck, we need the database home ID by using dbcli list-dbhomes.
[root@skantdr1 log]# dbcli list-dbhomes ID Name DB Version Home Location Status ---------------------------------------- -------------------- ---------------------------------------- --------------------------------------------- ---------- c177404f-d22e-46b5-95ac-28ed5b2da50d OraDB19000_home1 19.5.0.0.191015 /u01/app/oracle/product/19.0.0.0/dbhome_1 Configured [root@skantdr1 log]#
- Now, we can start the precheck for the database home by using the dbcli update-dbhome command with -p argument . Note the Job Id.
[root@skantdr1 log]# dbcli update-dbhome -i c177404f-d22e-46b5-95ac-28ed5b2da50d -p { "jobId" : "53aecb87-33a5-4e0d-b430-db563402a8d8", "status" : "Created", "message" : null, "reports" : [ ], "createTimestamp" : "February 28, 2020 06:14:37 AM UTC", "resourceList" : [ ], "description" : "DB Home Prechecks", "updatedTime" : "February 28, 2020 06:14:37 AM UTC", "percentageProgress" : null }
Note: -i is used for Database home ID and -p to run the prechecks.
- Check the job output by using the dbcli list-job command.
[root@skantdr1 log]# dbcli list-jobs ID Description Created Status ---------------------------------------- --------------------------------------------------------------------------- ----------------------------------- ---------- 9cd00f1c-38c6-4cd5-99b7-513b60f7deb4 Provisioning service creation February 27, 2020 5:31:12 PM UTC Success 4439c4c8-aa73-4974-a44c-21b6496009f2 Authentication key update for DCS_ADMIN February 27, 2020 6:14:08 PM UTC Success 2639eca4-c0ee-4e5f-9eab-d0c77620150e Authentication key update for DCS_ADMIN February 27, 2020 6:15:59 PM UTC Success 07128924-bdd0-4445-b577-54d11f38ef98 DG Config service creation February 27, 2020 6:23:16 PM UTC Success 67ba7f6b-dcd7-420b-8ab9-662f96644d56 DG Status service creation February 27, 2020 6:39:59 PM UTC Success 9062d19f-0b8a-4fd1-b2d8-a711d2af5936 SSH keys update February 27, 2020 6:44:02 PM UTC Success cb7c59a9-4be5-4180-8c2a-75ceb63729d0 SSH key delete February 27, 2020 6:44:23 PM UTC Success 4983e150-3876-4342-af60-5c2b791a9098 SSH key delete February 27, 2020 6:44:24 PM UTC Success 5e290489-2ec9-4b2b-919b-5c82ddbd489a DcsCli patching February 28, 2020 4:40:08 AM UTC Success ed8f348e-c7e5-4cf7-9bfa-23a0b54dbc8d Server Patching Prechecks February 28, 2020 4:42:15 AM UTC Success fa0996a6-7f99-48b2-92dc-5c1fb8e20481 Server Patching February 28, 2020 5:03:24 AM UTC Success 53aecb87-33a5-4e0d-b430-db563402a8d8 DB Home Prechecks February 28, 2020 6:14:37 AM UTC Running [root@skantdr1 log]#
- Apply the patch by using the dbcli update-dbhome command. Note the Job Id.
[root@skantdr1 log]# dbcli update-dbhome -i c177404f-d22e-46b5-95ac-28ed5b2da50d { "jobId" : "1de24101-07e0-4031-835d-de912c35656f", "status" : "Created", "message" : null, "reports" : [ ], "createTimestamp" : "February 28, 2020 06:29:35 AM UTC", "resourceList" : [ ], "description" : "DB Home Patching: Home Id is c177404f-d22e-46b5-95ac-28ed5b2da50d", "updatedTime" : "February 28, 2020 06:29:35 AM UTC", "percentageProgress" : null } [root@skantdr1 log]#
- Check the job output by using the dbcli describe-job command with the job ID.
[root@skantdr1 log]# dbcli describe-job -i 1de24101-07e0-4031-835d-de912c35656f Job details ---------------------------------------------------------------- ID: 1de24101-07e0-4031-835d-de912c35656f Description: DB Home Patching: Home Id is c177404f-d22e-46b5-95ac-28ed5b2da50d Status: Running Created: February 28, 2020 6:29:35 AM UTC Message: Task Name Start Time End Time Status ------------------------------------------------------------------------ ----------------------------------- ----------------------------------- ---------- Create Patching Repository Directories[skantdr1] February 28, 2020 6:29:36 AM UTC February 28, 2020 6:29:36 AM UTC Success Create Patching Repository Directories[skantdr2] February 28, 2020 6:29:36 AM UTC February 28, 2020 6:29:36 AM UTC Success Download latest patch metadata[skantdr1] February 28, 2020 6:29:36 AM UTC February 28, 2020 6:29:56 AM UTC Success Download latest patch metadata[skantdr2] February 28, 2020 6:29:56 AM UTC February 28, 2020 6:30:17 AM UTC Success checking GiHome version[skantdr2] February 28, 2020 6:30:17 AM UTC February 28, 2020 6:31:23 AM UTC Success checking GiHome version[skantdr1] February 28, 2020 6:30:17 AM UTC February 28, 2020 6:31:21 AM UTC Success Update System version[skantdr1] February 28, 2020 6:31:24 AM UTC February 28, 2020 6:31:24 AM UTC Success Update System version[skantdr2] February 28, 2020 6:31:24 AM UTC February 28, 2020 6:31:24 AM UTC Success Update Patching Repository[skantdr1] February 28, 2020 6:31:24 AM UTC February 28, 2020 6:32:52 AM UTC Success Update Patching Repository[skantdr2] February 28, 2020 6:32:52 AM UTC February 28, 2020 6:32:52 AM UTC Running [root@skantdr1 log]#
- Once the patching has been completed on Grid Infrastructure of 2-Node RAC. You can verify by using list-jobs, describe-component and describe-job with DBCLI utility.
[root@skantdr1 log]# dbcli list-jobs ID Description Created Status ---------------------------------------- --------------------------------------------------------------------------- ----------------------------------- ---------- 9cd00f1c-38c6-4cd5-99b7-513b60f7deb4 Provisioning service creation February 27, 2020 5:31:12 PM UTC Success 4439c4c8-aa73-4974-a44c-21b6496009f2 Authentication key update for DCS_ADMIN February 27, 2020 6:14:08 PM UTC Success 2639eca4-c0ee-4e5f-9eab-d0c77620150e Authentication key update for DCS_ADMIN February 27, 2020 6:15:59 PM UTC Success 07128924-bdd0-4445-b577-54d11f38ef98 DG Config service creation February 27, 2020 6:23:16 PM UTC Success 67ba7f6b-dcd7-420b-8ab9-662f96644d56 DG Status service creation February 27, 2020 6:39:59 PM UTC Success 9062d19f-0b8a-4fd1-b2d8-a711d2af5936 SSH keys update February 27, 2020 6:44:02 PM UTC Success cb7c59a9-4be5-4180-8c2a-75ceb63729d0 SSH key delete February 27, 2020 6:44:23 PM UTC Success 4983e150-3876-4342-af60-5c2b791a9098 SSH key delete February 27, 2020 6:44:24 PM UTC Success 5e290489-2ec9-4b2b-919b-5c82ddbd489a DcsCli patching February 28, 2020 4:40:08 AM UTC Success ed8f348e-c7e5-4cf7-9bfa-23a0b54dbc8d Server Patching Prechecks February 28, 2020 4:42:15 AM UTC Success fa0996a6-7f99-48b2-92dc-5c1fb8e20481 Server Patching February 28, 2020 5:03:24 AM UTC Success 53aecb87-33a5-4e0d-b430-db563402a8d8 DB Home Prechecks February 28, 2020 6:14:37 AM UTC Success 1de24101-07e0-4031-835d-de912c35656f DB Home Patching: Home Id is c177404f-d22e-46b5-95ac-28ed5b2da50d February 28, 2020 6:29:35 AM UTC Success [root@skantdr1 log]# dbcli describe-job -i 1de24101-07e0-4031-835d-de912c35656f Job details ---------------------------------------------------------------- ID: 1de24101-07e0-4031-835d-de912c35656f Description: DB Home Patching: Home Id is c177404f-d22e-46b5-95ac-28ed5b2da50d Status: Success Created: February 28, 2020 6:29:35 AM UTC Message: Task Name Start Time End Time Status ------------------------------------------------------------------------ ----------------------------------- ----------------------------------- ---------- Create Patching Repository Directories[skantdr1] February 28, 2020 6:29:36 AM UTC February 28, 2020 6:29:36 AM UTC Success Create Patching Repository Directories[skantdr2] February 28, 2020 6:29:36 AM UTC February 28, 2020 6:29:36 AM UTC Success Download latest patch metadata[skantdr1] February 28, 2020 6:29:36 AM UTC February 28, 2020 6:29:56 AM UTC Success Download latest patch metadata[skantdr2] February 28, 2020 6:29:56 AM UTC February 28, 2020 6:30:17 AM UTC Success checking GiHome version[skantdr2] February 28, 2020 6:30:17 AM UTC February 28, 2020 6:31:23 AM UTC Success checking GiHome version[skantdr1] February 28, 2020 6:30:17 AM UTC February 28, 2020 6:31:21 AM UTC Success Update System version[skantdr1] February 28, 2020 6:31:24 AM UTC February 28, 2020 6:31:24 AM UTC Success Update System version[skantdr2] February 28, 2020 6:31:24 AM UTC February 28, 2020 6:31:24 AM UTC Success Update Patching Repository[skantdr1] February 28, 2020 6:31:24 AM UTC February 28, 2020 6:32:52 AM UTC Success Update Patching Repository[skantdr2] February 28, 2020 6:32:52 AM UTC February 28, 2020 6:34:00 AM UTC Success Validating dbHome available space[skantdr1] February 28, 2020 6:34:01 AM UTC February 28, 2020 6:34:01 AM UTC Success Validating dbHome available space[skantdr2] February 28, 2020 6:34:01 AM UTC February 28, 2020 6:34:01 AM UTC Success Opatch updation[skantdr2] February 28, 2020 6:34:04 AM UTC February 28, 2020 6:34:07 AM UTC Success Opatch updation[skantdr1] February 28, 2020 6:34:04 AM UTC February 28, 2020 6:34:07 AM UTC Success Patch conflict check[skantdr1] February 28, 2020 6:34:07 AM UTC February 28, 2020 6:36:55 AM UTC Success Patch conflict check[skantdr2] February 28, 2020 6:36:55 AM UTC February 28, 2020 6:39:45 AM UTC Success db upgrade to version [skantdr1] February 28, 2020 6:39:45 AM UTC February 28, 2020 7:17:08 AM UTC Success db upgrade to version [skantdr2] February 28, 2020 7:17:08 AM UTC February 28, 2020 8:00:19 AM UTC Success SqlPatch upgrade February 28, 2020 8:00:19 AM UTC February 28, 2020 8:04:09 AM UTC Success updating the Database version February 28, 2020 8:04:41 AM UTC February 28, 2020 8:05:09 AM UTC Success [root@skantdr1 log]# dbcli describe-component System Version --------------- 19.4.3.0.0 Component Installed Version Available Version ---------------------------------------- -------------------- -------------------- GI 19.6.0.0.200114 up-to-date DB 19.6.0.0.200114 up-to-date [root@skantdr1 log]# dbcli list-databases ID DB Name DB Type DB Version CDB Class Shape Storage Status DbHomeID ---------------------------------------- ---------- -------- -------------------- ---------- -------- -------- ---------- ------------ ---------------------------------------- a1e7854d-5441-4468-91cc-e071aeddf90b SKANTORC Rac 19.6.0.0.200114 true Oltp ASM Configured c177404f-d22e-46b5-95ac-28ed5b2da50d [root@skantdr1 log]#
In the next post, we will see more usage of DBCLI utility.
Thank you for giving your valuable time to read the above information.
If you want to be updated with all our articles send us the Invitation or Follow us:
Telegram Channel: https://t.me/helporacle
Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/
LinkedIn Group: Oracle Cloud DBAAS
Facebook Page: OracleHelp
Do you need to update dbcli on both nodes? Or only on the node from which you use it to upgrade?
For safer both side,
Otherwise, one node is sufficient.