Your SlideShare is downloading. ×

11g新特性 在线实施补丁online patching

4,329

Published on

Published in: Technology, News & Politics
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
4,329
On Slideshare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
55
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. 11g 新特性-在线实施补丁 online patching by Maclean.liu liu.maclean@gmail.com www.oracledatabase12g.com
  • 2. About Mel Email:liu.maclean@gmail.coml Blog:www.oracledatabase12g.coml Oracle Certified Database Administrator Master 10gand 11gl Over 6 years experience with Oracle DBA technologyl Over 7 years experience with Linux technologyl Member Independent Oracle Users Groupl Member All China Users Groupl Presents for advanced Oracle topics: RAC,DataGuard, Performance Tuning and Oracle Internal.
  • 3. 在 Oracle 11g 中提出了 online patch(也叫 hot patch)的特性;Hot patching 允许我们在实例始终在线的情况下安装,启用或禁用一个修复补丁或者诊断补丁。针对 7*24 在线的业务系统,hot patch 为我们提供了一条既能避免当机时间而又可以实施补丁的途径。在 Oracle 11g 中我们可以使用 Opatch 命令行工具针对任意数据库实施在线补丁(前提是该补丁是一个 hot patch)。一般来说在线补丁(hot patches)只能是那些代码修改范围小且复杂度很低的补丁,举例来说它们往往是一些诊断补丁(diagnostic patches)或者小 bug 的修复(small bug fixes)。值得注意的是 hot patching 将需要消耗额外的内存,决定其消耗内存数量的因素是:1.补丁本身的大小,2.实例中的进程总数;举例来说某个补丁的大小正好为一个 OS page 的大小(一般为 4kB),那么当实例中运行的进程总数为 1000 时,则该 hot patching 所额外消耗的内存总数为 4kB*1000=4MB。hot patches 与常规 Conventional patches 对比具有可在线实施和安装快的特性,如下图:在实际生产环境中,相信没有多少朋友实施过 hot patching,一来国内目前还没有普及 11g 的使用,二来 hotpatching 的数量在所有 interim patch 中只占极少数;一直以来都想写这样一篇关于 hot patching 的博文,唯一妨碍我写作的问题是在 11.2.0.1 下找不到可实施的 online interim patch;以 MOS->patches&upgrade 目前的分类我们很难找出某个 base release 下可用的 hot patch,当然这并不妨碍补丁专栏的使用。为了这个令人郁闷的问题,我特意去提交了一个 Service Request,得到的回复:I have tried to find the patches which support online patching on 11.2.0.1 version,but I also can not find them because there are too many patches and there is no catalogfor the patcheswhich support online patching, and I can only check the patch readme to confirm whetherthat patch supports online patching.I found one patch which supports online patching, but this patch is for 11.2.0.2 version.The patch no. is 10188727.
  • 4. Sorry for the inconvenience brought to you. Hope the above update can help you.If the above patch is not what you want, then please update the SR and I will continuefor your issue.这其中提到的 patch 10188727,可以从 Note<RDBMS Online Patching Aka Hot Patching [ID 761111.1]>中找到,另外一个可找到的 hot patch 是 11.1.0.6 上的 6198642<DUMMY PATCH FOR TESTING DB11PATCHING>,不过很可惜该补丁只有 Linux x86 一个平台版本的。所以我不得不先将 11.2.0.1 的测试库升级到了11.2.0.2 上:SQL> select * from v$version;BANNER--------------------------------------------------------------------------------Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit ProductionPL/SQL Release 11.2.0.2.0 - ProductionCORE 11.2.0.2.0 ProductionTNS for Linux: Version 11.2.0.2.0 - ProductionNLSRTL Version 11.2.0.2.0 - Production[maclean@rh2 OPatch]$ ps -ef|grep pmon|grep -v grepmaclean 22481 1 0 19:19 ? 00:00:00 ora_pmon_PROD[maclean@rh2 OPatch]$ pmap -d 2248122481: ora_pmon_PRODAddress Kbytes Mode Offset Device Mapping0000000000400000 180232 r-x-- 0000000000000000 008:00002 oracle000000000b602000 1820 rwx-- 000000000b002000 008:00002 oracle000000000b7c9000 300 rwx-- 000000000b7c9000 000:00000 [ anon ]000000000dbef000 436 rwx-- 000000000dbef000 000:00000 [ anon ]0000000060000000 2050048 rwxs- 0000000000000000 000:00009 [ shmid=0x550001 ]0000003e09a00000 112 r-x-- 0000000000000000 008:00001 ld-2.5.so0000003e09c1b000 4 r-x-- 000000000001b000 008:00001 ld-2.5.so0000003e09c1c000 4 rwx-- 000000000001c000 008:00001 ld-2.5.so0000003e09e00000 1336 r-x-- 0000000000000000 008:00001 libc-2.5.so0000003e09f4e000 2044 ----- 000000000014e000 008:00001 libc-2.5.so0000003e0a14d000 16 r-x-- 000000000014d000 008:00001 libc-2.5.so0000003e0a151000 4 rwx-- 0000000000151000 008:00001 libc-2.5.so0000003e0a152000 20 rwx-- 0000003e0a152000 000:00000 [ anon ]0000003e0a200000 520 r-x-- 0000000000000000 008:00001 libm-2.5.so
  • 5. 0000003e0a282000 2044 ----- 0000000000082000 008:00001 libm-2.5.so0000003e0a481000 4 r-x-- 0000000000081000 008:00001 libm-2.5.so0000003e0a482000 4 rwx-- 0000000000082000 008:00001 libm-2.5.so0000003e0a600000 8 r-x-- 0000000000000000 008:00001 libdl-2.5.so0000003e0a602000 2048 ----- 0000000000002000 008:00001 libdl-2.5.so0000003e0a802000 4 r-x-- 0000000000002000 008:00001 libdl-2.5.so0000003e0a803000 4 rwx-- 0000000000003000 008:00001 libdl-2.5.so0000003e0aa00000 88 r-x-- 0000000000000000 008:00001 libpthread-2.5.so0000003e0aa16000 2044 ----- 0000000000016000 008:00001 libpthread-2.5.so0000003e0ac15000 4 r-x-- 0000000000015000 008:00001 libpthread-2.5.so0000003e0ac16000 4 rwx-- 0000000000016000 008:00001 libpthread-2.5.so0000003e0ac17000 16 rwx-- 0000003e0ac17000 000:00000 [ anon ]0000003e0ae00000 28 r-x-- 0000000000000000 008:00001 librt-2.5.so0000003e0ae07000 2048 ----- 0000000000007000 008:00001 librt-2.5.so0000003e0b007000 4 r-x-- 0000000000007000 008:00001 librt-2.5.so0000003e0b008000 4 rwx-- 0000000000008000 008:00001 librt-2.5.so0000003e0da00000 84 r-x-- 0000000000000000 008:00001 libnsl-2.5.so0000003e0da15000 2044 ----- 0000000000015000 008:00001 libnsl-2.5.so0000003e0dc14000 4 r-x-- 0000000000014000 008:00001 libnsl-2.5.so0000003e0dc15000 4 rwx-- 0000000000015000 008:00001 libnsl-2.5.so0000003e0dc16000 8 rwx-- 0000003e0dc16000 000:00000 [ anon ]00002abec920e000 8 rwx-- 00002abec920e000 000:00000 [ anon ]00002abec9210000 4 r-x-- 0000000000000000 008:00002 libodmd11.so00002abec9211000 1024 ----- 0000000000001000 008:00002 libodmd11.so00002abec9311000 4 rwx-- 0000000000001000 008:00002 libodmd11.so00002abec9312000 360 r-x-- 0000000000000000 008:00002 libcell11.so00002abec936c000 1020 ----- 000000000005a000 008:00002 libcell11.so00002abec946b000 36 rwx-- 0000000000059000 008:00002 libcell11.so00002abec9474000 4 rwx-- 00002abec9474000 000:00000 [ anon ]00002abec9475000 848 r-x-- 0000000000000000 008:00002 libskgxp11.so00002abec9549000 1024 ----- 00000000000d4000 008:00002 libskgxp11.so00002abec9649000 8 rwx-- 00000000000d4000 008:00002 libskgxp11.so00002abec9665000 4 rwx-- 00002abec9665000 000:00000 [ anon ]00002abec9666000 2580 r-x-- 0000000000000000 008:00002 libnnz11.so00002abec98eb000 1020 ----- 0000000000285000 008:00002 libnnz11.so00002abec99ea000 264 rwx-- 0000000000284000 008:00002 libnnz11.so00002abec9a2c000 8 rwx-- 00002abec9a2c000 000:00000 [ anon ]00002abec9a2e000 96 r-x-- 0000000000000000 008:00002 libclsra11.so00002abec9a46000 1020 ----- 0000000000018000 008:00002 libclsra11.so00002abec9b45000 4 rwx-- 0000000000017000 008:00002 libclsra11.so00002abec9b46000 4 rwx-- 00002abec9b46000 000:00000 [ anon ]00002abec9b47000 136 r-x-- 0000000000000000 008:00002 libdbcfg11.so
  • 6. 00002abec9b69000 1020 ----- 0000000000022000 008:00002 libdbcfg11.so00002abec9c68000 8 rwx-- 0000000000021000 008:00002 libdbcfg11.so00002abec9c6a000 6832 r-x-- 0000000000000000 008:00002 libhasgen11.so00002abeca316000 1020 ----- 00000000006ac000 008:00002 libhasgen11.so00002abeca415000 136 rwx-- 00000000006ab000 008:00002 libhasgen11.so00002abeca437000 24 rwx-- 00002abeca437000 000:00000 [ anon ]00002abeca43d000 8 r-x-- 0000000000000000 008:00002 libskgxn2.so00002abeca43f000 1020 ----- 0000000000002000 008:00002 libskgxn2.so00002abeca53e000 4 rwx-- 0000000000001000 008:00002 libskgxn2.so00002abeca53f000 4 rwx-- 00002abeca53f000 000:00000 [ anon ]00002abeca540000 656 r-x-- 0000000000000000 008:00002 libocr11.so00002abeca5e4000 1020 ----- 00000000000a4000 008:00002 libocr11.so00002abeca6e3000 12 rwx-- 00000000000a3000 008:00002 libocr11.so00002abeca6e6000 628 r-x-- 0000000000000000 008:00002 libocrb11.so00002abeca783000 1024 ----- 000000000009d000 008:00002 libocrb11.so00002abeca883000 8 rwx-- 000000000009d000 008:00002 libocrb11.so00002abeca885000 44 r-x-- 0000000000000000 008:00002 libocrutl11.so00002abeca890000 1020 ----- 000000000000b000 008:00002 libocrutl11.so00002abeca98f000 4 rwx-- 000000000000a000 008:00002 libocrutl11.so00002abeca990000 4 rwx-- 00002abeca990000 000:00000 [ anon ]00002abeca991000 4 r-x-- 0000000000000000 008:00001 libaio.so.1.0.100002abeca992000 2044 ----- 0000000000001000 008:00001 libaio.so.1.0.100002abecab91000 4 rwx-- 0000000000000000 008:00001 libaio.so.1.0.100002abecab92000 16 rwx-- 00002abecab92000 000:00000 [ anon ]00002abecab96000 20 r-x-- 0000000000000000 008:00001 libnuma.so.100002abecab9b000 2044 ----- 0000000000005000 008:00001 libnuma.so.100002abecad9a000 4 rwx-- 0000000000004000 008:00001 libnuma.so.100002abecad9b000 1280 rwx-- 00002abecad9b000 000:00000 [ anon ]00002abecaef5000 40 r-x-- 0000000000000000 008:00001 libnss_files-2.5.so00002abecaeff000 2044 ----- 000000000000a000 008:00001 libnss_files-2.5.so00002abecb0fe000 4 r-x-- 0000000000009000 008:00001 libnss_files-2.5.so00002abecb0ff000 4 rwx-- 000000000000a000 008:00001 libnss_files-2.5.so00002abecb100000 1700 rwx-- 00002abecb100000 000:00000 [ anon ]00002abecb2a9000 28 rwx-- 0000000000000000 000:00011 zero00002abecb2b0000 64 rwx-- 0000000000000000 000:00011 zero00002abecb2c0000 64 rwx-- 0000000000000000 000:00011 zero00002abecb2d0000 64 rwx-- 0000000000000000 000:00011 zero00002abecb2e0000 64 rwx-- 0000000000000000 000:00011 zero00002abecb2f0000 64 rwx-- 0000000000000000 000:00011 zero00002abecb300000 164 rwx-- 0000000000057000 000:00011 zero00002abecb329000 8 rwx-- 00002abecb329000 000:00000 [ anon ]00002abecb32b000 4 rwxs- 0000000000000000 008:00002 hc_PROD.dat
  • 7. 00002abecb32c000 40 r-x-- 0000000000000000 008:00002 libnque11.so00002abecb336000 1020 ----- 000000000000a000 008:00002 libnque11.so00002abecb435000 4 rwx-- 0000000000009000 008:00002 libnque11.so00002abecb436000 1048 rwx-- 00002abecb436000 000:00000 [ anon ]00007fff3342d000 84 rwx-- 00007ffffffea000 000:00000 [ stack ]ffffffffff600000 8192 ----- 0000000000000000 000:00000 [ anon ]mapped: 2291488K writeable/private: 7840K shared: 2050052K[maclean@rh2 ~]$ cd $ORACLE_HOME/OPatch[maclean@rh2 OPatch]$ unzip p10188727_112020_Linux-x86-64.zipArchive: p10188727_112020_Linux-x86-64.zip creating: 10188727/ creating: 10188727/files/ creating: 10188727/files/lib/ creating: 10188727/files/lib/libserver11.a/ inflating: 10188727/files/lib/libserver11.a/kkopq.o creating: 10188727/etc/ creating: 10188727/etc/config/ inflating: 10188727/etc/config/inventory.xml inflating: 10188727/etc/config/actions.xml inflating: 10188727/etc/config/deploy.xml creating: 10188727/etc/xml/ inflating: 10188727/etc/xml/GenericActions.xml inflating: 10188727/etc/xml/ShiphomeDirectoryStructure.xml inflating: 10188727/README.txt creating: 10188727/online/ creating: 10188727/online/files/ creating: 10188727/online/files/hpatch/ inflating: 10188727/online/files/hpatch/bug10188727.pch creating: 10188727/online/etc/ creating: 10188727/online/etc/config/ inflating: 10188727/online/etc/config/inventory.xml inflating: 10188727/online/etc/config/actions.xml inflating: 10188727/online/etc/config/deploy.xml creating: 10188727/online/etc/xml/ inflating: 10188727/online/etc/xml/GenericActions.xml inflating: 10188727/online/etc/xml/ShiphomeDirectoryStructure.xml[maclean@rh2 OPatch]$ opatch query 10188727 -allInvoking OPatch 11.2.0.1.1
  • 8. Oracle Interim Patch Installer version 11.2.0.1.1Copyright (c) 2009, Oracle Corporation. All rights reserved.Oracle Home : /s01/product/11.2.0/dbhome_2Central Inventory : /s01/oraInventory from : /etc/oraInst.locOPatch version : 11.2.0.1.1OUI version : 11.2.0.2.0OUI location : /s01/product/11.2.0/dbhome_2/ouiLog file location : /s01/product/11.2.0/dbhome_2/cfgtoollogs/opatch/opatch2011-02-17_20-05-21PM.logPatch history file: /s01/product/11.2.0/dbhome_2/cfgtoollogs/opatch/opatch_history.txt--------------------------------------------------------------------------------Patch created on 2 Dec 2010, 01:44:13 hrs PST8PDTNeed to shutdown Oracle instances: truePatch is roll-backable: truePatch is a "Patchset Update": falsePatch is a rolling patch: truePatch has sql related actions: falsePatch is an online patch: falsePatch is a portal patch: falsePatch is an "auto-enabled" patch: falseList of platforms supported: 226: Linux x86-64List of bugs to be fixed: 10188727: AFTER UPGRADING TO 11.2.0.2 SOME SQLS FAIL WITH ORA-7445 [KKEIDC()+180] ERRORThis patch is a "singleton" patch.This patch belongs to the "db" product familyList of executables affected: ORACLE_HOME/bin/oracleList of optional components: oracle.rdbms: 11.2.0.2.0
  • 9. List of optional actions: Update /s01/product/11.2.0/dbhome_2/lib/libserver11.a with /kkopq.o cd /s01/product/11.2.0/dbhome_2/rdbms/lib ; make -f ins_rdbms.mk ioracle ORACLE_HOME=/s01/product/11.2.0/dbhome_2 Possible XML representation of the patch: 10188727--------------------------------------------------------------------------------OPatch succeeded.[maclean@rh2 OPatch]$ ./opatch query -is_online_patch 10188727Invoking OPatch 11.2.0.1.1Oracle Interim Patch Installer version 11.2.0.1.1Copyright (c) 2009, Oracle Corporation. All rights reserved.Oracle Home : /s01/product/11.2.0/dbhome_2Central Inventory : /s01/oraInventory from : /etc/oraInst.locOPatch version : 11.2.0.1.1OUI version : 11.2.0.2.0OUI location : /s01/product/11.2.0/dbhome_2/ouiLog file location : /s01/product/11.2.0/dbhome_2/cfgtoollogs/opatch/opatch2011-02-17_19-45-33PM.logPatch history file: /s01/product/11.2.0/dbhome_2/cfgtoollogs/opatch/opatch_history.txt--------------------------------------------------------------------------------Patch is an online patch: falseOPatch succeeded./* 虽然 Opatch 返回"online patch: false",但实际上这是一个 online patch, 造成以上问题的原因可能是 Opatch 版本低 */[maclean@rh2 OPatch]$ tree 1018872710188727|-- README.txt|-- etc| |-- config
  • 10. | | |-- actions.xml| | |-- deploy.xml| | `-- inventory.xml| `-- xml| |-- GenericActions.xml| `-- ShiphomeDirectoryStructure.xml|-- files| `-- lib| `-- libserver11.a| `-- kkopq.o`-- online |-- etc | |-- config | | |-- actions.xml | | |-- deploy.xml | | `-- inventory.xml | `-- xml | |-- GenericActions.xml | `-- ShiphomeDirectoryStructure.xml `-- files `-- hpatch `-- bug10188727.pch/* 可以从以上目录结构中看到包含了 online 子目录,我们可以直接观察其 inventory.xml 信息文件 */[maclean@rh2 OPatch]$ cat 10188727/online/etc/config/inventory.xml |grep instance<instance_shutdown>false</instance_shutdown><instance_shutdown_message></instance_shutdown_message>/* 以上 instance_shutdown 为 false 说明其可以作为 online patch 实施 */[maclean@rh2 OPatch]$ cd 10188727/* opatch online patching 的具体语法如下 */opatch apply online -connectString <SID>:<USERNAME>:<PASSWORD>:<NODE1>, <SID2>:<USERNAME>:<PASSWORD>:<NODE2>,...[maclean@rh2 10188727]$ opatch apply online -connectString PROD:sys:d2nb51tzInvoking OPatch 11.2.0.1.1Oracle Interim Patch Installer version 11.2.0.1.1
  • 11. Copyright (c) 2009, Oracle Corporation. All rights reserved.Oracle Home : /s01/product/11.2.0/dbhome_2Central Inventory : /s01/oraInventory from : /etc/oraInst.locOPatch version : 11.2.0.1.1OUI version : 11.2.0.2.0OUI location : /s01/product/11.2.0/dbhome_2/ouiLog file location : /s01/product/11.2.0/dbhome_2/cfgtoollogs/opatch/opatch2011-02-17_19-49-44PM.logPatch history file: /s01/product/11.2.0/dbhome_2/cfgtoollogs/opatch/opatch_history.txtThe patch should be applied/rolled back in -all_nodes mode only.Converting the RAC mode to -all_nodes mode.ApplySession applying interim patch 10188727 to OH /s01/product/11.2.0/dbhome_2Running prerequisite checks...OPatch detected non-cluster Oracle Home from the inventory and will patch the localsystem only.Backing up files and inventory (not for auto-rollback) for the Oracle HomeBacking up files affected by the patch 10188727 for restore. This might take a while...Backing up files affected by the patch 10188727 for rollback. This might take awhile...Patching component oracle.rdbms, 11.2.0.2.0...The patch will be installed on active database instances.Installing and enabling the online patch bug10188727.pch, on database PROD.ApplySession adding interim patch 10188727 to inventoryVerifying the update...Inventory check OK: Patch ID 10188727 is registered in Oracle Home inventory with propermeta-data.Files check OK: Files from Patch ID 10188727 are present in Oracle Home.OPatch succeeded.[maclean@rh2 OPatch]$ opatch lsinventory -detail|tail -21Interim patches (1) :Patch (online) 10188727: applied on Thu Feb 17 19:49:52 CST 2011
  • 12. Unique Patch ID: 13202318 Created on 2 Dec 2010, 01:44:15 hrs PST8PDT Bugs fixed: 10188727 Files Touched: bug10188727.pch --> ORACLE_HOME/hpatch/bug10188727.pch Instances Patched: PROD Patch Location in Inventory: /s01/product/11.2.0/dbhome_2/inventory/oneoffs/10188727 Patch Location in Storage area: /s01/product/11.2.0/dbhome_2/.patch_storage/10188727_Dec_2_2010_01_44_15告警日志 alert.log 中的信息:Patch file bug10188727.pch is out of sync with oracle binary; performing fixupPatch file bug10188727.pch has been synced with oracle binaryPatch bug10188727.pch Installed - Update #1Patch bug10188727.pch Enabled - Update #2[maclean@rh2 OPatch]$ ps -ef|grep pmon|grep -v grepmaclean 22481 1 0 19:19 ? 00:00:00 ora_pmon_PROD[maclean@rh2 OPatch]$ pmap -d 22481|tail -1000002abecb435000 4 rwx-- 0000000000009000 008:00002 libnque11.so00002abecb436000 1048 rwx-- 00002abecb436000 000:00000 [ anon ]00002abecb53c000 8 r-x-- 000000000c64e000 008:00002 oracle00002abecb53e000 5052 r-x-- 00000000000bd000 008:00002 oracle00002abecba2d000 140 r-x-- 0000000000000000 008:00002 bug10188727.so00002abecba50000 1024 ----- 0000000000023000 008:00002 bug10188727.so00002abecbb50000 8 rwx-- 0000000000023000 008:00002 bug10188727.so00007fff3342d000 84 rwx-- 00007ffffffea000 000:00000 [ stack ]ffffffffff600000 8192 ----- 0000000000000000 000:00000 [ anon ]mapped: 2297720K writeable/private: 7848K shared: 2050052K/* 再次观察 pmon 进程的内存信息,可以看到 pmap 输出中多出了 2 个小的 oracle 正文镜像和 名为 bug10188727.so 的共享库文件,而该后台进程的 private memory 由原来的 7840k 上升到 7848k, 实际增幅为 8k *//* 此外可以通过 oradebug 命令将该 online patch 禁用,虽然并不推荐这样做 */SQL> oradebug patch disable bug10188727.pch;
  • 13. Statement processed.SQL> oradebug patch disable bug10188727.pch;Patch file already disabled[maclean@rh2 hpatch]$ pmap -d 22481|tail -800002abecb53c000 8 r-x-- 000000000c64e000 008:00002 oracle00002abecb53e000 5052 r-x-- 00000000000bd000 008:00002 oracle00002abecba2d000 140 r-x-- 0000000000000000 008:00002 bug10188727.so00002abecba50000 1024 ----- 0000000000023000 008:00002 bug10188727.so00002abecbb50000 8 rwx-- 0000000000023000 008:00002 bug10188727.so00007fff3342d000 84 rwx-- 00007ffffffea000 000:00000 [ stack ]ffffffffff600000 8192 ----- 0000000000000000 000:00000 [ anon ]mapped: 2297720K writeable/private: 7848K shared: 2050052K/* 但 disable 掉 online patch 并不会导致在线补丁额外消耗的内存被回收 *//* 当然我们还可以很方便地启用它 */SQL> oradebug patch enable bug10188727.pch;Statement processed.SQL> oradebug patch enable bug10188727.pch;Patch file already enabled[maclean@rh2 ~]$ cd $ORACLE_HOME/hpatch[maclean@rh2 hpatch]$ ls -ltotal 368-rw-r--r-- 1 maclean oinstall 177874 Feb 17 19:49 bug10188727.pch-rwx------ 1 maclean oinstall 1 Feb 17 19:49 bug10188727.pchPROD.fixup-rwx------ 1 maclean oinstall 176850 Feb 17 19:49 bug10188727.so-rw------- 1 maclean oinstall 712 Feb 17 20:13 orapatchPROD.cfg/* 注意不要在实例启动时删除以上 hpatch 目录及目录下任何文件,这可能导致 instance 出现意外 */[maclean@rh2 hpatch]$ cd $ORACLE_HOME/OPatch/* 我们还能够将 online patch rollback 回滚掉,如以下语法 */opatch rollback -id <patchID> -connectString <SID>:<USERNAME>:<PASSWORD>:<NODE1>, <SID2>:<USERNAME>:<PASSWORD>:<NODE2>, ...
  • 14. [maclean@rh2 OPatch]$ opatch rollback -id 10188727 -connectString PROD:sys:d2nb51tz-invPtrLoc /s01/product/11.2.0/dbhome_2/oraInst.locInvoking OPatch 11.2.0.1.1Oracle Interim Patch Installer version 11.2.0.1.1Copyright (c) 2009, Oracle Corporation. All rights reserved.Oracle Home : /s01/product/11.2.0/dbhome_2Central Inventory : /s01/oraInventory from : /s01/product/11.2.0/dbhome_2/oraInst.locOPatch version : 11.2.0.1.1OUI version : 11.2.0.2.0OUI location : /s01/product/11.2.0/dbhome_2/ouiLog file location : /s01/product/11.2.0/dbhome_2/cfgtoollogs/opatch/opatch2011-02-17_20-18-00PM.logPatch history file: /s01/product/11.2.0/dbhome_2/cfgtoollogs/opatch/opatch_history.txtRollbackSession rolling back interim patch 10188727 from OH/s01/product/11.2.0/dbhome_2The patch should be applied/rolled back in -all_nodes mode only.Converting the RAC mode to -all_nodes mode.Running prerequisite checks...OPatch detected non-cluster Oracle Home from the inventory and will patch the localsystem only.Backing up files affected by the patch 10188727 for restore. This might take a while...Patching component oracle.rdbms, 11.2.0.2.0...The patch will be removed from active database instances.Disabling and removing online patch bug10188727.pch, on database PRODRollbackSession removing interim patch 10188727 from inventoryOPatch succeeded.告警日志 alert.log 中的 remove 信息:Patch bug10188727.pch Disabled - Update #5Patch bug10188727.pch Removed - Update #6Thu Feb 17 20:18:07 2011
  • 15. Online patch bug10188727.pch has been disabledOnline patch bug10188727.pch has been removed[maclean@rh2 trace]$ pmap -d 22481|tail -800002abecb53c000 8 r-x-- 000000000c64e000 008:00002 oracle00002abecb53e000 5052 r-x-- 00000000000bd000 008:00002 oracle00002abecba2d000 140 r-x-- 0000000000000000 008:00002 bug10188727.so00002abecba50000 1024 ----- 0000000000023000 008:00002 bug10188727.so00002abecbb50000 8 rwx-- 0000000000023000 008:00002 bug10188727.so00007fff3342d000 84 rwx-- 00007ffffffea000 000:00000 [ stack ]ffffffffff600000 8192 ----- 0000000000000000 000:00000 [ anon ]mapped: 2297720K writeable/private: 7848K shared: 2050052K/* 显然 rollback 回滚掉该 online interim patch 也不足以回收内存,唯一的方法是重启实例 */SQL> startup force;[maclean@rh2 trace]$ ps -ef|grep pmon|grep -v grepmaclean 25563 1 0 20:22 ? 00:00:00 ora_pmon_PROD[maclean@rh2 trace]$ pmap -d 25563|tail -800002aaf2f324000 4 rwxs- 0000000000000000 008:00002 hc_PROD.dat00002aaf2f325000 40 r-x-- 0000000000000000 008:00002 libnque11.so00002aaf2f32f000 1020 ----- 000000000000a000 008:00002 libnque11.so00002aaf2f42e000 4 rwx-- 0000000000009000 008:00002 libnque11.so00002aaf2f42f000 1048 rwx-- 00002aaf2f42f000 000:00000 [ anon ]00007fffdfa84000 84 rwx-- 00007ffffffea000 000:00000 [ stack ]ffffffffff600000 8192 ----- 0000000000000000 000:00000 [ anon ]mapped: 2291488K writeable/private: 7840K shared: 2050052K/* Thats ok! ash to ash, dust to dust! */References:<RDBMS Online Patching Aka Hot Patching [ID 761111.1]>© 2011, www.oracledatabase12g.com. 版权所有.文章允许转载,但必须以链接方式注明源地址,否则追求法律责任.

×