编辑手记:为数据库升级打补丁是一项常规的任务,在通常情况下 ,打补丁是一件繁琐的事情,需要考虑的细节比较多。但在云上,可以通过按钮一键式应用 相关补丁集,高效便捷。我们今天一起来学习 Oracle Cloud Database Patching Then patch like a king with single click Database As A Service (DbaaS)


1、Configure and Practice Backup and Recovery in Cloud 在Oracle公有云上备份与恢复的配置和实践

2、Create a Primary and Standby Database in the Cloud 在Oracle公有云上创建standby数据库

3、 Create a database clone in the cloud 在Oracle公有云上创建克隆数据库


Joel Perez

Oracle ACE总监, Maximum Availability OCM,OTN 专家,全球第一批ACE称号获得者,致力于数据库高可用、灾难恢复、升级迁移和数据复制等方向设计和实现解决方案。

Nassyam Basha Oracle ACE总监,专注于Oracle高可用技术,印度甲骨文社区成员,定期在Oracle技术活动中进行演讲。并在实践中为客户提供最佳解决方案。


Patching your databases is regular taskwhenever Oracle releases new security patches on quarterly basis and at the endit is customer take depending on the downtime, when you planned for patching ofOn-Premises database then you have to take care of many things manually such asconflicts, OPatch utility version, Patching and post tasks but all these taskswe handle manually and carefully each step. This is numerously challenges aredecreased if your database on cloud. This article explains how easy to performpatching on your database (DBaaS) using single click.

当Oracle每季度发布新的安全修补程序时,及时升级打补丁是常规任务,客户一般会根据停机时间决定是否应用补丁。当有计划性地为数据库安装补丁集时,必须手动处理许多事情,例如版本冲突,OPatch实用程序版本,修补和一些安装后的任务,所有这些任务,我们都要手动并且仔细处理。 如果你的数据库在云上,安装的过程会简化许多。 本文介绍如何轻松地通过单击执行安装补丁集到数据库(DBaaS)的过程。

Challengesof patching over On-Premises


This is the job we are doing so far and ofcourse still, this requires lot of plan and below is the few important ones


  • What patches have been applied?已经打过哪些补丁
  • What patches we can apply onour database?目标库能打哪些补丁
  • Downloading patches 下载补丁集
  • OPatch utility version 确定Opatch应用程序的版本
  • One-off patch conflictdetection and resolution 一次性补丁冲突检测和解析
  • Installation of patch at OracleHome level 安装补丁到Oracle目录
  • Performing post tasks (loadingmodified SQL) 执行安装后的程序
  • Invalid objects compilation 失效对象编译

These are the above steps if we haveplanned very well and lot of work involved to download the patch and update theOPatch utility version to meet the requirement and many steps. If the oneoracle home shared by the more than one databases then we have to take care ofall the databases to perform post tasks.

对于以上涉及到的步骤我们都要做完整规划部署并按照要求执行,尤其是Opatch应用程序的版本一定要满足。如果一个oracle home目录被多个数据库共享,那么必须针对所有数据库执行post程序。

DBaaS– Cloud patching


Now consider customer databases moved fromon-premises to the Oracle cloud then….


Question: How easy to apply patch when database is on cloud? 问:在云上为数据库打补丁实现起来真的很简单吗? Guess: Probably we host database in cloud but again at the end itsdatabase, hence have to apply patch like we do on-premises.? 猜测:是不是只是在云端托管数据库,但最终还是在数据库终端打补丁,因此做法跟普通数据库应用补丁集并没有太大区别? Answer: Single click apply patch will do everything for you within 30minutes of span time for the security patches again it depends. 答:只需要通过单击按钮一键式安装补丁集,根据补丁集的不同,时间会不等,但一般在半个下傲视之内都可以完成。

Howit is possible?


Oracle cloud made things easy tointerrelate for all the oracle sources such as My Oracle Support, Special DBaaSMonitoring, and Easy access to the secured Oracle sources and hence OracleCloud have flexibility to perform all the tasks at one stop, so that manualintervention is not required any more to download the patches or to analyze orto apply.

Oracle云为所有Oracle数据源(例如My Oracle Support,特殊DBaaS监控和轻松访问受保护的Oracle源)提供了易于互连的功能,因此Oracle Cloud可以灵活地一站式执行所有任务,以便手动干预,并且不需要任何更多的下载补丁或分析应用。

Environment Information Service/Hostname : CKPT-DBaaS Domain : nassyambasha Oracle RDBMS : Database : On Cloud SID : ORC1 OPatch version : Patch to apply : April 2016 PSU Patch 22291127: DATABASE PATCH SET UPDATE Patch 22291127 - Database Patch Set Update CPUApr2016)

Applying patchon Database of cloud


In order to access our database service from the cloudwe can navigate as Dashboard à Select Oracle Database Cloud Serviceà from My services “click on URL” à from new page under database click on “ x instance(s) and then youcan see below screen with the list of databases services.

