1. 程式人生 > >AIX 6 Oracle RAC 11.2.0.4版本 PSU升級步驟

AIX 6 Oracle RAC 11.2.0.4版本 PSU升級步驟

1.檢查/更新OPatch版本

官方要求OPatch版本需在11.2.0.3.6或以上,如果檢查OPatch版本低於11.2.0.3.6,需從官網下載最新OPatch實用程式,並在各個節點的database home和GI home均打上最新補丁。

在節點1和節點2檢查OPatch版本

[[email protected]:/home/grid]$ /app/11.2.0/grid/OPatch/opatch version

[[email protected]:/home/oracle]$/app/oracle/product/11.2.0/db_1/OPatch/opatch version

分別替換節點1和節點2的OPatch

Oracle使用者

# unzip p6880880_112000_AIX64-5L.zip

# chown -R oracle:dba OPatch

[[email protected]:/home/oracle]$ cd $ORACLE_HOME

[[email protected]:/app/11.2.0/grid]$ mv OPatch OPatch_bak

[[email protected]:/app/11.2.0/grid]$ mv /OPatch/OPatch $ORACLE_HOME

[[email protected]:/app/11.2.0/grid

]$OPatch/opatch lsinventory

Grid 使用者

# unzip p6880880_112000_AIX64-5L.zip

# mv /app/11.2.0/grid/OPatch /app/11.2.0/grid/OPatch_bak

#mv /OPatch/OPatch /app/11.2.0/grid/

# chown -R grid:install /oragrid/11.2.0/grid/OPatch

[[email protected]:/home/grid]$/oragrid/11.2.0/grid/OPatch/opatch lsinventory

2.生成OCM響應檔案

登陸grid使用者,在所有節點生成OCM響應檔案

$ORACLE_HOME/OPatch/ocm/bin/emocmrsp -no_banner -output /home/grid/ocm.rsp

Provide your email address to be informed of security issues, install and

initiate Oracle Configuration Manager. Easier for you if you use your My

Oracle Support Email address/User Name.

Visit http://www.oracle.com/support/policies.html for details.

Email address/User Name:

 

You have not provided an email address for notification of security issues.

Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]:  y

The OCM configuration response file (/home/grid/ocm.rsp) was successfully created.

 

3.驗證Oracle補丁一致性

在所有節點的Grid和Oracle使用者執行:

[[email protected]:/home/grid]$$ORACLE_HOME/OPatch/opatch lsinventory -detail -oh $ORACLE_HOME

[[email protected]:/home/oracle]$ $ORACLE_HOME/OPatch/opatch lsinventory -detail -oh $ORACLE_HOME

4.解壓Patch檔案

# chown -R grid:dba /softwares/PSU

[[email protected]:/softwares/PSU]$unzip p25476126_112040_AIX64-5L.zip

5.停止EM

As the Oracle RAC database home owner execute:

[[email protected]:/home/oracle]$ $ORACLE_HOME/bin/emctl stop dbconsole

6.安裝GI補丁

本環境由於GI Home和Database Home都沒使用共享,也沒有建立使用ACFS檔案,採用下面這種方式打補丁:

在所有節點root使用者下執行

# cd /softwares/PSU/25476126

# /oragrid/11.2.0/grid/OPatch/opatch auto /softwares/PSU/25476126 -ocmrf /home/grid/ocm.rsp
遇到下面錯誤

 

檢視日誌是由於無法建立$ORACLE_HOME/.patch_storage

 

許可權問題造成的無法建立

 

# chown grid:dba /oragrid/11.2.0/grid

重新執行# /oragrid/11.2.0/grid/OPatch/opatch auto /softwares/PSU/25476126 -ocmrf /home/grid/ocm.rsp

7.執行資料庫SQL補丁

這步在需在一個節點執行

Oracle 使用者

[[email protected]:/home/oracle]$ cd $ORACLE_HOME/rdbms/admin

[[email protected]:/oraapp/app/oracle/rdbms/11g/rdbms/admin]$sqlplus /nolog

SQL> CONNECT / AS SYSDBA

SQL> @catbundle.sql psu apply

SQL> QUIT

[[email protected]:/home/oracle]$ cd $ORACLE_HOME/rdbms/admin

[[email protected]:/oraapp/app/oracle/rdbms/11g/rdbms/admin]$sqlplus /nolog

SQL> CONNECT / AS SYSDBA

SQL> @utlrp.sql

 

Check the following log files in $ORACLE_BASE/cfgtoollogs/catbundle for any errors:

catbundle_PSU_<database SID>_APPLY_<TIMESTAMP>.log

catbundle_PSU_<database SID>_GENERATE_<TIMESTAMP>.log

8.驗證補丁安裝情況

在grid和oracle使用者檢視

[[email protected]:/home/grid]$$ORACLE_HOME/OPatch/opatch lsinventory

[[email protected]:/home/oracle]$$ORACLE_HOME/OPatch/opatch lsinventory

資料庫中執行:

set linesize 200

set pagesize 200

col ACTION_TIME format a30

col ACTION format a10

col BUNDLE_SERIES format a15

col COMMENTS format a30

 

9.檢查叢集環境是否正常

[[email protected]:/home/grid]$crsctl stat res -t 

 

10、回退方案

如升級過程出現重大問題導致升級無法正常進行,啟動緊急回退流程,執行回退方案,需嚴格按照如下步驟執行回退操作:

如果補丁安裝之後出現故障,則需回滾操作。

opatch auto <UNZIPPED_PATCH_LOCATION>/25476126 -rollback -ocmrf <ocm response file>

資料庫SQL回滾:

cd $ORACLE_HOME/rdbms/admin

sqlplus /nolog

SQL> CONNECT / AS SYSDBA

SQL> STARTUP

SQL> @catbundle_PSU_<database SID PREFIX>_ROLLBACK.sql

SQL> QUIT

 

cd $ORACLE_HOME/rdbms/admin

sqlplus /nolog

SQL> CONNECT / AS SYSDBA

SQL> @utlrp.sql

 

在節點中檢查補丁是否回滾

[[email protected]:/home/grid]$$ORACLE_HOME/OPatch/opatch lsinventory

[[email protected]:/home/oracle]$$ORACLE_HOME/OPatch/opatch lsinventory

 

回退驗證

檢查叢集環境crs,database,通知專案組驗證