您好,登錄后才能下訂單哦!
1. 下載補丁和最新OPatch
GI PSU : p25869727_112040_Linux-x86-64.zip
OPatch : p6880880_112000_Linux-x86-64.zip
說明:GI PSU包括DB PSU,CPU。單機與RAC的opatch通用,單機與rac的psu不通用。
2. 檢查數據庫當前OPatch版本
RAC所有節點的GI home和DB home都需要檢查。
$ $ORACLE_HOME/OPatch/opatch version
3. 更新OPatch,RAC所有節點的GI home和DB home都需要更新。
3.1 更新grid用戶的OPatch
-- grid用戶操作
node1-> echo $ORACLE_HOME
/u01/app/11.2.0/grid
-- root用戶執行,/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 權限。
3.2 更新oracle用戶的OPatch
-- oracle用戶執行
node1-> echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/db_1
-- root用戶執行,/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. 解壓補丁文件 (所有節點的 grid,oracle都要解壓psu文件)
-- root用戶執行
[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. 所有節點都要檢查補丁之間有無沖突
5.1 Node1節點 grid用戶檢查
grid用戶執行結果:
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節點 oracle用戶檢查
oracle執行結果:
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. 為數據庫做冷備份 (如果不考慮安全性,這步可以省略,有點點風險)
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上級目錄整個備份)
tar -zcvpf db_20170802.tar.gz dbhome_1/
7. 停止 node1 數據庫實例 和 node1 crs服務
root用戶登錄節點1
-- root用戶執行,/u01/app/11.2.0/grid/ 為grid用戶的 $ORACLE_HOME
[root@node1 bin]# ./srvctl stop instance -d devdb -i devdb1 (停node1的數據庫實例)
[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. 手動更新補丁
8.1 節點1 grid 用戶執行
node1-> $ORACLE_HOME/OPatch/opatch napply -oh $ORACLE_HOME -local /tmp/grid_psu/26030799/
輸出略..
OPatch succeeded.
8.2 節點1 oracle 用戶執行
[oracle@jyracdb1 ~]$ $ORACLE_HOME/OPatch/opatch napply -oh $ORACLE_HOME -local /tmp/grid_psu/26030799/25869727/
輸出略..
OPatch succeeded.
8.3 執行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 啟動 node1 數據庫實例 和 node1 crs服務(實際上前面執行 rootcrs.pl -patch 已經讓node1的crs起來了)
[root@node1 bin]# ./srvctl start instance -d devdb -i devdb1
8.5 然后在節點2重復節點1(停止節點二數據庫和節點二crs服務、grid、oracle打補丁、rootadd_rdbms.sh 、rootcrs.pl -patch)操作
9. 升級字典操作(升級數據庫字典,要停業務。如果打補丁在DBCA之前,則不需要升級數據庫字典,反之則需要升級數據庫字典)
由于RAC實際只有一個數據庫,因此任意節點登錄數據庫執行1次即可。最后重啟數據庫。
9.1 關閉數據庫實例及相關進程 (靜態監聽、動態監聽、EOM、相關服務)
--停止數據庫外部進程
[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 正式升級數據庫的數據字典
[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. 驗證補丁更新結果
各節點的GI HOME和ORACLE HOME都執行驗證。
-- 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
--查看無效對象
select count(*) from dba_objects where status<>'VALID';
COUNT(*)
----------
0
11. 啟動監聽,對外提供服務,查看監聽是否正常
[root@node1 bin]# ./srvctl start listener
[root@node1 bin]# ./srvctl status listener
補充:更新最新補丁 p26610246_112040_Linux-x86-64.zip 集群補丁中,db補丁為26609445
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。