您好,登錄后才能下訂單哦!
1. 下載補(bǔ)丁和最新OPatch
GI PSU : p25869727_112040_Linux-x86-64.zip
OPatch : p6880880_112000_Linux-x86-64.zip
說明:GI PSU包括DB PSU,CPU。單機(jī)與RAC的opatch通用,單機(jī)與rac的psu不通用。
2. 檢查數(shù)據(jù)庫當(dāng)前OPatch版本
RAC所有節(jié)點(diǎn)的GI home和DB home都需要檢查。
$ $ORACLE_HOME/OPatch/opatch version
3. 更新OPatch,RAC所有節(jié)點(diǎn)的GI home和DB home都需要更新。
3.1 更新grid用戶的OPatch
-- grid用戶操作
node1-> echo $ORACLE_HOME
/u01/app/11.2.0/grid
-- root用戶執(zhí)行,/u01/app/11.2.0/grid/為grid用戶下的$ORACLE_HOME路徑
[root@node1 tmp]# mv /u01/app/11.2.0/grid/OPatch /u01/app/11.2.0/grid/OPatch_bak
[root@node1 tmp]# ll p6880880_112000_Linux-x86-64.zip
-rw-r--r--. 1 grid oinstall 99065778 Aug 3 03:07 p6880880_112000_Linux-x86-64.zip
[root@node1 tmp]# unzip p6880880_112000_Linux-x86-64.zip -d /u01/app/11.2.0/grid/
[root@node1 tmp]# chown -R grid:oinstall /u01/app/11.2.0/grid/OPatch
-- grid用戶操作
node1-> $ORACLE_HOME/OPatch/opatch version
OPatch Version: 11.2.0.3.16
OPatch succeeded.
說明:需要注意grid用戶$ORACLE_HOME 權(quán)限。
3.2 更新oracle用戶的OPatch
-- oracle用戶執(zhí)行
node1-> echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/db_1
-- root用戶執(zhí)行,/u01/app/oracle/product/11.2.0/db_1 為oracle用戶下的$ORACLE_HOME路徑
[root@node1 tmp]# mv /u01/app/oracle/product/11.2.0/db_1/OPatch /u01/app/oracle/product/11.2.0/db_1/OPatch_bak
[root@node1 tmp]# unzip p6880880_112000_Linux-x86-64.zip -d /u01/app/oracle/product/11.2.0/db_1/
[root@node1 tmp]# chown -R oracle:oinstall /u01/app/oracle/product/11.2.0/db_1/OPatch
-- oracle用戶操作
node1-> $ORACLE_HOME/OPatch/opatch version
OPatch Version: 11.2.0.3.16
OPatch succeeded.
4. 解壓補(bǔ)丁文件 (所有節(jié)點(diǎn)的 grid,oracle都要解壓psu文件)
-- root用戶執(zhí)行
[root@node1 tmp]# unzip p26030799_112040_Linux-x86-64.zip -d /tmp/grid_psu/
[root@node1 tmp]# chown -R grid:oinstall /tmp/grid_psu/
[root@node1 tmp]# unzip p26030799_112040_Linux-x86-64.zip -d /tmp/ora_psu/
[root@node1 tmp]# chown -R oracle:oinstall /tmp/ora_psu/
5. 所有節(jié)點(diǎn)都要檢查補(bǔ)丁之間有無沖突
5.1 Node1節(jié)點(diǎn) grid用戶檢查
grid用戶執(zhí)行結(jié)果:
node1-> cd 26030799/
node1-> $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 11.2.0.3.16
Copyright (c) 2017, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u01/app/11.2.0/grid
Central Inventory : /u01/app/oraInventory
from : /u01/app/11.2.0/grid/oraInst.loc
OPatch version : 11.2.0.3.16
OUI version : 11.2.0.4.0
Log file location : /u01/app/11.2.0/grid/cfgtoollogs/opatch/opatch3017-08-03_03-53-17AM_1.log
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.
5.2 Node1節(jié)點(diǎn) oracle用戶檢查
oracle執(zhí)行結(jié)果:
node1-> cd 26030799/
node1-> $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /tmp/grid_psu/26030799/ -oh $ORACLE_HOME
Oracle Interim Patch Installer version 11.2.0.3.16
Copyright (c) 2017, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u01/app/oracle/product/11.2.0/db_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/11.2.0/db_1/oraInst.loc
OPatch version : 11.2.0.3.16
OUI version : 11.2.0.4.0
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch3017-08-03_05-39-28AM_1.log
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.
6. 為數(shù)據(jù)庫做冷備份 (如果不考慮安全性,這步可以省略,有點(diǎn)點(diǎn)風(fēng)險(xiǎn))
RMAN>run {
shutdown immediate;
startup mount;
allocate channel c1 type disk;
allocate channel c2 type disk;
backup full tag='db_full_bak' database format '/home/oracle/rmanbak/full_cold_%d_%s.bak';
alter database open;
}
使用root用戶備份oracle_home (將#ORACLE_HOME上級(jí)目錄整個(gè)備份)
tar -zcvpf db_20170802.tar.gz dbhome_1/
7. 停止 node1 數(shù)據(jù)庫實(shí)例 和 node1 crs服務(wù)
root用戶登錄節(jié)點(diǎn)1
-- root用戶執(zhí)行,/u01/app/11.2.0/grid/ 為grid用戶的 $ORACLE_HOME
[root@node1 bin]# ./srvctl stop instance -d devdb -i devdb1 (停node1的數(shù)據(jù)庫實(shí)例)
[root@node1 bin]# /u01/app/11.2.0/grid/crs/install/rootcrs.pl -unlock
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'node1'
.....
Successfully unlock /u01/app/11.2.0/grid
8. 手動(dòng)更新補(bǔ)丁
8.1 節(jié)點(diǎn)1 grid 用戶執(zhí)行
node1-> $ORACLE_HOME/OPatch/opatch napply -oh $ORACLE_HOME -local /tmp/grid_psu/26030799/
輸出略..
OPatch succeeded.
8.2 節(jié)點(diǎn)1 oracle 用戶執(zhí)行
[oracle@jyracdb1 ~]$ $ORACLE_HOME/OPatch/opatch napply -oh $ORACLE_HOME -local /tmp/grid_psu/26030799/25869727/
輸出略..
OPatch succeeded.
8.3 執(zhí)行rootadd_rdbms.sh 、rootcrs.pl -patch
su – root
[root@node1 26030799]# /u01/app/11.2.0/grid/rdbms/install/rootadd_rdbms.sh
[root@node1 26030799]# /u01/app/11.2.0/grid/crs/install/rootcrs.pl -patch
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
Installing Trace File Analyzer
CRS-4123: Oracle High Availability Services has been started.
8.4 啟動(dòng) node1 數(shù)據(jù)庫實(shí)例 和 node1 crs服務(wù)(實(shí)際上前面執(zhí)行 rootcrs.pl -patch 已經(jīng)讓node1的crs起來了)
[root@node1 bin]# ./srvctl start instance -d devdb -i devdb1
8.5 然后在節(jié)點(diǎn)2重復(fù)節(jié)點(diǎn)1(停止節(jié)點(diǎn)二數(shù)據(jù)庫和節(jié)點(diǎn)二crs服務(wù)、grid、oracle打補(bǔ)丁、rootadd_rdbms.sh 、rootcrs.pl -patch)操作
9. 升級(jí)字典操作(升級(jí)數(shù)據(jù)庫字典,要停業(yè)務(wù)。如果打補(bǔ)丁在DBCA之前,則不需要升級(jí)數(shù)據(jù)庫字典,反之則需要升級(jí)數(shù)據(jù)庫字典)
由于RAC實(shí)際只有一個(gè)數(shù)據(jù)庫,因此任意節(jié)點(diǎn)登錄數(shù)據(jù)庫執(zhí)行1次即可。最后重啟數(shù)據(jù)庫。
9.1 關(guān)閉數(shù)據(jù)庫實(shí)例及相關(guān)進(jìn)程 (靜態(tài)監(jiān)聽、動(dòng)態(tài)監(jiān)聽、EOM、相關(guān)服務(wù))
--停止數(shù)據(jù)庫外部進(jìn)程
[root@11g ~]#ps -ef|grep -v grep |grep LOCAL=NO|awk '{print $2}'|xargs kill -9
[oracle@11g rmanbak]$ cat /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
[root@node1 bin]# ./srvctl stop listener
[root@node1 bin]# ./srvctl status listener
[oracle@11g rmanbak]$ ps -ef |grep ora_|grep -v grep
[oracle@11g rmanbak]$ netstat -an |grep 1521
[oracle@11g rmanbak]$ netstat -an |grep 1158
[root@node1 bin]# ./srvctl stop database -d devdb
9.2 正式升級(jí)數(shù)據(jù)庫的數(shù)據(jù)字典
[root@node1 bin]# ./srvctl start database -d devdb
node1-> sqlplus / as sysdba
SQL> @$ORACLE_HOME/rdbms/admin/catbundle.sql psu apply
SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql
[root@node1 bin]# ./srvctl stop database -d devdb
[root@node1 bin]# ./srvctl start database -d devdb
10. 驗(yàn)證補(bǔ)丁更新結(jié)果
各節(jié)點(diǎn)的GI HOME和ORACLE HOME都執(zhí)行驗(yàn)證。
-- grid用戶
node1-> $ORACLE_HOME/OPatch/opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.3.16
Copyright (c) 2017, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/11.2.0/grid
Central Inventory : /u01/app/oraInventory
from : /u01/app/11.2.0/grid/oraInst.loc
OPatch version : 11.2.0.3.16
OUI version : 11.2.0.4.0
Log file location : /u01/app/11.2.0/grid/cfgtoollogs/opatch/opatch3017-08-03_07-27-26AM_1.log
Lsinventory Output file location : /u01/app/11.2.0/grid/cfgtoollogs/opatch/lsinv/lsinventory2017-08-03_07-27-26AM.txt
--------------------------------------------------------------------------------
Local Machine Information::
Hostname: node1.localdomain
ARU platform id: 226
ARU platform description:: Linux x86-64
Installed Top-level Products (1):
Oracle Grid Infrastructure 11g 11.2.0.4.0
There are 1 products installed in this Oracle Home.
Interim patches (3) :
Patch 25920335 : applied on Thu Aug 03 06:30:47 CST 2017
Unique Patch ID: 21279331
Patch description: "OCW Patch Set Update : 11.2.0.4.170718 (25920335)"
Created on 27 Jun 2017, 05:40:19 hrs PST8PDT
OPatch succeeded.
-- oracle用戶
node1-> sqlplus / as sysdba
SQL>
col ACTION_TIME for a30;
col COMMENTS for a20;
col BUNDLE_SERIES for a10;
select ACTION_TIME,BUNDLE_SERIES,COMMENTS from dba_registry_history;
ACTION_TIME BUNDLE_SER COMMENTS
------------------------------ ---------- --------------------
24-AUG-13 12.03.45.119862 PM PSU Patchset 11.2.0.2.0
24-FEB-17 05.51.27.427073 AM PSU Patchset 11.2.0.2.0
03-AUG-17 07.16.37.247390 AM PSU PSU 11.2.0.4.170718
--查看無效對(duì)象
select count(*) from dba_objects where status<>'VALID';
COUNT(*)
----------
0
11. 啟動(dòng)監(jiān)聽,對(duì)外提供服務(wù),查看監(jiān)聽是否正常
[root@node1 bin]# ./srvctl start listener
[root@node1 bin]# ./srvctl status listener
補(bǔ)充:更新最新補(bǔ)丁 p26610246_112040_Linux-x86-64.zip 集群補(bǔ)丁中,db補(bǔ)丁為26609445
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。