本文主要是介绍RAC+ADG apply PSU+PATCH,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
---环境------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
这篇关于RAC+ADG apply PSU+PATCH的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!