- 浏览: 302749 次
最新评论
-
com_xpp:
思创工作一年小结 -
aijuans1:
思创
思创工作一年小结 -
mixer_a:
一切都是对象
JavaScript 也可以面向对象 -
dyllove98:
不错,面向对象就容易阅读和理解
JavaScript 也可以面向对象 -
spyker:
楼主男人女人?
舞蹈和编程的一点乱想
Oracle RAC 平台下 Patch 安装与卸载 步骤
之前整理过一篇Oracle Patch 的文章,参考:
Oracle 补丁体系 及 opatch 工具 介绍
http://blog.csdn.net/tianlesoftware/archive/2010/08/13/5809526.aspx
关于Oracle Patch 的知识,参考之前的文章。 这篇主要是演示下RAC 平台下Patch 的安装与卸载。
一. Path 安装说明
在metalink 上下了个Path:5689937,在readme 文档里有RAC下的安装方法。
1.1 安装Patch
(1). 关闭其中一个节点上的DB实例。
(2). 关闭在第一步操作节点上的nodeapps services:
srvctl stop nodeapps -n <node-name>
(3). 在第一步操作的节点上应用patch:
进入Patch的目录,然后运行opatch命令,注意加上-local 参数。
cd 5689937
opatch apply -local
(4). 启动该节点的nodeapps 和ASM服务。
srvctl start nodeapps -n <node-name>
srvctl start asm -n rac1 -i +ASM1
(5). 启动该节点上的DB实例。
srvctl start instance -d sid -i sid1
(6) 在其他节点上,重复以上步骤来安装Patch。
1.2 Patch 安装的后续操作
选择一个节点,执行如下操作即可。 在这个操作期间,用户可以访问数据库。
(1)启动所有实例
(2)在其中一个节点上用SYSDBA 连接并执行catcpu.sql脚本:
cd $ORACLE_HOME/cpu/CPUJan2007 --必须进入这个目录
sqlplus /nolog
sql> connect /as sysdba
sql> startup
sql> @catcpu.sql
sql> quit
运行完该脚本之后, 注意查看alert log,有无错误信息,并检查有无无效对象。
可以通过如下SQL,来查看无效对象:
sql> select object_name from dba_objects where status= 'INVALID';
如果有无效对象,执行utlrp.sql 来编译这些对象:
cd $oracle_home/rdbms/admin
sqlplus /nolog
sql> connect /as sysdba
sql> startup
sql> @utlrp.sql
1.3 Patch 卸载
(1) 在其中一个节点上关闭DB 实例
(2) 在第一步的节点上关闭nodeapps 服务。
srvctl stop nodeapps -n <node-name>
(3) 回滚Patch,进入Patch 文件的目录,执行命令
cd 5689937
opatch rollback -id 5689937
如果出现什么错误,对照readme 文档,该文档里有一些常见错误的处理方法。
(4)启动该节点上的nodeapps 和ASM服务
srvctl start nodeapps -n <node-name>
(5) 启动该节点上的DB实例
(6) 在其他节点上重复上述操作
因为在打patch 期间,每次只对一个实例进行操作,所以DB 还可以对外提供访问。
1.4 Patch卸载的后续操作
在其中一个节点上执行如下操作:
(1)执行如下脚本:
cd $ORACLE_HOME/cpu/CPUJan2007
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catcpu_rollback.sql
SQL> QUIT
(2)如果在第一步脚本结束时报有无效对象,则执行如下脚本,编译这些无效对象:
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @utlrp.sql
查看无效对象
SQL> SELECT OBJECT_NAME FROM DBA_OBJECTS WHERE STATUS = 'INVALID';
二. RAC 情况
[oracle@rac1 u01]$ sh crs_stat.sh
Name Target State Host
------------------------------ ---------- --------- -------
ora.dave.dave1.inst ONLINE ONLINE rac1
ora.dave.dave2.inst ONLINE ONLINE rac2
ora.dave.db ONLINE ONLINE rac2
ora.dave.taf.cs ONLINE ONLINE rac2
ora.dave.taf.dave1.srv ONLINE ONLINE rac1
ora.dave.taf.dave2.srv ONLINE ONLINE rac2
ora.rac1.ASM1.asm ONLINE ONLINE rac1
ora.rac1.LISTENER_RAC1.lsnr ONLINE ONLINE rac1
ora.rac1.gsd ONLINE ONLINE rac1
ora.rac1.ons ONLINE ONLINE rac1
ora.rac1.vip ONLINE ONLINE rac1
ora.rac2.ASM2.asm ONLINE ONLINE rac2
ora.rac2.LISTENER_RAC2.lsnr ONLINE ONLINE rac2
ora.rac2.gsd ONLINE ONLINE rac2
ora.rac2.ons ONLINE ONLINE rac2
ora.rac2.vip ONLINE ONLINE rac2
我这里配置了Server-side TAF. 所以net service name(tnsnames.ora)配置:
RAC =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.82)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.83)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = dave)
)
)
Oracle RAC Failover 详解
http://blog.csdn.net/tianlesoftware/archive/2010/03/04/5340788.aspx
测试:
C:/Users/Administrator.DavidDai>sqlplus sys/oracle@rac as sysdba;
SQL*Plus: Release 11.2.0.1.0 Production on 星期六 4月 2 23:03:47 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL> select instance_name from v$instance;
INSTANCE_NAME
--------------------------------
dave1
SQL>
三. 安装Patch 示例
节点1操作:
[oracle@rac1 u01]$ sh crs_stat.sh
Name Target State Host
------------------------------ ---------- --------- -------
ora.dave.dave1.inst ONLINE ONLINE rac1
ora.dave.dave2.inst ONLINE ONLINE rac2
ora.dave.db ONLINE ONLINE rac2
ora.dave.taf.cs ONLINE ONLINE rac2
ora.dave.taf.dave1.srv ONLINE ONLINE rac1
ora.dave.taf.dave2.srv ONLINE ONLINE rac2
ora.rac1.ASM1.asm ONLINE ONLINE rac1
ora.rac1.LISTENER_RAC1.lsnr ONLINE ONLINE rac1
ora.rac1.gsd ONLINE ONLINE rac1
ora.rac1.ons ONLINE ONLINE rac1
ora.rac1.vip ONLINE ONLINE rac1
ora.rac2.ASM2.asm ONLINE ONLINE rac2
ora.rac2.LISTENER_RAC2.lsnr ONLINE ONLINE rac2
ora.rac2.gsd ONLINE ONLINE rac2
ora.rac2.ons ONLINE ONLINE rac2
ora.rac2.vip ONLINE ONLINE rac2
[oracle@rac1 u01]$ srvctl stop instance -d dave -i dave1
[oracle@rac1 u01]$ srvctl stop nodeapps -n rac1
[oracle@rac1 u01]$ sh crs_stat.sh
Name Target State Host
------------------------------ ---------- --------- -------
ora.dave.dave1.inst OFFLINE OFFLINE
ora.dave.dave2.inst ONLINE ONLINE rac2
ora.dave.db ONLINE ONLINE rac2
ora.dave.taf.cs ONLINE ONLINE rac2
ora.dave.taf.dave1.srv ONLINE OFFLINE
ora.dave.taf.dave2.srv ONLINE ONLINE rac2
ora.rac1.ASM1.asm OFFLINE OFFLINE
ora.rac1.LISTENER_RAC1.lsnr OFFLINE OFFLINE
ora.rac1.gsd OFFLINE OFFLINE
ora.rac1.ons OFFLINE OFFLINE
ora.rac1.vip OFFLINE OFFLINE
ora.rac2.ASM2.asm ONLINE ONLINE rac2
ora.rac2.LISTENER_RAC2.lsnr ONLINE ONLINE rac2
ora.rac2.gsd ONLINE ONLINE rac2
ora.rac2.ons ONLINE ONLINE rac2
ora.rac2.vip ONLINE ONLINE rac2
[oracle@rac1 u01]$ cd 5689937/
[oracle@rac1 5689937]$ opatch apply -local
Invoking OPatch 10.2.0.1.0
Oracle interim Patch Installer version 10.2.0.1.0
Copyright (c) 2005, Oracle Corporation. All rights reserved..
Oracle Home : /u01/app/oracle/product/10.2.0/db_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/10.2.0/db_1/oraInst.loc
OPatch version : 10.2.0.1.0
OUI version : 10.2.0.1.0
OUI location : /u01/app/oracle/product/10.2.0/db_1/oui
Log file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch-2011_Apr_03_15-47-59-CST_Sun.log
ApplySession applying interim patch '5689937' to OH '/u01/app/oracle/product/10.2.0/db_1'
ApplySession: Optional component(s) [ oracle.sdo.companion, 10.2.0.1.0 ] , [ oracle.isearch.client, 10.2.0.1.0 ] , [ oracle.ons, 10.2.0.1.0 ] not present in the Oracle Home or a higher version is found.
Invoking fuser to check for active processes.
Invoking fuser on "/u01/app/oracle/product/10.2.0/db_1/bin/genezi"
Invoking fuser on "/u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr"
Invoking fuser on "/u01/app/oracle/product/10.2.0/db_1/bin/lsnrctl"
Invoking fuser on "/u01/app/oracle/product/10.2.0/db_1/bin/oracle"
You selected -local option, hence OPatch will patch the local system only.
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/10.2.0/db_1')
Is the local system ready for patching?
Do you want to proceed? [y|n]
y
User Responded with: Y
Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '5689937' for restore. This might take a while...
Backing up files affected by the patch '5689937' for rollback. This might take a while...
Command invocation returned Error... 'touch: cannot touch `/bin/genoccish': Permission denied
chmod: cannot access `/bin/genoccish': No such file or directory
', Return Code = 1
Execution of PRE script failed, with return value = 1
Do you want to proceed? [y|n]
y
User Responded with: Y
Patching component oracle.rdbms.rsf, 10.2.0.1.0...
Updating archive file "/u01/app/oracle/product/10.2.0/db_1/lib/libgeneric10.a" with "lib/libgeneric10.a/qcpi4.o"
Updating archive file "/u01/app/oracle/product/10.2.0/db_1/lib/libgeneric10.a" with "lib/libgeneric10.a/qcs.o"
Updating archive file "/u01/app/oracle/product/10.2.0/db_1/lib/libgeneric10.a" with "lib/libgeneric10.a/qcsj.o"
Updating archive file "/u01/app/oracle/product/10.2.0/db_1/lib/libcommon10.a" with "lib/libcommon10.a/ttcbur.o"
Updating archive file "/u01/app/oracle/product/10.2.0/db_1/lib/libcommon10.a" with "lib/libcommon10.a/ttcdrv.o"
Updating archive file "/u01/app/oracle/product/10.2.0/db_1/lib/libcommon10.a" with "lib/libcommon10.a/ttcpip.o"
Updating archive file "/u01/app/oracle/product/10.2.0/db_1/lib/libcommon10.a" with "lib/libcommon10.a/ttccdf.o"
Updating archive file "/u01/app/oracle/product/10.2.0/db_1/lib/libcommon10.a" with "lib/libcommon10.a/ttcclr.o"
Copying file to "/u01/app/oracle/product/10.2.0/db_1/rdbms/lib/genezi.o"
...
Copying file to "/u01/app/oracle/product/10.2.0/db_1/cpu/CPUJan2007/MODPLSQL/check.sh"
Copying file to "/u01/app/oracle/product/10.2.0/db_1/cpu/CPUJan2007/MODPLSQL/modplsqlcpu.sql"
Copying file to "/u01/app/oracle/product/10.2.0/db_1/cpu/CPUJan2007/MODPLSQL/owadummy.sql"
Running make for target igenezi
Running make for target client_sharedlib
Running make for target install
Running make for target libnmemso
Running make for target ioracle
Running make for target itnslsnr
Running make for target ilsnrctl
ApplySession adding interim patch '5689937' to inventory
--------------------------------------------------------------------------------
*********************************************************************
** ATTENTION **
** **
** Please note that the Security Patch Installation (Patch Deinstallation) is **
** not complete until all the Post Installation (Post Deinstallation) **
** instructions noted in the Readme accompanying this patch, have been **
** successfully completed. **
** **
*********************************************************************
--------------------------------------------------------------------------------
Execution of 'sh /u01/5689937/custom/scripts/post -apply 5689937 ':
Return Code = 0
The local system has been patched and can be restarted.
OPatch succeeded.
[oracle@rac1 5689937]$
[oracle@rac1 u01]$ srvctl start nodeapps -n rac1
[oracle@rac1 u01]$ srvctl start asm -n rac1 -i +ASM1
[oracle@rac1 u01]$ srvctl start instance -d dave -i dave1
[oracle@rac1 u01]$ sh crs_stat.sh
Name Target State Host
------------------------------ ---------- --------- -------
ora.dave.dave1.inst ONLINE ONLINE rac1
ora.dave.dave2.inst ONLINE ONLINE rac2
ora.dave.db ONLINE ONLINE rac2
ora.dave.taf.cs ONLINE ONLINE rac2
ora.dave.taf.dave1.srv ONLINE ONLINE rac1
ora.dave.taf.dave2.srv ONLINE ONLINE rac2
ora.rac1.ASM1.asm ONLINE ONLINE rac1
ora.rac1.LISTENER_RAC1.lsnr ONLINE ONLINE rac1
ora.rac1.gsd ONLINE ONLINE rac1
ora.rac1.ons ONLINE ONLINE rac1
ora.rac1.vip ONLINE ONLINE rac1
ora.rac2.ASM2.asm ONLINE ONLINE rac2
ora.rac2.LISTENER_RAC2.lsnr ONLINE ONLINE rac2
ora.rac2.gsd ONLINE ONLINE rac2
ora.rac2.ons ONLINE ONLINE rac2
ora.rac2.vip ONLINE ONLINE rac2
[oracle@rac1 u01]$ scp -r 5689937 192.168.2.43:/u01
在节点2上进行操作:
[oracle@rac2 u01]$ sh crs_stat.sh
Name Target State Host
------------------------------ ---------- --------- -------
ora.dave.dave1.inst ONLINE ONLINE rac1
ora.dave.dave2.inst ONLINE ONLINE rac2
ora.dave.db ONLINE ONLINE rac2
ora.dave.taf.cs ONLINE ONLINE rac2
ora.dave.taf.dave1.srv ONLINE ONLINE rac1
ora.dave.taf.dave2.srv ONLINE ONLINE rac2
ora.rac1.ASM1.asm ONLINE ONLINE rac1
ora.rac1.LISTENER_RAC1.lsnr ONLINE ONLINE rac1
ora.rac1.gsd ONLINE ONLINE rac1
ora.rac1.ons ONLINE ONLINE rac1
ora.rac1.vip ONLINE ONLINE rac1
ora.rac2.ASM2.asm ONLINE ONLINE rac2
ora.rac2.LISTENER_RAC2.lsnr ONLINE ONLINE rac2
ora.rac2.gsd ONLINE ONLINE rac2
ora.rac2.ons ONLINE ONLINE rac2
ora.rac2.vip ONLINE ONLINE rac2
[oracle@rac2 u01]$ srvctl stop instance -d dave -i dave2
[oracle@rac2 u01]$ srvctl stop nodeapps -n rac2
[oracle@rac2 u01]$ sh crs_stat.sh
Name Target State Host
------------------------------ ---------- --------- -------
ora.dave.dave1.inst ONLINE ONLINE rac1
ora.dave.dave2.inst OFFLINE OFFLINE
ora.dave.db ONLINE ONLINE rac2
ora.dave.taf.cs ONLINE ONLINE rac2
ora.dave.taf.dave1.srv ONLINE ONLINE rac1
ora.dave.taf.dave2.srv ONLINE OFFLINE
ora.rac1.ASM1.asm ONLINE ONLINE rac1
ora.rac1.LISTENER_RAC1.lsnr ONLINE ONLINE rac1
ora.rac1.gsd ONLINE ONLINE rac1
ora.rac1.ons ONLINE ONLINE rac1
ora.rac1.vip ONLINE ONLINE rac1
ora.rac2.ASM2.asm OFFLINE OFFLINE
ora.rac2.LISTENER_RAC2.lsnr OFFLINE OFFLINE
ora.rac2.gsd OFFLINE OFFLINE
ora.rac2.ons OFFLINE OFFLINE
ora.rac2.vip OFFLINE OFFLINE
[oracle@rac2 OPatch]$ cd /u01/5689937/
[oracle@rac2 5689937]$ ls
custom etc files README.txt
[oracle@rac2 5689937]$ opatch apply -local
....
The local system has been patched and can be restarted.
OPatch succeeded.
[oracle@rac2 u01]$ srvctl start nodeapps -n rac2
[oracle@rac2 u01]$ srvctl start asm -n rac2 -i +ASM2
[oracle@rac2 u01]$ srvctl start instance -d dave -i dave2
[oracle@rac2 u01]$ sh crs_stat.sh
Name Target State Host
------------------------------ ---------- --------- -------
ora.dave.dave1.inst ONLINE ONLINE rac1
ora.dave.dave2.inst ONLINE ONLINE rac2
ora.dave.db ONLINE ONLINE rac2
ora.dave.taf.cs ONLINE ONLINE rac2
ora.dave.taf.dave1.srv ONLINE ONLINE rac1
ora.dave.taf.dave2.srv ONLINE ONLINE rac2
ora.rac1.ASM1.asm ONLINE ONLINE rac1
ora.rac1.LISTENER_RAC1.lsnr ONLINE ONLINE rac1
ora.rac1.gsd ONLINE ONLINE rac1
ora.rac1.ons ONLINE ONLINE rac1
ora.rac1.vip ONLINE ONLINE rac1
ora.rac2.ASM2.asm ONLINE ONLINE rac2
ora.rac2.LISTENER_RAC2.lsnr ONLINE ONLINE rac2
ora.rac2.gsd ONLINE ONLINE rac2
ora.rac2.ons ONLINE ONLINE rac2
ora.rac2.vip ONLINE ONLINE rac2
后续操作:
[oracle@rac2 u01]$ cd /u01/app/oracle/product/10.2.0/db_1/cpu/CPUJan2007
[oracle@rac2 CPUJan2007]$ sqlplus / as sysdba;
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Apr 3 16:17:38 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL> @catcpu.sql
........
No errors.
No. of Invalid Objects is :18
Please refer to README.html to for instructions on validating these objects
Logfile for the current catcpu.sql session is : APPLY_DAVE_03Apr2011_16_17_56.log
not spooling currently
SQL> select count(*) from dba_objects where status= 'INVALID';
COUNT(*)
----------
18
SQL> @?/rdbms/admin/utlrp.sql
.....
DOC> The following query reports the number of errors caught during
DOC> recompilation. If this number is non-zero, please query the error
DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors
DOC> are due to misconfiguration or resource constraints that must be
DOC> fixed before objects can compile successfully.
DOC>#
ERRORS DURING RECOMPILATION
---------------------------
0
最后确认下Patch 的安装情况:
[oracle@rac2 u01]$ opatch lsinventory
Invoking OPatch 10.2.0.1.0
Oracle interim Patch Installer version 10.2.0.1.0
Copyright (c) 2005, Oracle Corporation. All rights reserved..
Oracle Home : /u01/app/oracle/product/10.2.0/db_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/10.2.0/db_1/oraInst.loc
OPatch version : 10.2.0.1.0
OUI version : 10.2.0.1.0
OUI location : /u01/app/oracle/product/10.2.0/db_1/oui
Log file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch-2011_Apr_03_16-24-11-CST_Sun.log
Lsinventory Output file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory-2011_Apr_03_16-24-11-CST_Sun.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Database 10g 10.2.0.1.0
There are 1 products installed in this Oracle Home.
Interim patches (1) :
Patch 5689937 : applied on Sun Apr 03 16:12:59 CST 2011
Created on 8 Jan 2007, 11:48:31 hrs US/Eastern
Bugs fixed:
4671216, 4925103, 4604970, 4616376, 5689937, 4288876, 5225798, 5694720
4754888, 4750469, 4369235, 4751931, 4966716, 5049080, 5242648, 4348230
5490846, 4630549, 5490936, 5049088
Rac system comprising of multiple nodes
Local node = rac2
Remote node = rac1
--------------------------------------------------------------------------------
OPatch succeeded.
RAC 平台下 Patch 的安装到此结束。
四. Patch 卸载示例
节点1操作:
[oracle@rac1 u01]$ srvctl stop instance -d dave -i dave1
[oracle@rac1 u01]$ srvctl stop nodeapps -n rac1
[oracle@rac1 u01]$ cd 5689937/
[oracle@rac1 5689937]$ opatch rollback -id 5689937 -local
--注意这里的local,如果不加local,在节点1上操作完了,会继续操作节点2.
Invoking OPatch 10.2.0.1.0
Oracle interim Patch Installer version 10.2.0.1.0
Copyright (c) 2005, Oracle Corporation. All rights reserved..
Oracle Home : /u01/app/oracle/product/10.2.0/db_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/10.2.0/db_1/oraInst.loc
OPatch version : 10.2.0.1.0
OUI version : 10.2.0.1.0
OUI location : /u01/app/oracle/product/10.2.0/db_1/oui
Log file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch-2011_Apr_03_17-02-32-CST_Sun.log
RollbackSession rolling back interim patch '5689937' from OH '/u01/app/oracle/product/10.2.0/db_1'
Invoking fuser to check for active processes.
Invoking fuser on "/u01/app/oracle/product/10.2.0/db_1/bin/genezi"
Invoking fuser on "/u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr"
Invoking fuser on "/u01/app/oracle/product/10.2.0/db_1/bin/lsnrctl"
Invoking fuser on "/u01/app/oracle/product/10.2.0/db_1/bin/oracle"
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: 'rac2'
Local node: 'rac1'
Please shut down Oracle instances running out of this ORACLE_HOME on all the nodes.
(Oracle Home = '/u01/app/oracle/product/10.2.0/db_1')
Are all the nodes ready for patching?
Do you want to proceed? [y|n]
y
User Responded with: Y
Backing up files affected by the patch '5689937' for restore. This might take a while...
Command invocation returned Error... 'touch: cannot touch `/bin/genoccish': Permission denied
chmod: cannot access `/bin/genoccish': No such file or directory
', Return Code = 1
Execution of PRE script failed, with return value = 1
Do you want to proceed? [y|n]
y
User Responded with: Y
Patching component oracle.rdbms.rsf, 10.2.0.1.0...
[oracle@rac1 5689937]$ srvctl start nodeapps -n rac1
[oracle@rac1 5689937]$ srvctl start asm -n rac1 -i +ASM1
[oracle@rac1 5689937]$ srvctl start instance -d dave -i dave1
节点2操作:
[oracle@rac2 u01]$ srvctl stop instance -d dave -i dave2
[oracle@rac2 u01]$ srvctl stop nodeapps -n rac2
[oracle@rac2 u01]$ ls
5689937 backup rman_backup.sh software
app crs_stat.sh rman_backup.sh.out sw
[oracle@rac2 u01]$ cd 5689937/
[oracle@rac2 5689937]$ opatch rollback -id 5689937 -local
[oracle@rac2 5689937]$ srvctl start nodeapps -n rac2
[oracle@rac2 5689937]$ srvctl start asm -n rac2 -i +ASM2
[oracle@rac2 5689937]$ srvctl start instance -d dave -i dave2
[oracle@rac2 u01]$ sh crs_stat.sh
Name Target State Host
------------------------------ ---------- --------- -------
ora.dave.dave1.inst ONLINE ONLINE rac1
ora.dave.dave2.inst ONLINE ONLINE rac2
ora.dave.db ONLINE ONLINE rac2
ora.dave.taf.cs ONLINE ONLINE rac2
ora.dave.taf.dave1.srv ONLINE ONLINE rac1
ora.dave.taf.dave2.srv ONLINE ONLINE rac2
ora.rac1.ASM1.asm ONLINE ONLINE rac1
ora.rac1.LISTENER_RAC1.lsnr ONLINE ONLINE rac1
ora.rac1.gsd ONLINE ONLINE rac1
ora.rac1.ons ONLINE ONLINE rac1
ora.rac1.vip ONLINE ONLINE rac1
ora.rac2.ASM2.asm ONLINE ONLINE rac2
ora.rac2.LISTENER_RAC2.lsnr ONLINE ONLINE rac2
ora.rac2.gsd ONLINE ONLINE rac2
ora.rac2.ons ONLINE ONLINE rac2
ora.rac2.vip ONLINE ONLINE rac2
后续操作:
看Patch 的readme里说的catcpu_rollback.sql脚本是在$ORACLE_HOME/cpu/CPUJan2007/目录里,但是patch 一旦rollback 之后,对应的文件就被删除掉了。
用Find 搜了一下,这个文件在备份的目录还是有的:
[oracle@rac1 db_1]$ find . -name catcpu_rollback.sql
./.patch_storage/5689937_Jan_8_2007_11_48_31/original_patch/files/cpu/CPUJan2007/catcpu_rollback.sql
./.patch_storage/5689937_Jan_8_2007_11_48_31/backup/cpu/CPUJan2007/catcpu_rollback.sql
同时,在patch的安装目录里也有这个文件:
[oracle@rac1 CPUJan2007]$ pwd
/u01/5689937/files/cpu/CPUJan2007
[oracle@rac1 CPUJan2007]$ ls
catcpu_rollback.sql javcpu.sql prvtcr.plb xdbcpu.sql
catcpu.sql MODPLSQL sdocpu.sql
所以,这里进Patch的安装目录来执行这个脚本:
[oracle@rac1 CPUJan2007]$ pwd
/u01/5689937/files/cpu/CPUJan2007
[oracle@rac1 CPUJan2007]$ sqlplus / as sysdba;
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Apr 3 17:35:33 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL> @catcpu_rollback.sql
...
No. of Invalid Objects is :18
Please refer to README.html to for instructions on validating these objects
Logfile for the current catcpu_rollback.sql session is : ROLLBACK_DAVE_03Apr2011_17_35_41.log
not spooling currently
同样有18个无效对象。 编译一下:
SQL> @?/rdbms/admin/utlrp.sql
...
DOC> The following query reports the number of errors caught during
DOC> recompilation. If this number is non-zero, please query the error
DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors
DOC> are due to misconfiguration or resource constraints that must be
DOC> fixed before objects can compile successfully.
DOC>#
ERRORS DURING RECOMPILATION
---------------------------
0
最后确认一下:
[oracle@rac1 u01]$ opatch lsinventory
Invoking OPatch 10.2.0.1.0
Oracle interim Patch Installer version 10.2.0.1.0
Copyright (c) 2005, Oracle Corporation. All rights reserved..
Oracle Home : /u01/app/oracle/product/10.2.0/db_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/10.2.0/db_1/oraInst.loc
OPatch version : 10.2.0.1.0
OUI version : 10.2.0.1.0
OUI location : /u01/app/oracle/product/10.2.0/db_1/oui
Log file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch-2011_Apr_03_17-41-23-CST_Sun.log
Lsinventory Output file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory-2011_Apr_03_17-41-23-CST_Sun.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Database 10g 10.2.0.1.0
There are 1 products installed in this Oracle Home.
There are no Interim patches installed in this Oracle Home.
Rac system comprising of multiple nodes
Local node = rac1
Remote node = rac2
--------------------------------------------------------------------------------
OPatch succeeded.
这里已经没有了我们patch的信息了。patch的卸载到此结束。
五. Patch 安装脚本
如果Path多的话,可以使用如下脚本来执行,不过还是需要手工的输入确定Y。 这个脚本是Jin 同学给我的。 感谢他的辛勤劳动。
#!/bin/sh
# sh run.sh | tee -a log
# before run,check the dir
PATCHNUM='
5898210
'
export PATH=$PATH:/usr/ccs/bin
for numdir in $PATCHNUM
do
cd ${numdir}
$ORACLE_HOME/ OPatch/opatch apply -silent -local
--注意:silent默认会选择n
$ORACLE_HOME/ OPatch/opatch apply -local
echo ${numdir} ok
echo ---------------------OK-----------------------
echo ---------------------NEXT---------------------
cd ..
done
exit 0
---------------------------------------------------------------------------------------------------
Blog: http://blog.csdn.net/tianlesoftware
网上资源: http://tianlesoftware.download.csdn.net
相关视频:http://blog.csdn.net/tianlesoftware/archive/2009/11/27/4886500.aspx
DBA1 群:62697716(满); DBA2 群:62697977(满) DBA3 群:62697850(满)
DBA 超级群:63306533(满); DBA4 群: 83829929 DBA5群: 142216823
聊天 群:40132017 聊天2群:69087192
--加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请
相关推荐
在某些情况下,可能需要彻底卸载和清理 Oracle RAC(Real Application Clusters)环境,尤其是在遇到安装失败或其他不可预料的问题时。本文将详细介绍如何进行“暴力卸载”Oracle 11g RAC 数据库,包括具体的步骤、...
本篇文章详细介绍了Oracle RAC环境下ACFS/ADVM模块的安装与卸载流程。ACFS(Automatic Cluster File System)是Oracle RAC环境中用于存储共享文件系统的一种机制,而ADVM(Automatic Distributed Volume Manager)则...
Oracle 11g的安装和卸载过程涉及到许多细节,确保每个步骤正确执行至关重要。遵循官方文档和上述指南,可以降低出错的可能性。如果在过程中遇到问题,可以参考Oracle的技术文档或寻求专业帮助。
### Windows平台Oracle RAC集群安装过程详解 #### 引言 在企业级应用环境中,为了提高数据处理能力和系统的高可用性,Oracle Real Application Clusters (RAC) 成为了一种热门选择。尤其在Windows平台上部署Oracle...
在“Oracle安装及卸载步骤”文件中,可能包含了预定义的响应文件模板。修改这些文件以适应您的环境。 4. **启动安装程序**:运行下载的安装文件,如“runInstaller”。如果使用响应文件,通过命令行指定它,如`./...
手工建库: 1.写参数文件,创建实例: vi $ORACLE_HOME/dbs/initorcl.ora 写入以下内容: ...control_files='/u01/app/oracle/oradata/orcl/control01.ctl','/u01/app/oracle/oradata/orcl/control02.ctl'
Oracle RAC环境下的数据库操作是一项复杂的工作,尤其是涉及到删除和重新安装Grid Infrastructure及Oracle数据库的情况。这个过程通常是为了升级到企业版或者解决某些特定的技术问题。以下是对整个流程的详细解释: ...
在本文中,我们将详细介绍搭建Oracle RAC的过程,包括规划、安装、配置和测试等步骤。 一、规划 在开始搭建Oracle RAC之前,我们需要进行详细的规划,包括IP规划、主机名规划、存储规划等。 1. IP规划:我们需要...
【华为云ECS ORACLE RAC 11.2.0.4 安装指导】 在当前技术环境中,由于去IOE(IBM、Oracle、EMC)的趋势,许多国内企业正考虑替换Oracle数据库,转而使用国产数据库或云计算平台上的数据库服务。然而,将Oracle RAC...
### Windows平台下的Oracle RAC配置与安装 #### 1. 概述 Oracle Real Application Clusters (Oracle RAC) 是一种高性能、高可用性的数据库解决方案,它可以实现在多个服务器(节点)之间共享一个数据库实例。在...
oracle rac安装个人笔记oracle rac安装个人笔记oracle rac安装个人笔记oracle rac安装个人笔记oracle rac安装个人笔记oracle rac安装个人笔记oracle rac安装个人笔记oracle rac安装个人笔记oracle rac安装个人笔记...
本文旨在为Oracle数据库管理员提供一份详尽的手册,介绍如何在VMware vSphere ESXi平台上安装和配置Oracle Real Application Clusters (RAC)。通过本手册,您将了解整个安装过程的关键步骤,以及如何克服在虚拟化...
Oracle RAC环境的安装配置是整个解决方案的关键步骤,本手册将指导用户如何在 RHEL(Red Hat Enterprise Linux)平台上安装和配置 Oracle RAC 数据库环境。 一、存储配置 在安装 Oracle RAC 之前,需要先进行存储...
以下是对Oracle 12c RAC在ESXi平台安装过程中的关键步骤的详细解释: 1. **环境准备**: 在安装Oracle 12c RAC之前,首先需要配置一个合适的硬件和软件环境。这通常包括安装ESXi虚拟化平台,规划网络架构(如公共...
在生产环境下实施 Oracle RAC 需要进行详细的规划和实施本文将详细介绍 Oracle RAC 项目实施方案,涵盖硬件规划、系统拓扑结构设计、磁盘规划、IP 地址规划、交换机接口规划、存储系统实施、ORACLE RAC 安装等方面。...
### Oracle RAC 安装与配置知识点 #### 一、集群配置概述 Oracle Real Application Clusters ...以上内容概括了文档中的Oracle RAC安装与配置的主要步骤和要点。这些知识点对于理解和实施Oracle RAC环境具有重要意义。
Centos7安装部署Oracle RAC 11G说明文档,Oracle 11g R2安装,RAC环境搭建
本文档详细介绍了 Oracle RAC 的安装部署过程,涵盖了物理硬件配置需求、虚拟机需求、操作系统安装、数据库安装、 Oracle RAC 图形界面搭建方法、创建磁盘组、安装 Oracle 数据库、性能测试相关参数、常见问题汇总等...
本文档详细介绍了Oracle RAC重启的具体步骤,包括准备工作、关闭RAC以及启动RAC等关键操作。通过这些步骤,可以有效地完成Oracle RAC集群的重启过程,同时保证数据的安全性和一致性。这些知识点对于IT专业人士来说...
Oracle RAC(Real Application Clusters)坏节点重建与卸载是一个复杂的过程,涉及到Oracle Grid Infrastructure的多个关键组成部分,包括OCR(Oracle Cluster Registry)和集群资源管理。文档2016852.1详述了当遇到...