温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Oracle 11.2.0.4打PSU 11.2.0.4.161018

发布时间:2020-07-27 03:30:08 阅读:4818 作者:hbxztc 栏目:数据库
开发者测试专用服务器限时活动,0元免费领,库存有限,领完即止! 点击查看>>

最近生产上要给Oracle数据库打11g最新的补丁,这里先做一个测试记录一下。

Oracle数据库所有补丁的MOS文档ID 1922396.1下载地址:https://support.oracle.com/epmos/faces/DocContentDisplay?_afrLoop=242245405602967&id=1577380.1&_afrWindowMode=0&_adf.ctrl-state=zv36z4hoo_53这个下载需要有MOS账号

Oracle数据库的补丁有几种:PSU、SPU、CPU等,这次打的PSU24006111 (11.2.0.4.161018)

平台:OS Linux6.7 x86-64+Oracle 11.2.0.4.0单实例

升级方法已经在补丁包里的README.html文档里写的很清楚了,这里只是做个演示。

1、下载最新的的PSU包和最新的OPatch包,上传到服务器

p24006111_112040_Linux-x86-64.zip

p6880880_112000_Linux-x86-64.zip

2、解压压缩包,并把OPatch替换原ORACLE_HOME里的OPatch目录

[oracle@rhel6 psu]$ unzip p24006111_112040_Linux-x86-64.zip
[oracle@rhel6 psu]$ unzip p6880880_112000_Linux-x86-64.zip
[oracle@rhel6 psu]$ ls -l |grep ^d
drwxrwxr-x 14 oracle oinstall      4096 Aug 26 21:56 24006111
drwxr-x--- 10 oracle oinstall      4096 Aug 18  2015 OPatch
[oracle@rhel6 psu]$ mv $ORACLE_HOME/OPatch $ORACLE_HOME/OPatch_bak
[oracle@rhel6 psu]$ mv OPatch/ $ORACLE_HOME

3、配置OPatch的环境变量

[oracle@rhel6 psu]$ vi ~/.bash_profile
#添加
export PATH=$PATH:$ORACLE_HOME/OPatch
[oracle@rhel6 psu]$ source ~/.bash_profile 
[oracle@rhel6 psu]$ which opatch
/u02/app/oracle/product/11.2.4/db1/OPatch/opatch
#查看当前数据库的补丁情况
[oracle@rhel6 psu]$ opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2016, Oracle Corporation.  All rights reserved.


Oracle Home       : /u02/app/oracle/product/11.2.4/db1
Central Inventory : /u01/app/oraInventory
   from           : /u02/app/oracle/product/11.2.4/db1/oraInst.loc
OPatch version    : 11.2.0.3.12
OUI version       : 11.2.0.4.0
Log file location : /u02/app/oracle/product/11.2.4/db1/cfgtoollogs/opatch/opatch3016-12-20_10-45-47AM_1.log

Lsinventory Output file location : /u02/app/oracle/product/11.2.4/db1/cfgtoollogs/opatch/lsinv/lsinventory2016-12-20_10-45-47AM.txt

--------------------------------------------------------------------------------
Local Machine Information::
Hostname: rhel6
ARU platform id: 226
ARU platform description:: Linux x86-64

Installed Top-level Products (1): 

Oracle Database 11g                                                  11.2.0.4.0
There are 1 products installed in this Oracle Home.


There are no Interim patches installed in this Oracle Home.


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

OPatch succeeded.

4、升级前检查是否有冲突

[oracle@rhel6 psu]$ cd 24006111/
[oracle@rhel6 24006111]$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2016, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /u02/app/oracle/product/11.2.4/db1
Central Inventory : /u01/app/oraInventory
   from           : /u02/app/oracle/product/11.2.4/db1/oraInst.loc
OPatch version    : 11.2.0.3.12
OUI version       : 11.2.0.4.0
Log file location : /u02/app/oracle/product/11.2.4/db1/cfgtoollogs/opatch/opatch3016-12-20_10-49-53AM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.

