RAC+ADG apply PSU+PATCH

本文档详细记录了在AIX操作系统上,针对RAC+ADG环境,如何采用离线方式安装PSU和补丁的过程。涉及停服、切换用户、执行预检查、应用补丁、执行后置脚本以及验证等一系列操作步骤。
摘要由CSDN通过智能技术生成
---环境------
aix rac+adg,off-line方式打补丁
----读所有patch,及PSU的readme,很重要,特别是patch,可能有的应用patch方法不应-----
----停实例,停服务,停集群,disable集群,杀进程-----
[oracle@trsendb1 /]srvctl stop instance -d xxxx -i xxxx
[oracle@trsendb1 /]srvctl stop service -d xxxx -s xxxx,xxxx,xxxx
[root@trsendb1 /]#source /home/grid/.profile
[root@trsendb1 /]#crsctl stop crs
[oracle@trsendb1 /]ps -ef|grep "(LOCAL=NO)"|grep -v grep|akw '{print $2}'|xargs kill -9

-------------查看OPatch版本
[oracle@trsendb1 /]cd $ORACLE_HOME/OPatch
[oracle@trsendb1 /]opatch version
[oracle@trsendb1 /]opatch lsinventory

------------开始工作
[root@trsendb1 /]#. /home/grid/.profile
[YOU HAVE NEW MAIL]
[root@trsendb1 /]#crsctl stop crs
[root@trsendb1 /]#cd $ORACLE_HOME
[root@trsendb1 /u01/app/11.2.0/grid]#cd crs
[root@trsendb1 /u01/app/11.2.0/grid/crs]#cd install
[root@trsendb1 /u01/app/11.2.0/grid/crs/install]#./rootcrs.pl -unlock
[root@trsendb1 /u01/app/11.2.0/grid/crs/install]#/usr/sbin/slibclean
[root@trsendb1 /tempfs/Patch]export PATH=$PATH:/tempfs/Patch/OPatch
[root@trsendb1 /tempfs/Patch]chown -R grid:oinstall OPatch 20130712
[root@trsendb1 /tempfs/Patch]chown -R grid:oinstall OPatch/
[root@trsendb1 /tempfs/Patch]chown -R grid:oinstall 13940331
[root@trsendb1 /tempfs/Patch]#ps -ef|grep d.bin

----------切换到grid用户检查PSU兼容性及nappley PSU--------
[grid@trsendb1 ~]$opatch prereq CheckConflictAgainstOHWithDetail  -phBaseDir /tempfs/Patch/20130712/16056266
[grid@trsendb1 ~]$opatch prereq CheckConflictAgainstOHWithDetail  -phBaseDir /tempfs/Patch/20130712/16315641
[grid@trsendb1 ~]$opatch napply -oh $ORACLE_HOME -local /tempfs/Patch/20130712/16056266

----切换到oracle用户检查PSU兼容性及nappley PSU-------------
[oracle@trsendb1 ~]$opatch prereq CheckConflictAgainstOHWithDetail  -phBaseDir /tempfs/Patch/20130712/16056266
[oracle@trsendb1 ~]$/tempfs/Patch/20130712/16315641/custom/server/16315641/custom/scripts/prepatch.sh -dbhome $ORACLE_HOME
/tempfs/Patch/20130712/16315641/custom/server/16315641/custom/scripts/prepatch.sh completed successfully.
[oracle@trsendb1 ~]$opatch napply -oh $ORACLE_HOME -local /tempfs/Patch/20130712/16315641/custom/server/16315641
[oracle@trsendb1 ~]$/tempfs/Patch/20130712/16315641/custom/server/16315641/custom/scripts/postpatch.sh -dbhome $ORACLE_HOME


----完成补丁----------------------------
[oracle@trsendb1 ~]$sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Fri Jul 12 22:19:25 2013
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.

-----------------检查对象有效性---------------------
--------检查-------------------------------------
[root@trsendb1 /tempfs/Patch/20130712]#ps -ef
[root@trsendb1 /tempfs/Patch/20130712]#ps -ef|grep d.bin
[root@trsendb1 /tempfs/Patch/20130712]#. /home/grid/.profile
[root@trsendb1 /tempfs/Patch/20130712]#crsctl stat res -init -t
[grid@trsendb1 /u01/app/11.2.0/grid/OPatch]$./opatch lsinventory
[root@trsendb1 /tempfs/Patch]#su - oracle
[oracle@trsendb1 ~]$cd /u01/app/oracle/db_1/OPatch/
[oracle@trsendb1 /u01/app/oracle/db_1/OPatch]$./opatch lsinventory

