ps -ef |grep LOCAL=
su - oracle
P720:/tools$$ORACLE_HOME/OPatch/opatch version
Invoking OPatch 11.2.0.1.7
OPatch Version: 11.2.0.1.7
OPatch succeeded.
P720:/tools$$ORACLE_HOME/OPatch/opatch lsinventory
Invoking OPatch 11.2.0.1.7
Oracle Interim Patch Installer version 11.2.0.1.7
Copyright (c) 2011, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/product/11.2
Central Inventory : /g01/oraInventory
from : /etc/oraInst.loc
OPatch version : 11.2.0.1.7
OUI version : 11.2.0.3.0
Log file location : /u01/app/product/11.2/cfgtoollogs/opatch/opatch2013-05-02_14-26-08PM.log
Lsinventory Output file location : /u01/app/product/11.2/cfgtoollogs/opatch/lsinv/lsinventory2013-05-02_14-26-08PM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Database 11g 11.2.0.3.0
There are 1 products installed in this Oracle Home.
There are no Interim patches installed in this Oracle Home.
--------------------------------------------------------------------------------
OPatch succeeded.
P720:/tools$
su - grid
P720:/home/grid&$ORACLE_HOME/OPatch/opatch version
Invoking OPatch 11.2.0.1.7
OPatch Version: 11.2.0.1.7
OPatch succeeded.
P720:/home/grid&$ORACLE_HOME/OPatch/opatch lsinventory
Invoking OPatch 11.2.0.1.7
Oracle Interim Patch Installer version 11.2.0.1.7
Copyright (c) 2011, Oracle Corporation. All rights reserved.
Oracle Home : /g01/grid/asm
Central Inventory : /g01/oraInventory
from : /etc/oraInst.loc
OPatch version : 11.2.0.1.7
OUI version : 11.2.0.3.0
Log file location : /g01/grid/asm/cfgtoollogs/opatch/opatch2013-05-02_14-27-04PM.log
Lsinventory Output file location : /g01/grid/asm/cfgtoollogs/opatch/lsinv/lsinventory2013-05-02_14-27-04PM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Grid Infrastructure 11.2.0.3.0
There are 1 products installed in this Oracle Home.
There are no Interim patches installed in this Oracle Home.
--------------------------------------------------------------------------------
OPatch succeeded.
P720:/home/grid&
SQL>shutdown immediate
$lsnrctl stop
如版本为11.2.0.1的则说明版本过低,需下载最新的OPATCH ,PSU号为6880880(p6880880_112000_Linux-x86-64.zip)
--备份opatch
&su - grid
&cp -rp $ORACLE_HOME/OPatch/ ./OPatch_bak
P720:/g01/grid/asm/OPatch_bak&cp -rp /g01/grid/asm/OPatch_bak/OPatch /g01/grid/asm/OPatch_bak/
cp: 0653-435 /g01/grid/asm/OPatch_bak/OPatch and /g01/grid/asm/OPatch_bak/OPatch are identical (not copied).
su - oracle
cp -rp $ORACLE_HOME/OPatch/ ./OPatch_bak
$ORACLE_HOME/OPatch/opatch -help
--解压并安装opatch
su - grid
unzip p6880880_112000_AIX64-5L.zip -d $ORACLE_HOME
P720:/g01&$ORACLE_HOME/OPatch/opatch version
OPatch Version: 11.2.0.3.0
OPatch succeeded.
P720:/g01&
su - oracle
unzip p6880880_112000_AIX64-5L.zip -d $ORACLE_HOME
P720:/u01$$ORACLE_HOME/OPatch/opatch version
OPatch Version: 11.2.0.3.0
OPatch succeeded.
P720:/u01$
RAC:对crs的进行unlock,同时关闭节点1上的crs
su – root
#/u01/app/11.2.0/grid/crs/install/rootcrs.pl -unlock
su - grid
cd /tmp/14275605
P720:/tmp/14275605&$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir ./
Oracle Interim Patch Installer version 11.2.0.3.0
Copyright (c) 2012, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /g01/grid/asm
Central Inventory : /g01/oraInventory
from : /g01/grid/asm/oraInst.loc
OPatch version : 11.2.0.3.0
OUI version : 11.2.0.3.0
Log file location : /g01/grid/asm/cfgtoollogs/opatch/opatch2013-05-04_22-19-37PM_1.log
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.
P720:/tmp/14275605&
su - oracle
cd /tmp/14275605
P720:/tmp/14275605$$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir ./
Oracle Interim Patch Installer version 11.2.0.3.0
Copyright (c) 2012, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u01/app/product/11.2
Central Inventory : /g01/oraInventory
from : /u01/app/product/11.2/oraInst.loc
OPatch version : 11.2.0.3.0
OUI version : 11.2.0.3.0
Log file location : /u01/app/product/11.2/cfgtoollogs/opatch/opatch2013-05-04_22-20-55PM_1.log
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.
P720:/tmp/14275605$
进入 14275605 psu 解压目录,确保14275605权限为oracle:oinstall
给GI HOME打补丁
su - grid
$ORACLE_HOME/OPatch/opatch napply -oh $ORACLE_HOME -local /tmp/14275605
Composite patch 14275605 successfully applied.
OPatch Session completed with warnings.
Log file location: /g01/grid/asm/cfgtoollogs/opatch/opatch2013-05-04_22-39-34PM_1.log
OPatch completed with warnings.
P720:/tmp/14275605&$ORACLE_HOME/OPatch/opatch lspatches
14275605;Database Patch Set Update : 11.2.0.3.4 (14275605)
P720:/tmp/14275605&
给RDBMS DB HOME打补丁
su - oracle
$ORACLE_HOME/OPatch/opatch napply -oh $ORACLE_HOME -local /tmp/14275605
Composite patch 14275605 successfully applied.
OPatch Session completed with warnings.
Log file location: /u01/app/product/11.2/cfgtoollogs/opatch/opatch2013-05-04_22-46-17PM_1.log
OPatch completed with warnings.
P720:/tmp/14275605$$ORACLE_HOME/OPatch/opatch lspatches
14275605;Database Patch Set Update : 11.2.0.3.4 (14275605)
P720:/tmp/14275605$
RAC:需要执行rootcrs.pl -patch
su – root
[root@vmac1 ~]# /g01/11ggrid/app/11.2.0/grid/rdbms/install/rootadd_rdbms.sh
[root@vmac1 ~]# /g01/11ggrid/app/11.2.0/grid/crs/install/rootcrs.pl -patch
$ORACLE_HOME/OPatch/opatch lsinventory
P720:/tmp/14275605$$ORACLE_HOME/OPatch/opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.3.0
Copyright (c) 2012, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/product/11.2
Central Inventory : /g01/oraInventory
from : /u01/app/product/11.2/oraInst.loc
OPatch version : 11.2.0.3.0
OUI version : 11.2.0.3.0
Log file location : /u01/app/product/11.2/cfgtoollogs/opatch/opatch2013-05-04_22-54-13PM_1.log
Lsinventory Output file location : /u01/app/product/11.2/cfgtoollogs/opatch/lsinv/lsinventory2013-05-04_22-54-13PM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Database 11g 11.2.0.3.0
There are 1 products installed in this Oracle Home.
Interim patches (1) :
Patch 14275605 : applied on Sat May 04 22:49:08 CST 2013
Unique Patch ID: 15379971.2
Patch description: "Database Patch Set Update : 11.2.0.3.4 (14275605)"
Created on 3 Oct 2012, 23:27:54 hrs PST8PDT
Sub-patch 13923374; "Database Patch Set Update : 11.2.0.3.3 (13923374)"
Sub-patch 13696216; "Database Patch Set Update : 11.2.0.3.2 (13696216)"
Sub-patch 13343438; "Database Patch Set Update : 11.2.0.3.1 (13343438)"
Bugs fixed:
12880299, 12960925, 14038787, 13059165, 12834027, 13502183, 12612118
12764337, 13397104, 13916709, 13772618, 14390252, 10133521, 9761357
13588248, 12894807, 13773133, 13742435, 12829021, 13657605, 13742434
12585543, 13742433, 13742438, 13742437, 13742436, 12905058, 13503598
9873405, 12535346, 12582664, 13632717, 12861463, 13343438, 12971775
13080778, 12849688, 13696216, 13103913, 13737746, 13457582, 13742464
13099577, 12917230, 13036331, 12938841, 12693626, 14548763, 12656535
13499128, 13624984, 12678920, 11708510, 12401111, 13377816, 13699124
13338048, 12913474, 13705338, 12662040, 12658411, 11877623, 11063191
13250244, 12847466, 12718090, 12797765, 14613900, 12919564, 12780983
12617123, 12950644, 12923168, 13035360, 13903046, 13923374, 13572659
13420224, 12646784, 13370330, 14275605, 13340388, 12583611, 14409183
12794305, 13464002, 10350832, 14480674, 14480675, 14480676, 12998795
13467683, 12588744, 13528551, 12594032, 13612575, 13001379, 14076523
12797420, 12620823, 13257247, 13358781, 13041324, 13649031, 13366202
13385346, 13527323, 13804294, 13326736, 13492735, 14664355, 13981051
13466801, 13332439, 13718279, 13035804, 14063281, 14063280, 13362079
13419660, 13384182, 9703627, 12845115, 12976376, 13070939, 11840910
9858539, 13566938, 13430938, 12748240, 12780098, 13354082, 14062797
12879027, 14062796, 14062795, 14062794, 14062793, 14062792, 13476583
13484963, 13550185, 13554409
--------------------------------------------------------------------------------
OPatch succeeded.
$ORACLE_HOME/OPatch/opatch lspatches
应用完毕进入rdbms/admin目录执行catbundle.sql脚本应用改变
cd $ORACLE_HOME/rdbms/admin
$lsnrctl start
$sqlplus / as sysdba
SQL> startup
SQL> @catbundle.sql psu apply
SQL> quit
执行utlrp 脚本 并重启DB
SQL> @?/rdbms/admin/utlrp
SQL> shutdown immediate;
SQL> startup;
查询PSU版本号
SQL>select substr(action_time,1,30) action_time,
substr(id,1,8) id,
substr(action,1,10) action,
substr(version,1,8) version,
substr(comments,1,20) comments
from registry$history;
SQL> select substr(action_time,1,30) action_time,
2 substr(id,1,8) id,
3 substr(action,1,10) action,
4 substr(version,1,8) version,
5 substr(comments,1,20) comments
6 from registry$history;
ACTION_TIME ID
------------------------------------------------------------ ----------------
ACTION VERSION COMMENTS
-------------------- ---------------- ----------------------------------------
21-NOV-12 12.01.00.181539 AM 4
APPLY 11.2.0.3 PSU 11.2.0.3.4
04-MAY-13 11.04.10.211276 PM 4
APPLY 11.2.0.3 PSU 11.2.0.3.4
SQL>
在以下目录检查是否错误
$ORACLE_HOME/cfgtoollogs/catbundle
$ORACLE_BASE/cfgtoollogs/catbundle
日志格式如下:
catbundle_PSU_<database SID>_APPLY_<TIMESTAMP>.log
catbundle_PSU_<database SID>_GENERATE_<TIMESTAMP>.log
到此 PSU数据库升级完成
执行完catbundle.sql后,会在$ORACLE_HOME/rdbms/admin目录下生成
catbundle_PSU_<database SID>_APPLY.sql,catbundle_PSU_<database SID>_ROLLBACK.sql两个脚本
[oracle@ora_11g admin]$ ls -al catbundle_PSU_TEST01_*
-rw-r----- 1 oracle oinstall 1130 Dec 18 20:13 catbundle_PSU_TEST01_APPLY.sql
-rw-r----- 1 oracle oinstall 1139 Dec 18 20:13 catbundle_PSU_TEST01_ROLLBACK.sql
catbundle_PSU_TEST01_ROLLBACK.sql用于回滚PSU时使用