在RAC資料庫上滾動(Rolling)安裝或回退小補丁的方法及步驟
在RAC資料庫上安裝小補丁時,為了不停止業務,可以使用滾動安裝的方式(Rolling),也就是說,安裝補丁的時候,先停止一個資料庫例項,在這臺節點安裝
這個補丁,然後啟動這個例項,再停止下一個例項並安裝這個補丁,這樣能夠保證一直有可用的資料庫例項,業務能夠繼續。
使用滾動安裝的前提是這個補丁是可以Rolling安裝的,對於如何判斷一個補丁是Rolling的,下面的文章中會提到。
一般來說,大體的Rolling安裝的方式如下:
1. 下載補丁。
2. 打補丁之前,最好做一下資料庫的備份。
3. 檢查這次安裝的補丁是否和以往的補丁衝突。
4. 如果有測試庫,最好先在測試庫測試一下這個補丁。
5. 務必仔細閱讀補丁的Readme並按照其中的步驟來打補丁:
1). 用oracle使用者將這個補丁上傳到伺服器上的一個目錄.
2). 解壓這個檔案:
3). 停止1號機這個ORACLE_HOME下所有的資料庫例項+ASM例項(如果有);
4). 在1號機打補丁:
$cd $ORACLE_HOME/OPatch/10082277
$opatch apply
5). 然後opatch會問您是否要打下一個節點,這時候執行下面的操作:
6). 啟動1號機這個ORACLE_HOME下所有的資料庫例項+ASM例項(如果有);
7). 停止2號機這個ORACLE_HOME下所有的資料庫例項+ASM例項(如果有);
8). 在之前打補丁的那個提示符中,確認繼續打下一個節點;
9). 啟動2號機這個ORACLE_HOME下所有的資料庫例項+ASM例項(如果有);
10).如果有多個節點,依次執行。
下面是在10.2.0.4 RAC上滾動(Rolling)安裝補丁8575528的過程:
1).用oracle使用者將這個補丁上傳到伺服器上的一個目錄,比如:$ORACLE_HOME/OPatch下面.
$ pwd
/u01/app/oracle/OPatch
$ ls
docs emdpatch.pl jlib opatch opatch.ini opatch.pl opatchprereqs p8575528_10204_Linux-x86.zip
2).解壓這個檔案:
su - oracle
$ unzip p8575528_10204_Linux-x86.zip
Archive: p8575528_10204_Linux-x86.zip
creating: 8575528/
creating: 8575528/files/
creating: 8575528/files/lib/
creating: 8575528/files/lib/libserver10.a/
inflating: 8575528/files/lib/libserver10.a/kks1.o
inflating: 8575528/files/lib/libserver10.a/kksc.o
inflating: 8575528/files/lib/libserver10.a/kksh.o
inflating: 8575528/files/lib/libserver10.a/ksmp.o
creating: 8575528/etc/
creating: 8575528/etc/config/
inflating: 8575528/etc/config/inventory
inflating: 8575528/etc/config/actions
creating: 8575528/etc/xml/
inflating: 8575528/etc/xml/GenericActions.xml
inflating: 8575528/etc/xml/ShiphomeDirectoryStructure.xml
inflating: 8575528/README.txt
$ ls
8575528 docs emdpatch.pl jlib opatch opatch.ini opatch.pl opatchprereqs p8575528_10204_Linux-x86.zip
3).檢查這個補丁是不是可以在RAC上滾動安裝(rolling)。
$ $ORACLE_HOME/OPatch/opatch query -all /u01/app/oracle/OPatch/8575528|grep rolling
Patch is a rolling patch: true <=====可以滾動安裝
4).停止1號機資料庫的ORACLE_HOME下所有的資料庫例項(如果有ASM,也要停止):
$srvctl stop instance -d
$srvctl stop asm -n
比如:
$srvctl stop instance -d ONEPIECE -i ONEPIECE1
$srvctl stop asm -n nascds14
$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....E1.inst application OFFLINE OFFLINE
ora....SM1.asm application OFFLINE OFFLINE
5). 在1號機打補丁:
比如:
$su - oracle
$cd /u01/app/oracle/OPatch/8575528
$opatch apply
Invoking OPatch 10.2.0.4.2
Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/oracle
Central Inventory : /home/oracle/oraInventory
from : /etc/oraInst.loc
OPatch version : 10.2.0.4.2
OUI version : 10.2.0.4.0
OUI location : /u01/app/oracle/oui
Log file location : /u01/app/oracle/cfgtoollogs/opatch/opatch2012-06-13_01-27-38AM.log
ApplySession applying interim patch '8575528' to OH '/u01/app/oracle'
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: 'nascds15'
Local node: 'nascds14'
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle')
Is the local system ready for patching? [y|n]
y <======輸入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 '8575528' for restore. This might take a while...
Backing up files affected by the patch '8575528' for rollback. This might take a while...
Patching component oracle.rdbms, 10.2.0.4.0...
Updating archive file "/u01/app/oracle/lib/libserver10.a" with "lib/libserver10.a/kks1.o"
Updating archive file "/u01/app/oracle/lib/libserver10.a" with "lib/libserver10.a/kksc.o"
Updating archive file "/u01/app/oracle/lib/libserver10.a" with "lib/libserver10.a/kksh.o"
Updating archive file "/u01/app/oracle/lib/libserver10.a" with "lib/libserver10.a/ksmp.o"
Running make for target ioracle
ApplySession adding interim patch '8575528' to inventory
Verifying the update...
Inventory check OK: Patch ID 8575528 is registered in Oracle Home inventory with proper meta-data.
Files check OK: Files from Patch ID 8575528 are present in Oracle Home.
The local system has been patched. You can restart Oracle instances on it.
Patching in rolling mode.
The node 'nascds15' will be patched next.
Please shutdown Oracle instances running out of this ORACLE_HOME on 'nascds15'.
(Oracle Home = '/u01/app/oracle')
Is the node ready for patching? [y|n]
6). 然後opatch會問您是否要打下一個節點。這時候執行下面的操作。
7). 啟動1號機的ASM 例項和資料庫例項:
$srvctl start asm -n
$srvctl start instance -d
比如:
$srvctl start asm -n nascds14
$srvctl start instance -d ONEPIECE -i ONEPIECE1
$crs_stat -t
ora....E1.inst application ONLINE ONLINE nascds14
ora....SM1.asm application ONLINE ONLINE nascds14
8).停止2號機的ASM例項和資料庫例項:
$srvctl stop instance -d
$srvctl stop asm -n
$srvctl stop instance -d ONEPIECE -i ONEPIECE2
$srvctl stop asm -n nascds15
$crs_stat
ora....E2.inst application OFFLINE OFFLINE
ora....SM2.asm application OFFLINE OFFLINE
9). 在之前打補丁的那個提示符中,確認繼續打下一個節點。
Is the node ready for patching? [y|n]
y <====輸入y
User Responded with: Y
Updating nodes 'nascds15'
Apply-related files are:
FP = "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/copy_files.txt"
DP = "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/copy_dirs.txt"
MP = "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/make_cmds.txt"
RC = "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/remote_cmds.txt"
Instantiating the file "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/copy_files.txt.instantiated"
by replacing $ORACLE_HOME in "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/copy_files.txt" with
actual path.
Propagating files to remote nodes...
Instantiating the file "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/copy_dirs.txt.instantiated"
by replacing $ORACLE_HOME in "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/copy_dirs.txt" with
actual path.
Propagating directories to remote nodes...
Instantiating the file "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/make_cmds.txt.instantiated"
by replacing $ORACLE_HOME in "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/make_cmds.txt" with
actual path.
Running command on remote node 'nascds15':
cd /u01/app/oracle/rdbms/lib; /usr/bin/make -f ins_rdbms.mk ioracle ORACLE_HOME=/u01/app/oracle || echo
REMOTE_MAKE_FAILED::>&2
The node 'nascds15' 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 'nascds15' .
The following make commands were invoked on remote nodes:
'cd /u01/app/oracle/rdbms/lib; /usr/bin/make -f ins_rdbms.mk ioracle ORACLE_HOME=/u01/app/oracle
'
OPatch succeeded.
10). 啟動2號機的ASM例項和資料庫例項:
$srvctl start asm -n
$srvctl start instance -d
比如:
$srvctl start asm -n nascds15
$srvctl start instance -d ONEPIECE -i ONEPIECE2
11).在兩個節點分別執行下面的命令來確認補丁已經安裝成功。
$ORACLE_HOME/OPatch/opatch lsinventory
[oracle@nascds14 8575528]$ $ORACLE_HOME/OPatch/opatch lsinventory
Invoking OPatch 10.2.0.4.2
Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/oracle
Central Inventory : /home/oracle/oraInventory
from : /etc/oraInst.loc
OPatch version : 10.2.0.4.2
OUI version : 10.2.0.4.0
OUI location : /u01/app/oracle/oui
Log file location : /u01/app/oracle/cfgtoollogs/opatch/opatch2012-06-13_01-44-11AM.log
Lsinventory Output file location : /u01/app/oracle/cfgtoollogs/opatch/lsinv/lsinventory2012-06-13_01-44-11AM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (2):
Oracle Database 10g 10.2.0.1.0
Oracle Database 10g Release 2 Patch Set 3 10.2.0.4.0
There are 2 products installed in this Oracle Home.
Interim patches (1) :
Patch 8575528 : applied on Wed Jun 13 01:28:24 CST 2012<<<<<<<<<<<<<<<<<<<
Created on 17 Aug 2010, 07:56:36 hrs PST8PDT
Bugs fixed:
8575528
Rac system comprising of multiple nodes
Local node = nascds14
Remote node = nascds15
--------------------------------------------------------------------------------
OPatch succeeded.
Rac system comprising of multiple nodes
Local node = nascds14
Remote node = nascds15
--------------------------------------------------------------------------------
OPatch succeeded.
下面是在10.2.0.4 RAC上滾動(Rolling)回退補丁8575528的過程:
1).停止1號機資料庫ORACLE_HOME下所有的資料庫例項(如果有ASM,也要停止):
$srvctl stop instance -d
$srvctl stop asm -n
比如:
$srvctl stop instance -d ONEPIECE -i ONEPIECE1
$srvctl stop asm -n nascds14
$crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....E1.inst application OFFLINE OFFLINE
ora....SM1.asm application OFFLINE OFFLINE
2). 在1號機回滾補丁:
比如:
$su - oracle
$cd $ORACLE_HOME/OPatch/8575528
$opatch rollback -id 8575528
Invoking OPatch 10.2.0.4.2
Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/oracle
Central Inventory : /home/oracle/oraInventory
from : /etc/oraInst.loc
OPatch version : 10.2.0.4.2
OUI version : 10.2.0.4.0
OUI location : /u01/app/oracle/oui
Log file location : /u01/app/oracle/cfgtoollogs/opatch/opatch2012-06-13_18-22-10PM.log
RollbackSession rolling back interim patch '8575528' from OH '/u01/app/oracle'
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: 'nascds15'
Local node: 'nascds14'
Please shut down Oracle instances running out of this ORACLE_HOME on all the nodes.
(Oracle Home = '/u01/app/oracle')
Are all the nodes ready for patching? [y|n]
y <=========輸入y
User Responded with: Y
Backing up files affected by the patch '8575528' for restore. This might take a while...
Patching component oracle.rdbms, 10.2.0.4.0...
Updating archive file "/u01/app/oracle/lib/libserver10.a" with "lib/libserver10.a/kks1.o"
Updating archive file "/u01/app/oracle/lib/libserver10.a" with "lib/libserver10.a/kksc.o"
Updating archive file "/u01/app/oracle/lib/libserver10.a" with "lib/libserver10.a/kksh.o"
Updating archive file "/u01/app/oracle/lib/libserver10.a" with "lib/libserver10.a/ksmp.o"
Running make for target ioracle
RollbackSession removing interim patch '8575528' from inventory
Patching in rolling mode.
The node 'nascds15' will be patched next.
Please shutdown Oracle instances running out of this ORACLE_HOME on 'nascds15'.
(Oracle Home = '/u01/app/oracle')
Is the node ready for patching? [y|n]
3). 然後opatch會問您是否要在另外一個節點上回滾。這時候執行下面的操作。
4). 啟動1號機ASM 例項和資料庫例項:
$srvctl start asm -n
$srvctl start instance -d
比如:
$srvctl start asm -n nascds14
$srvctl start instance -d ONEPIECE -i ONEPIECE1
$crs_stat -t
ora....E1.inst application ONLINE ONLINE nascds14
ora....SM1.asm application ONLINE ONLINE nascds14
5).停止2號機的ASM例項和資料庫例項:
$srvctl stop instance -d
$srvctl stop asm -n
$srvctl stop instance -d ONEPIECE -i ONEPIECE2
$srvctl stop asm -n nascds15
$crs_stat -t
ora....E2.inst application OFFLINE OFFLINE
ora....SM2.asm application OFFLINE OFFLINE
6). 在之前回滾補丁的那個提示符中,確認繼續下一個節點。
The node 'nascds15' will be patched next.
Please shutdown Oracle instances running out of this ORACLE_HOME on 'nascds15'.
(Oracle Home = '/u01/app/oracle')
Is the node ready for patching? [y|n]
y <=========輸入y
User Responded with: Y
Updating nodes 'nascds15'
Rollback-related files are:
FR = "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/remove_files.txt"
DR = "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/remove_dirs.txt"
FP = "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/copy_files.txt"
MP = "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/make_cmds.txt"
RC = "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/remote_cmds.txt"
Instantiating the file "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/remove_dirs.txt.instantiated"
by replacing $ORACLE_HOME in "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/remove_dirs.txt" with
actual path.
Removing directories on remote nodes...
Instantiating the file "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/copy_files.txt.instantiated"
by replacing $ORACLE_HOME in "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/copy_files.txt" with
actual path.
Propagating files to remote nodes...
Instantiating the file "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/copy_dirs.txt.instantiated"
by replacing $ORACLE_HOME in "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/copy_dirs.txt" with
actual path.
Propagating directories to remote nodes...
Instantiating the file "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/make_cmds.txt.instantiated"
by replacing $ORACLE_HOME in "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/make_cmds.txt" with
actual path.
Running command on remote node 'nascds15':
cd /u01/app/oracle/rdbms/lib; /usr/bin/make -f ins_rdbms.mk ioracle ORACLE_HOME=/u01/app/oracle || echo
REMOTE_MAKE_FAILED::>&2
The node 'nascds15' 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 'nascds15' .
The following make commands were invoked on remote nodes:
'cd /u01/app/oracle/rdbms/lib; /usr/bin/make -f ins_rdbms.mk ioracle ORACLE_HOME=/u01/app/oracle
'
OPatch succeeded.
7). 啟動2號機的ASM例項和資料庫例項:
$srvctl start asm -n
$srvctl start instance -d
比如:
$srvctl start asm -n nascds15
$srvctl start instance -d ONEPIECE -i ONEPIECE2
8).在兩個節點分別執行下面的命令來確認補丁已經回滾成功。
$ $ORACLE_HOME/OPatch/opatch lsinventory
Invoking OPatch 10.2.0.4.2
Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/oracle
Central Inventory : /home/oracle/oraInventory
from : /etc/oraInst.loc
OPatch version : 10.2.0.4.2
OUI version : 10.2.0.4.0
OUI location : /u01/app/oracle/oui
Log file location : /u01/app/oracle/cfgtoollogs/opatch/opatch2012-06-13_19-40-41PM.log
Lsinventory Output file location : /u01/app/oracle/cfgtoollogs/opatch/lsinv/lsinventory2012-06-13_19-40-41PM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (2):
Oracle Database 10g 10.2.0.1.0
Oracle Database 10g Release 2 Patch Set 3 10.2.0.4.0
There are 2 products installed in this Oracle Home.
There are no Interim patches installed in this Oracle Home.
Rac system comprising of multiple nodes
Local node = nascds14
Remote node = nascds15
--------------------------------------------------------------------------------
OPatch succeeded.
本文摘自:https://blogs.oracle.com/Database4CN/entry/%E5%9C%A8rac%E6%95%B0%E6%8D%AE%E5%BA%93%E4%B8%8A%E6%BB%9A%E5%8A%A8_rolling_%E5%AE%89%E8%A3%85_%E5%9B%9E%E9%80%80%E5%B0%8F%E8%A1%A5%E4%B8%81%E7%9A%84%E6%96%B9%E6%B3%95
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26194851/viewspace-751314/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 19c rac自動打補丁步驟
- 【UP_ORACLE】如何給Oracle DG打補丁(二)備庫安裝補丁步驟Oracle
- 【UP_ORACLE】如何給Oracle DG打補丁(三)主庫安裝補丁步驟Oracle
- MySQL資料庫安裝步驟-WindowsMySql資料庫Windows
- win10更新補丁解除安裝怎麼操作_解除安裝win10更新補丁詳細步驟Win10
- oracle rac資料庫的安裝Oracle資料庫
- Oracle RAC叢集解除安裝步驟Oracle
- 在Linux系統安裝flash的步驟方法Linux
- win10怎麼解除安裝補丁_解除安裝win10已安裝更新補丁的方法Win10
- vgant 安裝oracle資料庫racOracle資料庫
- win10安裝KB4565483補丁失敗怎麼回事_win10 KB4565483補丁安裝失敗解決步驟Win10
- 達夢資料庫DM8在LINUX環境下安裝步驟資料庫Linux
- vnc安裝步驟,4個在Linux下vnc的個安裝步驟VNCLinux
- 【PG資料庫】PG資料庫的安裝及連線方法資料庫
- 在anlions os上安裝資料庫資料庫
- Oracle RAC更新補丁Oracle
- Oracle資料庫啟動步驟Oracle資料庫
- RAC之資料庫軟體安裝資料庫
- weblogic 12 補丁安裝Web
- SharePoint or Office 打補丁或產品安裝遇到問題
- Flutter-安裝步驟及安裝遇到的問題Flutter
- PostgreSQL簡介及安裝步驟SQL
- mysql安裝教程8.0.26 安裝mysql的步驟和方法MySql
- openGauss資料庫在CentOS上的安裝實踐資料庫CentOS
- windows10補丁安裝失敗如何處理_win10無法安裝補丁修復方法WindowsWin10
- xftp安裝步驟,xftp安裝的2大步驟FTP
- vnc安裝步驟,vnc安裝步驟詳解VNC
- Toad for Oracle 2020 安裝教程(附安裝方法步驟)Oracle
- 安裝gulp步驟和使用方法
- Win10系統怎樣解除安裝幽靈熔斷補丁_win10解除安裝幽靈補丁的方法Win10
- charles的安裝步驟
- 安裝jdk的步驟JDK
- [ 安裝 ] Zeppelin安裝步驟!
- ORACLE RAC的全自動 打補丁標準化文件Oracle
- 安裝mysql資料庫及問題解決方法MySql資料庫
- Photoshop 2024 (ps) Mac版安裝下載 及破解補丁Mac
- 【補丁】Oracle補丁的知識及術語Oracle
- 一次GI補丁安裝不完整導致的RAC心跳流量異常
- ORACLE11GR2 RAC解除安裝ASM例項步驟OracleASM