RAC環境ROLLING UPGRADE方式應用PATCH
Oracle的RAC環境支援ROLLING UPGRADE方式安裝PATCH。
所謂ROLLING UPGRADE安裝補丁或升級是指高可用環境中一個節點先安裝補丁或升級版本,由其他的節點提供服務,隨後升級或安裝補丁後的節點啟動提供服務,然後其他的節點再安裝補丁或升級。整個安裝補丁或升級過程中不停止對外提供服務。
Oracle的DATA GUARD、STREAM和RAC等高可用環境都支援ROLLING UPGRADE,不過RAC環境僅支援補丁的ROLLING UPGRADE,不支援補丁集的安裝以及版本的升級。
昨天碰到了一個Solaris上的bug:http://yangtingkun.itpub.net/post/468/482352。這裡描述在RAC環境中,使用ROLLING UPGRADE方式來應用PATCH,修正這個bug。
首先在本機透過sqlplus登陸資料庫:
SQL> conn test/test@test
已連線。
SQL> set pages 100 lines 120
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
test1
SQL> select name from v$database;
NAME
---------
TEST
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
PL/SQL Release 11.1.0.6.0 - Production
CORE 11.1.0.6.0 Production
TNS for Solaris: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production
現在登陸到資料庫的例項1。
下面在例項1所在的節點解開補丁:
bash-3.00$ mkdir $ORACLE_HOME/patch
bash-3.00$ mv p5885301_111060_SOLARIS64.zip $ORACLE_HOME/patch
bash-3.00$ cd $ORACLE_HOME/patch
bash-3.00$ ls
p5885301_111060_SOLARIS64.zip
bash-3.00$ unzip p5885301_111060_SOLARIS64.zip
Archive: p5885301_111060_SOLARIS64.zip
creating: 5885301/
creating: 5885301/files/
creating: 5885301/files/lib/
creating: 5885301/files/lib/libcommon11.a/
inflating: 5885301/files/lib/libcommon11.a/slspool.o
creating: 5885301/files/lib32/
creating: 5885301/files/lib32/libcommon11.a/
inflating: 5885301/files/lib32/libcommon11.a/slspool.o
creating: 5885301/etc/
creating: 5885301/etc/config/
inflating: 5885301/etc/config/inventory.xml
inflating: 5885301/etc/config/actions.xml
creating: 5885301/etc/xml/
inflating: 5885301/etc/xml/GenericActions.xml
inflating: 5885301/etc/xml/ShiphomeDirectoryStructure.xml
inflating: 5885301/README.txt
現在要關閉節點1上所有的例項,當然也包括ASM例項:
bash-3.00$ srvctl stop inst -d test -i test1
bash-3.00$ srvctl stop asm -n ser1
bash-3.00$ srvctl stop listener -n ser1
檢查客戶端的連線:
SQL> select * from dual;
select * from dual
*
第 1 行出現錯誤:
ORA-12571: TNS: 包寫入程式失敗
SQL> conn test/test@test
已連線。
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
test2
SQL> select name from v$database;
NAME
---------
TEST
SQL> select instance_name from gv$instance;
INSTANCE_NAME
----------------
test2
由於例項1已經關閉,所以會話被斷開,再次連線會話連線到例項2上。
下面開始節點1上的patch操作:
bash-3.00$ cd 5885301/
bash-3.00$ $ORACLE_HOME/Opatch/opatch apply
bash: /data/oracle/product/11.1/database/Opatch/opatch: No such file or directory
bash-3.00$ /data/oracle/product/11.1/database/OPatch/opatch apply
Invoking OPatch 11.1.0.6.0
Oracle Interim Patch Installer version 11.1.0.6.0
Copyright (c) 2007, Oracle Corporation. All rights reserved.
Oracle Home : /data/oracle/product/11.1/database
Central Inventory : /data/oraInventory
from : /var/opt/oracle/oraInst.loc
OPatch version : 11.1.0.6.0
OUI version : 11.1.0.6.0
OUI location : /data/oracle/product/11.1/database/oui
Log file location : /data/oracle/product/11.1/database/cfgtoollogs/opatch/opatch2009-04-15_16-13-03PM.log
ApplySession applying interim patch '5885301' to OH '/data/oracle/product/11.1/database'
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.
Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '5885301' for restore. This might take a while...
Backing up files affected by the patch '5885301' for rollback. This might take a while...
Patching component oracle.rdbms, 11.1.0.6.0...
Updating archive file "/data/oracle/product/11.1/database/lib/libcommon11.a" with "lib/libcommon11.a/slspool.o"
Updating archive file "/data/oracle/product/11.1/database/lib32/libcommon11.a" with "lib32/libcommon11.a/slspool.o"
Running make for target client_sharedlib
ApplySession adding interim patch '5885301' to inventory
Verifying the update...
Inventory check OK: Patch ID 5885301 is registered in Oracle Home inventory with proper meta-data.
Files check OK: Files from Patch ID 5885301 are present in Oracle Home.
Patching in rolling mode.
Updating nodes 'ser2'
Apply-related files are:
FP = "/data/oracle/product/11.1/database/.patch_storage/5885301_Oct_6_2008_22_40_42/rac/copy_files.txt"
DP = "/data/oracle/product/11.1/database/.patch_storage/5885301_Oct_6_2008_22_40_42/rac/copy_dirs.txt"
MP = "/data/oracle/product/11.1/database/.patch_storage/5885301_Oct_6_2008_22_40_42/rac/make_cmds.txt"
RC = "/data/oracle/product/11.1/database/.patch_storage/5885301_Oct_6_2008_22_40_42/rac/remote_cmds.txt"
Instantiating the file "/data/oracle/product/11.1/database/.patch_storage/5885301_Oct_6_2008_22_40_42/rac/copy_files.txt.instantiated" by replacing $ORACLE_HOME in "/data/oracle/product/11.1/database/.patch_storage/5885301_Oct_6_2008_22_40_42/rac/copy_files.txt" with actual path.
Propagating files to remote nodes...
OPatch failed to copy files to remote nodes 'ser2' . Detail: Error while copying files inside directory '/data/oracle/product/11.1/database' based on listed file '/data/oracle/product/11.1/database/.patch_storage/5885301_Oct_6_2008_22_40_42/rac/copy_files.txt.instantiated' to nodes 'ser2'. [PRKC-1073 : Failed to transfer directory "/data/oracle/product/11.1/database/.patch_storage/5885301_Oct_6_2008_22_40_42/rac/copy_files.txt.instantiated" to any of the given nodes "ser2 ".
Error on node ser2:PRKC-1044 : Failed to check remote command execution setup for node ser2 using shells /usr/bin/ssh and /usr/bin/rsh
permission denied]
OPatch failed to copy files to remote nodes 'ser2' .
Do you want to proceed? [y|n]
n
User Responded with: N
OPatch failed to propagate the patch to the remote node(s).
Run the patch again on each of the remote node(s) using -local option.
Details: Error while copying files inside directory '/data/oracle/product/11.1/database' based on listed file '/data/oracle/product/11.1/database/.patch_storage/5885301_Oct_6_2008_22_40_42/rac/copy_files.txt.instantiated' to nodes 'ser2'. [PRKC-1073 : Failed to transfer directory "/data/oracle/product/11.1/database/.patch_storage/5885301_Oct_6_2008_22_40_42/rac/copy_files.txt.instantiated" to any of the given nodes "ser2 ".
Error on node ser2:PRKC-1044 : Failed to check remote command execution setup for node ser2 using shells /usr/bin/ssh and /usr/bin/rsh
permission denied]
ApplySession failed: OUI-67081:OPatch failed to propagate the patch to the remote node(s).
Run the patch again on each of the remote node(s) using -local option.
Details: Error while copying files inside directory '/data/oracle/product/11.1/database' based on listed file '/data/oracle/product/11.1/database/.patch_storage/5885301_Oct_6_2008_22_40_42/rac/copy_files.txt.instantiated' to nodes 'ser2'. [PRKC-1073 : Failed to transfer directory "/data/oracle/product/11.1/database/.patch_storage/5885301_Oct_6_2008_22_40_42/rac/copy_files.txt.instantiated" to any of the given nodes "ser2 ".
Error on node ser2:PRKC-1044 : Failed to check remote command execution setup for node ser2 using shells /usr/bin/ssh and /usr/bin/rsh
permission denied]
System intact, OPatch will not attempt to restore the system
--------------------------------------------------------------------------------
The following warnings have occurred during OPatch execution:
1) OUI-67187:
OPatch failed to copy files to remote nodes 'ser2' . Detail: Error while copying files inside directory '/data/oracle/product/11.1/database' based on listed file '/data/oracle/product/11.1/database/.patch_storage/5885301_Oct_6_2008_22_40_42/rac/copy_files.txt.instantiated' to nodes 'ser2'. [PRKC-1073 : Failed to transfer directory "/data/oracle/product/11.1/database/.patch_storage/5885301_Oct_6_2008_22_40_42/rac/copy_files.txt.instantiated" to any of the given nodes "ser2 ".
Error on node ser2:PRKC-1044 : Failed to check remote command execution setup for node ser2 using shells /usr/bin/ssh and /usr/bin/rsh
permission denied]
--------------------------------------------------------------------------------
OPatch failed with error code 73
遠端節點操作失敗,這是正常的,因為遠端節點還在執行。下面啟動本地例項:
bash-3.00$ srvctl start asm -n ser1
bash-3.00$ srvctl start inst -d test -i test1
bash-3.00$ srvctl start listener -n ser1
檢查例項1上bug是否已經解決:
bash-3.00$ export ORACLE_SID=test1
bash-3.00$ sqlplus test/test
SQL*Plus: Release 11.1.0.6.0 - Production on 星期三 4月 15 16:20:31 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
連線到:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> spo /export/home/oracle/result.txt
SQL> select 1 from dual;
1
----------
1
SQL> spo out
_default: unknown printer
SQL>
節點1上的bug已經解決,且資料庫一直對外提供服務,下面在節點2上執行相同的操作:
bash-3.00$ srvctl stop inst -d test -i test2
bash-3.00$ srvctl stop asm -n ser2
bash-3.00$ srvctl stop listener -n ser2
檢查客戶端的連線:
SQL> select * from dual;
select * from dual
*
第 1 行出現錯誤:
ORA-12571: TNS: 包寫入程式失敗
SQL> conn test/test@test
已連線。
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
test1
SQL> select name from v$database;
NAME
---------
TEST
SQL> select instance_name from gv$instance;
INSTANCE_NAME
----------------
test1
同樣在節點2應用PATCH的時候,節點1上的例項可以對外提供服務。
下面在節點2上打PATCH,為了避免打PATCH的時候出現類似節點1上的錯誤,在應用PATCH的時候指定-LOCAL引數:
bash-3.00$ cd 5885301/
bash-3.00$ $ORACLE_HOME/OPatch/opatch apply -local
Invoking OPatch 11.1.0.6.0
Oracle Interim Patch Installer version 11.1.0.6.0
Copyright (c) 2007, Oracle Corporation. All rights reserved.
Oracle Home : /data/oracle/product/11.1/database
Central Inventory : /data/oraInventory
from : /var/opt/oracle/oraInst.loc
OPatch version : 11.1.0.6.0
OUI version : 11.1.0.6.0
OUI location : /data/oracle/product/11.1/database/oui
Log file location : /data/oracle/product/11.1/database/cfgtoollogs/opatch/opatch2009-04-15_16-32-03PM.log
ApplySession applying interim patch '5885301' to OH '/data/oracle/product/11.1/database'
Running prerequisite checks...
You selected -local option, hence OPatch will patch the local system only.
Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '5885301' for restore. This might take a while...
Backing up files affected by the patch '5885301' for rollback. This might take a while...
Patching component oracle.rdbms, 11.1.0.6.0...
Updating archive file "/data/oracle/product/11.1/database/lib/libcommon11.a" with "lib/libcommon11.a/slspool.o"
Updating archive file "/data/oracle/product/11.1/database/lib32/libcommon11.a" with "lib32/libcommon11.a/slspool.o"
Running make for target client_sharedlib
ApplySession adding interim patch '5885301' to inventory
Verifying the update...
Inventory check OK: Patch ID 5885301 is registered in Oracle Home inventory with proper meta-data.
Files check OK: Files from Patch ID 5885301 are present in Oracle Home.
OPatch succeeded.
PATCH應用成功,啟動節點2上的服務:
bash-3.00$ srvctl start asm -n ser2
bash-3.00$ srvctl start inst -d test -i test2
bash-3.00$ srvctl start listener -n ser2
節點2上的例項已經啟動,下面檢查客戶端的連線是否正常:
SQL> select instance_name from gv$instance;
INSTANCE_NAME
----------------
test1
test2
可以看到節點1上的連線正常,且資料庫的兩個例項都已經啟動。雖然在應用補丁的過程中,兩個例項都重啟過,但是資料庫對外的服務一直沒有停止。
至此ROLLING UPGRADE方式應用補丁的操作已經完成,本文只是為了說明ROLLING UPGRADE與普通應用PATCH的區別,所以沒有在節點1上使用-LOCAL選項應用補丁。真正ROLLING UPGRADE操作應該在RAC的每個節點上已-LOCAL方式應用補丁。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/4227/viewspace-589307/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- RAC和ASM環境下打patchASM
- ORA-15137: The ASM cluster is in rolling patch stateASM
- RAC環境下的SEQUENCE對應用的影響
- RAC環境修改spfile的位置
- KingbaseES RAC部署案例之---SAN環境構建RAC
- 手工清理19c RAC環境
- RAC環境下建立物理DATAGUARD(1)
- RAC環境下建立物理DATAGUARD(2)
- Oracle RAC 環境下的連線管理Oracle
- 如何在rac環境中增加監聽
- 將Java應用部署到SAP雲平臺neo環境的兩種方式Java
- docker 生產環境基礎應用Docker
- 在生產環境使用Docker部署應用Docker
- Oracle RAC環境下ASM磁碟組擴容OracleASM
- Dockerfile 方式定製 lnmp 環境DockerLNMP
- Linux環境變數詳解與應用Linux變數
- FreeRtos於嵌入式環境的應用
- 有關HTTP的PATCH提交方式HTTP
- Oracle 11.2.0.4 rac for aix acfs異常環境的克隆環境ASM磁碟組掛載緩慢OracleAIASM
- Oracle RAC一鍵部署001(主機環境校驗)Oracle
- ORACLE 12C RAC 生產環境搭建介紹Oracle
- oracle 11G RAC的建立(VM虛擬環境)Oracle
- 物聯網路卡應用於環境監測
- Mac安裝開發環境-應用端篇Mac開發環境
- Istio實踐(1)-環境搭建及應用部署
- OGG Integrated Mode(downstream方式)環境搭建
- 如何在生產環境中通過Restful API的方式請求重啟Spring Boot應用?RESTAPISpring Boot
- 用 Spring 區分開發環境、測試環境、生產環境Spring開發環境
- Oracle RAC 環境 引數檔案的啟動順序Oracle
- Oracle RAC環境新增新的network和listener(未完成)Oracle
- TiDB 在餓了麼歸檔環境的應用TiDB
- 10分鐘內一鍵部署環境及應用
- 容器雲測試、UAT、生產環境應該採用什麼樣的部署架構和方式架構
- 如何用JavaScript判斷前端應用執行環境(移動平臺還是桌面環境)JavaScript前端
- ORACLE rac 11.2.0.4 for rhel7.8 upgrade to 19.11.1 報錯ORA-29516處理Oracle
- Oracle 12cR1 RAC叢集安裝(一)--環境準備Oracle
- DM8 配置DMDSC主備環境(rac到單節點 )
- 結合 Shell 對 Koa 應用執行環境檢查
- 【唯實踐】容器環境應用一鍵拉起實踐