5、安装Patch包,单实例的数据库按如下方法打patch就可以了,如果是RAC则需要详细查看README.html

[oracle@rhel6 psu]$ cd 24006111/
[oracle@rhel6 24006111]$ opatch apply
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2016, Oracle Corporation.  All rights reserved.


Oracle Home       : /u02/app/oracle/product/11.2.4/db1
Central Inventory : /u01/app/oraInventory
   from           : /u02/app/oracle/product/11.2.4/db1/oraInst.loc
OPatch version    : 11.2.0.3.12
OUI version       : 11.2.0.4.0
Log file location : /u02/app/oracle/product/11.2.4/db1/cfgtoollogs/opatch/opatch3016-12-20_10-53-13AM_1.log

Verifying environment and performing prerequisite checks...
Prerequisite check "CheckActiveFilesAndExecutables" failed.
The details are:


Following executables are active :
/u02/app/oracle/product/11.2.4/db1/bin/oracle
/u02/app/oracle/product/11.2.4/db1/lib/libclntsh.so.11.1
UtilSession failed: Prerequisite check "CheckActiveFilesAndExecutables" failed.
Log file location: /u02/app/oracle/product/11.2.4/db1/cfgtoollogs/opatch/opatch3016-12-20_10-53-13AM_1.log

OPatch failed with error code 73
#打补丁报错,查看日志
[oracle@rhel6 24006111]$ more /u02/app/oracle/product/11.2.4/db1/cfgtoollogs/opatch/opatch3016-12-20_10-53-13AM_1.log
......
[Dec 20, 2016 10:53:21 AM]   Following executables are active :
                             /u02/app/oracle/product/11.2.4/db1/bin/oracle
                             /u02/app/oracle/product/11.2.4/db1/lib/libclntsh.so.11.1
[Dec 20, 2016 10:53:21 AM]   Prerequisite check "CheckActiveFilesAndExecutables" failed.
                             The details are:
                             
                             
                             Following executables are active :
                             /u02/app/oracle/product/11.2.4/db1/bin/oracle
                             /u02/app/oracle/product/11.2.4/db1/lib/libclntsh.so.11.1
......
#这个错误的意思是检测到有命令正在运行,不能进行升级,停止数据库和监听
[oracle@rhel6 24006111]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Tue Dec 20 10:57:16 2016

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

sys@ORCL>shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
sys@ORCL>exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@rhel6 24006111]$ lsnrctl stop

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 20-DEC-2016 10:58:32

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
The command completed successfully
[oracle@rhel6 24006111]$ ps -ef |grep ora
root      2361  2342  0 10:11 pts/0    00:00:00 su - oracle
oracle    2362  2361  0 10:11 pts/0    00:00:01 -bash
oracle    3409  2362  0 10:59 pts/0    00:00:00 ps -ef
oracle    3410  2362  0 10:59 pts/0    00:00:00 grep ora
#重新打补丁
[oracle@rhel6 24006111]$ opatch apply
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2016, Oracle Corporation.  All rights reserved.


Oracle Home       : /u02/app/oracle/product/11.2.4/db1
Central Inventory : /u01/app/oraInventory
   from           : /u02/app/oracle/product/11.2.4/db1/oraInst.loc
OPatch version    : 11.2.0.3.12
OUI version       : 11.2.0.4.0
Log file location : /u02/app/oracle/product/11.2.4/db1/cfgtoollogs/opatch/opatch3016-12-20_11-18-32AM_1.log

Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   17478514  18031668  18522509  19121551  19769489  20299013  20760982  21352635  21948347  22502456  23054359  24006111  

Do you want to proceed? [y|n]
y
User Responded with: Y

All checks passed.
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name: 
You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]:  y



Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u02/app/oracle/product/11.2.4/db1')


Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying sub-patch '17478514' to OH '/u02/app/oracle/product/11.2.4/db1'
......
Composite patch 24006111 successfully applied.
Log file location: /u02/app/oracle/product/11.2.4/db1/cfgtoollogs/opatch/opatch3016-12-20_11-18-32AM_1.log

