11gR2 RAC out-of-place 滾動升級(1)
本週給一套AIX下RAC庫打PSU
正常情況下,AIX平臺,2個節點打PSU就需要2小時,而且還老出一點檔案無法拷貝的錯
報錯一會滾,OPatch自己的備份又要備份很久
而且經常發生前面的PSU報告有爭用的問題,無法自動回滾掉
要是心裡素質不好,決定要被弄的手忙腳亂
當天升級的時候,客戶都不敢在邊上看了。最後總算是有驚無險完成升級
回來思索grid能否 out-of-place 打PSU,總算找到了一篇文件
Minimal downtime patching via cloning 11gR2 ORACLE_HOME directories (Doc ID 1136544.1)
文件是基於EXADA他的,但是文件中明確說明,適用於其他平臺
安裝可以提前進行,到了計劃時間點,只需要做switch即可,測試1個節點切換10分鐘即可
-------------------------------------------
1.首先,準備新的grid和database的安裝目錄
-------------------------------------------
我的環境是:
當前:/u01/app/11.2.0/grid /u01/app1/oracle/product/11.2/db_1 11.2.0.3.3
目標:/u01/app/11.2.0/grid_2 /u01/app1/oracle/product/11.2/db_2 11.2.0.3.6
[oracle@database1 11.2]$ pwd
/u01/app/oracle/product/11.2
[oracle@database1 11.2]$ ls -l
total 4
drwxr-xr-x 76 oracle oinstall 4096 Aug 2 11:08 db_1
lrwxrwxrwx 1 oracle oinstall 34 Aug 2 10:44 db_2 -> /u01/app1/oracle/product/11.2/db_2
[oracle@database1 11.2]$ ls -ld /u01/app1/oracle/product/11.2/db_2
drwxr-xr-x 2 oracle oinstall 4096 Aug 2 10:16 /u01/app1/oracle/product/11.2/db_2
[grid@database1 11.2.0]$ pwd
/u01/app/11.2.0
[grid@database1 11.2.0]$ ls -tlr
total 4
drwxr-xr-x 69 root oinstall 4096 Sep 26 2012 grid
lrwxrwxrwx 1 root root 23 Aug 2 10:46 grid_2 -> /u01/app1/11.2.0/grid_2
[grid@database1 11.2.0]$ ls -ld /u01/app1/11.2.0/grid_2
drwxr-xr-x 2 root oinstall 4096 Aug 2 10:15 /u01/app1/11.2.0/grid_2
-------------------------------------------
2.克隆GRID,兩個節點分別執行
-------------------------------------------
拷貝
# export ORACLE_HOME=/u01/app/11.2.0/grid_2
# cd /u01/app/11.2.0/grid;
# tar cfp - . | ( cd $ORACLE_HOME ; tar xf - )
解鎖
# /usr/bin/perl $ORACLE_HOME/OPatch/crs/patch112.pl -unlock -desthome=$ORACLE_HOME
注意許可權,免得影響
chmod 775 /u01/app/oracle/
chmod 775 /u01/app/11.2.0/grid_2
cd /u01/app/11.2.0/grid_2
ls -l |grep root|awk '{print $9}'|xargs chmod 775
克隆
database1
$ export ORACLE_HOME=/u01/app/11.2.0/grid_2
$ /usr/bin/perl $ORACLE_HOME/clone/bin/clone.pl ORACLE_BASE=/u01/app/oracle \
ORACLE_HOME=$ORACLE_HOME ORACLE_HOME_NAME=Ora11g_gridinfrahome1_2 \
INVENTORY_LOCATION=/u01/app/oraInventory \
-O'"CLUSTER_NODES={database1,database2}"' \
-O'"LOCAL_NODE=database1"' CRS=false -O"SHOW_ROOTSH_CONFIRMATION=false"
database2
$ export ORACLE_HOME=/u01/app/11.2.0/grid_2
$ /usr/bin/perl $ORACLE_HOME/clone/bin/clone.pl ORACLE_BASE=/u01/app/oracle \
ORACLE_HOME=$ORACLE_HOME ORACLE_HOME_NAME=Ora11g_gridinfrahome1_2 \
INVENTORY_LOCATION=/u01/app/oraInventory \
-O'"CLUSTER_NODES={database1,database2}"' \
-O'"LOCAL_NODE=database2"' CRS=false -O"SHOW_ROOTSH_CONFIRMATION=false"
可能報告JAVA找不到
Checking swap space: must be greater than 500 MB. Actual 4971 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2013-08-02_01-45-01PM. Please wait ...The Java RunTime Environment was not found at /tmp/OraInstall2013-08-02_01-45-01PM/jre/bin/java. Hence, the Oracle Universal Installer cannot be run.
Please visit http://www.javasoft.com and install JRE version 1.3.1 or higher and try again.
: No such file or directory
修改 /u01/app1/11.2.0/grid_2/oui/oraparam.ini 中 JRE_LOCATION=/u01/app/11.2.0/grid_2/jdk/jre
可能報告NoClassDefFoundError
Exception in thread "main" java.lang.NoClassDefFoundError: %JRE_MEMORY_OPTIONS%
修改 /u01/app1/11.2.0/grid_2/oui/oraparam.ini 中 JRE_MEMORY_OPTIONS=" -mx150m"
如果以前GRID適用rds協議,那麼clone會導致其切換回udp,需要重新修改
$ export ORACLE_HOME=/u01/app/11.2.0/grid_2
$ cd $ORACLE_HOME/rdbms/lib
$ make -f ins_rdbms.mk ipc_rds ioracle
-------------------------------------------
3.對grid_2 安裝11.2.0.3.6的PSU,兩個節點分別執行
-------------------------------------------
檢查
$ export ORACLE_HOME=/u01/app/11.2.0/grid_2
$ $ORACLE_HOME/OPatch/opatch prereq \
CheckConflictAgainstOH -ph /u01/app/oracle/admin/olm/software/112036/16315641 \
-invPtrLoc $ORACLE_HOME/oraInst.loc -oh $ORACLE_HOME
$ $ORACLE_HOME/OPatch/opatch prereq \
CheckConflictAgainstOH -ph /u01/app/oracle/admin/olm/software/112036/16056266 \
-invPtrLoc $ORACLE_HOME/oraInst.loc -oh $ORACLE_HOME
生成ocm.rsp
$ export ORACLE_HOME=/u01/app/11.2.0/grid_2
$ cd /u01/app/oracle
$ $ORACLE_HOME/OPatch/ocm/bin/emocmrsp
回滾11.2.0.3.3 PSU,我在安裝中遇到報告其有爭用
# export ORACLE_HOME=/u01/app/11.2.0/grid_2
# /usr/bin/perl $ORACLE_HOME/OPatch/crs/patch112.pl -unlock -desthome=$ORACLE_HOME
$ export ORACLE_HOME=/u01/app/11.2.0/grid_2
$ opatch rollback -id 13919095 -oh $ORACLE_HOME -local
安裝11.2.0.3.6 PSU
# export ORACLE_HOME=/u01/app/11.2.0/grid_2
# $ORACLE_HOME/OPatch/opatch auto /u01/app/oracle/admin/olm/software/112036 -oh $ORACLE_HOME -ocmrf /u01/app/oracle/ocm.rsp
檢查
$ /u01/app/11.2.0/grid_2/OPatch/opatch lsinventory -oh /u01/app/11.2.0/grid_2
-------------------------------------------
4.克隆ORACLE,兩個節點分別執行
-------------------------------------------
拷貝
# export ORACLE_HOME=/u01/app/oracle/product/11.2/db_2
# cd /u01/app/oracle/product/11.2/db_1
# tar cfp - . | ( cd $ORACLE_HOME ; tar xf - )
克隆
$ export ORACLE_HOME=/u01/app/oracle/product/11.2/db_2
$ cd $ORACLE_HOME/clone/bin
$ ./clone.pl ORACLE_HOME=$ORACLE_HOME ORACLE_HOME_NAME=OraDB_home2 ORACLE_BASE=/u01/app/oracle
-- 確保HOME目錄許可權在755,否則SSH要出問題
$ $ORACLE_HOME/oui/bin/runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME "CLUSTER_NODES={database1,database2}"
如果以前ORACLE適用rds協議,那麼clone會導致其切換回udp,需要重新修改
$ cd $ORACLE_HOME/rdbms/lib;
$ make -f ins_rdbms.mk ipc_rds ioracle
執行root.sh
# export ORACLE_HOME=/u01/app/oracle/product/11.2/db_2
# $ORACLE_HOME/root.sh
安裝11.2.0.3.6 PSU
# export ORACLE_HOME=/u01/app/oracle/product/11.2/db_2
# $ORACLE_HOME/OPatch/opatch auto /u01/app/oracle/admin/olm/software/112036 -oh $ORACLE_HOME -ocmrf /u01/app/oracle/ocm.rsp
檢查
$ /u01/app1/oracle/product/11.2/db_2/OPatch/opatch lsinventory -oh /u01/app1/oracle/product/11.2/db_2
-------------------------------------------
5.切換,兩個節點分別執行
-------------------------------------------
關閉資料庫
$ export ORACLE_HOME=/u01/app/oracle/product/11.2/db_1
$ $ORACLE_HOME/bin/srvctl stop home -o $ORACLE_HOME -n database1 -s /tmp/mygi.stat
切換GRID
注意,當前資料庫的PATCHSET是那個版本,就用那個版本的patch1120x.pl
# export ORACLE_HOME=/u01/app/11.2.0/grid_2
# /usr/bin/perl $ORACLE_HOME/OPatch/crs/patch11203.pl -patch -desthome=$ORACLE_HOME
修改環境變數
root
grid
oracle
切換資料庫
srvctl modify database -d orcl -o /u01/app/oracle/product/11.2/db_2
[grid@database1 grid]$ crsctl stat res -t
ora.orcl.db
1 ONLINE ONLINE database1 Open,Running from O
ld Oracle Home
2 ONLINE ONLINE database2 Open,Running from O
ld Oracle Home
srvctl stop instance -d orcl -i ORCL1
srvctl start instance -d orcl -i ORCL1
srvctl stop instance -d orcl -i ORCL2
srvctl start instance -d orcl -i ORCL2
啟動資料庫,跑指令碼,升級,這個一個節點跑即可
-------------------------------------------
6.如何rollback
-------------------------------------------
DB直接切換配置即可
GRID可以使用指令碼,切換回去即可,測試可行
# export ORACLE_HOME=/u01/app/11.2.0/grid
# /usr/bin/perl $ORACLE_HOME/OPatch/crs/patch11203.pl -patch -desthome=$ORACLE_HOME
正常情況下,AIX平臺,2個節點打PSU就需要2小時,而且還老出一點檔案無法拷貝的錯
報錯一會滾,OPatch自己的備份又要備份很久
而且經常發生前面的PSU報告有爭用的問題,無法自動回滾掉
要是心裡素質不好,決定要被弄的手忙腳亂
當天升級的時候,客戶都不敢在邊上看了。最後總算是有驚無險完成升級
回來思索grid能否 out-of-place 打PSU,總算找到了一篇文件
Minimal downtime patching via cloning 11gR2 ORACLE_HOME directories (Doc ID 1136544.1)
文件是基於EXADA他的,但是文件中明確說明,適用於其他平臺
安裝可以提前進行,到了計劃時間點,只需要做switch即可,測試1個節點切換10分鐘即可
-------------------------------------------
1.首先,準備新的grid和database的安裝目錄
-------------------------------------------
我的環境是:
當前:/u01/app/11.2.0/grid /u01/app1/oracle/product/11.2/db_1 11.2.0.3.3
目標:/u01/app/11.2.0/grid_2 /u01/app1/oracle/product/11.2/db_2 11.2.0.3.6
[oracle@database1 11.2]$ pwd
/u01/app/oracle/product/11.2
[oracle@database1 11.2]$ ls -l
total 4
drwxr-xr-x 76 oracle oinstall 4096 Aug 2 11:08 db_1
lrwxrwxrwx 1 oracle oinstall 34 Aug 2 10:44 db_2 -> /u01/app1/oracle/product/11.2/db_2
[oracle@database1 11.2]$ ls -ld /u01/app1/oracle/product/11.2/db_2
drwxr-xr-x 2 oracle oinstall 4096 Aug 2 10:16 /u01/app1/oracle/product/11.2/db_2
[grid@database1 11.2.0]$ pwd
/u01/app/11.2.0
[grid@database1 11.2.0]$ ls -tlr
total 4
drwxr-xr-x 69 root oinstall 4096 Sep 26 2012 grid
lrwxrwxrwx 1 root root 23 Aug 2 10:46 grid_2 -> /u01/app1/11.2.0/grid_2
[grid@database1 11.2.0]$ ls -ld /u01/app1/11.2.0/grid_2
drwxr-xr-x 2 root oinstall 4096 Aug 2 10:15 /u01/app1/11.2.0/grid_2
-------------------------------------------
2.克隆GRID,兩個節點分別執行
-------------------------------------------
拷貝
# export ORACLE_HOME=/u01/app/11.2.0/grid_2
# cd /u01/app/11.2.0/grid;
# tar cfp - . | ( cd $ORACLE_HOME ; tar xf - )
解鎖
# /usr/bin/perl $ORACLE_HOME/OPatch/crs/patch112.pl -unlock -desthome=$ORACLE_HOME
注意許可權,免得影響
chmod 775 /u01/app/oracle/
chmod 775 /u01/app/11.2.0/grid_2
cd /u01/app/11.2.0/grid_2
ls -l |grep root|awk '{print $9}'|xargs chmod 775
克隆
database1
$ export ORACLE_HOME=/u01/app/11.2.0/grid_2
$ /usr/bin/perl $ORACLE_HOME/clone/bin/clone.pl ORACLE_BASE=/u01/app/oracle \
ORACLE_HOME=$ORACLE_HOME ORACLE_HOME_NAME=Ora11g_gridinfrahome1_2 \
INVENTORY_LOCATION=/u01/app/oraInventory \
-O'"CLUSTER_NODES={database1,database2}"' \
-O'"LOCAL_NODE=database1"' CRS=false -O"SHOW_ROOTSH_CONFIRMATION=false"
database2
$ export ORACLE_HOME=/u01/app/11.2.0/grid_2
$ /usr/bin/perl $ORACLE_HOME/clone/bin/clone.pl ORACLE_BASE=/u01/app/oracle \
ORACLE_HOME=$ORACLE_HOME ORACLE_HOME_NAME=Ora11g_gridinfrahome1_2 \
INVENTORY_LOCATION=/u01/app/oraInventory \
-O'"CLUSTER_NODES={database1,database2}"' \
-O'"LOCAL_NODE=database2"' CRS=false -O"SHOW_ROOTSH_CONFIRMATION=false"
可能報告JAVA找不到
Checking swap space: must be greater than 500 MB. Actual 4971 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2013-08-02_01-45-01PM. Please wait ...The Java RunTime Environment was not found at /tmp/OraInstall2013-08-02_01-45-01PM/jre/bin/java. Hence, the Oracle Universal Installer cannot be run.
Please visit http://www.javasoft.com and install JRE version 1.3.1 or higher and try again.
: No such file or directory
修改 /u01/app1/11.2.0/grid_2/oui/oraparam.ini 中 JRE_LOCATION=/u01/app/11.2.0/grid_2/jdk/jre
可能報告NoClassDefFoundError
Exception in thread "main" java.lang.NoClassDefFoundError: %JRE_MEMORY_OPTIONS%
修改 /u01/app1/11.2.0/grid_2/oui/oraparam.ini 中 JRE_MEMORY_OPTIONS=" -mx150m"
如果以前GRID適用rds協議,那麼clone會導致其切換回udp,需要重新修改
$ export ORACLE_HOME=/u01/app/11.2.0/grid_2
$ cd $ORACLE_HOME/rdbms/lib
$ make -f ins_rdbms.mk ipc_rds ioracle
-------------------------------------------
3.對grid_2 安裝11.2.0.3.6的PSU,兩個節點分別執行
-------------------------------------------
檢查
$ export ORACLE_HOME=/u01/app/11.2.0/grid_2
$ $ORACLE_HOME/OPatch/opatch prereq \
CheckConflictAgainstOH -ph /u01/app/oracle/admin/olm/software/112036/16315641 \
-invPtrLoc $ORACLE_HOME/oraInst.loc -oh $ORACLE_HOME
$ $ORACLE_HOME/OPatch/opatch prereq \
CheckConflictAgainstOH -ph /u01/app/oracle/admin/olm/software/112036/16056266 \
-invPtrLoc $ORACLE_HOME/oraInst.loc -oh $ORACLE_HOME
生成ocm.rsp
$ export ORACLE_HOME=/u01/app/11.2.0/grid_2
$ cd /u01/app/oracle
$ $ORACLE_HOME/OPatch/ocm/bin/emocmrsp
回滾11.2.0.3.3 PSU,我在安裝中遇到報告其有爭用
# export ORACLE_HOME=/u01/app/11.2.0/grid_2
# /usr/bin/perl $ORACLE_HOME/OPatch/crs/patch112.pl -unlock -desthome=$ORACLE_HOME
$ export ORACLE_HOME=/u01/app/11.2.0/grid_2
$ opatch rollback -id 13919095 -oh $ORACLE_HOME -local
安裝11.2.0.3.6 PSU
# export ORACLE_HOME=/u01/app/11.2.0/grid_2
# $ORACLE_HOME/OPatch/opatch auto /u01/app/oracle/admin/olm/software/112036 -oh $ORACLE_HOME -ocmrf /u01/app/oracle/ocm.rsp
檢查
$ /u01/app/11.2.0/grid_2/OPatch/opatch lsinventory -oh /u01/app/11.2.0/grid_2
-------------------------------------------
4.克隆ORACLE,兩個節點分別執行
-------------------------------------------
拷貝
# export ORACLE_HOME=/u01/app/oracle/product/11.2/db_2
# cd /u01/app/oracle/product/11.2/db_1
# tar cfp - . | ( cd $ORACLE_HOME ; tar xf - )
克隆
$ export ORACLE_HOME=/u01/app/oracle/product/11.2/db_2
$ cd $ORACLE_HOME/clone/bin
$ ./clone.pl ORACLE_HOME=$ORACLE_HOME ORACLE_HOME_NAME=OraDB_home2 ORACLE_BASE=/u01/app/oracle
-- 確保HOME目錄許可權在755,否則SSH要出問題
$ $ORACLE_HOME/oui/bin/runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME "CLUSTER_NODES={database1,database2}"
如果以前ORACLE適用rds協議,那麼clone會導致其切換回udp,需要重新修改
$ cd $ORACLE_HOME/rdbms/lib;
$ make -f ins_rdbms.mk ipc_rds ioracle
執行root.sh
# export ORACLE_HOME=/u01/app/oracle/product/11.2/db_2
# $ORACLE_HOME/root.sh
安裝11.2.0.3.6 PSU
# export ORACLE_HOME=/u01/app/oracle/product/11.2/db_2
# $ORACLE_HOME/OPatch/opatch auto /u01/app/oracle/admin/olm/software/112036 -oh $ORACLE_HOME -ocmrf /u01/app/oracle/ocm.rsp
檢查
$ /u01/app1/oracle/product/11.2/db_2/OPatch/opatch lsinventory -oh /u01/app1/oracle/product/11.2/db_2
-------------------------------------------
5.切換,兩個節點分別執行
-------------------------------------------
關閉資料庫
$ export ORACLE_HOME=/u01/app/oracle/product/11.2/db_1
$ $ORACLE_HOME/bin/srvctl stop home -o $ORACLE_HOME -n database1 -s /tmp/mygi.stat
切換GRID
注意,當前資料庫的PATCHSET是那個版本,就用那個版本的patch1120x.pl
# export ORACLE_HOME=/u01/app/11.2.0/grid_2
# /usr/bin/perl $ORACLE_HOME/OPatch/crs/patch11203.pl -patch -desthome=$ORACLE_HOME
修改環境變數
root
grid
oracle
切換資料庫
srvctl modify database -d orcl -o /u01/app/oracle/product/11.2/db_2
[grid@database1 grid]$ crsctl stat res -t
ora.orcl.db
1 ONLINE ONLINE database1 Open,Running from O
ld Oracle Home
2 ONLINE ONLINE database2 Open,Running from O
ld Oracle Home
srvctl stop instance -d orcl -i ORCL1
srvctl start instance -d orcl -i ORCL1
srvctl stop instance -d orcl -i ORCL2
srvctl start instance -d orcl -i ORCL2
啟動資料庫,跑指令碼,升級,這個一個節點跑即可
-------------------------------------------
6.如何rollback
-------------------------------------------
DB直接切換配置即可
GRID可以使用指令碼,切換回去即可,測試可行
# export ORACLE_HOME=/u01/app/11.2.0/grid
# /usr/bin/perl $ORACLE_HOME/OPatch/crs/patch11203.pl -patch -desthome=$ORACLE_HOME
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8242091/viewspace-767707/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [譯] Elasticsearch 滾動升級Elasticsearch
- 入門Kubernetes - 滾動升級/回滾
- 資料庫升級之-Dataguard滾動升級資料庫
- 【邏輯DG滾動升級三】ORACLE11204 邏輯DG滾動升級至12C---正式升級Oracle
- 滴滴HBase大版本滾動升級之旅
- oracle 10 rac 升級 10.2.0.1升級到10.2.0.5Oracle
- 11gR2 RAC convert ONENODE
- 11gR2 OneNode Convert RAC
- Kubernetes:Pod 升級、回滾
- 14 使用DBMS_ROLLING 執行滾動升級
- 【邏輯DG滾動升級二】ORACLE11204 邏輯DG滾動升級至12C---DG端前期準備Oracle
- oracle rac 11.2.0.3 升級到11.2.0.4Oracle
- 【邏輯DG滾動升級一】ORACLE11204 邏輯DG滾動升級至12C---生產端前期準備Oracle
- 1分鐘搞定 Nginx 版本的平滑升級與回滾Nginx
- 11gR2 RAC新增節點步驟
- Oracle RAC 11gR2開啟歸檔Oracle
- Oracle:Oracle RAC 11.2.0.4 升級為 19cOracle
- Oracle 11gR2 RAC 叢集服務啟動與關閉總結Oracle
- 淺入Kubernetes(12):Deployment 的升級、回滾
- linux7 靜默安裝 11GR2 RACLinux
- ORACLE 11GR2 RAC的網路規劃解析Oracle
- 12.1.0.2 單機 升級 19.16 RAC步驟詳解
- kubernetes實踐之四十:Pod的升級與回滾
- 【前端詞典】5 種滾動吸頂實現方式的比較[效能升級版]前端
- 三級 NestedScroll 巢狀滾動實踐巢狀
- 【kingsql分享】Oracle 18c RAC補丁升級實戰【DBRU】SQLOracle
- 關閉chrome自動升級的教程 chrome如何取消自動升級Chrome
- ABP Framework 手動升級指南:從6.0.1升級到7.0.0Framework
- OpenSSH升級(從OpenSSH_7.4p1升級到OpenSSH_8.4p1) [操作指令碼]指令碼
- openssh升級7.4p1至8.4p1、openssl升級至openssl-1.1.1h
- Oracle 11gR2 RAC 單網路卡轉雙網路卡繫結配置Oracle
- 【Oracle19c】Oracle19c RAC 升級 ru:19.3-19.6Oracle
- CentOs下手動升級node版本CentOS
- sal原始碼解析-輕量級的滾動動畫庫原始碼動畫
- CSS題目系列(1) - 可滾動的TableCSS
- 支援行級同步滾動的 markdown 編輯器
- div滾動條樣式,水平滾動
- RecyclerView滾動位置,滾動速度設定View
- 隱藏滾動條保留滾動效果