最近在本机上重新用vmware server 1.04 搭建了一套10G RAC系统,在搭建过程把步骤基本记录下来,希望对大家有帮助。
本部分主要讲述如何升级RAC数据库
一般情况下,最好在创建数据库前升级软件会省去不少麻烦,我这里为了测试,选择先创建数据库再升级。
1、 如果安装了管理器和isqlplus执行如下命令停止:
emctl stop dbconsole
isqlplusctl stop
2、 停止服务和实例
以oracle用户在其中一个节点执行
[oracle@rac1 ~]$ srvctl stop service -d rac
[oracle@rac1 ~]$ srvctl stop instance -d rac -i rac1,rac2
3、 停止nodeapps
两个节点以root分别执行:
节点1:
[root@rac1 ~]# cd /opt/oracle/product/10.2/crs/bin/
[root@rac1 bin]# ./srvctl stop nodeapps -n rac1
节点2:
[root@rac1 ~]# cd /opt/oracle/product/10.2/crs/bin/
[root@rac1 bin]# ./srvctl stop nodeapps -n rac2
4、 停止crs
在所有节点以root分别执行:
[root@rac1 bin]# ./crsctl stop crs
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
5、 升级数据库软件
必须在安装oracle软件的节点打运行补丁更新程序。
[root@rac1 ~]# export DISPLAY=172.25.8.131:1.0
[root@rac1 ~]# xhost +
access control disabled, clients can connect from any host
[root@rac1 ~]#
[root@rac1 ~]# su - oracle
[oracle@rac1 ~]$ cd /soft/Disk1/
[oracle@rac1 Disk1]$ ls
10203_buglist.htm install patch_note.htm response runInstaller stage
[oracle@rac1 Disk1]$ ./runInstaller
Starting Oracle Universal Installer...
Checking installer requirements...
Checking operating system version: must be redhat-3, SuSE-9, SuSE-10, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
Passed
All installer requirements met.
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2008-01-16_06-09-15PM. Please wait ...[oracle@rac1 Disk1]$ Oracle Universal Installer, Version10.2.0.3.0 Production
Copyright (C) 1999, 2006, Oracle. All rights reserved.
在弹出的界面下一步,选择OraDb10g_home1
下一步,默认是选择了所有节点
下一步,开始升级
最后在所有节点以root执行脚本:
[root@rac1 bin]# /opt/oracle/product/10.2/database/root.sh
Running Oracle10 root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /opt/oracle/product/10.2/database
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying coraenv to /usr/local/bin ...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
至此,数据库软件部分升级完成。
1) 升级数据库
数据库升级可以用dbua,也可以手工升级。我在这里选择手工升级的方式。
1、 启动所有节点的的crs及监听等资源
[root@rac1 bin]# /etc/init.d/init.crs start
Startup will be queued to init within 90 seconds.
[root@rac2 bin]# /etc/init.d/init.crs start
Startup will be queued to init within 90 seconds.
1、 在节点1修改参数
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。
2、 执行更新脚本
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.
3、 编译无效对象
SQL> @?/rdbms/admin/utlrp.sql
4、 修改参数
SQL> ALTER SYSTEM SET CLUSTER_DATABASE=TRUE SCOPE=spfile;
System altered.
重启数据库,升级完成。