我们通过在导航栏输入Dashboard访问到Oracle云上的数据库服务页面,然后选择“Oracle Database Cloud Service” à在我的服务中选择“click onURL”à然后在新的页面选择数据库实例名称就可以打开以下页面,页面上我们会看到很多的数据库服务。

From the home page of database service, wecan see the hardware configuration, connectivity information of database. Nowwe can jump to the administration section of the left side panel to check thelist of the available patches and to know the patch history.

在数据库服务的主页面,有硬件配置、数据库的连接信息,选择控制面板,查看可用的补丁集和 已经应用的补丁集。

So this section shows us that the databaseis eligible to apply the PSU update which is April 2016 PSU andwe can see other information such as when this patch is released and quickaccess to readme file.


If once we decided to go to apply the patchthen the first step is to perform the “pre-check” of database over thedatabase. Manually we have to run the command using OPatch but here singleclick can perform and provides the output whether the patch have any conflictsor not.


After initiating pre-check it will startchecking with database homes.

预检查完成之后接下来检查Oracle home目录。

It takes very little time to perform thepre-check and after that you will see below status message of the conflicts.This step can be performed as much as many times if in case.


Now we are ready to go for patching, priorto that we will gather the OPatch lsinventory information so that we cancrosscheck after applying the patch.

现在准备就绪,可以应用补丁集了。应用之前,先收集OPatch lsinventory信息,以便在应用补丁后进行交叉检查。

[oracle@CKPT-DBaaS~]$ hostname CKPT-DBaaS [oracle@CKPT-DBaaS~]$ id uid=54321(oracle)gid=54321(oinstall) groups=54321(oinstall),54322(dba) [oracle@CKPT-DBaaS~]$ [oracle@CKPT-DBaaS~]$ export PATH=$ORACLE_HOME/OPatch:$PATH [oracle@CKPT-DBaaS~]$ OPatch version OPatch Version: OPatch succeeded. [oracle@CKPT-DBaaS~]$ OPatch lsinventory Oracle Interim PatchInstaller version Copyright (c) 2016,Oracle Corporation. All rights reserved.

Oracle Home :/u01/app/oracle/product/12.1.0/dbhome_1 Central Inventory :/u01/app/oraInventory from :/u01/app/oracle/product/12.1.0/dbhome_1/oraInst.loc OPatch version : OUI version : Log file location :/u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/OPatch/OPatch2016-07-16_08-23-00AM_1.log Lsinventory Outputfile location : /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/OPatch/lsinv/lsinventory2016-07-16_08-23-00AM.txt ---------------------------------------------------------------------- LocalMachine Information:: Hostname:CKPT-DBaaS.compute-nassyambasha.oraclecloud.internal ARU platform id: 226 ARU platformdescription:: Linux x86-64 Installed Top-levelProducts (1): Oracle Database12c There are 1 productsinstalled in this Oracle Home. Interim patches (3): Patch 22139226 : applied on Thu Jan 21 12:30:53 IST 2016 Unique PatchID: 19729684 ... ---------------------------------------------------------------------- OPatch succeeded. [oracle@CKPT-DBaaS~]$

We have gathered required information andnow we will proceed to apply patch directly from the cloud dashboard for thedatabase service.


Before proceeding with patching cloudprompts for your approval once again to ensure, because it requires downtimeand hence this step should consider when the downtime is accepted. You canleave a comment so that the job id tagged with comment to view for otherusers.

在修补云提示以获得批准之前,请再次确认,因为需要停机时间,此步骤应考虑何时接受停机时间。 操作用户可以在此处留下评论,以便将作业标签标记为评论,以供其他用户查看。

Once the comment entered and acknowledged thatmeans we are ensuring to apply patch forcibly then again we can click on thepatch button and then the job id will be created and oracle cloud handles thecomplete patching.

当输入评论以后,就意味着用户将会强制应用补丁集,此时点击Opatch程序将会创建job id, oracle cloud handles将会辅助完成应用补丁集的过程。

Now the patching is in progress and we cancheck the status on clicking the “Last Patch applied” section and it shows whenthe patching is started with the job id and the current status.

如上图,正在应用补丁集。可以通过选择“LastPatch applied”查看应用状态。状态信息包括开始应用的时间,job ID,当前完成状态等。

We can review the database and listenerstatus while patching in progress from the console using putty ssh terminal. Ifwe see below the listener and also the database are already down and that meansof course patching is in progress.

我们可以在使用putty ssh终端从控制台进行修补过程中查看数据库和监听器状态。我们看到下面的监听器和数据库已经关闭,安装补丁集的过程还在进行。

[oracle@CKPT-DBaaS~]$ ps -ef|grep pmon oracle 6848 1369 0 08:36 pts/1 00:00:00 grep pmon [oracle@CKPT-DBaaS~]$ ps -ef|grep tns root 20 2 0 Jun26 ? 00:00:00 [netns] oracle 6850 1369 0 08:36 pts/1 00:00:00 grep tns [oracle@CKPT-DBaaS~]$

Whole patching took for 25 minutes ofoverall process; the duration depends on each patch and the number ofdatabases.


