RAC和ASM環境下打patch
在RAC環境下打patch與單節點類似,不過在RAC環境下Oracle提供了rolling patch方式,降低打patch對資料庫的影響。
以下是基於RAC + ASM環境的patch步驟,簡單記錄。
[oracle@dwdb01 tmp]$ unzip p10017048_10205_Linux-x86-64.zip
Archive: p10017048_10205_Linux-x86-64.zip
creating: 10017048/
creating: 10017048/files/
creating: 10017048/files/lib/
creating: 10017048/files/lib/libserver10.a/
inflating: 10017048/files/lib/libserver10.a/kkfd.o
creating: 10017048/etc/
creating: 10017048/etc/config/
inflating: 10017048/etc/config/inventory
inflating: 10017048/etc/config/actions
creating: 10017048/etc/xml/
inflating: 10017048/etc/xml/GenericActions.xml
inflating: 10017048/etc/xml/ShiphomeDirectoryStructure.xml
inflating: 10017048/README.txt
2. 停止服務
這裡要分幾種情況:
1) 如果是rolling patch方式打補丁,則只需要先停止第一個需要patch的節點;為了簡單起見,你也可以停止所有的節點例項,不過這樣的話停機時間會增加。
2) 如果ASM和Oracle例項執行在同一個ORACLE_HOME下,則需要把ASM和資料庫例項都關閉,否則只需要管理資料庫例項即可。
這裡的環境是ASM和Oracle例項在同一個ORACLE_HOME下,也因為這還不是生產庫,因此可以簡單地把相關服務都停掉。
[oracle@dwdb01 10017048]$ srvctl stop database -d dwrac
[oracle@dwdb01 10017048]$ srvctl stop asm -n dwdb01
[oracle@dwdb01 10017048]$ srvctl stop asm -n dwdb02
[oracle@dwdb01 10017048]$ srvctl stop asm -n dwdb03
[oracle@dwdb01 10017048]$ srvctl stop asm -n dwdb04
可以透過crs_stat檢查一下狀態。
3. 打補丁
[oracle@dwdb01 ]$ cd 10017048
[oracle@dwdb01 10017048]$ export ORACLE_SID=dwrac1
[oracle@dwdb01 10017048]$ /oracle/product/10.2.0/db/OPatch/opatch apply
Invoking OPatch 10.2.0.4.9
Oracle Interim Patch Installer version 10.2.0.4.9
Copyright (c) 2009, Oracle Corporation. All rights reserved.
Oracle Home : /oracle/product/10.2.0/db
Central Inventory : /oracle/oraInventory
from : /etc/oraInst.loc
OPatch version : 10.2.0.4.9
OUI version : 10.2.0.5.0
OUI location : /oracle/product/10.2.0/db/oui
Log file location : /oracle/product/10.2.0/db/cfgtoollogs/opatch/opatch2011-02-23_19-13-23PM.log
Patch history file: /oracle/product/10.2.0/db/cfgtoollogs/opatch/opatch_history.txt
ApplySession applying interim patch '10017048' to OH '/oracle/product/10.2.0/db'
Running prerequisite checks...
OPatch detected the node list and the local node from the inventory. OPatch will patch the local system then propagate the patch to the remote nodes.
This node is part of an Oracle Real Application Cluster.
Remote nodes: 'dwdb02' 'dwdb03' 'dwdb04'
Local node: 'dwdb01'
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/oracle/product/10.2.0/db')
Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '10017048' for restore. This might take a while...
Backing up files affected by the patch '10017048' for rollback. This might take a while...
Patching component oracle.rdbms, 10.2.0.5.0...
Updating archive file "/oracle/product/10.2.0/db/lib/libserver10.a" with "lib/libserver10.a/kkfd.o"
Running make for target ioracle
ApplySession adding interim patch '10017048' to inventory
Verifying the update...
Inventory check OK: Patch ID 10017048 is registered in Oracle Home inventory with proper meta-data.
Files check OK: Files from Patch ID 10017048 are present in Oracle Home.
The local system has been patched. You can restart Oracle instances on it.
Patching in rolling mode.
Remaining nodes to be patched:
'dwdb02' 'dwdb03' 'dwdb04'
What is the next node to be patched?
dwdb02
You have selected 'dwdb02' from 'dwdb02' 'dwdb03' 'dwdb04'
The node 'dwdb02' will be patched next.
Please shutdown Oracle instances running out of this ORACLE_HOME on 'dwdb02'.
(Oracle Home = '/oracle/product/10.2.0/db')
Is the node ready for patching? [y|n]
y
User Responded with: Y
Updating nodes 'dwdb02'
Apply-related files are:
FP = "/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/copy_files.txt"
DP = "/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/copy_dirs.txt"
MP = "/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/make_cmds.txt"
RC = "/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/remote_cmds.txt"
Instantiating the file "/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/copy_files.txt.instantiated" by replacing $ORACLE_HOME in "/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/copy_files.txt" with actual path.
Propagating files to remote nodes...
Instantiating the file "/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/copy_dirs.txt.instantiated" by replacing $ORACLE_HOME in "/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/copy_dirs.txt" with actual path.
Propagating directories to remote nodes...
Instantiating the file "/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/make_cmds.txt.instantiated" by replacing $ORACLE_HOME in "/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/make_cmds.txt" with actual path.
Running command on remote node 'dwdb02':
cd /oracle/product/10.2.0/db/rdbms/lib; /usr/bin/make -f ins_rdbms.mk ioracle ORACLE_HOME=/oracle/product/10.2.0/db || echo REMOTE_MAKE_FAILED::>&2
The node 'dwdb02' has been patched. You can restart Oracle instances on it.
Remaining nodes to be patched:
'dwdb03' 'dwdb04'
What is the next node to be patched?
dwdb03
You have selected 'dwdb03' from 'dwdb03' 'dwdb04'
The node 'dwdb03' will be patched next.
Please shutdown Oracle instances running out of this ORACLE_HOME on 'dwdb03'.
(Oracle Home = '/oracle/product/10.2.0/db')
Is the node ready for patching? [y|n]
y
User Responded with: Y
Updating nodes 'dwdb03'
Apply-related files are:
FP = "/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/copy_files.txt"
DP = "/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/copy_dirs.txt"
MP = "/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/make_cmds.txt"
RC = "/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/remote_cmds.txt"
Propagating files to remote nodes...
Propagating directories to remote nodes...
Instantiating the file "/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/make_cmds.txt.instantiated" by replacing $ORACLE_HOME in "/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/make_cmds.txt" with actual path.
Running command on remote node 'dwdb03':
cd /oracle/product/10.2.0/db/rdbms/lib; /usr/bin/make -f ins_rdbms.mk ioracle ORACLE_HOME=/oracle/product/10.2.0/db || echo REMOTE_MAKE_FAILED::>&2
The node 'dwdb03' has been patched. You can restart Oracle instances on it.
The node 'dwdb04' will be patched next.
Please shutdown Oracle instances running out of this ORACLE_HOME on 'dwdb04'.
(Oracle Home = '/oracle/product/10.2.0/db')
Is the node ready for patching? [y|n]
y
User Responded with: Y
Updating nodes 'dwdb04'
Apply-related files are:
FP = "/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/copy_files.txt"
DP = "/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/copy_dirs.txt"
MP = "/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/make_cmds.txt"
RC = "/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/remote_cmds.txt"
Propagating files to remote nodes...
Propagating directories to remote nodes...
Instantiating the file "/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/make_cmds.txt.instantiated" by replacing $ORACLE_HOME in "/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/make_cmds.txt" with actual path.
Running command on remote node 'dwdb04':
cd /oracle/product/10.2.0/db/rdbms/lib; /usr/bin/make -f ins_rdbms.mk ioracle ORACLE_HOME=/oracle/product/10.2.0/db || echo REMOTE_MAKE_FAILED::>&2
The node 'dwdb04' has been patched. You can restart Oracle instances on it.
There were relinks on remote nodes. Remember to check the binary size and timestamp on the nodes 'dwdb02' 'dwdb03' 'dwdb04' .
The following make commands were invoked on remote nodes:
'cd /oracle/product/10.2.0/db/rdbms/lib; /usr/bin/make -f ins_rdbms.mk ioracle ORACLE_HOME=/oracle/product/10.2.0/db
'
OPatch succeeded.
整個打補丁的過程,Oracle會詢問是否需要在其他節點打,直到所有節點都打上補丁。注意,要用到這一特性,需要配置ssh互信。
4. 最後啟動asm和資料庫例項
[oracle@dwdb01 bin]$ srvctl start asm -n dwdb01
[oracle@dwdb01 bin]$ srvctl start asm -n dwdb02
[oracle@dwdb01 bin]$ srvctl start asm -n dwdb03
[oracle@dwdb01 bin]$ srvctl start asm -n dwdb04
[oracle@dwdb01 bin]$ srvctl start database -d dwrac
[oracle@dwdb01 bin]$ srvctl start service -d dwrac
如果嚴格使用rolling patch的方式的話,則步驟是:
1. 在第一個節點停止ASM和Oracle instance(ASM和Oracle共用一個ORACLE_HOME)
srvctl stop instance -d dwrac -i dwrac1
srvctl stop asm -n dwdb01
2. 在第一個節點打補丁
opatch apply
打完第一個補丁後,Oracle會詢問下一個需要打patch是那個。
3. 另開視窗,啟動第一個節點的資源,並關閉下一個需要打patch的資源
srvctl start instance -d dwrac -i dwrac1
srvctl start asm -n dwdb01
srvctl stop instance -d dwrac -i dwrac2
srvctl stop asm -n dwdb02
4. 依此類推,直到所有節點打完patch為止
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/231499/viewspace-1046629/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle RAC環境下ASM磁碟組擴容OracleASM
- Oracle 11.2.0.4 rac for aix acfs異常環境的克隆環境ASM磁碟組掛載緩慢OracleAIASM
- RAC環境下建立物理DATAGUARD(1)
- RAC環境下建立物理DATAGUARD(2)
- 通過ORACLE VM virtualbox環境安裝oracle 11G RAC(ASM)OracleASM
- DG環境下打補丁
- Oracle RAC 環境下的連線管理Oracle
- goldengate + asm + racGoASM
- LINUX 的patch 製作,及打patchLinux
- 打 patch 報錯:corrupt patch at line 36
- RAC+ASM+DATAGUARDASM
- RAC環境下的SEQUENCE對應用的影響
- ORA-15137: The ASM cluster is in rolling patch stateASM
- RAC環境修改spfile的位置
- KingbaseES RAC部署案例之---SAN環境構建RAC
- Oracle RAC 第二節點打補丁報錯 oui-patch.xml (Permission denied)OracleUIXML
- 手工清理19c RAC環境
- Oracle RAC環境新增新的network和listener(未完成)Oracle
- 【RAC】asm_diskgroups 引數ASM
- Git 打補丁-- patch 和 diff 的使用(詳細)Git
- Git 打補丁– patch 和 diff 的使用(詳細)Git
- 如何在rac環境中增加監聽
- window環境下安裝和切換兩個python環境Python
- oracle RAC+DG 擴容ASM和表空間(Linux)OracleASMLinux
- RAC安裝【AIX 7 + 11.2.0.4 + ASM】AIASM
- RAC+DG(asm單例項)ASM單例
- 超大記憶體環境下的Oracle RAC引數設定建議記憶體Oracle
- Windows環境下的Nginx環境搭建WindowsNginx
- Windows 環境下 Python 環境安裝WindowsPython
- window環境下testlink環境搭建(xammp)
- 如何使用git 生成patch 和打入patchGit
- 以太坊-Win環境下remix環境搭建REM
- 如何下載安裝jdk和配置環境JDK
- Linux系統下CUDA和cuDNN環境配置LinuxDNN
- Linux環境下nodejs和cnpm的安裝LinuxNodeJSNPM
- React 和 Vite 環境下 TailwindCSS 的配置指南ReactViteAICSS
- AIX 5.3/6.1環境下安裝Oracle 10gR2 RAC常見報錯AIOracle 10g
- Oracle RAC日常運維-ASM磁碟擴容Oracle運維ASM