--------启动监听--------------
[grid@trsendb1 ~]$lsnrctl start listener_dg
------------ADG应用日志--------------
[oracle@trsendb1 ~]$sqlplus / as sysdba
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
Database altered.
---------------启动数据库实例及相关服务---------------------------
[grid@trsendb2 /tempfs/Patch/20130712]$srvctl start instance -d xxxx -i xxxx -o xxxx

----------------应用PSU的大概步骤------------------------------------------
Note: You need to make sure that the Oracle ACFS file systems are unmounted
1、Run the pre root script. If this is a GI Home, as the root user execute:
# <GI_HOME>/crs/install/rootcrs.pl -unlock
If this is an Oracle Restart Home, as the root user execute:
# <GI_HOME>/crs/install/roothas.pl -unlock
2、Apply the CRS patch using. As the GI home owner execute:
$ <GI_HOME>/OPatch/opatch napply -oh <GI_HOME> -local <UNZIPPED_PATCH_LOCATION>/<GI_components_number>
As the GI home owner execute:
$ <GI_HOME>/OPatch/opatch apply -oh <GI_HOME> -local <UNZIPPED_PATCH_LOCATION>/<DB_PSU_number>
3、Run the pre script for DB component of the patch. As the database home owner execute:
$ <UNZIPPED_PATCH_LOCATION>/<GI_components_number>/custom/server/<GI_components_number>/custom/scripts/prepatch.sh -dbhome <ORACLE_HOME>
4、Apply the DB patch. As the database home owner execute:
$ <ORACLE_HOME>/OPatch/opatch napply -oh <ORACLE_HOME> -local <UNZIPPED_PATCH_LOCATION>/<GI_components_number>/custom/server/<GI_components_number>
$ <ORACLE_HOME>/OPatch/opatch apply -oh <ORACLE_HOME> -local <UNZIPPED_PATCH_LOCATION>/<DB_PSU_number>
5、Run the post script for DB component of the patch. As the database home owner execute:
$ <UNZIPPED_PATCH_LOCATION>/<GI_components_number>/custom/server/<GI_components_number>/custom/scripts/postpatch.sh -dbhome <ORACLE_HOME>
6、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




---------------------下面是一个节点的gi和db的psu及db的patch应用部分日志-----------------------------
root@trsendb2 /tempfs]#source /home/grid/.profile
[YOU HAVE NEW MAIL]
root@trsendb2[+ASM2]:/tempfs$ crsctl disable crs===>disable crs
CRS-4621: Oracle High Availability Services autostart is disabled.
root@trsendb2[+ASM2]:/tempfs$ crsctl stop crs======>停crs
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'trsendb2'
CRS-2673: Attempting to stop 'ora.crsd' on 'trsendb2'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'trsendb2'
CRS-2673: Attempting to stop 'ora.trsendb2.vip' on 'trsendb2'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'trsendb2'
CRS-2673: Attempting to stop 'ora.oc4j' on 'trsendb2'
CRS-2673: Attempting to stop 'ora.cvu' on 'trsendb2'
CRS-2673: Attempting to stop 'ora.OCRDG.dg' on 'trsendb2'
CRS-2673: Attempting to stop 'ora.registry.acfs' on 'trsendb2'
CRS-2673: Attempting to stop 'ora.DATADG.dg' on 'trsendb2'
CRS-2673: Attempting to stop 'ora.INDEXDG.dg' on 'trsendb2'
CRS-2673: Attempting to stop 'ora.RECOVERYDG.dg' on 'trsendb2'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'trsendb2'
CRS-2677: Stop of 'ora.cvu' on 'trsendb2' succeeded
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'trsendb2' succeeded
CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'trsendb2' succeeded
CRS-2673: Attempting to stop 'ora.scan1.vip' on 'trsendb2'
CRS-2677: Stop of 'ora.DATADG.dg' on 'trsendb2' succeeded
CRS-2677: Stop of 'ora.trsendb2.vip' on 'trsendb2' succeeded
CRS-2673: Attempting to stop 'ora.standby1.vip' on 'trsendb2'
CRS-2677: Stop of 'ora.INDEXDG.dg' on 'trsendb2' succeeded
CRS-2677: Stop of 'ora.scan1.vip' on 'trsendb2' succeeded
CRS-2677: Stop of 'ora.RECOVERYDG.dg' on 'trsendb2' succeeded
CRS-2677: Stop of 'ora.standby1.vip' on 'trsendb2' succeeded
CRS-2677: Stop of 'ora.registry.acfs' on 'trsendb2' succeeded
CRS-2677: Stop of 'ora.oc4j' on 'trsendb2' succeeded
CRS-2677: Stop of 'ora.OCRDG.dg' on 'trsendb2' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'trsendb2'
CR
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值