In span of 25 minutes all the tasks areperformed


  • Download required patches 下载相应的补丁集
  • Apply the patch over OracleHome 在Oracle home目录应用补丁集
  • Loading modified SQL 上传修饰SQL
  • Recompiling invalid objects 重新编译失效对象。

Further more information can be grabbedfrom the Patch history by clicking like below.


After patching completed we can verify thestatus from database level using the below query .


The same information we can also gatherfrom the database alert log and the contents are below.


Sat Jul 16 08:44:452016 AQPC started withpid=35, OS id=15902 DatabaseCharacterset for PDB$SEED is AL32UTF8 Opening pdb PDB$SEED(2) with no Resource Manager plan active ALTER PLUGGABLEDATABASE ALL OPEN DatabaseCharacterset for PSPDB is AL32UTF8 Opening pdb PSPDB(3) with no Resource Manager plan active Pluggable databasePSPDB opened read write Completed: ALTERPLUGGABLE DATABASE ALL OPEN Starting backgroundprocess CJQ0 Completed: ALTERDATABASE OPEN Sat Jul 16 08:44:482016 CJQ0 started withpid=36, OS id=16023 Sat Jul 16 08:44:492016 =========================================================== Dumping currentpatch information =========================================================== Patch Id: 19769480 ... Patch Id: 23192060 ... ===========================================================

Sat Jul 16 08:44:492016 db_recovery_file_dest_sizeof 6144 MB is 48.22% used. This is a user-specified limiton the amount of space that will be used by this database forrecovery-related files, and does not reflect the amount of space available inthe underlying filesystem or ASM diskgroup. Sat Jul 16 08:45:382016 SERVER COMPONENTid=UTLRP_BGN: timestamp=2016-07-16 08:45:38 Container=CDB$ROOT Id=1 diag_adl:SERVERCOMPONENT id=UTLRP_END: timestamp=2016-07-16 08:45:41 Container=CDB$ROOT Id=1 diag_adl: diag_adl:XDBinstalled. diag_adl: diag_adl:XDBinitialized. Sat Jul 16 08:54:282016 Resize operationcompleted for file# 1, old size 839680K, new size 849920K

We have crosschecked the patching and theloading modified sql from alert log and we finally crosscheck the OPatchlsinventory to know the list of patches are applied.

我们已经对补丁集做了交叉检查,并从告警日志加载了修饰sql,通过交叉检查OPatch lsinventory可以获取应用补丁列表。

[oracle@CKPT-DBaaS ~]$export PATH=$ORACLE_HOME/OPatch:$PATH [oracle@CKPT-DBaaS~]$ OPatch lsinventory Oracle Interim PatchInstaller version Copyright (c) 2016,Oracle Corporation. All rights reserved. Oracle Home : /u01/app/oracle/product/12.1.0/dbhome_1 Central Inventory :/u01/app/oraInventory from :/u01/app/oracle/product/12.1.0/dbhome_1/oraInst.loc OPatch version : OUI version :

Log file location :/u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/OPatch/OPatch2016-07-16_15-37-52PM_1.log Lsinventory Outputfile location : ... OPatch succeeded. [oracle@CKPT-DBaaS~]$


We’ve seen the step by step procedure toapply the patch for database service on cloud and the major challenges ofapplying patches from on-premises and the advantages of patching of clouddatabase with just single click.




原文发布于微信公众号 - 数据和云(OraNews)





0 条评论
登录 后参与评论




LONG LONG LONG AGO就发现通过Hook磁盘端口驱动程序中的IRP_MJ_SCSI派遣函数方式过不了KB了,最近又遇到这个问题就想借此机会分析一下...



? | 导语 想晚上吃鸡?前端编码效率提升工具了解一下? 一、Bash篇(Mac) iTerm2 iTerm 2 is a terminal emulato...


微信公众平台快速开发框架 For Core 2.0 beta –JCSoft.WX.Core 5.2.0 beta发布

写在前面 最近比较忙,都没有好好维护博客,今天拿个半成品来交代吧。 记不清上次关于微信公众号快速开发框架(简称JCWX)的更新是什么时候了,自从更新到支持.Ne...


从头开始写一个 Chrome 插件


win7 安装 mac虚拟机

  一周前社团ios方向刚完成招新,图新鲜的我也试装了一下虚拟机。自己装的时候是按教程来的,很轻松就装成了。 ios的经理见我装的那么溜,就把几个需要装虚拟机的...


不同系统里同一Customizing activity的显示差异分析

比如SAP HANA Live Reporting这个Customizing Activity,在System AG3里不可见,但是在另一个系统QHD里却能使用...




来自专栏xingoo, 一个梦想做发明家的程序员


安装head head插件可以用来快速查看elasticsearch中的数据概况以及非全量的数据,也支持控件化查询和rest请求,但是体验都不是很好。 一般就用...






我们假设一个场景,当你接触到一个新的环境,我们需要了解这个数据库是否为RAC,是否有备库。 如果有备库,那么问题来了,如果想去验证备库的状态是否有效,是否及时应...