As you know, OCI Classic was the first version of Oracle Cloud, is a secure, reliable, low cost, standards-based infrastructure service.
We have two ways of patching a database:
- Using the Oracle Cloud GUI trough an Internet browser.
- Using the console tool dbaascli.
During this article I will use the Cloud GUI console for some tasks, so we need access to the cloud tenancy and access to the Database resource. So, let’s begin.
First step, not always needed but strongly recommended: Create a backup!
Go to the Database classic option and click on Instances option. Inside the Instance option, select the database instances you want to patch and click on the name to enter to the administration console.
On the Admin Console, the step is as simple as Click on the Backup Now button. A confirmation windows will ask if we want to keep the backup taken forever, select No (default) and click on Backup.
The last step was the only action executed by the GUI console. Now, we access the server residing the database using the OPC user and the we change to the root user. All the actions performed now must be executed using the root user.
ssh opc@130.XXX.103.40
[opc@prd10dbe ~]$
[opc@prd10dbe ~]$ sudo su -
[root@prd10dbe ~]#
|
[root@prd10dbe ~]# dbaascli patch tools list
DBAAS CLI version 18.4.6.1.0
Executing command patch tools list
Current Patchid : 18.4.6.1.0_191003.1238
No applicable tools patches are available
|
In this case, we can see a message saying that there are no Applicable tools patches available. if updates are available a message will appear with the patch ID and the command needed to apply the update, the message will be similar than:
Next step. Validate the patch, this step is similar than run an opatch prereq command.
[root@prd10dbe ~]# dbaascli patch db prereq -- patchid LATEST
DBAAS CLI version 18.4.6.1.0
Executing command patch db prereq -- patchid LATEST
INFO: DBCS patching
This might take some time, please take a look at file /var/opt/oracle/log/dbpatchm/dbpatchm.log for progress
Use of uninitialized value $imgsize in string eq at /var/opt/oracle/patch/../perl_lib/DBAAS/oss_patch.pm line 1538.
Use of uninitialized value $imgsize in concatenation (.) or string at /var/opt/oracle/patch/../perl_lib/DBAAS/oss_patch.pm line 1540.
Use of uninitialized value $dbimgsize_in_gb in numeric lt (<) at /var/opt/oracle/patch/dbpatchm line 2547.
Prereq check completed successfully, ready to apply patch
|
On the file dbpatchm.log we will find the result of the analysis, in this case the prereq check was successful. Please check the next step if the analysis fails.
(Optional step) If an error had found during the prereq check. We can check the dbpatchm.log file to find the patch id that may cause conflict with the latest patch. The message will be similar than:
ZOP-47: The patch(es) has supersets with other patches installed in the Oracle Home (or) among themselves.
Prereq "checkConflictAgainstOHWithDetail" failed.
Summary of Conflict Analysis:
There are no patches that can be applied now.
Following patches have conflicts. Please contact Oracle Support and get the merged patch of the patches :
26272761, 28662603
Conflicts/Supersets for each patch are:
Patch : 28662603
Conflict with 26272761
|
- Enter to the oracle user: su – oracle
- Stop the listener: lsnrctl stop
- Stop the database: sqlplus / as sysdba, shutdown immediate;
- Go to the opatch location: cd $ORACLE_HOME/opatch
- And rollback the conflicting patch: ./opatch rollback -id 26272761
[root@prd10dbe ~]# dbaascli patch db apply --patchid LATEST
DBAAS CLI version 18.4.6.1.0
Executing command patch db apply --patchid LATEST
INFO: DBCS patching
This might take some time, please take a look at file /var/opt/oracle/log/dbpatchm/dbpatchm.log for progress
Use of uninitialized value $imgsize in string eq at /var/opt/oracle/patch/../perl_lib/DBAAS/oss_patch.pm line 1538.
Use of uninitialized value $imgsize in concatenation (.) or string at /var/opt/oracle/patch/../perl_lib/DBAAS/oss_patch.pm line 1540.
Use of uninitialized value $dbimgsize_in_gb in numeric lt (<) at /var/opt/oracle/patch/dbpatchm line 2547.
catcon: ALL catcom-related output will be written to [/var/opt/oracle/log/dbpatchm/cdb_utlrp_catcom_21532.lst]
catcon: See [/var/opt/oracle/log/dbpatchm/cdb_utlrp_*.log] files for output generated by script.
catcon: See [/var/opt/oracle/log/dbpatchm/cdb_utlrp_*.lst] files for spool files, if any
catcon.pl: completed successfully
Patch installed successfully
|
Note: the patching process will run in background so, don’t worry if you have any issues with your ssh session the process will finish by itself and you can check the status with the log file.
- Once the patch finished successfully, we can perform some database validations:
- Listener status
- PDB’s open mode
- Opatch inventory
- Object status
Patching an Oracle Infrastructure Cloud Classic Database Service is a simple process (maybe more than the on premise) than can be done by multiple choices. The way you choose will depend of your preferences and the type of control you desire. Just remember always keep your database updated.
Nice post. You pointed on very important facts by this post. Thanks for sharing!!!
ResponderEliminarVisit here...
Web Hosting
backup on cloud
Backup Storage