oracle 11g 补丁更新步骤


1.检查OPatch版本

需要跟踪对应补丁的README说明,确定当前环境的OPatch版本符合要求,如果不符合要求,需要下载符合要求的OPatch版本。

1.1 查询OPatch版本
$ORACLE_HOME/OPatch/opatch version

1.2 替换为新版本OPatch(GRID_HOME and ORACLE_HOME)
备份原来的OPatch,解压新版本OPatch到$ORACLE_HOME下,检查OPatch的版本:
mv $ORACLE_HOME/OPatch/ $ORACLE_HOME/OPatch/OPatchbk
cp $ORACLE_HOME/OPatch/ $ORACLE_HOME
chown -R grid:oinstall OPatch
chmod 755 OPatch
$ORACLE_HOME/OPatch/opatch version

2. 解压补丁文件并且授权

# unzip p27475913_112040_Linux-x86-64.zip
chown -R grid:oinstall 27475913
chmod 775 27475913

3.确认停止oem

---查看oem运行状态:
$ORACLE_HOME/bin/emctl status dbconsole
---如果是运行状态,则需要关闭:
$ORACLE_HOME/bin/emctl stop dbconsole
(一般是在oracle用户登录1节点停止em)

4.本次PSU补丁说明

27441052;OCW PATCH SET UPDATE: 11.2.0.4.180417 (27441052)
27338049;Database Patch Set Update : 11.2.0.4.180417 (27338049)
22502505;ACFS Patch Set Update : 11.2.0.4.160419 (22502505)

5. 安装前检查是否冲突

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

6. 手动应用补丁

6.1 停止crs
---Stop the CRS managed resources running from DB homes. If this is a GI Home environment, as the database home owner execute:
$ <ORACLE_HOME>/bin/srvctl stop home -o <ORACLE_HOME> -s <status file location> -n <node name>

6.2 运行rootcrs.pl
---Run the pre root script. If this is a GI Home, as the root user execute:
# <GI_HOME>/crs/install/rootcrs.pl -unlock
---停止节点1的服务
su - root
# <GI_HOME>/crs/install/rootcrs.pl -unlock

6.3 应用CRS补丁
---Apply the CRS patch using.
As the GI home owner execute:
$ <GI_HOME>/OPatch/opatch napply -oh <GI_HOME> -local <UNZIPPED_PATCH_LOCATION>/<GI_PSU_number>/<OCW Components_number>
As the GI home owner execute:
$ <GI_HOME>/OPatch/opatch napply -oh <GI_HOME> -local <UNZIPPED_PATCH_LOCATION>/<GI_PSU_number>/<ACFS Components_number>
As the GI home owner execute:
$ <GI_HOME>/OPatch/opatch apply -oh <GI_HOME> -local <UNZIPPED_PATCH_LOCATION>/<GI_PSU_number>/<DB_PSU_number>

---grid用户登录,打对应补丁:
su - grid
$ /u01/app/11.2.0/grid/OPatch/opatch napply -oh $ORACLE_HOME -local /u01/app/stage/27475913/22502505/
$ /u01/app/11.2.0/grid/OPatch/opatch napply -oh $ORACLE_HOME -local /u01/app/stage/27475913/27338049/
$ /u01/app/11.2.0/grid/OPatch/opatch napply -oh $ORACLE_HOME -local /u01/app/stage/27475913/27441052/

6.4 补丁安装前执行脚本
---.Run the pre script for DB component of the patch. As the database home owner execute:
$ <UNZIPPED_PATCH_LOCATION>/<GI_PSU_number>/<OCW Components_number>/custom/server/<OCW Components_number>/custom/scripts/prepatch.sh -dbhome <ORACLE_HOME>
---Oracle用户登录,补丁安装前检查:
su - oracle
$ /u01/app/stage/27475913/27441052/custom/server/27441052/custom/scripts/prepatch.sh -dbhome $ORACLE_HOME

6.5 应用db补丁
$ <ORACLE_HOME>/OPatch/opatch napply -oh <ORACLE_HOME> -local <UNZIPPED_PATCH_LOCATION>/<GI_PSU_number>/<OCW Components_number>/custom/server/<OCW Components_number>
$ <ORACLE_HOME>/OPatch/opatch apply -oh <ORACLE_HOME> -local <UNZIPPED_PATCH_LOCATION>/<GI_PSU_number>/<DB_PSU_number>
---oracle用户登录,打对应补丁:
$ /u01/app/oracle/product/11.2.0.4/OPatch/opatch napply -oh $ORACLE_HOME -local /u01/app/stage/27475913/27441052/custom/server/27441052/
$ /u01/app/oracle/product/11.2.0.4/OPatch/opatch napply -oh $ORACLE_HOME -local /u01/app/stage/27475913/27338049/
6 .6 补丁安装后执行脚本
---.Run the post script for DB component of the patch. As the database home owner execute:
$ <UNZIPPED_PATCH_LOCATION>/<GI_PSU_number>/<OCW Components_number>/custom/server/<OCW Components_number>/custom/scripts/postpatch.sh -dbhome <ORACLE_HOME>
oracle用户登录,补丁修复完确定:
$ /u01/app/stage/27475913/27441052/custom/server/27441052/custom/scripts/postpatch.sh -dbhome $ORACLE_HOME

7.root用户执行脚本

---.Run the post script. As the root user execute:
# <GI_HOME>/rdbms/install/rootadd_rdbms.sh
If this is a GI Home, as the root user execute:
# <GI_HOME>/crs/install/rootcrs.pl -patch
If this is an Oracle Restart Home, as the root user execute:
# <GI_HOME>/crs/install/roothas.pl -patch
root用户登录,执行脚本:
su - root
# $GRID_HOME/rdbms/install/rootadd_rdbms.sh
# $GRID_HOME/crs/install/rootcrs.pl -patch


##########################################################
Start the CRS managed resources that were earlier running from DB homes. If this is a GI Home environment, as the database home owner execute:
$ /bin/srvctl start home -o -s -n
If this is an Oracle Restart Home environment, as the database home owner execute:
$ /bin/srvctl start home -o -s

8.升级数据字典

---post patch
8.1 升级数据字典(单节点运行)

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

8.2 重编译Java类.
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
CONNECT / AS SYSDBA
@utlrp.sql

############################################################################
SQL> select * from dba_registry_history;

ACTION_TIME ACTION NAMESPACE VERSION ID BUNDLE_SERIES COMMENTS
--------------------------------------------------------------------------- ------------------------------ ------------------------------ ------------------------------ ---------- ------------------------------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
24-AUG-13 12.03.45.119862 PM APPLY SERVER 11.2.0.4 0 PSU Patchset 11.2.0.2.0
05-JUN-18 05.04.34.287621 AM APPLY SERVER 11.2.0.4 171017 PSU PSU 11.2.0.4.171017
06-JUN-18 01.01.54.058111 AM APPLY SERVER 11.2.0.4 180417 PSU PSU 11.2.0.4.180417





  • 1
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值