打DB RELEASE UPDAT补丁程--Windows Oracle 12.2.0.1.0

 

微信公众号:云库管    www.yunDBA.com

北京云库管科技有限公司 (内部培训资料) 返回上级

 

 

思路总结:

1.    Opatch工具升级到某高版本以上(具体见补丁集readme.html中有要求);

2.    停止数据库服务执行opatch apply命令,目的是用新补丁程序替换原有程序文件(对应下面第16步);

3.    打开数据库startup模式,用datapatch –verbose命令执行补丁集SQL脚本,更改数据词典内容(对应下面第9步),这点和11g不同。

 

目录

1、打补丁前检查当前已存补丁... 2

2、先查看补丁安装帮助文件(在补丁压缩包中的readme.html... 3

3、停Oracle实例和监听服务等(即Oraclexxx开头的服务都停)... 4

4、停止分布时事物服务(Distributed Transaction Coordinator... 5

5、解压缩补丁包后进入到该目录安装补丁... 6

6、打补丁opatch apply. 11

7、启动数据库实例和监听服务等... 13

8、启动Distributed Transaction Coordinator服务... 13

9、更新dba_registry_sqlpatch视图... 13

10、查看dba_registry_sqlpatch视图... 14

 

 

1、打补丁前检查当前已存补丁

C:\app\Administrator\virtual\product\12.2.0\dbhome_1\OPatch>opatch lsinventory

https://img-blog.csdn.net/2018052513565461?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTMwMTI0MDY=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70

可以看到当前没有安装任何补丁。

 

2、先查看补丁安装帮助文件(在补丁压缩包中的readme.html

,可有goole浏览器翻译一下

https://img-blog.csdn.net/20180525135031608?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTMwMTI0MDY=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70

 

3、停Oracle实例和监听服务等(即Oraclexxx开头的服务都停)

https://img-blog.csdn.net/20180525141050966?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTMwMTI0MDY=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70

4、停止分布时事物服务(Distributed Transaction Coordinator

https://img-blog.csdn.net/20180525135944626?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTMwMTI0MDY=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70

将该服务停止。

cmd

e:\ > net stop msdtc

MSDTC 服务正在停止....

MSDTC 服务已成功停止。

 

 

5、解压缩补丁包后进入到该目录安装补丁

C:\app\Administrator\virtual\product\12.2.0\dbhome_1\OPatch>cd /d C:\Users\Administrator\Desktop\p27426753_122010_MSWIN-x86-64\27426753
 

C:\Users\Administrator\Desktop\p27426753_122010_MSWIN-x86-64\27426753>C:\app\Administrator\virtual\product\12.2.0\dbhome_1\OPatch\opatch apply

第一次安装失败,还有很多文件在使用:

https://img-blog.csdn.net/2018052514131152?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTMwMTI0MDY=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70

检查了下,有一个sqlplus窗口未关闭:

https://img-blog.csdn.net/20180525141548272?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTMwMTI0MDY=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70

找到打开的sqlplus窗口并关闭,然后重新应用补丁程序:

https://img-blog.csdn.net/20180525141834917?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTMwMTI0MDY=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70

需要输入2y进行确认,开始补丁更新:

https://img-blog.csdn.net/20180525143224828?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTMwMTI0MDY=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70

https://img-blog.csdn.net/20180525143324727?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTMwMTI0MDY=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70

 

6、打补丁opatch apply

C:\Users\Administrator\Desktop\p27426753_122010_MSWIN-x86-64\27426753>C:\app\Administrator\virtual\product\12.2.0\dbhome_1\OPatch\opatch apply

https://img-blog.csdn.net/2018052514365643?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTMwMTI0MDY=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70

。。。。

https://img-blog.csdn.net/20180525143936663?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTMwMTI0MDY=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70

https://img-blog.csdn.net/20180525143959998?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTMwMTI0MDY=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70

 

 7、启动数据库实例和监听服务等

https://img-blog.csdn.net/20180525152253568?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTMwMTI0MDY=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70

 

 8、启动Distributed Transaction Coordinator服务

cmd

e:\ > net start msdtc

MSDTC 服务正在启动....

MSDTC 服务已成功启动。

 

9、用命令更新dba_registry_sqlpatch视图

cmd

c:\> sqlplus  "/ as sysdba"

#打开数据库

SQL> startup

SQL> alter pluggable database all open;

3)、更新dba_registry_sqlpatch

c:\>cd $ORACLE_HOME/OPatch

c:\OPatch>./datapatch -verbose

     27105253 (DATABASE RELEASE UPDATE 12.2.0.1.180116)

Patch installation complete.  Total patches installed: 3

Validating logfiles...

Patch 27105253 apply (pdb CDB$ROOT):SUCCESS

logfile:/u01/app/oracle/cfgtoollogs/sqlpatch/27105253/21862470/27105253_apply_ORCL_CDBROOT_2018Apr15_16_54_49.log(no errors)

SQL Patching tool complete on Sun Apr 1516:57:37 2018

10、查看dba_registry_sqlpatch视图

SQL> select VERSION,STATUS,ACTION_TIME,DESCRIPTION from dba_registry_sqlpatch;

VERSION  STATUS  ACTION_TIME                        DESCRIPTION                               

---------- ---------------------------------------------------------------------------------------

12.2.0.1  SUCCESS  13-SEP-18 10.45.06.831323 PM DATABASE JUL 2018 RELEASE UPDATE 12.2.0.1.180717