文章目錄
1 根據oracle官方發佈的漏洞報告下載補丁
2 補丁包上傳解壓到Linux Server
3 補丁包上傳解壓到Windows Server
4 關於OPatch
5 Linux與Windows安裝補丁區別
6 Linux安裝補丁
6.1 Linux單個補丁安裝
6.2 查看已安裝的補丁
6.3 多個補丁安裝
6.4 單個補丁回滾
6.5 多個補丁回滾
6.6 驗證補丁是否應用到Oracle Home
7 重啓weblogic應用服務
8 Windows安裝補丁css
文章正文
由oracle官方發佈的漏洞公告,對weblogic進行補丁升級。
本文介紹的是weblogic安裝的版本爲12.1.3,若是你使用的是其餘版本的請根據實際版原本選擇下載,須要使用Generic通用包安裝的weblogic才能進行補丁升級(補丁包下載須要擁有weblogic購買受權纔有權限下載)。java
①打開連接地址:https://www.oracle.com/security-alerts/#CriticalPatchUpdates
補丁的下載這裏我以2020年1月的補丁包爲例,點擊【Critical Patch Update - January 2020】
②找到weblogic對應版本點擊Fusion Middleware
按Ctrl+F搜索【oracle weblogic server, versions】,點擊【Fusion Middleware】
會自動跳轉到帳戶登陸界面,帳號登陸Oracle
③跳轉的頁面菜單,點擊【3.3 Oracle Fusion Middleware】
④再選擇【Section 3.3.50 "Oracle WebLogic Server"】
⑤找到WebLogic Server 12.1.3.0 home點擊WLS PATCH SET UPDATE 12.1.3.0.191015 【Patch 30463093】
⑥跳轉的頁面中點擊選擇下載
⑦彈出的窗口上點擊下載【p30463093_121300_Generic.zip】
node
將下載的p30463093_121300_Generic.zip補丁包使用weblogic的安裝用戶如oracle上傳到Linux服務器上的OPatch路徑下,如/home/oracle/Middleware/OPatch
將補丁包解壓到當前目錄下
[oracle@weblogic ~]$ cd /home/oracle/Middleware/OPatch
[oracle@weblogic OPatch]$ unzip p30463093_121300_Generic.ziplinux
將下載的p30463093_121300_Generic.zip補丁包上傳到Windows服務器上的OPatch路徑下,如D:\weblogic\middleware\OPatch\並解壓web
OPatch是一個基於java的程序,能夠運行在全部支持的操做系統,須要安裝Oracle通用安裝程序(即OUI)。它用於向Oracle軟件應用補丁程序。
須要注意的是OUI和OPatch不是單獨安裝的,在安裝Oracle的產品時會安裝OUI和OPatch;若是在安裝的Oracle產品中沒有找到,說明Oracle產品多是以開發包方式安裝的,即安裝的不是生產環境使用的產品。服務器
查看OPatch幫助 [oracle@weblogic OPatch]$ /home/oracle/Middleware/OPatch/opatch -help Oracle 中間補丁程序安裝程序版本 13.2.0.0.0 版權全部 (c) 2014, Oracle Corporation。保留全部權利。 Usage: opatch [ -help ] [ -report ] [ command ] command := apply checkapplicable compare lsinventory lspatches napply nrollback rollback query version prereq util <global_arguments> := -help Displays the help message for the command. -report Print the actions without executing. example: 'opatch -help' 'opatch apply -help' 'opatch checkapplicable -help' 'opatch compare -help' 'opatch lsinventory -help' 'opatch lspatches -help' 'opatch napply -help' 'opatch nrollback -help' 'opatch rollback -help' 'opatch prereq -help' 'opatch util -help' OPatch succeeded.
查看OPatch的版本 [oracle@weblogic ~]$ cd /home/oracle/Middleware/OPatch [oracle@weblogic OPatch]$ ./opatch version OPatch Version: 13.2.0.0.0 OPatch succeeded.
本人在這兩種服務器中安裝補丁的區別就是在linux上安裝時能夠不須要關閉服務器運行的java進程,而在Windows上安裝時須要關閉,不然安裝會報錯。oracle
(注:安裝過程當中,會有一次提示,須要鍵盤輸入y繼續安裝) [oracle@weblogic OPatch]$ cd 30463093/ [oracle@weblogic 30463093]$ /home/oracle/Middleware/OPatch/opatch apply -jdk $JAVA_HOME Oracle 中間補丁程序安裝程序版本 13.2.0.0.0 版權全部 (c) 2014, Oracle Corporation。保留全部權利。 Oracle Home : /home/oracle/Middleware Central Inventory : /home/oracle/oraInventory1 from : /home/oracle/Middleware/oraInst.loc OPatch version : 13.2.0.0.0 OUI version : 13.2.0.0.0 Log file location : /home/oracle/Middleware/cfgtoollogs/opatch/30463093_Mar_04_2020_16_34_45/apply2020-03-04_16-34-40下午_1.log OPatch detects the Middleware Home as "/home/oracle/Middleware" 三月 04, 2020 4:34:47 下午 oracle.sysman.oii.oiii.OiiiInstallAreaControl initAreaControl 信息: Install area Control created with access level 0 Applying interim patch '30463093' to OH '/home/oracle/Middleware' Verifying environment and performing prerequisite checks... Interim patch 30463093 is a superset of the patch(es) [ 29633448 ] in the Oracle Home OPatch 將回退補丁程序子集並應用指定的補丁程序。 All checks passed. 請關閉本地系統上在此 ORACLE_HOME 以外運行的 Oracle 實例。 (Oracle 主目錄 = '/home/oracle/Middleware') 本地系統是否已準備打補丁? [y|n] y User Responded with: Y Backing up files... Rolling back interim patch '29633448' from OH '/home/oracle/Middleware' 正在爲組件 oracle.wls.workshop.code.completion.support, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.workshop.code.completion.support, 12.1.3.0.0 打補丁... 正在爲組件 oracle.css.mod, 12.1.3.0.0 打補丁... 正在爲組件 oracle.css.mod, 12.1.3.0.0 打補丁... 正在爲組件 oracle.fmwconfig.common.shared, 12.1.3.0.0 打補丁... 正在爲組件 oracle.fmwconfig.common.shared, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.common.nodemanager, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.common.nodemanager, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.server.shared.with.core.engine, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.server.shared.with.core.engine, 12.1.3.0.0 打補丁... 正在爲組件 oracle.webservices.base, 12.1.3.0.0 打補丁... 正在爲組件 oracle.webservices.base, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.shared.with.cam, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.shared.with.cam, 12.1.3.0.0 打補丁... 正在爲組件 oracle.webservices.orawsdl, 12.1.3.0.0 打補丁... 正在爲組件 oracle.webservices.orawsdl, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.libraries.mod, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.libraries.mod, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.admin.console.en, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.admin.console.en, 12.1.3.0.0 打補丁... 正在爲組件 oracle.webservices.wls, 12.1.3.0.0 打補丁... 正在爲組件 oracle.webservices.wls, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.core.app.server, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.core.app.server, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.clients, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.clients, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.wlsportable.mod, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.wlsportable.mod, 12.1.3.0.0 打補丁... 正在爲組件 oracle.fmwconfig.common.wls.shared, 12.1.3.0.0 打補丁... 正在爲組件 oracle.fmwconfig.common.wls.shared, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.libraries, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.libraries, 12.1.3.0.0 打補丁... RollbackSession 從產品清單中刪除中間補丁程序 '29633448' OPatch 在自動回退後返回到補丁程序 '30463093' 的應用程序。 正在爲組件 oracle.wls.workshop.code.completion.support, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.workshop.code.completion.support, 12.1.3.0.0 打補丁... 正在爲組件 oracle.css.mod, 12.1.3.0.0 打補丁... 正在爲組件 oracle.css.mod, 12.1.3.0.0 打補丁... 正在爲組件 oracle.fmwconfig.common.shared, 12.1.3.0.0 打補丁... 正在爲組件 oracle.fmwconfig.common.shared, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.common.nodemanager, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.common.nodemanager, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.server.shared.with.core.engine, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.server.shared.with.core.engine, 12.1.3.0.0 打補丁... 正在爲組件 oracle.webservices.base, 12.1.3.0.0 打補丁... 正在爲組件 oracle.webservices.base, 12.1.3.0.0 打補丁... 正在爲組件 oracle.webservices.orawsdl, 12.1.3.0.0 打補丁... 正在爲組件 oracle.webservices.orawsdl, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.admin.console.nonen, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.admin.console.nonen, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.shared.with.cam, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.shared.with.cam, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.libraries.mod, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.libraries.mod, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.admin.console.en, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.admin.console.en, 12.1.3.0.0 打補丁... 正在爲組件 oracle.webservices.wls, 12.1.3.0.0 打補丁... 正在爲組件 oracle.webservices.wls, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.core.app.server, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.core.app.server, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.clients, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.clients, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.wlsportable.mod, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.wlsportable.mod, 12.1.3.0.0 打補丁... 正在爲組件 oracle.fmwconfig.common.wls.shared, 12.1.3.0.0 打補丁... 正在爲組件 oracle.fmwconfig.common.wls.shared, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.libraries, 12.1.3.0.0 打補丁... 正在爲組件 oracle.wls.libraries, 12.1.3.0.0 打補丁... Verifying the update... Patch 30463093 successfully applied Log file location: /home/oracle/Middleware/cfgtoollogs/opatch/30463093_Mar_04_2020_16_34_45/apply2020-03-04_16-34-40下午_1.log OPatch succeeded.
操做指令以下: [oracle@weblogic 30463093]$ ./opatch lspatches [oracle@weblogic OPatch]$ ./opatch lspatches 三月 04, 2020 6:05:10 下午 oracle.sysman.oii.oiii.OiiiInstallAreaControl initAreaControl 信息: Install area Control created with access level 0 30463093;WLS PATCH SET UPDATE 12.1.3.0.191015 OPatch succeeded.
例:/home/oracle/Middleware/OPatch/目錄下有兩個補丁 [oracle@weblogic OPatch]$ pwd /home/oracle/Middleware/OPatch/ [oracle@weblogic OPatch]$ ll 29633448/ 28298916/ [oracle@weblogic OPatch]$ /home/oracle/Middleware/OPatch/opatch napply -id 29633448, 28298916
操做指令以下: [oracle@weblogic OPatch]$ pwd /home/oracle/Middleware/OPatch/ [oracle@weblogic OPatch]$ /home/oracle/Middleware/OPatch/opatch nrollback -id 29633448
操做指令以下: [oracle@weblogic OPatch]$ pwd /home/oracle/Middleware/OPatch/ [oracle@weblogic OPatch]$ /home/oracle/Middleware/OPatch/opatch nrollback -id 29633448, 28298916
To verify what patches have been applied to an Oracle home, or to find out additional information about the Oracle home, use the opatch lsinventory command.
驗證什麼補丁已經應用到Oracle Home,或瞭解Oracle Home附加的信息,使用opatch lsinventory命令。app
[oracle@weblogic OPatch]$ /home/oracle/Middleware/OPatch/opatch lsinventory -jdk $JAVA_HOME Oracle 中間補丁程序安裝程序版本 13.2.0.0.0 版權全部 (c) 2014, Oracle Corporation。保留全部權利。 Oracle Home : /home/oracle/Middleware Central Inventory : /home/oracle/oraInventory1 from : /home/oracle/Middleware/oraInst.loc OPatch version : 13.2.0.0.0 OUI version : 13.2.0.0.0 Log file location : /home/oracle/Middleware/cfgtoollogs/opatch/opatch2020-03-04_16-39-03下午_1.log OPatch detects the Middleware Home as "/home/oracle/Middleware" 三月 04, 2020 4:39:08 下午 oracle.sysman.oii.oiii.OiiiInstallAreaControl initAreaControl 信息: Install area Control created with access level 0 Lsinventory Output file location : /home/oracle/Middleware/cfgtoollogs/opatch/lsinv/lsinventory2020-03-04_16-39-03下午.txt -------------------------------------------------------------------------------- 中間補丁程序 (1) : Patch 30463093 : applied on Wed Mar 04 16:38:16 CST 2020 Unique Patch ID: 23094631 Patch description: "WLS PATCH SET UPDATE 12.1.3.0.191015" Created on 3 Oct 2019, 14:45:59 hrs PST8PDT Bugs fixed: 24482639, 27829330, 29585355, 27228370, 29750025, 29752735, 25832897 29671344, 28973782, 29957539, 29158881, 18516704, 20446229, 28166339 24931180, 29921455, 24468857, 29356775, 23857587, 30153412, 24705722 29448643, 23071867, 29671623, 29870012, 29726561, 29701537, 29312272 26403575, 29667975, 28891448, 29140540, 29140516, 28998139, 28874066 29140551, 29140549, 26791760, 29140508, 29140555, 28626991, 26353793 28110087, 28313163, 28594324, 26624375, 28409586, 28375173, 28481582 28140800, 28375702, 27988175, 28043040, 17905354, 20020455, 27416586 27417245, 27445260, 27947832, 18412312, 27934864, 27819370, 27234961 25993295, 27948303, 26769768, 26439373, 20952741, 27565682, 26608537 25987400, 26806438, 26885274, 26835012, 26038824, 23304470, 27117282 23049601, 26589850, 26985581, 25750303, 26547016, 27111664, 25205507 26797049, 20952475, 19763916, 22690676, 24618043, 24376591, 25355394 24469063, 24818026, 18854885, 26144830, 19828316, 21270142, 26044754 21241854, 26596622, 22083678, 18746053, 21562338, 22746640, 20047315 19926398, 21549018, 20162146, 20774032, 25917709, 26632886, 26563889 25439226, 25174732, 21748022, 26861216, 18597348, 23342794, 25823774 25695948, 20969389, 25955347, 20432957, 21902034, 24341200, 18387934 21652727, 25720769, 21225816, 20256190, 24837293, 16956849, 21347054 25375968, 25522149, 24533963, 24802574, 19175526, 22586217, 25743025 21562704, 19721047, 24828619, 25743005, 22540656, 20207088, 18485034 26144926, 25118289, 20629733, 20197139, 25534314, 25577947, 24399682 24817968, 23099318, 22383225, 23326877, 22107941, 22759067, 25590885 19170125, 22901740, 19865550, 25192229, 19549507, 20311530, 22950801 19565095, 20430490, 25164167, 19234430, 20193085, 21081720, 25317743 21158132, 25059150, 20671165, 23555480, 20717353, 25497443, 22261241 18974055, 21189073, 20157787, 23733891, 21119215, 20205647, 25029531 22987229, 22749253, 19472793, 17889922, 24305841, 23640078, 20692185 22836462, 23063611, 22860104, 19150684, 24522430, 23732201, 19775778 23223461, 21834255, 23735210, 23103220, 22999996, 22850769, 18438079 22486599, 22900750, 20419243, 22541225, 20739167, 22829635, 23004029 22836557, 20736912, 22910817, 19150123, 21647599, 18144979, 24750930 18806464, 21545042, 20585084, 22249331, 22550116, 20062321, 21603584 21964759, 20226151, 20672949, 23107300, 22097019, 19463153, 19689036 20783846, 22378134, 22599178, 19947189, 23099223, 21836275, 20220959 16815912, 19467894, 20246732, 22574362, 20080046, 21522926, 19986568 20551651, 18123824, 21294990, 21947902, 20907322, 21561271, 22666897 21129379, 20128089, 20720853, 18559995, 19263075, 19425078, 20721340 20087183, 20044804, 14236278, 21083766, 20786128, 22498352, 20758488 22100830, 21039390, 22339918, 22049932, 19477196, 19212729, 21519519 19928803, 19790693, 21516492, 20229977, 22200449, 22200523, 22175246 19703527, 21495475, 22248079, 19879223, 21252292, 18836900, 19883023 20333386, 21615827, 18428696, 17702917, 19874466, 18945422, 19953516 20613957, 21756751, 22247869, 22200594, 17968606, 22200491, 19585666 19668883, 18082758, 19917893, 18722098, 18466848, 19705162, 19973098 20471785, 19500276, 20169972, 19917991, 19422493, 19299358, 18746515 20323632, 20080751, 19351700, 21746415, 19297004, 19001915, 18718889 20798352, 20758863, 17394051, 16562029, 21169554, 18432174, 20266379 20206879, 19080525, 21107126, 19268444, 18729264, 19852007, 20985893 20523619, 21069524, 20814890, 20906638, 18376812, 19936917, 18481239 18727635, 19556868, 18289179, 18964349, 18305935, 19459949, 19066738 19988824, 19265688, 19033547, 19533331, 19576633, 18753794, 19907066 18671042, 18912482, 18922324, 19339238, 17721032, 18538501, 19942900 19730967, 18276961, 19287842, 18589879, 17012341, 19287874, 18691894 18859387, 18968900 -------------------------------------------------------------------------------- OPatch succeeded.
步驟1、先關閉java進程服務
步驟2、進入D:\weblogic\middleware\OPatch\30463093目錄下,執行補丁更新操做,具體操做以下:
Ø 在按住鍵盤上的Ctrl與Shift按鍵的同時鼠標右鍵點擊界面空白處,在彈出的窗口中選擇「在此處打開命令窗口」:
ide
執行命令以下(注:安裝過程當中,會有一次提示,須要鍵盤輸入y繼續安裝): D:\weblogic\middleware\OPatch\opatch.bat apply -jdk %JAVA_HOME%
步驟三:執行補丁查詢指令,確認已經安裝的補丁信息ui
指令以下: D:\weblogic\middleware\OPatch\opatch.bat lsinventory -jdk %JAVA_HOME%