OPatch succeeded.

6、升级数据字典并重新编译无效对象

[oracle@rhel6 24006111]$ sqlplus / as sysdba
idle>startup
......
idle>@?/rdbms/admin/catbundle.sql psu apply
.......
idle>SPOOL off
idle>SET echo off
Check the following log file for errors:
/u02/app/oracle/cfgtoollogs/catbundle/catbundle_PSU_ORCL_APPLY_2016Dec20_11_30_47.log
#检查日志没有报错
#编译失效对象
sys@ORCL>@?/rdbms/admin/utlrp.sql
#检查升级情况
sys@ORCL>col action_time for a30
sys@ORCL>col action for a10
sys@ORCL>col namespace for a20
sys@ORCL>col version for a20
sys@ORCL>col bundle_series for a30
sys@ORCL>col comments for a30
sys@ORCL>select * from dba_registry_history;

ACTION_TIME		       ACTION	  NAMESPACE	       VERSION			    ID BUNDLE_SERIES		      COMMENTS
------------------------------ ---------- -------------------- -------------------- ---------- ------------------------------ ------------------------------
24-AUG-13 12.03.45.119862 PM   APPLY	  SERVER	       11.2.0.4 		     0 PSU			      Patchset 11.2.0.2.0
07-JUL-16 11.03.29.165250 AM   APPLY	  SERVER	       11.2.0.4 		     0 PSU			      Patchset 11.2.0.2.0
20-DEC-16 11.32.28.671654 AM   APPLY	  SERVER	       11.2.0.4 		161018 PSU			      PSU 11.2.0.4.161018
#使用opatch命令查看补丁情况
[oracle@rhel6 24006111]$ opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2016Oracle Corporation.  All rights reserved.


Oracle Home       : /u02/app/oracle/product/11.2.4/db1
Central Inventory : /u01/app/oraInventory
   from           : /u02/app/oracle/product/11.2.4/db1/oraInst.loc
OPatch version    : 11.2.0.3.12
OUI version       : 11.2.0.4.0
Log file location : /u02/app/oracle/product/11.2.4/db1/cfgtoollogs/opatch/opatch3016-12-20_11-52-01AM_1.log

Lsinventory Output file location : /u02/app/oracle/product/11.2.4/db1/cfgtoollogs/opatch/lsinv/lsinventory2016-12-20_11-52-01AM.txt

--------------------------------------------------------------------------------
Local Machine Information::
Hostname: rhel6
ARU platform id: 226
ARU platform description:: Linux x86-64

Installed Top-level Products (1): 

Oracle Database 11g                                                  11.2.0.4.0
There are 1 products installed in this Oracle Home.


Interim patches (1) :

Patch  24006111     : applied on Tue Dec 20 11:24:30 CST 2016
Unique Patch ID:  20508568
Patch description:  "Database Patch Set Update : 11.2.0.4.161018 (24006111)"
   Created on 26 Aug 201605:54:48 hrs PST8PDT
