1. 首页
  2. IT资讯

RAC和ASM环境下打patch

在RAC环境下打patch与单节点类似,不过在RAC环境下Oracle提供了rolling patch方式,降低打patch对数据库的影响。以下是基于RAC + ASM环境的patch步骤,简单记录。

[@more@]1. 首先解压文件[oracle@dwdb01 tmp]$ unzip p10017048_10205_Linux-x86-64.zip Archive: p10017048_10205_Linux-x86-64.zip creating: 10017048/ creating: 10017048/files/ creating: 10017048/files/lib/ creating: 10017048/files/lib/libserver10.a/ inflating: 10017048/files/lib/libserver10.a/kkfd.o creating: 10017048/etc/ creating: 10017048/etc/config/ inflating: 10017048/etc/config/inventory inflating: 10017048/etc/config/actions creating: 10017048/etc/xml/ inflating: 10017048/etc/xml/GenericActions.xml inflating: 10017048/etc/xml/ShiphomeDirectoryStructure.xml inflating: 10017048/README.txt 2. 停止服务这里要分几种情况:1) 如果是rolling patch方式打补丁,则只需要先停止第一个需要patch的节点;为了简单起见,你也可以停止所有的节点实例,不过这样的话停机时间会增加。2) 如果ASM和Oracle实例运行在同一个ORACLE_HOME下,则需要把ASM和数据库实例都关闭,否则只需要管理数据库实例即可。这里的环境是ASM和Oracle实例在同一个ORACLE_HOME下,也因为这还不是生产库,因此可以简单地把相关服务都停掉。[oracle@dwdb01 10017048]$ srvctl stop database -d dwrac[oracle@dwdb01 10017048]$ srvctl stop asm -n dwdb01[oracle@dwdb01 10017048]$ srvctl stop asm -n dwdb02[oracle@dwdb01 10017048]$ srvctl stop asm -n dwdb03[oracle@dwdb01 10017048]$ srvctl stop asm -n dwdb04可以通过crs_stat检查一下状态。3. 打补丁[oracle@dwdb01 ]$ cd 10017048[oracle@dwdb01 10017048]$ export ORACLE_SID=dwrac1[oracle@dwdb01 10017048]$ /oracle/product/10.2.0/db/OPatch/opatch applyInvoking OPatch 10.2.0.4.9Oracle Interim Patch Installer version 10.2.0.4.9Copyright (c) 2009, Oracle Corporation. All rights reserved.Oracle Home : /oracle/product/10.2.0/dbCentral Inventory : /oracle/oraInventory from : /etc/oraInst.locOPatch version : 10.2.0.4.9OUI version : 10.2.0.5.0OUI location : /oracle/product/10.2.0/db/ouiLog file location : /oracle/product/10.2.0/db/cfgtoollogs/opatch/opatch2011-02-23_19-13-23PM.logPatch history file: /oracle/product/10.2.0/db/cfgtoollogs/opatch/opatch_history.txtApplySession applying interim patch ‘10017048’ to OH ‘/oracle/product/10.2.0/db’Running prerequisite checks…OPatch detected the node list and the local node from the inventory. OPatch will patch the local system then propagate the patch to the remote nodes.This node is part of an Oracle Real Application Cluster.Remote nodes: ‘dwdb02’ ‘dwdb03’ ‘dwdb04’ Local node: ‘dwdb01’Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.(Oracle Home = ‘/oracle/product/10.2.0/db’)Is the local system ready for patching? [y|n]yUser Responded with: YBacking up files and inventory (not for auto-rollback) for the Oracle HomeBacking up files affected by the patch ‘10017048’ for restore. This might take a while…Backing up files affected by the patch ‘10017048’ for rollback. This might take a while…Patching component oracle.rdbms, 10.2.0.5.0…Updating archive file “/oracle/product/10.2.0/db/lib/libserver10.a” with “lib/libserver10.a/kkfd.o”Running make for target ioracleApplySession adding interim patch ‘10017048’ to inventoryVerifying the update…Inventory check OK: Patch ID 10017048 is registered in Oracle Home inventory with proper meta-data.Files check OK: Files from Patch ID 10017048 are present in Oracle Home.The local system has been patched. You can restart Oracle instances on it.Patching in rolling mode.Remaining nodes to be patched: ‘dwdb02’ ‘dwdb03’ ‘dwdb04’ What is the next node to be patched?dwdb02You have selected ‘dwdb02’ from ‘dwdb02’ ‘dwdb03’ ‘dwdb04’ The node ‘dwdb02’ will be patched next.Please shutdown Oracle instances running out of this ORACLE_HOME on ‘dwdb02’.(Oracle Home = ‘/oracle/product/10.2.0/db’)Is the node ready for patching? [y|n]yUser Responded with: YUpdating nodes ‘dwdb02’ Apply-related files are: FP = “/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/copy_files.txt” DP = “/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/copy_dirs.txt” MP = “/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/make_cmds.txt” RC = “/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/remote_cmds.txt”Instantiating the file “/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/copy_files.txt.instantiated” by replacing $ORACLE_HOME in “/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/copy_files.txt” with actual path.Propagating files to remote nodes…Instantiating the file “/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/copy_dirs.txt.instantiated” by replacing $ORACLE_HOME in “/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/copy_dirs.txt” with actual path.Propagating directories to remote nodes…Instantiating the file “/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/make_cmds.txt.instantiated” by replacing $ORACLE_HOME in “/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/make_cmds.txt” with actual path.Running command on remote node ‘dwdb02’: cd /oracle/product/10.2.0/db/rdbms/lib; /usr/bin/make -f ins_rdbms.mk ioracle ORACLE_HOME=/oracle/product/10.2.0/db || echo REMOTE_MAKE_FAILED::>&2 The node ‘dwdb02’ has been patched. You can restart Oracle instances on it.Remaining nodes to be patched: ‘dwdb03’ ‘dwdb04’ What is the next node to be patched?dwdb03You have selected ‘dwdb03’ from ‘dwdb03’ ‘dwdb04’ The node ‘dwdb03’ will be patched next.Please shutdown Oracle instances running out of this ORACLE_HOME on ‘dwdb03’.(Oracle Home = ‘/oracle/product/10.2.0/db’)Is the node ready for patching? [y|n]yUser Responded with: YUpdating nodes ‘dwdb03’ Apply-related files are: FP = “/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/copy_files.txt” DP = “/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/copy_dirs.txt” MP = “/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/make_cmds.txt” RC = “/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/remote_cmds.txt”Propagating files to remote nodes…Propagating directories to remote nodes…Instantiating the file “/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/make_cmds.txt.instantiated” by replacing $ORACLE_HOME in “/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/make_cmds.txt” with actual path.Running command on remote node ‘dwdb03’: cd /oracle/product/10.2.0/db/rdbms/lib; /usr/bin/make -f ins_rdbms.mk ioracle ORACLE_HOME=/oracle/product/10.2.0/db || echo REMOTE_MAKE_FAILED::>&2 The node ‘dwdb03’ has been patched. You can restart Oracle instances on it.The node ‘dwdb04’ will be patched next.Please shutdown Oracle instances running out of this ORACLE_HOME on ‘dwdb04’.(Oracle Home = ‘/oracle/product/10.2.0/db’)Is the node ready for patching? [y|n]yUser Responded with: YUpdating nodes ‘dwdb04’ Apply-related files are: FP = “/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/copy_files.txt” DP = “/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/copy_dirs.txt” MP = “/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/make_cmds.txt” RC = “/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/remote_cmds.txt”Propagating files to remote nodes…Propagating directories to remote nodes…Instantiating the file “/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/make_cmds.txt.instantiated” by replacing $ORACLE_HOME in “/oracle/product/10.2.0/db/.patch_storage/10017048_Sep_15_2010_06_14_25/rac/make_cmds.txt” with actual path.Running command on remote node ‘dwdb04’: cd /oracle/product/10.2.0/db/rdbms/lib; /usr/bin/make -f ins_rdbms.mk ioracle ORACLE_HOME=/oracle/product/10.2.0/db || echo REMOTE_MAKE_FAILED::>&2 The node ‘dwdb04’ has been patched. You can restart Oracle instances on it.There were relinks on remote nodes. Remember to check the binary size and timestamp on the nodes ‘dwdb02’ ‘dwdb03’ ‘dwdb04’ .The following make commands were invoked on remote nodes:’cd /oracle/product/10.2.0/db/rdbms/lib; /usr/bin/make -f ins_rdbms.mk ioracle ORACLE_HOME=/oracle/product/10.2.0/db’OPatch succeeded.整个打补丁的过程,Oracle会询问是否需要在其他节点打,直到所有节点都打上补丁。注意,要用到这一特性,需要配置ssh互信。4. 最后启动asm和数据库实例[oracle@dwdb01 bin]$ srvctl start asm -n dwdb01[oracle@dwdb01 bin]$ srvctl start asm -n dwdb02[oracle@dwdb01 bin]$ srvctl start asm -n dwdb03[oracle@dwdb01 bin]$ srvctl start asm -n dwdb04[oracle@dwdb01 bin]$ srvctl start database -d dwrac[oracle@dwdb01 bin]$ srvctl start service -d dwrac 如果严格使用rolling patch的方式的话,则步骤是:1. 在第一个节点停止ASM和Oracle instance(ASM和Oracle共用一个ORACLE_HOME) srvctl stop instance -d dwrac -i dwrac1srvctl stop asm -n dwdb012. 在第一个节点打补丁opatch apply打完第一个补丁后,Oracle会询问下一个需要打patch是那个。3. 另开窗口,启动第一个节点的资源,并关闭下一个需要打patch的资源srvctl start instance -d dwrac -i dwrac1srvctl start asm -n dwdb01 srvctl stop instance -d dwrac -i dwrac2srvctl stop asm -n dwdb024. 依此类推,直到所有节点打完patch为止

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/231499/viewspace-1046629/,如需转载,请注明出处,否则将追究法律责任。

主题测试文章,只做测试使用。发布者:布吉卡,转转请注明出处:http://www.cxybcw.com/195641.html

联系我们

13687733322

在线咨询:点击这里给我发消息

邮件:1877088071@qq.com

工作时间:周一至周五,9:30-18:30,节假日休息

QR code