Oracle 11g RAC 打補丁過程(11.2.0.3.15)

feelpurple發表於2016-01-14
--關閉EM

emctl status dbconsole
emctl stop dbconsole

--關閉資料庫和監聽

srvctl stop database -d ptfdb
srvctl stop listener -n ptfdb1
srvctl stop listener -n ptfdb2

1、檢視資料庫安裝的補丁

$ORACLE_HOME/OPatch/opatch lsinventory

2、解壓 patch 包

unzip p20760997_112030_Linux-x86-64.zip
cd 20760997/

3、檢查是否滿足補丁安裝條件

$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./

4、安裝補丁

cd 20760997
$ORACLE_HOME/OPatch/opatch apply

在安裝補丁的過程中,安裝完本地補丁後,會提示是否安裝遠端節點的補丁,選擇是即可。

5、安裝補丁後的操作

--啟動資料庫和監聽

srvctl start database -d ptfdb

srvctl start listener -n ptfdb1
srvctl start listener -n ptfdb2

cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
CONNECT / AS SYSDBA
STARTUP
@catbundle.sql psu apply
QUIT

cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> @utlrp.sql

--檢查安裝的補丁

select * from dba_registry_history;
SELECT comp_name, version, status FROM dba_registry;

6、安裝中的報錯

--報錯一
SQL> execute dbms_java.loadjava('-synonym -schema ORDSYS -resolve -grant PUBLIC ord/jlib/ordimann.jar');
BEGIN dbms_java.loadjava('-synonym -schema ORDSYS -resolve -grant PUBLIC ord/jlib/ordimann.jar'); END;
*
ERROR at line 1:
ORA-04031: unable to allocate 4096 bytes of shared memory ("java
pool","java/io/Serializable","JOXLE^1b45c29",":SGAClass")
ORA-06512: at "SYS.DBMS_JAVA", line 655
ORA-06512: at line 1
SQL> execute dbms_java.loadjava('-grant PUBLIC -schema ORDSYS ord/jlib/jai_core.jar');
BEGIN dbms_java.loadjava('-grant PUBLIC -schema ORDSYS ord/jlib/jai_core.jar'); END;
*
ERROR at line 1:
ORA-04031: unable to allocate 4096 bytes of shared memory ("java
pool","java/io/Serializable","JOXLE^1b45c29",":SGAClass")
ORA-06512: at "SYS.DBMS_JAVA", line 655
ORA-06512: at line 1
Invoking prereq "checkconflictagainstohwithdetail"
OracleHomeInventory was not able to create a lock file, probably due to a failed OPatch Session. The loaded inventory might not show correctly what you have in the Oracle Home.

--解決方法

這是由於JAVA池分配的太小了,更改JAVA池後,重啟資料庫。
alter system set java_pool_size=300M scope=spfile;

--報錯二

OUI-67076:OracleHomeInventory was not able to create a lock file, probably due to a failed OPatch Session. The loaded inventory might not show correctly what you have in the Oracle Home.

--解決方法

cd $ORACLE_HOME/.patch_storage
mv patch_locked patch_locked.back

--報錯三

Following executables are active :
/u01/app/oracle/product/11.2.0/db_1/lib/libclntsh.so.11.1
UtilSession failed: Prerequisite check "CheckActiveFilesAndExecutables" failed.
Log file location: /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/16902043_Jan_13_2016_14_27_14/rollback2016-01-13_14-27-14PM_1.log

--解決方法
如有未清除程式,則執行下列命令
fuser -k /u01/app/oracle/product/11.2.0/db_1/lib/libclntsh.so.11.1

--報錯四

OPatch found the word "warning" in the stderr of the make command.
Please look at this stderr. You can re-run this make command.
Stderr output:
ins_precomp.mk:19: warning: overriding commands for target `pcscfg.cfg'
/u01/app/oracle/product/11.2.0/db_1/precomp/lib/env_precomp.mk:2160: warning: ignoring old commands for target `pcscfg.cfg'
/u01/app/oracle/product/11.2.0/db_1/precomp/lib/ins_precomp.mk:19: warning: overriding commands for target `pcscfg.cfg'
/u01/app/oracle/product/11.2.0/db_1/precomp/lib/env_precomp.mk:2160: warning: ignoring old commands for target `pcscfg.cfg'

OPatch found the word "warning" in the stderr of the make command.
Please look at this stderr. You can re-run this make command.
Stderr output:
ins_emagent.mk:113: warning: overriding commands for target `nmosudo'
ins_emagent.mk:52: warning: ignoring old commands for target `nmosudo'
/u01/app/oracle/product/11.2.0/db_1/sysman/lib/ins_emagent.mk:113: warning: overriding commands for target `nmosudo'
/u01/app/oracle/product/11.2.0/db_1/sysman/lib/ins_emagent.mk:52: warning: ignoring old commands for target `nmosudo'

--解決方法
這是一個正常的警告,實際上補丁已經更新成功。

7、補丁回退的方法

$ORACLE_HOME/OPatch/opatch rollback -id 20760997

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26506993/viewspace-1976664/,如需轉載,請註明出處,否則將追究法律責任。

相關文章