Verification of Clock Synchronization across the cluster nodes was successful.
SELECT inst_id , instance_number inst_no , instance_name inst_name , parallel , status , database_status db_status , active_state state , host_name host FROM gv$instance ORDER BY inst_id;
14、所有数据库文件及它们所在的 ASM 磁盘组 ― (SQL):
(1)、在本地服务器上停止Oracle Clusterware 系统:
[root@rac01 ~]# /u01/app/11.2.0/grid/bin/crsctl stop cluster
CRS-2673: Attempting to stop 'ora.crsd' on 'rac01'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'rac01'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'rac01'
CRS-2673: Attempting to stop 'ora.CRS.dg' on 'rac01'
CRS-2673: Attempting to stop 'ora.racdb.db' on 'rac01'
CRS-2673: Attempting to stop 'ora.registry.acfs' on 'rac01'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.rac01.vip' on 'rac01'
CRS-2677: Stop of 'ora.rac01.vip' on 'rac01' succeeded
CRS-2672: Attempting to start 'ora.rac01.vip' on 'rac02'
CRS-2677: Stop of 'ora.registry.acfs' on 'rac01' succeeded
CRS-2676: Start of 'ora.rac01.vip' on 'rac02' succeeded
CRS-2677: Stop of 'ora.CRS.dg' on 'rac01' succeeded
CRS-2677: Stop of 'ora.racdb.db' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.FRA.dg' on 'rac01'
CRS-2673: Attempting to stop 'ora.RACDB_DATA.dg' on 'rac01'
CRS-2677: Stop of 'ora.FRA.dg' on 'rac01' succeeded
CRS-2677: Stop of 'ora.RACDB_DATA.dg' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'rac01'
CRS-2677: Stop of 'ora.asm' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.ons' on 'rac01'
CRS-2673: Attempting to stop 'ora.eons' on 'rac01'
CRS-2677: Stop of 'ora.ons' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'rac01'
CRS-2677: Stop of 'ora.net1.network' on 'rac01' succeeded
CRS-2677: Stop of 'ora.eons' on 'rac01' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'rac01' has completed
CRS-2677: Stop of 'ora.crsd' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.cssdmonitor' on 'rac01'
CRS-2673: Attempting to stop 'ora.ctssd' on 'rac01'
CRS-2673: Attempting to stop 'ora.evmd' on 'rac01'
CRS-2673: Attempting to stop 'ora.asm' on 'rac01'
CRS-2677: Stop of 'ora.cssdmonitor' on 'rac01' succeeded
CRS-2677: Stop of 'ora.evmd' on 'rac01' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'rac01' succeeded
CRS-2677: Stop of 'ora.asm' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'rac01'
CRS-2677: Stop of 'ora.cssd' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.diskmon' on 'rac01'
CRS-2677: Stop of 'ora.diskmon' on 'rac01' succeeded
注:在运行“crsctl stop cluster”命令之后,如果 Oracle Clusterware 管理的资源中有任何一个还在运行,则整个命令失败。使用 -f 选项无条件地停止所有资源并停止 Oracle Clusterware 系统。
另请注意,可通过指定 -all 选项在集群中所有服务器上停止 Oracle Clusterware 系统。如下所示,在rac01和rac02上停止oracle clusterware系统:
[root@rac02 ~]# /u01/app/11.2.0/grid/bin/crsctl stop cluster �Call
在本地服务器上启动oralce clusterware系统:
[root@rac01 ~]# /u01/app/11.2.0/grid/bin/crsctl start cluster
注:可通过指定 -all 选项在集群中所有服务器上启动 Oracle Clusterware 系统。
[root@rac02 ~]# /u01/app/11.2.0/grid/bin/crsctl start cluster �Call
还可以通过列出服务器(各服务器之间以空格分隔)在集群中一个或多个指定的服务器上启动 Oracle Clusterware 系统:
[root@rac01 ~]# /u01/app/11.2.0/grid/bin/crsctl start cluster -n rac01 rac02
使用 SRVCTL 启动/停止所有实例:
[oracle@rac01 ~]#
srvctl stop database -d racdb
[oracle@rac01 ~]#
srvctl start database -d racdb
安装的后置任务:
1 .官方建议的两个安装后置任务
(1) 备份 root.sh 脚本
官方建议在完成安装后要备份root.sh脚本文件。如果在Oracle Home目录中又安装其它的产品,安装时OUI会升级已存在的root.sh文件。如果需要root.sh内的原始信息,就可以在备份中找到。
cd $ORACLE_HOME;cp root.sh root.sh.bak
(2)重新编译无效对象
运行 utlrp.sql 脚本立即重新编译所有无效的 PL/SQL 程序包,而不是在首次访问它们时再重新编译。这是个可选步骤,但建议您选择该步骤。
[oracle@racnode1 ~]$
sqlplus / as sysdba
SQL>
@?/rdbms/admin/utlrp.sql 2.
在 RAC 环境中启用存档日志
(1)、以 oracle 用户身份登录到一个节点(即 racnode1),通过在当前实例中将 cluster_database 设置为 FALSE 来禁用集群实例参数:
[oracle@rac01 ~]$
sqlplus / as sysdba
SQL>
alter system set cluster_database=false scope=spfile sid='racdb1';
System altered.
(2)、以 oracle 用户身份关闭
所有 访问集群化数据库的实例:
[oracle@rac01 ~]$
srvctl stop database -d racdb
(3)、使用本地实例,挂载数据库:
[oracle@rac01 ~]$
sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Sat Nov 21 19:26:47 2009 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to an idle instance.
SQL>
startup mount
ORACLE instance started.
Total System Global Area 1653518336 bytes
Fixed Size 2213896 bytes
Variable Size 1073743864 bytes
Database Buffers 570425344 bytes
Redo Buffers 7135232 bytes
(4)、启用存档功能:
SQL>
alter database archivelog;
Database altered.
(5)、通过在当前实例中将实例参数 cluster_database 修改为 TRUE,重新启用对集群的支持:
SQL>
alter system set cluster_database=true scope=spfile sid='racdb1';
System altered.
(6)、关闭本地实例:
SQL>
shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
(7)、以 oracle 帐户身份使用 srvctl 命令重启
所有实例:
[oracle@rac01 ~]$
srvctl start database -d racdb
(8)、登录到本地实例,验证存档日志模式已启用:
[oracle@rac01 ~]$
sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Sat Nov 21 19:33:38 2009 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options
SQL>
archive log list
Database log mode
Archive Mode
Automatic archival
Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 69
Next log sequence to archive 70
Current log sequence 703
在两个RAC节点都备份spfile初始化参数文件:创建一个备份目录:
[oracle@rac02 ~]$ mkdir $ORACLE_HOME/spfile_bak
[oracle@rac02 ~]$ sqlplus “/as sysdba”