Update the DB System Resources Using dbcli
You can use the dbcli utility to update your DB system resources. This includes updating the DB system, the operating system (OS) on the nodes within the DB system, and Database Homes.
For more information on dbcli commands, see Oracle Database CLI Reference.
Prerequisites
- Preparing for an OS update.
Before you update the OS, review the following important guidelines and information:
- Back up the database in the DB system prior to attempting an OS update.
-
Do not remove packages from a DB system. However, you might have to remove custom RPMs (packages that were installed after the system was provisioned) for the update to complete successfully.Note
Do not install Network Manager on the DB system. Installing this package and rebooting the system results in severe loss of access to the system. - Oracle recommends that you test any updates thoroughly on a non-production system before updating a production system.
- The image used to launch a DB system is updated regularly with the necessary updates. After you launch a DB system, you are responsible for applying the required OS security updates published through the Oracle public YUM server.
- To apply OS updates, the virtual cloud network (VCN) in the DB system must be configured to allow access to the YUM repository. For more information, see VCN and Subnets.
- Requirements for using SSH to connect to a DB system.
To connect to the DB system via SSH, you need the path to the private key associated with the public key used when the DB system was launched.
You also need the public or private IP address of the DB system.
Use the private IP address to connect to the system from your on-premises network, or from within the VCN. This includes connecting from a host located on-premises connecting through a VPN or FastConnect to your VCN, or from another host in the same VCN. Use the DB system's public IP address to connect to the system from outside the cloud (with no VPN). You can find the IP addresses in the Console as follows:
- On the DB System Details page, under Resources, click Nodes.
- View the values that are displayed in the Public IP address and Private IP address & DNS name columns of the table displaying the Nodes of the DB system.
Update the CLI With the Latest Commands
Perform the following steps to update the CLI to ensure you have the latest update commands (older DB systems might not include them).
- SSH to the DB system.
ssh -i <private_key_path> opc@<db_system_ip_address>
- Log in as
opc
and thensudo
to theroot
user. Usesudo su -
with a hyphen to invoke theroot
user's profile, which will set thePATH
to the dbcli directory (/opt/oracle/dcs/bin
).sudo su -
- Update the CLI by using the CLI Update Command.
Output:cliadm update-dbcli
{ "jobId" : "dc9ce73d-ed71-4473-99cd-9663b9d79bfd", "status" : "Created", "message" : "Dcs cli will be updated", "reports" : [ ], "createTimestamp" : "January 18, 2017 10:19:34 AM PST", "resourceList" : [ ], "description" : "dbcli patching", "updatedTime" : "January 18, 2017 10:19:34 AM PST" }
- Wait for the update job to complete successfully. Check the status of the job by using the Job Commands.
Output:dbcli list-jobs
ID Description Created Status ------------------------------------ -------------- ----------------------------------- ---------- dc9ce73d-ed71-4473-99cd-9663b9d79bfd dbcli patching January 18, 2017 10:19:34 AM PST Success
Check for Installed and Available Updates
Perform the following steps to check for installed and available updates.
- SSH to the DB system.
ssh -i <private_key_path> opc@<db_system_ip_address>
- Log in as
opc
and thensudo
to theroot
user. Usesudo su -
with a hyphen to invoke theroot
user's profile, which will set thePATH
to the dbcli directory (/opt/oracle/dcs/bin
).sudo su -
- Display the installed update versions by using the Component Command. If the Available Version column
indicates a version number for a component, you should update the component.
Output:dbcli describe-component
System Version --------------- 12.1.2.10.0 Component Name Installed Version Available Version --------------------- -------------------- -------------------- OAK 12.1.2.10.0 up-to-date GI 12.1.0.2.161018 up-to-date ORADB12102_HOME1 12.1.0.2.160719 12.1.0.2.161018
- Display the latest update versions available in Object Storage by using
the Latestpatch
Command.
Output:dbcli describe-latestpatch
componentType availableVersion --------------- -------------------- gi 12.1.0.2.161018 db 11.2.0.4.161018 db 12.1.0.2.161018 oak 12.1.2.10.0
Update Server Components
Perform the following steps to update the Grid Infrastructure (GI) and storage management kit (OAK) server components.
- SSH to the DB system.
ssh -i <private_key_path> opc@<db_system_ip_address>
- Log in as
opc
and thensudo
to theroot
user. Usesudo su -
with a hyphen to invoke theroot
user's profile, which will set thePATH
to the dbcli directory (/opt/oracle/dcs/bin
).sudo su -
- Update the server components by using the Server Command.
Output:dbcli update-server
{ "jobId" : "9a02d111-e902-4e94-bc6b-9b820ddf6ed8", "status" : "Created", "reports" : [ ], "createTimestamp" : "January 19, 2017 09:37:11 AM PST", "resourceList" : [ ], "description" : "Server Patching", "updatedTime" : "January 19, 2017 09:37:11 AM PST" }
Note down the
jobId
in the above example. - Check the job output by using the Job Commands with the
jobId
.
Output:dbcli describe-job -i 9a02d111-e902-4e94-bc6b-9b820ddf6ed8
Job details ---------------------------------------------------------------- ID: 9a02d111-e902-4e94-bc6b-9b820ddf6ed8 Description: Server Patching Status: Running Created: January 19, 2017 9:37:11 AM PST Message: Task Name Start Time End Time Status ---------------------------------------- ----------------------------------- ----------------------------------- ---------- Create Patching Repository Directories January 19, 2017 9:37:11 AM PST January 19, 2017 9:37:11 AM PST Success Download latest patch metadata January 19, 2017 9:37:11 AM PST January 19, 2017 9:37:11 AM PST Success Update System version January 19, 2017 9:37:11 AM PST January 19, 2017 9:37:11 AM PST Success Update Patching Repository January 19, 2017 9:37:11 AM PST January 19, 2017 9:38:35 AM PST Success oda-hw-mgmt upgrade January 19, 2017 9:38:35 AM PST January 19, 2017 9:38:58 AM PST Success Opatch updation January 19, 2017 9:38:58 AM PST January 19, 2017 9:38:58 AM PST Success Patch conflict check January 19, 2017 9:38:58 AM PST January 19, 2017 9:42:06 AM PST Success Apply cluster-ware patch January 19, 2017 9:42:06 AM PST January 19, 2017 10:02:32 AM PST Success Updating GiHome version January 19, 2017 10:02:32 AM PST January 19, 2017 10:02:38 AM PST Success
- Verify that the server components were updated successfully by using the Component Command. The Available Version column should indicate
update-to-date
.
Update Database Home Components
Perform the following steps to update the Database Home components.
- SSH to the DB system.
ssh -i <private_key_path> opc@<db_system_ip_address>
- Log in as
opc
and thensudo
to theroot
user. Usesudo su -
with a hyphen to invoke theroot
user's profile, which will set the PATH to the dbcli directory (/opt/oracle/dcs/bin
).sudo su -
- Get the
ID
of the Database Home by using the Dbhome Commands.
Output:dbcli list-dbhomes
ID Name DB Version Home Location ------------------------------------ ----------------- ---------- ------------------------------------------ b727bf80-c99e-4846-ac1f-28a81a725df6 OraDB12102_home1 12.1.0.2 /u01/app/orauser/product/12.1.0.2/dbhome_1
- Update the Database Home components by using the Dbhome Commands and providing the
ID
from the previous step.
Output:dbcli update-dbhome -i b727bf80-c99e-4846-ac1f-28a81a725df6
{ "jobId" : "31b38f67-f993-4f2e-b7eb-5bccda9901ae", "status" : "Created", "message" : null, "reports" : [ ], "createTimestamp" : "January 20, 2017 10:08:48 AM PST", "resourceList" : [ ], "description" : "DB Home Patching: Home Id is 52e2e799-946a-4339-964b-c203dee35328", "updatedTime" : "January 20, 2017 10:08:48 AM PST" }
Note down the
jobId
in the above example. - Check the job output by using the Job Commands with the
jobId
.
Output:dbcli describe-job -i 31b38f67-f993-4f2e-b7eb-5bccda9901ae
Job details ---------------------------------------------------------------- ID: 31b38f67-f993-4f2e-b7eb-5bccda9901ae Description: DB Home Patching: Home Id is b727bf80-c99e-4846-ac1f-28a81a725df6 Status: Success Created: January 20, 2017 10:08:48 AM PST Message: Task Name Start Time End Time Status ---------------------------------------- ----------------------------------- ----------------------------------- ---------- Create Patching Repository Directories January 20, 2017 10:08:49 AM PST January 20, 2017 10:08:49 AM PST Success Download latest patch metadata January 20, 2017 10:08:49 AM PST January 20, 2017 10:08:49 AM PST Success Update System version January 20, 2017 10:08:49 AM PST January 20, 2017 10:08:49 AM PST Success Update Patching Repository January 20, 2017 10:08:49 AM PST January 20, 2017 10:08:58 AM PST Success Opatch updation January 20, 2017 10:08:58 AM PST January 20, 2017 10:08:58 AM PST Success Patch conflict check January 20, 2017 10:08:58 AM PST January 20, 2017 10:12:00 AM PST Success db upgrade January 20, 2017 10:12:00 AM PST January 20, 2017 10:22:17 AM PST Success
- Verify that the Database Home components were updated successfully by using the Component Command. The Available Version column should indicate
update-to-date
.
Check for Available Operating System Updates for DB System Nodes
- Oracle recommends rebooting the DB system if any kernel update is present in OS update.
- Oracle does not recommend installing OS packages or dependencies that are not part of the version lock that Oracle provides.
- SSH to the DB system.
ssh -i <private_key_path> opc@<db_system_ip_address>
- Log in as
opc
and thensudo
to theroot
user. Usesudo su -
with a hyphen to invoke the root user's profile, which will set thePATH
to the dbcli directory (/opt/oracle/dcs/bin
).sudo su -
- Use the
get-availableospatches
command to identify updates you want to apply to the OS. Note that if therebootIsRequired
field is "true", you must reboot the DB system after applying the update.
Output:dbcli get-availableospatches
To get the output in JSON, use the following command.Update Available Reboot Required -------------------- -------------------- Yes Yes
Output:dbcli get-availableospatches -j
{ "updateAvailable" : true, "rebootIsRequired" : true, "updateableRpms" : [ "curl.x86_64::7.29.0-59.0.1.el7_9.1", "freetype.x86_64::2.8-14.el7_9.1", "kernel-devel.x86_64::3.10.0-1160.11.1.el7", "kernel-headers.x86_64::3.10.0-1160.11.1.el7", "kernel-uek.x86_64::4.1.12-124.45.6.el7uek", "kernel-uek-firmware.noarch::4.1.12-124.45.6.el7uek", "libX11.x86_64::1.6.7-3.el7_9", "libX11-common.noarch::1.6.7-3.el7_9", "libcurl.x86_64::7.29.0-59.0.1.el7_9.1", "libsmbclient.x86_64::4.10.16-9.el7_9", "libwbclient.x86_64::4.10.16-9.el7_9", "python.x86_64::2.7.5-90.0.1.el7", "python-libs.x86_64::2.7.5-90.0.1.el7", "samba-client-libs.x86_64::4.10.16-9.el7_9", "samba-common.noarch::4.10.16-9.el7_9", "samba-common-libs.x86_64::4.10.16-9.el7_9", "sudo.x86_64::1.8.23-10.el7_9.1" ], "installedRpms" : [ "curl.x86_64::7.29.0-59.0.1.el7", "freetype.x86_64::2.8-14.el7", "kernel-devel.x86_64::3.10.0-1160.2.2.el7", "kernel-headers.x86_64::3.10.0-1160.2.2.el7", "kernel-uek.x86_64::4.1.12-124.43.4.el7uek", "kernel-uek-firmware.noarch::4.1.12-124.43.4.el7uek", "libX11.x86_64::1.6.7-2.el7", "libX11-common.noarch::1.6.7-2.el7", "libcurl.x86_64::7.29.0-59.0.1.el7", "libsmbclient.x86_64::4.10.16-7.el7_9", "libwbclient.x86_64::4.10.16-7.el7_9", "python.x86_64::2.7.5-89.0.1.el7", "python-libs.x86_64::2.7.5-89.0.1.el7", "samba-client-libs.x86_64::4.10.16-7.el7_9", "samba-common.noarch::4.10.16-7.el7_9", "samba-common-libs.x86_64::4.10.16-7.el7_9", "sudo.x86_64::1.8.23-10.el7" ] }
Update the Operating System of a DB System Node
This topic explains how to use the dbcli
to run a precheck and then apply an update to the OS running on a DB system node.
Some OS update operations require a reboot after update is complete. Use the
dbcli get-availableospatches
command as described in the previous topic to determine if the update you are applying requires a reboot.
Perform the following steps to update the OS of a DB system node.
- SSH to the DB system.
ssh -i <private_key_path> opc@<db_system_ip_address>
- Log in as
opc
and thensudo
to theroot
user. Usesudo su -
with a hyphen to invoke the root user's profile, which will set thePATH
to the dbcli directory (/opt/oracle/dcs/bin
).sudo su -
- Use the
update-server -c os -p
command to run a precheck:
Output:dbcli update-server -c os -p
{ "jobId" : "7fc5cadd-d256-436a-be0d-c2bfe9fd4e95", "status" : "Created", "message" : null, "reports" : [ ], "createTimestamp" : "March 01, 2021 07:36:19 AM UTC", "resourceList" : [ ], "description" : "OS Patching Prechecks", "updatedTime" : "March 01, 2021 07:36:20 AM UTC", "percentageProgress" : "0%" }
- If the precheck is successful and uncovers no issues that prevent a successful update operation, you can update the OS. If the precheck is not successful, address the issues identified by the precheck before trying to update the OS.
Note
You can use the-l
(--local
) flag to update the server components only in the current node.To update the OS, use the
dbcli update-server -c os
command:
Output:dbcli update-server -c os
{ "jobId" : "bee1c6d9-45fb-4e5b-8ee8-f02e7cd192ab", "status" : "Created", "message" : null, "reports" : [ ], "createTimestamp" : "March 01, 2021 07:37:43 AM UTC", "resourceList" : [ ], "description" : "OS Patching", "updatedTime" : "March 01, 2021 07:37:43 AM UTC", "percentageProgress" : "0%" }
- If the OS update requires a reboot, reboot the server after the update operation is complete.