【云端起舞】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.


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


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

相关文章
|
1月前
|
Oracle 安全 关系型数据库
【Oracle】使用Navicat Premium连接Oracle数据库两种方法
以上就是两种使用Navicat Premium连接Oracle数据库的方法介绍,希望对你有所帮助!
282 28
|
21天前
|
Ubuntu 关系型数据库 Linux
Linux数据库安装
本文介绍了在CentOS 8.0和Ubuntu 22.04系统上安装、配置和启动MariaDB数据库服务器的详细步骤。包括通过`yum`和`apt`包管理器安装MariaDB服务,启动并检查服务运行状态,设置root用户密码以及连接数据库的基本操作。此外,还展示了如何在Ubuntu上更新软件包列表、安装依赖项,并验证MariaDB的版本和运行状态。通过这些步骤,用户可以成功部署并初始化MariaDB环境,为后续数据库管理与应用开发奠定基础。
37 4
|
26天前
|
Oracle 关系型数据库 MySQL
Oracle linux 8 二进制安装 MySQL 8.4企业版
Oracle linux 8 二进制安装 MySQL 8.4企业版
57 1
|
1月前
|
监控 Java Shell
【YashanDB 知识库】ycm 托管数据库时,数据库非 OM 安装无法托管
本文主要介绍了因数据库未按规范使用 yasboot 安装导致的问题及解决方法。问题表现为无 yasom 和 yasagent 进程,且目录结构缺失,致使 ycm 无法托管与监控。分析发现可能是数据库版本旧或安装不规范引起。解决方法为先生成配置文件,安装 yasom 和 yasagent,再生成并修改托管配置模板,最终通过命令完成托管至 yasom 和 ycm。总结强调了按规范安装数据库的重要性以避免类似问题。
|
1月前
|
SQL Oracle 关系型数据库
【赵渝强老师】Oracle的闪回数据库
Oracle闪回数据库功能类似于“倒带按钮”,可快速将数据库恢复至 earlier 状态,无需还原备份。本文介绍了闪回数据库的使用方法及实战案例:包括设置归档模式、开启闪回功能、记录SCN号、执行误操作后的恢复步骤等。通过具体 SQL 操作演示了如何利用闪回数据库恢复被误删的用户数据。注意,使用此功能前需确保数据库为归档模式。
|
2月前
|
Oracle 关系型数据库 数据库
【赵渝强老师】Oracle数据库的闪回表
本文介绍了Oracle数据库中的闪回表(Flashback Table)功能,它能够将表的数据快速恢复到特定时间点或系统改变号(SCN),无需备份。文章通过实战示例详细演示了如何使用闪回表恢复数据,包括授权、创建测试表、记录时间与SCN号、删除数据、启用行移动功能、执行闪回操作以及验证恢复结果等步骤。同时,还展示了如何通过触发器禁止插入操作,并在闪回过程中处理触发器的启用问题。文末附有视频讲解,帮助读者更好地理解闪回表的使用方法。
98 10
|
18天前
|
负载均衡 算法 关系型数据库
大数据大厂之MySQL数据库课程设计:揭秘MySQL集群架构负载均衡核心算法:从理论到Java代码实战,让你的数据库性能飙升!
本文聚焦 MySQL 集群架构中的负载均衡算法,阐述其重要性。详细介绍轮询、加权轮询、最少连接、加权最少连接、随机、源地址哈希等常用算法,分析各自优缺点及适用场景。并提供 Java 语言代码实现示例,助力直观理解。文章结构清晰,语言通俗易懂,对理解和应用负载均衡算法具有实用价值和参考价值。
大数据大厂之MySQL数据库课程设计:揭秘MySQL集群架构负载均衡核心算法:从理论到Java代码实战,让你的数据库性能飙升!
|
2月前
|
关系型数据库 MySQL Java
【YashanDB知识库】原生mysql驱动配置连接崖山数据库
【YashanDB知识库】原生mysql驱动配置连接崖山数据库
【YashanDB知识库】原生mysql驱动配置连接崖山数据库
|
18天前
|
存储 关系型数据库 MySQL
大数据新视界 --面向数据分析师的大数据大厂之 MySQL 基础秘籍:轻松创建数据库与表,踏入大数据殿堂
本文详细介绍了在 MySQL 中创建数据库和表的方法。包括安装 MySQL、用命令行和图形化工具创建数据库、选择数据库、创建表(含数据类型介绍与选择建议、案例分析、最佳实践与注意事项)以及查看数据库和表的内容。文章专业、严谨且具可操作性,对数据管理有实际帮助。
大数据新视界 --面向数据分析师的大数据大厂之 MySQL 基础秘籍:轻松创建数据库与表,踏入大数据殿堂

热门文章

最新文章

推荐镜像

更多