Sub-patch  23054359"Database Patch Set Update : 11.2.0.4.160719 (23054359)"
Sub-patch  22502456"Database Patch Set Update : 11.2.0.4.160419 (22502456)"
Sub-patch  21948347"Database Patch Set Update : 11.2.0.4.160119 (21948347)"
Sub-patch  21352635"Database Patch Set Update : 11.2.0.4.8 (21352635)"
Sub-patch  20760982"Database Patch Set Update : 11.2.0.4.7 (20760982)"
Sub-patch  20299013"Database Patch Set Update : 11.2.0.4.6 (20299013)"
Sub-patch  19769489"Database Patch Set Update : 11.2.0.4.5 (19769489)"
Sub-patch  19121551"Database Patch Set Update : 11.2.0.4.4 (19121551)"
Sub-patch  18522509"Database Patch Set Update : 11.2.0.4.3 (18522509)"
Sub-patch  18031668"Database Patch Set Update : 11.2.0.4.2 (18031668)"
Sub-patch  17478514"Database Patch Set Update : 11.2.0.4.1 (17478514)"
   Bugs fixed:
     17288409210518522431694717811429186075461720571920506699
     17816865179222542333011917754782169348031336479517311728
     17441661172848171699207517446237140158421997256921756677
     17375354209257952153855817449815194638971386682217235750
     17982555174785141831753114338435182353902080358313944971
     20142975178117891692916518704244205067061754697320334344
     14054676170880681734609118264060173435142153856719680952
     18471685192117241395145621847223163153981874413916850630
     23177648190494531867330417883081199152711864141918262334
     17006183160651661827745416833527101364731805155617865671
     17852463185548711785349818334586175517091758848019827973
     17344412178428251882886817025461118832521360909817239687
     17602269191971752219545718316692173135251261172119544839
     18964939176007191819116419393542175713062077715018482502
     19466309222437191704052717165204180982071678570817465741
     17174582161807631677784012982566194638932219546522148226
     1687544912816846172375216599380193583171781143817811447
     17945983219833251876275016912439171847211806191417282229
     18331850182024411708235918723434219723201955410614034426
     18339044194583771775299520448824178919431725809017767676
     16668584183843911704076417381384159133551835616614084247
     20596234205067152175666113853126182038371424553116043574
     21756699221954411784889717877323214531531746814120861693
     17786518179122171703713016956380181557621747814517394950
     18641461181890361861991717027426213526461626842524476274
     22195492195840681843630722507210172652171763492113498382
     21526048192585042000408717443671221954851800042222321756
     20004021175710392106738716344544180095641435473721286665
     18135678186140152044179718362222178350481647271617936109
     17050888173254131401018318747196177617751672159417082983
     20067212211798981730227718084625159903591820383517297939
     17811456223809191673114821168487141339751382954317215560
     1769420917385178180910598322815175869551720115917655634
     18331812197305081886864617648596162200771606990117348614
     17393915172745371795701718096714173087891843664714285317
     19289642147648291832850917622427169437112219547714368995
     22502493173466711899684317783588213438381661869417672719
     18856999187832241785116017546761177989531827383022092979
     16596890199725661638498317726838222963661736060622321741
     13645875181995371654288621787056178895491456518417071721
     17610798202990152134389722893153206574411739754518230522
     16360112197694891290505818641451127477401843049517016369
     17042658146027881755106319972568215174401850886119788842
     14657740173328001383737819972564171869051831532819699191
     17437634223531991809361519006849190131831729685618674024
     17232014168552921776229614692762210518401770502322507234
     19121551213302641985450321868720193094661868186220558005
     18554763173901601845651416306373139558261813969017501491
     17752121216686271729988917889583186733251972130418293054
     17242746179512331809424617649265196151361701183216870214
     17477958185225092063127416091637173232221659564116524926
     18228645182825621759690818031668171561481649461522683225
     17545847176552402452874117614134135585571734132617891946
     17716305226579421639206819271443213518771809212717614227
     18440047169035361410680318973907186733421903286717389192
     17612828161941601700657017721717173904311757024016863422
     18325460197270571642254119972570172671141824496221538485
     18765602182038381619814317246576148292501783562718247991
     14458214210518621669223217786278172272772447626516042673
     16314254162286041683784217393683235368351778725920331945
     20074391158617751639908318018515226832121826055021051858
     17080436166139641703697316579084244337111838453718280813
     2029621316901385159799652333012418441944164501699756271
     17892268117336031628569117587063213437751818039016538760
     18193833213879642105183317238511178246371657144318306996
     1485202117853456186740471236406122195448



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

OPatch succeeded.

7、升级失败回滚

opatch rollback -id 24006111

亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI

开发者交流群×