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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 11gR2 RAC out-of-place 滾動升級(2)
- ORACLE RAC 的滾動升級Oracle
- [譯] Elasticsearch 滾動升級Elasticsearch
- 【RAC】11gR2 rac 上滾動安裝/回退補丁
- 資料庫升級之-Dataguard滾動升級資料庫
- 滾動升級(rolling upgrade) Oracle 10g RACOracle 10g
- 入門Kubernetes - 滾動升級/回滾
- 【邏輯DG滾動升級三】ORACLE11204 邏輯DG滾動升級至12C---正式升級Oracle
- 滴滴HBase大版本滾動升級之旅
- Oracle RAC 手動升級 11.2.0.3.4Oracle
- 使用SQL Apply實現滾動升級SQLAPP
- 1分鐘搞定 Nginx 版本的平滑升級與回滾Nginx
- 【邏輯DG滾動升級二】ORACLE11204 邏輯DG滾動升級至12C---DG端前期準備Oracle
- 11gR2 RAC ASM 啟動ASM
- rac 升級crs 升級資料庫軟體,升級資料庫資料庫
- ORACLE 滾動升級(Rolling Upgrades)介紹Oracle
- 【邏輯DG滾動升級一】ORACLE11204 邏輯DG滾動升級至12C---生產端前期準備Oracle
- oracle 10 rac 升級 10.2.0.1升級到10.2.0.5Oracle
- oracle 10.2.0.1 rac 升級到10.2.0.4 rac時,dbua升級的元件列表Oracle元件
- 14 使用DBMS_ROLLING 執行滾動升級
- oracle 10g rac升級Oracle 10g
- physru指令碼實現11g DataGuard簡易滾動升級指令碼
- 【Oracle12C】11GR2升級到12CR1並插入CDBOracle
- 11gR2 RAC ASM啟動過程ASM
- Oracle RAC 11.2.0.3.2 升級 11.2.0.3.4Oracle
- Oracle 資料庫 升級為 RACOracle資料庫
- RAC 資料庫升級 10.2.0.1.0 到 10.2.0.2.0 之升級catalog資料庫
- oracle rac 11.2.0.3 升級到11.2.0.4Oracle
- ORACLE 10G RAC 升級補丁Oracle 10g
- RAC資料庫升級到10.2.0.5資料庫
- aix 6.1上rac升級到10.2.0.4AI
- 升級oracle 10g clusterware 和 racOracle 10g
- Oracle 10g rac升級(10.2.0.1 Rac到10.2.0.4)Oracle 10g
- oracle 10.2.0.4 rac 升級到oracle 10.2.0.5 rac步驟Oracle
- 探索Oracle之資料庫升級七 11gR2 to 12c 升級完成後插入PDBOracle資料庫
- Oracle 11gR2 RAC的關閉和啟動Oracle
- ORACLE 10gR2 RAC升級至10.2.0.4-(1)停止相關程式Oracle 10g
- 11G通過邏輯standby滾動升級例項說明及注意