下载oracle rac的安装补丁p8202632_10205_Linux-x86-64.zip,clusterware和database的补丁都包含在这里面
1.升级clusterware软件包
1)首先停止所有资源,不建议使用crs_stop -all来停止
- [oracle@node1 bin]$srvctl start nodeapps -n node1
- [oracle@node2 bin]$srvctl start nodeapps -n node2
查看状态
- [oracle@node2 bin]$ crs_stat -t
- Name Type Target State Host
- ------------------------------------------------------------
- ora....E1.lsnr application OFFLINE OFFLINE
- ora.node1.gsd application OFFLINE OFFLINE
- ora.node1.ons application OFFLINE OFFLINE
- ora.node1.vip application OFFLINE OFFLINE
- ora....E2.lsnr application OFFLINE OFFLINE
- ora.node2.gsd application OFFLINE OFFLINE
- ora.node2.ons application OFFLINE OFFLINE
- ora.node2.vip application OFFLINE OFFLINE
- ora.orcl.db application OFFLINE OFFLINE
- ora....l1.inst application OFFLINE OFFLINE
- ora....l2.inst application OFFLINE OFFLINE
2)然后切换到oracle用户,开启安装进程
- [root@node1 ~]# chown -R oracle.oinstall /home/oracle/Disk1/
- [oracle@node1 Disk1]$ ./runInstaller
3)选择crs补丁的安装目录及名称,这个保持和第一次安装时候一致
4)选择集群安装方式
5)安装进行中
6)按照要求在所有节点上面执行脚本,一定要在第一个节点执行完毕之后再在第二个节点上面执行
- [root@node1 ~]# /home/oracle/oracrs/product/10.2.0/crs/bin/crsctl stop crs
- Stopping resources.
- Successfully stopped CRS resources
- Stopping CSSD.
- Shutting down CSS daemon.
- Shutdown request successfully issued.
- [root@node1 node1]# /home/oracle/oracrs/product/10.2.0/crs/install/root102.sh
- Creating pre-patch directory for saving pre-patch clusterware files
- Completed patching clusterware files to /home/oracle/oracrs/product/10.2.0/crs
- Relinking some shared libraries.
- Relinking of patched files is complete.
- WARNING: directory '/home/oracle/oracrs/product/10.2.0' is not owned by root
- WARNING: directory '/home/oracle/oracrs/product' is not owned by root
- WARNING: directory '/home/oracle/oracrs' is not owned by root
- WARNING: directory '/home/oracle' is not owned by root
- Preparing to recopy patched init and RC scripts.
- Recopying init and RC scripts.
- Startup will be queued to init within 30 seconds.
- Starting up the CRS daemons.
- Waiting for the patched CRS daemons to start.
- This may take a while on some systems.
- .
- 10205 patch successfully applied.
- clscfg: EXISTING configuration version 3 detected.
- clscfg: version 3 is 10G Release 2.
- Successfully deleted 1 values from OCR.
- Successfully deleted 1 keys from OCR.
- Successfully accumulated necessary OCR keys.
- Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
- node
: - node 1: node1 node1-priv node1
- Creating OCR keys for user 'root', privgrp 'root'..
- Operation successful.
- clscfg -upgrade completed successfully
- Creating '/home/oracle/oracrs/product/10.2.0/crs/install/paramfile.crs' with data used for CRS configuration
- Setting CRS configuration values in /home/oracle/oracrs/product/10.2.0/crs/install/paramfile.crs
查看状态
- [oracle@node2 bin]$ crs_stat -t
- Name Type Target State Host
- ------------------------------------------------------------
- ora....SM1.asm application ONLINE ONLINE node1
- ora....E1.lsnr application ONLINE ONLINE node1
- ora.node1.gsd application ONLINE ONLINE node1
- ora.node1.ons application ONLINE ONLINE node1
- ora.node1.vip application ONLINE ONLINE node1
- ora....SM2.asm application ONLINE ONLINE node2
- ora....E2.lsnr application ONLINE ONLINE node2
- ora.node2.gsd application ONLINE ONLINE node2
- ora.node2.ons application ONLINE ONLINE node2
- ora.node2.vip application ONLINE ONLINE node2
- ora.orcl.db application ONLINE ONLINE node1
- ora....l1.inst application ONLINE ONLINE node1
- ora....l2.inst application ONLINE ONLINE node2
2.数据库升级
最好在建库之前进行数据库的升级,我这里是建库之后进行的,相对来说麻烦一点
1)如果安装了管理器和isqlplus执行如下命令停止:
- emctl stop dbconsole
- isqlplusctl stop
- [oracle@node1 bin]$ emctl stop dbconsole
- TZ set to PRC
- OC4J Configuration issue. /orac/orahome/10.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_node1_orcl not found.
- [oracle@node1 bin]$ isqlplusctl stop
- iSQL*Plus 10.2.0.1.0
- Copyright (c) 2003, 2005, Oracle. All rights reserved.
- getnameinfo failed
- getnameinfo failed
- getnameinfo failed
- getnameinfo failed
- getnameinfo failed
- getnameinfo failed
- getnameinfo failed
- getnameinfo failed
- getnameinfo failed
- iSQL*Plus instance on port 5560 is not running ...
2)停止服务和实例
在两个节点上面停止nodeapps(以下命令在两个节点上面都执行一下)
- [oracle@node1 bin]$ srvctl stop nodeapps -n node1
- [oracle@node2 bin]$ srvctl stop nodeapps -n node2
- [oracle@node1 bin]$ crs_stat -t
- Name Type Target State Host
- ------------------------------------------------------------
- ora....SM1.asm application OFFLINE OFFLINE
- ora....E1.lsnr application OFFLINE OFFLINE
- ora.node1.gsd application OFFLINE OFFLINE
- ora.node1.ons application OFFLINE OFFLINE
- ora.node1.vip application OFFLINE OFFLINE
- ora....SM2.asm application OFFLINE OFFLINE
- ora....E2.lsnr application OFFLINE OFFLINE
- ora.node2.gsd application OFFLINE OFFLINE
- ora.node2.ons application OFFLINE OFFLINE
- ora.node2.vip application OFFLINE OFFLINE
- ora.orcl.db application OFFLINE OFFLINE
- ora....l1.inst application OFFLINE OFFLINE
- ora....l2.inst application OFFLINE OFFLINE
3)然后开启安装进程,选择安装目录
4)选择集群安装
5)按照要求切换root用户执行脚本
6)启动两个节点上面的资源
- [oracle@node1 ~]$ srvctl start nodeapps -n node1
- [oracle@node2 ~]$ srvctl start nodeapps -n node2
- [oracle@node1 ~]$ srvctl start asm -n node1
- [oracle@node2 ~]$ srvctl start asm -n node2
- [oracle@node2 bin]$ crs_stat -t
- Name Type Target State Host
- ------------------------------------------------------------
- ora....SM1.asm application ONLINE ONLINE node1
- ora....E1.lsnr application ONLINE ONLINE node1
- ora.node1.gsd application ONLINE ONLINE node1
- ora.node1.ons application ONLINE ONLINE node1
- ora.node1.vip application ONLINE ONLINE node1
- ora....SM2.asm application ONLINE ONLINE node2
- ora....E2.lsnr application ONLINE ONLINE node2
- ora.node2.gsd application ONLINE ONLINE node2
- ora.node2.ons application ONLINE ONLINE node2
- ora.node2.vip application ONLINE ONLINE node2
- ora.orcl.db application OFFLINE OFFLINE
- ora....l1.inst application OFFLINE OFFLINE
- ora....l2.inst application OFFLINE OFFLINE
7)在其中一个节点进行操作
- SQL> STARTUP NOMOUNT
- SQL> ALTER SYSTEM SET SHARED_POOL_SIZE='150M' SCOPE=spfile;
- System altered.
- SQL> ALTER SYSTEM SET JAVA_POOL_SIZE='150M' SCOPE=spfile;
- System altered.
- SQL> ALTER SYSTEM SET CLUSTER_DATABASE=FALSE SCOPE=spfile;
- System altered.
保证SHARED_POOL_SIZE和JAVA_POOL_SIZE不小于150m。因为数据文件是共享的,所以升级的时候只需要在其中一个节点升级就行了,所以要把CLUSTER_DATABASE设成FALSE。
8)执行更新脚本
- SQL> STARTUP UPGRADE
- SQL> SPOOL patch.log
- SQL> @?/rdbms/admin/catupgrd.sql
- SQL> SPOOL OFF
- 检查日志看有没有错误,如果没有错误,则重启数据库:
- SQL> shutdown immediate
- Database closed.
- Database dismounted.
- ORACLE instance shut down.
- SQL> startup
- ORACLE instance started.
- Total System Global Area 469762048 bytes
- Fixed Size 1262428 bytes
- Variable Size 419433636 bytes
- Database Buffers 46137344 bytes
- Redo Buffers 2928640 bytes
- Database mounted.
- Database opened.
9)编译无效对象
- SQL> @?/rdbms/admin/utlrp.sql
10)修改参数
- SQL> ALTER SYSTEM SET CLUSTER_DATABASE=TRUE SCOPE=spfile;
- SQL> shutdown immediate
- Database closed.
- Database dismounted.
- ORACLE instance shut down.
升级完成,关闭数据库。
3.测试
1)在两个节点上面启动实例
- [oracle@node1 bin]$ ./srvctl start database -d orcl
- [oracle@node2 bin]$ ./srvctl start database -d orc2
- [oracle@node2 bin]$ crs_stat -t
- Name Type Target State Host
- ------------------------------------------------------------
- ora....SM1.asm application ONLINE ONLINE node1
- ora....E1.lsnr application ONLINE ONLINE node1
- ora.node1.gsd application ONLINE ONLINE node1
- ora.node1.ons application ONLINE ONLINE node1
- ora.node1.vip application ONLINE ONLINE node1
- ora....SM2.asm application ONLINE ONLINE node2
- ora....E2.lsnr application ONLINE ONLINE node2
- ora.node2.gsd application ONLINE ONLINE node2
- ora.node2.ons application ONLINE ONLINE node2
- ora.node2.vip application ONLINE ONLINE node2
- ora.orcl.db application ONLINE ONLINE node1
- ora....l1.inst application ONLINE ONLINE node1
- ora....l2.inst application ONLINE ONLINE node2
2)用pl/sql连接查看
- orcl =
- (DESCRIPTION =
- (ADDRESS_LIST =
- (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.183.141)(PORT = 1521))
- (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.183.142)(PORT = 1521))
- (LOAD_BALANCE = yes)
- )
- (CONNECT_DATA =
- (SERVICE_NAME = orcl)
- )
- )
3)当前连接到node1
查看数据库版本,显示已经升级了
关闭node1的实例
- [oracle@node1 bin]$ srvctl stop instance -d orcl -i orcl1
- [oracle@node1 bin]$ crs_stat -t
- Name Type Target State Host
- ------------------------------------------------------------
- ora....SM1.asm application ONLINE ONLINE node1
- ora....E1.lsnr application ONLINE ONLINE node1
- ora.node1.gsd application ONLINE ONLINE node1
- ora.node1.ons application ONLINE ONLINE node1
- ora.node1.vip application ONLINE ONLINE node1
- ora....SM2.asm application ONLINE ONLINE node2
- ora....E2.lsnr application ONLINE ONLINE node2
- ora.node2.gsd application ONLINE ONLINE node2
- ora.node2.ons application ONLINE ONLINE node2
- ora.node2.vip application ONLINE ONLINE node2
- ora.orcl.db application ONLINE ONLINE node1
- ora....l1.inst application OFFLINE OFFLINE
- ora....l2.inst application ONLINE ONLINE node2
4)显示当前连接到node2
查看数据库版本,显示也是已经升级过的