4.2. 设置ORACLE_HOME 和 ORACLE_SID环境变量 11
4.3.9. 停crs进程 (root用户,所有节点执行) 14
5.7. 执行升级脚本 (使用root用户,在所有节点执行) 22
6.8. 执行升级脚本 (使用root用户,在所有节点执行) 34
7.4.2. 修改CLUSTER_DATABASE参数 38
1. 概述
数据库做版本升级,版本从Oracle 10g 10.2.0.4 升级到10.2.0.5。
序号
操作内容
花费时间
备注
1
停止业务系统
20分钟
2
备份数据库
1小时
3
升级CRS
20分钟
4
升级数据库软件
40分钟
5
升级数据库
1小时
6
启动业务系统
20分钟
2. 升级系统环境信息
2.1. 确定oracle软件安装信息
[oracle@nmacct1 ~]$ more /etc/oratab
# This file is used by ORACLE utilities. It is created by root.sh
# and updated by the Database Configuration Assistant when creating
# a database.
# A colon, ':', is used as the field terminator. A new line terminates
# the entry. Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
# $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively. The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
nmjf:/oracle/product/10.2.0/db:N
If you are installing this patch set on an existing Oracle Real Application Cluster 10g release 10.2.0.x installation, you must run Oracle Universal Installer from the same node from which the Oracle Database software was installed. 这个信息如何确认?
[oracle@nmacct2 ~]$ cat $CRS_HOME/log/`hostname`/cssd/ocssd* | grep master
[ CSSD]CLSS-3001: local node number 2, master node number 1
[ CSSD]CLSS-3001: local node number 2, master node number 2
2.2. 集群信息
[oracle@nmacct1 ~]$ olsnodes -n -i
nmacct1 1 nmacct1-vip
nmacct2 2 nmacct2-vip
[oracle@nmacct1 ~]$ crs_stat | grep NAME
NAME=ora.nmacct1.LISTENER_NMACCT1.lsnr
NAME=ora.nmacct1.gsd
NAME=ora.nmacct1.ons
NAME=ora.nmacct1.vip
NAME=ora.nmacct2.LISTENER_NMACCT2.lsnr
NAME=ora.nmacct2.gsd
NAME=ora.nmacct2.ons
NAME=ora.nmacct2.vip
NAME=ora.nmjf.db
NAME=ora.nmjf.nmjf1.inst
NAME=ora.nmjf.nmjf2.inst
2.3. CRS版本信息
[oracle@nmacct1 ~]$ crsctl query crs activeversion
CRS active version on the cluster is [10.2.0.4.0]
2.4. 数据库版本信息
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Linux: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
2.5. Oracle时区定义
SQL> SELECT version FROM v$timezone_file;
VERSION
----------
4
The 10.2.0.5 patch set includes an update to the Oracle time zone definitions to Version 4. This version of the time zone definitions includes the changes to daylight saving time in the USA in 2007 and other updates.
For full overview, see My Oracle Support (formerly OracleMetaLink) document 1086400.1 Actions for the DSTv4 update in the 10.2.0.5 patchset.
When patching from a lower 10.2 release or upgrading from 10.1.0.x directly to 10.2.0.5, check the current version of the Oracle time zone definitions with the following command:
SELECT version FROM v$timezone_file;
If this query reports version 4, no action is required.
If this reports a version lower or higher than 4, see My Oracle Support document 1086400.1 Actions for the DSTv4 update in the Release 10.2.0.5 patchset.
On upgrading from any release of Oracle9i to Release 10.2.0.5, see My Oracle Support document 1086400.1 Actions for the DSTv4 update in the 10.2.0.5 patchset.
On upgrading from Release 8.1.7 directly to Release 10.2.0.5, no action is required because Release 8.1.7 has no timezone data stored.
2.6. 数据文件信息
3. 数据库备份
3.1. ORACLE_HOME备份
3.2. OCR备份
3.3. VOTEDISK备份
3.4. 数据库全量备份
4. 停数据库/CRS服务
4.1. 确定集群状态
[oracle@nmacct1 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....T1.lsnr application ONLINE ONLINE nmacct1
ora....ct1.gsd application ONLINE ONLINE nmacct1
ora....ct1.ons application ONLINE ONLINE nmacct1
ora....ct1.vip application ONLINE ONLINE nmacct1
ora....T2.lsnr application ONLINE ONLINE nmacct2
ora....ct2.gsd application ONLINE ONLINE nmacct2
ora....ct2.ons application ONLINE ONLINE nmacct2
ora....ct2.vip application ONLINE ONLINE nmacct2
ora.nmjf.db application ONLINE ONLINE nmacct2
ora....f1.inst application ONLINE ONLINE nmacct1
ora....f2.inst application ONLINE ONLINE nmacct2
4.2. 设置ORACLE_HOME 和 ORACLE_SID环境变量
$ ORACLE_HOME=/oracle/product/10.2.0/db
$ ORACLE_SID=nmjf1
$ PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch/bin:$PATH
$ export ORACLE_HOME ORACLE_SID PATH
4.3. 停止所有进程
以下命令,如特殊标注外,均使用oracle用户执行。
Note:
If you are using Oracle Clusterware, you must shut down all Oracle Database instances on all cluster nodes before applying the patch set to the Oracle Clusterware installation. All Oracle database instances are restarted during the Oracle Clusterware patch set installation. After the Oracle Clusterware patch set installation is complete, you must shut down all Oracle Database and Oracle ASM instances running in the Oracle RAC Oracle home before patching the Oracle RAC Oracle home.
4.3.1. 停iSQL*Plus
[oracle@nmacct1 ~]$ isqlplusctl stop
iSQL*Plus 10.2.0.4.0
Copyright (c) 2003, 2007, Oracle. All Rights Reserved.
iSQL*Plus instance on port 5560 is not running ...
4.3.2. 停dbconsole
[oracle@nmacct1 ~]$ emctl stop dbconsole
TZ set to PRC
OC4J Configuration issue. /oracle/product/10.2.0/db/oc4j/j2ee/OC4J_DBConsole_nmacct1_nmjf1 not found.
4.3.3. 停监听程序
[oracle@nmacct1 ~]$ crs_stat | grep -i listener
NAME=ora.nmacct1.LISTENER_NMACCT1.lsnr
NAME=ora.nmacct2.LISTENER_NMACCT2.lsnr
[oracle@nmacct1 ~]$ lsnrctl stop LISTENER_NMACCT1
LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 16-JUL-2013 16:10:27
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=nmacct1-vip)(PORT=1521)(IP=FIRST)))
The command completed successfully
可以使用srvctl命令替代lsnrctl。
[oracle@nmacct1 ~]$ srvctl stop listener -n nmacct1
[oracle@nmacct1 ~]$ srvctl stop listener -n nmacct2
4.3.4. 停数据库services
[oracle@nmacct1 ~]$ srvctl stop service -d nmjf
4.3.5. 停instances
[oracle@nmacct1 ~]$ srvctl stop database -d nmjf
4.3.6. 停asm
[oracle@nmacct1 ~]$ srvctl stop asm -n nmacct1
[oracle@nmacct1 ~]$ srvctl stop asm -n nmacct2
4.3.7. 停节点应用
[oracle@nmacct1 ~]$ srvctl stop nodeapps -n nmacct1
CRS-0216: Could not stop resource 'ora.nmacct1.LISTENER_NMACCT1.lsnr'.
[oracle@nmacct1 ~]$ srvctl stop nodeapps -n nmacct2
CRS-0216: Could not stop resource 'ora.nmacct2.LISTENER_NMACCT2.lsnr'.
4.3.8. 查看集群状态
[oracle@nmacct1 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....T1.lsnr application OFFLINE OFFLINE
ora....ct1.gsd application OFFLINE OFFLINE
ora....ct1.ons application OFFLINE OFFLINE
ora....ct1.vip application OFFLINE OFFLINE
ora....T2.lsnr application OFFLINE OFFLINE
ora....ct2.gsd application OFFLINE OFFLINE
ora....ct2.ons application OFFLINE OFFLINE
ora....ct2.vip application OFFLINE OFFLINE
ora.nmjf.db application OFFLINE OFFLINE
ora....f1.inst application OFFLINE OFFLINE
ora....f2.inst application OFFLINE OFFLINE
4.3.9. 停crs进程 (root用户,所有节点执行)
? 节点nmacct1
[root@nmacct1 ~]# $CRS_HOME/bin/crsctl stop crs
Stopping resources. This could take several minutes.
Successfully stopped CRS resources.
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
? 节点nmacct2
[root@nmacct2 ~]# $CRS_HOME/bin/crsctl stop crs
Stopping resources. This could take several minutes.
Successfully stopped CRS resources.
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
4.3.10. 备份系统
Oracle recommends that you create a backup of the Oracle Inventory, Oracle 10g home and Oracle 10g Database before you install the patch set. If you are planning to apply this patch to Oracle RAC, ensure that you create a backup of these components on all nodes before applying the patch. You must also ensure that the GID and UID of the CRS / Oracle User be less than 65536 bytes (ID username will provide the UID / GID for the user).
5. 升级CRS到10.2.0.5
The Oracle Clusterware software must be at the same or newer level as the Oracle software in the Oracle RAC Oracle home.
Therefore, you should always upgrade Oracle Clusterware before you upgrade Oracle RAC.
Before applying the 10.2.0.5 patch set to the Clusterware home, run the following command on all the cluster nodes:
5.1. 修改目录权限 (所有节点执行)
? 节点nmacct1
[root@nmacct1 ~]# chmod -R +w $CRS_HOME/inventory/Templates/*
? 节点nmacct2
[root@nmacct2 ~]# chmod -R +w $CRS_HOME/inventory/Templates/*
5.2. 启动补丁安装界面
[oracle@nmacct1 Disk1]$ ./runInstaller
Starting Oracle Universal Installer...
Checking installer requirements...
5.3. 选择CRS安装目录
5.4. 选择CRS升级节点
5.5. 安装条件检测
忽略告警提示。
5.6. 确认开始安装
5.7. 执行升级脚本 (使用root用户,在所有节点执行)
5.7.1. 节点nmacct1
[oracle@nmacct1 ~]$ su -
Password:
[root@nmacct1 ~]# /oracle/product/10.2.0/crs/bin/crsctl stop crs
Stopping resources. This could take several minutes.
Error while stopping resources. Possible cause: CRSD is down.
[root@nmacct1 ~]# /oracle/product/10.2.0/crs/install/root102.sh
Creating pre-patch directory for saving pre-patch clusterware files
Completed patching clusterware files to /oracle/product/10.2.0/crs
Relinking some shared libraries.
Relinking of patched files is complete.
WARNING: directory '/oracle/product/10.2.0' is not owned by root
WARNING: directory '/oracle/product' is not owned by root
WARNING: directory '/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 <nodenumber>: <nodename> <private interconnect name> <hostname>
node 1: nmacct1 nmacct1-priv nmacct1
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
clscfg -upgrade completed successfully
Creating '/oracle/product/10.2.0/crs/install/paramfile.crs' with data used for CRS configuration
Setting CRS configuration values in /oracle/product/10.2.0/crs/install/paramfile.crs
5.7.2. 节点nmacct2
[root@nmacct2 ~]# /oracle/product/10.2.0/crs/bin/crsctl stop crs
Stopping resources. This could take several minutes.
Error while stopping resources. Possible cause: CRSD is down.
[root@nmacct2 ~]# /oracle/product/10.2.0/crs/install/root102.sh
Creating pre-patch directory for saving pre-patch clusterware files
Completed patching clusterware files to /oracle/product/10.2.0/crs
Relinking some shared libraries.
Relinking of patched files is complete.
WARNING: directory '/oracle/product/10.2.0' is not owned by root
WARNING: directory '/oracle/product' is not owned by root
WARNING: directory '/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 <nodenumber>: <nodename> <private interconnect name> <hostname>
node 2: nmacct2 nmacct2-priv nmacct2
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
clscfg -upgrade completed successfully
Creating '/oracle/product/10.2.0/crs/install/paramfile.crs' with data used for CRS configuration
Setting CRS configuration values in /oracle/product/10.2.0/crs/install/paramfile.crs
5.8. 确认安装完成
5.9. 检查集群信息,CRS版本信息
[oracle@nmacct1 crs]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....T1.lsnr application ONLINE ONLINE nmacct1
ora....ct1.gsd application ONLINE ONLINE nmacct1
ora....ct1.ons application ONLINE ONLINE nmacct1
ora....ct1.vip application ONLINE ONLINE nmacct1
ora....T2.lsnr application ONLINE ONLINE nmacct2
ora....ct2.gsd application ONLINE ONLINE nmacct2
ora....ct2.ons application ONLINE ONLINE nmacct2
ora....ct2.vip application ONLINE ONLINE nmacct2
ora.nmjf.db application ONLINE ONLINE nmacct1
ora....f1.inst application ONLINE ONLINE nmacct1
ora....f2.inst application ONLINE ONLINE nmacct2
5.9.1. 节点nmacct1
[oracle@nmacct1 crs]$ crsctl query crs activeversion
CRS active version on the cluster is [10.2.0.5.0]
5.9.2. 节点nmacct2
[oracle@nmacct2 ~]$ crsctl query crs activeversion
CRS active version on the cluster is [10.2.0.5.0]
升级CRS完成。
6. 升级数据库软件到10.2.0.5
6.1. 停止数据库
6.1.1. 停数据库services
[oracle@nmacct1 ~]$ srvctl stop service -d nmjf
6.1.2. 停instances
[oracle@nmacct1 ~]$ srvctl stop database -d nmjf
6.1.3. 停asm
[oracle@nmacct1 ~]$ srvctl stop asm -n nmacct1
[oracle@nmacct1 ~]$ srvctl stop asm -n nmacct2
6.1.4. 停监听程序
[oracle@nmacct2 ~]$ srvctl stop listener -n nmacct1
[oracle@nmacct2 ~]$ srvctl stop listener -n nmacct2
6.1.5. 查看集群状态
[oracle@nmacct2 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....T1.lsnr application OFFLINE OFFLINE
ora....ct1.gsd application ONLINE ONLINE nmacct1
ora....ct1.ons application ONLINE ONLINE nmacct1
ora....ct1.vip application ONLINE ONLINE nmacct1
ora....T2.lsnr application OFFLINE OFFLINE
ora....ct2.gsd application ONLINE ONLINE nmacct2
ora....ct2.ons application ONLINE ONLINE nmacct2
ora....ct2.vip application ONLINE ONLINE nmacct2
ora.nmjf.db application OFFLINE OFFLINE
ora....f1.inst application OFFLINE OFFLINE
ora....f2.inst application OFFLINE OFFLINE
6.2. 启动补丁安装界面
[oracle@nmacct1 Disk1]$ ./runInstaller
Starting Oracle Universal Installer...
Checking installer requirements...
6.3. 选择数据库软件安装目录
6.4. 取消MOS邮件支持
6.5. 确认安装节点
6.6. 安装条件检测
6.7. 确认开始安装
6.8. 执行升级脚本 (使用root用户,在所有节点执行)
6.8.1. 节点nmacct1
[root@nmacct1 ~]# /oracle/product/10.2.0/db/root.sh
Running Oracle 10g root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /oracle/product/10.2.0/db
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.
6.8.2. 节点nmacct1
[root@nmacct2 ~]# /oracle/product/10.2.0/db/root.sh
Running Oracle 10g root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /oracle/product/10.2.0/db
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.
6.9. 确认安装完成
7. 手动升级数据库
7.1. 查看集群状态
[oracle@nmacct2 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....T1.lsnr application OFFLINE OFFLINE
ora....ct1.gsd application ONLINE ONLINE nmacct1
ora....ct1.ons application ONLINE ONLINE nmacct1
ora....ct1.vip application ONLINE ONLINE nmacct1
ora....T2.lsnr application OFFLINE OFFLINE
ora....ct2.gsd application ONLINE ONLINE nmacct2
ora....ct2.ons application ONLINE ONLINE nmacct2
ora....ct2.vip application ONLINE ONLINE nmacct2
ora.nmjf.db application OFFLINE OFFLINE
ora....f1.inst application OFFLINE OFFLINE
ora....f2.inst application OFFLINE OFFLINE
7.2. 启动监听
[oracle@nmacct2 ~]$ srvctl start listener -n nmacct1
[oracle@nmacct2 ~]$ srvctl start listener -n nmacct2
7.3. 启动asm
[oracle@nmacct2 ~]$ srvctl start asm -n nmacct1
[oracle@nmacct2 ~]$ srvctl start asm -n nmacct2
7.4. 修改CLUSTER_DATABASE参数
7.4.1. 启动数据库到nomount模式
[oracle@nmacct2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Tue Jul 16 17:02:14 2013
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 314572800 bytes
Fixed Size 2095928 bytes
Variable Size 121636040 bytes
Database Buffers 184549376 bytes
Redo Buffers 6291456 bytes
7.4.2. 修改CLUSTER_DATABASE参数
SQL> ALTER SYSTEM SET CLUSTER_DATABASE=FALSE SCOPE=spfile;
System altered.
7.4.3. 关闭数据库
SQL> shutdown immediate;
7.5. 执行数据库升级
7.5.1. 启动到升级模式
SQL> startup upgrade;
ORACLE instance started.
Total System Global Area 314572800 bytes
Fixed Size 2095928 bytes
Variable Size 121636040 bytes
Database Buffers 184549376 bytes
Redo Buffers 6291456 bytes
Database mounted.
Database opened.
7.5.2. 执行升级脚本
SQL> spool patch_10205.log
SQL> @?/rdbms/admin/catupgrd.sql
Total Upgrade Time: 00:20:08
DOC>#######################################################################
DOC>#######################################################################
DOC>
DOC> The above PL/SQL lists the SERVER components in the upgraded
DOC> database, along with their current version and status.
DOC>
DOC> Please review the status and version columns and look for
DOC> any errors in the spool log file. If there are errors in the spool
DOC> file, or any components are not VALID or not the current version,
DOC> consult the Oracle Database Upgrade Guide for troubleshooting
DOC> recommendations.
DOC>
DOC> Next shutdown immediate, restart for normal operation, and then
DOC> run utlrp.sql to recompile any invalid application objects.
DOC>
DOC>#######################################################################
DOC>#######################################################################
DOC>#
SQL> spool off
7.5.3. 检查升级日志
TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UPGRD_END 2013-07-16 17:25:39
.
Oracle Database 10.2 Upgrade Status Utility 07-16-2013 17:25:39
.
Component Status Version HH:MM:SS
Oracle Database Server VALID 10.2.0.5.0 00:06:51
JServer JAVA Virtual Machine VALID 10.2.0.5.0 00:01:50
Oracle XDK VALID 10.2.0.5.0 00:00:23
Oracle Database Java Packages VALID 10.2.0.5.0 00:00:18
Oracle Text VALID 10.2.0.5.0 00:00:17
Oracle XML Database VALID 10.2.0.5.0 00:01:41
Oracle Real Application Clusters VALID 10.2.0.5.0 00:00:00
Oracle Workspace Manager VALID 10.2.0.5.0 00:00:30
Oracle Data Mining VALID 10.2.0.5.0 00:00:12
OLAP Analytic Workspace VALID 10.2.0.5.0 00:00:11
OLAP Catalog VALID 10.2.0.5.0 00:00:36
Oracle OLAP API VALID 10.2.0.5.0 00:00:32
Oracle interMedia VALID 10.2.0.5.0 00:03:00
Spatial VALID 10.2.0.5.0 00:01:25
Oracle Expression Filter VALID 10.2.0.5.0 00:00:09
Oracle Enterprise Manager VALID 10.2.0.5.0 00:00:31
Oracle Rule Manager VALID 10.2.0.5.0 00:00:06
.
Total Upgrade Time: 00:20:08
DOC>#######################################################################
DOC>#######################################################################
DOC>
DOC> The above PL/SQL lists the SERVER components in the upgraded
DOC> database, along with their current version and status.
DOC>
DOC> Please review the status and version columns and look for
DOC> any errors in the spool log file. If there are errors in the spool
DOC> file, or any components are not VALID or not the current version,
DOC> consult the Oracle Database Upgrade Guide for troubleshooting
DOC> recommendations.
DOC>
DOC> Next shutdown immediate, restart for normal operation, and then
DOC> run utlrp.sql to recompile any invalid application objects.
DOC>
DOC>#######################################################################
DOC>#######################################################################
DOC>#
7.6. 重启数据库,编译无效对象
SQL> SHUTDOWN IMMEDIATE;
SQL> STARTUP;
SQL> @?/rdbms/admin/utlrp.sql
OBJECTS WITH ERRORS
-------------------
0
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
7.7. 检查数据库组件版本
SQL> SELECT COMP_NAME, VERSION, STATUS FROM SYS.DBA_REGISTRY;
COMP_NAME VERSION STATUS
---------------------------------------- ------------------------------ ----------
Spatial 10.2.0.5.0 VALID
Oracle interMedia 10.2.0.5.0 VALID
OLAP Catalog 10.2.0.5.0 VALID
Oracle Enterprise Manager 10.2.0.5.0 VALID
Oracle XML Database 10.2.0.5.0 VALID
Oracle Text 10.2.0.5.0 VALID
Oracle Expression Filter 10.2.0.5.0 VALID
Oracle Rule Manager 10.2.0.5.0 VALID
Oracle Workspace Manager 10.2.0.5.0 VALID
Oracle Data Mining 10.2.0.5.0 VALID
Oracle Database Catalog Views 10.2.0.5.0 VALID
COMP_NAME VERSION STATUS
---------------------------------------- ------------------------------ ----------
Oracle Database Packages and Types 10.2.0.5.0 VALID
JServer JAVA Virtual Machine 10.2.0.5.0 VALID
Oracle XDK 10.2.0.5.0 VALID
Oracle Database Java Packages 10.2.0.5.0 VALID
OLAP Analytic Workspace 10.2.0.5.0 VALID
Oracle OLAP API 10.2.0.5.0 VALID
Oracle Real Application Clusters 10.2.0.5.0 VALID
18 rows selected.
7.8. 修改CLUSTER_DATABASE参数
SQL> ALTER SYSTEM SET CLUSTER_DATABASE=TRUE SCOPE=spfile;
System altered.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 314572800 bytes
Fixed Size 2095928 bytes
Variable Size 184550600 bytes
Database Buffers 121634816 bytes
Redo Buffers 6291456 bytes
Database mounted.
Database opened.
7.9. 启动未启动节点的实例
[oracle@nmacct1 crs]$ srvctl start instance -d nmjf -i nmjf1
7.10. 启动services
[oracle@nmacct1 crs]$ srvctl start service -d nmjf
7.11. 查看集群状态
[oracle@nmacct1 crs]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....T1.lsnr application ONLINE ONLINE nmacct1
ora....ct1.gsd application ONLINE ONLINE nmacct1
ora....ct1.ons application ONLINE ONLINE nmacct1
ora....ct1.vip application ONLINE ONLINE nmacct1
ora....T2.lsnr application ONLINE ONLINE nmacct2
ora....ct2.gsd application ONLINE ONLINE nmacct2
ora....ct2.ons application ONLINE ONLINE nmacct2
ora....ct2.vip application ONLINE ONLINE nmacct2
ora.nmjf.db application ONLINE ONLINE nmacct1
ora....f1.inst application ONLINE ONLINE nmacct1
ora....f2.inst application ONLINE ONLINE nmacct2