【云端起舞】Oracle云上一键安装数据库补丁集

简介:

编辑手记:为数据库升级打补丁是一项常规的任务,在通常情况下 ,打补丁是一件繁琐的事情,需要考虑的细节比较多。但在云上,可以通过按钮一键式应用 相关补丁集,高效便捷。我们今天一起来学习 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技术活动中进行演讲。并在实践中为客户提供最佳解决方案。


Introduction简介

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

DbaaS-云上打补丁的实现

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      :   12.1.0.2

Database               :   On Cloud

SID                         :   ORC1

OPatch version      :   12.1.0.1.10

Patch to apply        :   April 2016 PSU

Patch 22291127: DATABASE PATCH SET UPDATE 12.1.0.2.160419

Patch 22291127 - Database Patch Set Update 12.1.0.2.160419(Includes 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 12.1.0.2.160419 which is April 2016 PSU andwe can see other information such as when this patch is released and quickaccess to readme file.


在这部分我们可以看到在2016年4月份该数据库成功应用过12.1.0.2.160419的补丁集,同样,我们也可以查看该补丁集什么时候被释放,或者直接点击阅读readme文件。


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.


如果决定应用补丁,第一步就是在数据库上执行数据库的“预检查”。非云上数据块我们必须手动执行Opatch程序,但这里直接可以单击执行,并提供输出显示补丁是否有冲突。



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:12.1.0.1.10

OPatch succeeded.

[oracle@CKPT-DBaaS~]$ OPatch lsinventory

Oracle Interim PatchInstaller version 12.1.0.1.10

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    : 12.1.0.1.10

OUI version          : 12.1.0.2.0

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  12.1.0.2.0

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.


整个安装补丁集的过程25分钟就完成了,一般完成时间取决于不同的补丁集和数据库的数量。(不大于30分钟)。



In span of 25 minutes all the tasks areperformed

在25分钟完成了以下全部过程:

  • 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 12.1.0.1.10

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    : 12.1.0.1.10

OUI version          : 12.1.0.2.0

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~]$

 

Conclusion总结

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.


通过以上一步一步的过程,将云计算数据库服务的补丁应用到云上。文章同时对比了传统应用补丁的主要挑战以及云数据库应用补丁集的优点。


文章转自数据和云公众号,原文链接

相关文章
|
3天前
|
监控 数据库
【YashanDB知识库】ycm托管数据库时,数据库非OM安装无法托管
### 简介 在检查数据库安装时,发现未使用yasboot安装,导致无yasom和yasagent进程及缺少相关目录,无法通过ycm托管和监控。为解决此问题,需先将数据库托管到yasom中,再托管到ycm中。具体步骤包括生成配置文件、安装yasom和yasagent、修改并执行托管配置。最终确保数据库能被正常托管和监控。经验总结:应按规范使用yasboot安装数据库,避免后续问题。 (239字符)
|
3天前
|
Oracle 关系型数据库 网络安全
崖山异构数据库迁移利器YMP初体验-Oracle迁移YashanDB
文章是作者小草对崖山异构数据库迁移利器 YMP 的初体验分享,包括背景、YMP 简介、体验环境说明、YMP 部署(含安装前准备、安装、卸载、启动与停止)、数据迁移及遇到的问题与解决过程。重点介绍了 YMP 功能、部署的诸多细节和数据迁移流程,还提到了安装和迁移中遇到的问题及解决办法。
|
1月前
|
关系型数据库 MySQL 数据库
Docker Compose V2 安装常用数据库MySQL+Mongo
以上内容涵盖了使用 Docker Compose 安装和管理 MySQL 和 MongoDB 的详细步骤,希望对您有所帮助。
173 42
|
2月前
|
SQL NoSQL 关系型数据库
超强数据库管理软件推荐-没有之一-还在用Navicat管理本地数据库的吗?还在为Navicat寻求绿色版或者购买正版的费用望而却步吗?DBeaver让你解决所有数据库本地编写问题-优雅草央千澈-DBeaver下载和安装
超强数据库管理软件推荐-没有之一-还在用Navicat管理本地数据库的吗?还在为Navicat寻求绿色版或者购买正版的费用望而却步吗?DBeaver让你解决所有数据库本地编写问题-优雅草央千澈-DBeaver下载和安装
185 18
超强数据库管理软件推荐-没有之一-还在用Navicat管理本地数据库的吗?还在为Navicat寻求绿色版或者购买正版的费用望而却步吗?DBeaver让你解决所有数据库本地编写问题-优雅草央千澈-DBeaver下载和安装
|
6天前
|
监控 Java Shell
【YashanDB 知识库】ycm 托管数据库时,数据库非 OM 安装无法托管
【YashanDB 知识库】ycm 托管数据库时,数据库非 OM 安装无法托管
|
2月前
|
存储 缓存 NoSQL
云端问道21期方案教学-应对高并发,利用云数据库 Tair(兼容 Redis®*)缓存实现极速响应
云端问道21期方案教学-应对高并发,利用云数据库 Tair(兼容 Redis®*)缓存实现极速响应
|
2月前
|
缓存 NoSQL 关系型数据库
云端问道21期实操教学-应对高并发,利用云数据库 Tair(兼容 Redis®)缓存实现极速响应
本文介绍了如何通过云端问道21期实操教学,利用云数据库 Tair(兼容 Redis®)缓存实现高并发场景下的极速响应。主要内容分为四部分:方案概览、部署准备、一键部署和完成及清理。方案概览中,展示了如何使用 Redis 提升业务性能,降低响应时间;部署准备介绍了账号注册与充值步骤;一键部署详细讲解了创建 ECS、RDS 和 Redis 实例的过程;最后,通过对比测试验证了 Redis 缓存的有效性,并指导用户清理资源以避免额外费用。
|
3月前
|
弹性计算 关系型数据库 数据库
从自建到云端,数据库迁移全攻略
本文详细介绍了将自建数据库迁移至阿里云RDS的全过程,涵盖WordPress网站安装、数据库迁移配置及验证等步骤。通过DTS数据传输服务,实现库表结构、全量和增量数据的无缝迁移,确保业务连续性和数据一致性。方案具备零成本维护、高可用性(最高99.99%)、性能优化及全面的数据安全保障等核心优势。此外,提供了详细的图文教程,帮助用户快速上手并完成迁移操作,确保业务稳定运行。点击文末“阅读原文”了解更多详情及参与活动赢取精美礼品。
232 13
|
2月前
|
SQL 数据挖掘 关系型数据库
阿里云百炼|析言GBI全新发布:联合云上数据库,助力企业轻松实现ChatBI
析言GBI是阿里云推出的一款基于AI的智能数据分析产品,通过自然语言处理实现对话式数据分析。用户无需编写代码,即可轻松进行数据查询、分析和可视化。该产品支持多种数据库连接方式(如MySQL、PostgreSQL等),并提供多版本选择以适应不同业务需求。即将发布的动态规划BI分析功能将进一步提升复杂问题的拆解与综合分析能力。欢迎访问阿里云百炼应用广场体验析言GBI,并享受200次免费问题额度。
|
3月前
|
存储 Oracle 关系型数据库
数据库数据恢复—ORACLE常见故障的数据恢复方案
Oracle数据库常见故障表现: 1、ORACLE数据库无法启动或无法正常工作。 2、ORACLE ASM存储破坏。 3、ORACLE数据文件丢失。 4、ORACLE数据文件部分损坏。 5、ORACLE DUMP文件损坏。
188 11

热门文章

最新文章

推荐镜像

更多