Oracle RacOneNode 修改 cluster name步骤
注意:操作可回退性不高,风险较大。唯一回退的方法是按照步骤,用旧的cluster name再重新配置一遍集群。请谨慎!
一、主机环境
redhat 6.5 x86 ORACLE 11.2.4.0
二、检查系统原始状态
2.1 数据库属性
[grid@redhat1 ~]$ srvctl config database -d redhat; 数据库唯一名称: redhat 数据库名: Oracle 主目录: /oracle/app/oracle/product/11.2.0/dbhome_1 Oracle 用户: oracle Spfile: +DATADG/redhat/spfileredhat.ora 域: 启动选项: open 停止选项: immediate 数据库角色: PRIMARY 管理策略: AUTOMATIC 服务器池: redhat 数据库实例: 磁盘组: DATADG,FRADG 装载点路径: 服务: redhat_00 类型: RACOneNode 联机重新定位超时: 30 实例名前缀: redhat 候选服务器: redhat1,redhat2 数据库是管理员管理的
2.2 数据库集群状态
[root@redhat1 bin]# ./crsctl status res -t -------------------------------------------------------------------------------- NAME TARGET STATE SERVER STATE_DETAILS -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.DATADG.dg ONLINE ONLINE redhat1 ONLINE ONLINE redhat2 ora.FRADG.dg ONLINE ONLINE redhat1 ONLINE ONLINE redhat2 ora.LISTENER.lsnr ONLINE ONLINE redhat1 ONLINE ONLINE redhat2 ora.OCRDG.dg ONLINE ONLINE redhat1 ONLINE ONLINE redhat2 ora.asm ONLINE ONLINE redhat1 Started ONLINE ONLINE redhat2 Started ora.gsd OFFLINE OFFLINE redhat1 OFFLINE OFFLINE redhat2 ora.net1.network ONLINE ONLINE redhat1 ONLINE ONLINE redhat2 ora.ons ONLINE ONLINE redhat1 ONLINE ONLINE redhat2 -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE redhat1 ora.cvu 1 ONLINE ONLINE redhat1 ora.oc4j 1 ONLINE ONLINE redhat1 ora.redhat.db 1 ONLINE ONLINE redhat1 Open ora.redhat.redhat_00.svc 1 ONLINE ONLINE redhat1 ora.redhat1.vip 1 ONLINE ONLINE redhat1 ora.redhat2.vip 1 ONLINE ONLINE redhat2 ora.scan1.vip 1 ONLINE ONLINE redhat1
2.3 集群名字
[grid@redhat1 ~]$ olsnodes -c redhat-cluster [grid@redhat1 ~]$
三、OLR、OCR 备份
OLR 备份需要两个节点分别执行
[root@redhat1 bin]# ./ocrconfig -local -manualbackup redhat1 2016/09/18 14:47:08 /oracle/app/11.2.0.4/cdata/redhat1/backup_20160918_144708.olr redhat1 2016/09/18 09:04:51 /oracle/app/11.2.0.4/cdata/redhat1/backup_20160918_090451.olr redhat1 2016/09/17 17:41:16 /oracle/app/11.2.0.4/cdata/redhat1/backup_20160917_174116.olr [root@redhat1 bin]# ./ocrconfig -local -showbackup redhat1 2016/09/18 14:47:08 /oracle/app/11.2.0.4/cdata/redhat1/backup_20160918_144708.olr redhat1 2016/09/18 09:04:51 /oracle/app/11.2.0.4/cdata/redhat1/backup_20160918_090451.olr redhat1 2016/09/17 17:41:16 /oracle/app/11.2.0.4/cdata/redhat1/backup_20160917_174116.olr
[root@redhat2 bin]# ./ocrconfig -local -manualbackup redhat2 2016/09/18 14:51:47 /oracle/app/11.2.0.4/cdata/redhat2/backup_20160918_145147.olr redhat2 2016/09/17 17:46:42 /oracle/app/11.2.0.4/cdata/redhat2/backup_20160917_174642.olr [root@redhat2 bin]#
OCR备份只需在1节点执行即可。 [root@redhat1 bin]# ./ocrconfig -manualbackup redhat1 2016/09/18 14:50:02 /oracle/app/11.2.0.4/cdata/rh-cluster/backup_20160918_145002.ocr redhat1 2016/09/18 09:06:03 /oracle/app/11.2.0.4/cdata/rh-cluster/backup_20160918_090603.ocr [root@redhat1 bin]# [root@redhat1 bin]# ./ocrconfig -showbackup redhat1 2016/09/18 13:17:10 /oracle/app/11.2.0.4/cdata/rh-cluster/backup00.ocr redhat1 2016/09/18 13:17:10 /oracle/app/11.2.0.4/cdata/rh-cluster/day.ocr redhat1 2016/09/18 13:17:10 /oracle/app/11.2.0.4/cdata/rh-cluster/week.ocr redhat1 2016/09/18 14:50:02 /oracle/app/11.2.0.4/cdata/rh-cluster/backup_20160918_145002.ocr redhat1 2016/09/18 09:06:03 /oracle/app/11.2.0.4/cdata/rh-cluster/backup_20160918_090603.ocr [root@redhat1 bin]#
四、停数据库实例(略)
五、deinstall grid infrastructure
切换到root用户,先在2节点执行,后在1节点执行。 2节点 [root@redhat2 install]#pwd /oracle/app/11.2.0.4/crs/install [root@redhat2 install]# ./rootcrs.pl -deconfig -force -verbose Using configuration parameter file: ./crsconfig_params 网络存在: 1/192.168.119.0/255.255.255.0/eth0, 类型 static VIP 存在: /redhat1-vip/192.168.119.11/192.168.119.0/255.255.255.0/eth0, 托管节点 redhat1 VIP 存在: /redhat2-vip/192.168.119.21/192.168.119.0/255.255.255.0/eth0, 托管节点 redhat2 GSD 已存在 ONS 存在: 本地端口 6100, 远程端口 6200, EM 端口 2016 CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'redhat2' CRS-2673: Attempting to stop 'ora.crsd' on 'redhat2' CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'redhat2' CRS-2673: Attempting to stop 'ora.DATADG.dg' on 'redhat2' CRS-2673: Attempting to stop 'ora.FRADG.dg' on 'redhat2' CRS-2673: Attempting to stop 'ora.OCRDG.dg' on 'redhat2' CRS-2677: Stop of 'ora.DATADG.dg' on 'redhat2' succeeded CRS-2677: Stop of 'ora.FRADG.dg' on 'redhat2' succeeded CRS-2677: Stop of 'ora.OCRDG.dg' on 'redhat2' succeeded CRS-2673: Attempting to stop 'ora.asm' on 'redhat2' CRS-2677: Stop of 'ora.asm' on 'redhat2' succeeded CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'redhat2' has completed CRS-2677: Stop of 'ora.crsd' on 'redhat2' succeeded CRS-2673: Attempting to stop 'ora.crf' on 'redhat2' CRS-2673: Attempting to stop 'ora.ctssd' on 'redhat2' CRS-2673: Attempting to stop 'ora.evmd' on 'redhat2' CRS-2673: Attempting to stop 'ora.asm' on 'redhat2' CRS-2673: Attempting to stop 'ora.mdnsd' on 'redhat2' CRS-2677: Stop of 'ora.crf' on 'redhat2' succeeded CRS-2677: Stop of 'ora.mdnsd' on 'redhat2' succeeded CRS-2677: Stop of 'ora.evmd' on 'redhat2' succeeded CRS-2677: Stop of 'ora.asm' on 'redhat2' succeeded CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'redhat2' CRS-2677: Stop of 'ora.ctssd' on 'redhat2' succeeded CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'redhat2' succeeded CRS-2673: Attempting to stop 'ora.cssd' on 'redhat2' CRS-2677: Stop of 'ora.cssd' on 'redhat2' succeeded CRS-2673: Attempting to stop 'ora.gipcd' on 'redhat2' CRS-2677: Stop of 'ora.gipcd' on 'redhat2' succeeded CRS-2673: Attempting to stop 'ora.gpnpd' on 'redhat2' CRS-2677: Stop of 'ora.gpnpd' on 'redhat2' succeeded CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'redhat2' has completed CRS-4133: Oracle High Availability Services has been stopped. Removing Trace File Analyzer Successfully deconfigured Oracle clusterware stack on this node 1节点 [root@redhat1 install]# pwd /oracle/app/11.2.0.4/crs/install [root@redhat1 install]# [root@redhat1 install]# [root@redhat1 install]# ./rootcrs.pl -deconfig -force -verbose -lastnode Using configuration parameter file: ./crsconfig_params CRS resources for listeners are still configured 网络存在: 1/192.168.119.0/255.255.255.0/eth0, 类型 static VIP 存在: /redhat1-vip/192.168.119.11/192.168.119.0/255.255.255.0/eth0, 托管节点 redhat1 GSD 已存在 ONS 存在: 本地端口 6100, 远程端口 6200, EM 端口 2016 CRS-2673: Attempting to stop 'ora.crsd' on 'redhat1' CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'redhat1' CRS-2673: Attempting to stop 'ora.OCRDG.dg' on 'redhat1' CRS-2673: Attempting to stop 'ora.DATADG.dg' on 'redhat1' CRS-2673: Attempting to stop 'ora.FRADG.dg' on 'redhat1' CRS-2673: Attempting to stop 'ora.oc4j' on 'redhat1' CRS-2677: Stop of 'ora.FRADG.dg' on 'redhat1' succeeded CRS-2677: Stop of 'ora.DATADG.dg' on 'redhat1' succeeded CRS-2677: Stop of 'ora.oc4j' on 'redhat1' succeeded CRS-2677: Stop of 'ora.OCRDG.dg' on 'redhat1' succeeded CRS-2673: Attempting to stop 'ora.asm' on 'redhat1' CRS-2677: Stop of 'ora.asm' on 'redhat1' succeeded CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'redhat1' has completed CRS-2677: Stop of 'ora.crsd' on 'redhat1' succeeded CRS-2673: Attempting to stop 'ora.ctssd' on 'redhat1' CRS-2673: Attempting to stop 'ora.evmd' on 'redhat1' CRS-2673: Attempting to stop 'ora.asm' on 'redhat1' CRS-2677: Stop of 'ora.evmd' on 'redhat1' succeeded CRS-2677: Stop of 'ora.ctssd' on 'redhat1' succeeded CRS-2677: Stop of 'ora.asm' on 'redhat1' succeeded CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'redhat1' CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'redhat1' succeeded CRS-2673: Attempting to stop 'ora.cssd' on 'redhat1' CRS-2677: Stop of 'ora.cssd' on 'redhat1' succeeded CRS-2672: Attempting to start 'ora.cssdmonitor' on 'redhat1' CRS-2676: Start of 'ora.cssdmonitor' on 'redhat1' succeeded CRS-2672: Attempting to start 'ora.cssd' on 'redhat1' CRS-2672: Attempting to start 'ora.diskmon' on 'redhat1' CRS-2676: Start of 'ora.diskmon' on 'redhat1' succeeded CRS-2676: Start of 'ora.cssd' on 'redhat1' succeeded CRS-4611: Successful deletion of voting disk +OCRDG. ASM 取消配置跟踪文件位置: /tmp/asmcadc_clean2016-09-18_02-59-21-PM.log ASM 清除配置开始 ASM 清除配置结束 已成功删除 SID 为 +ASM1 的 ASM。有关详细信息, 请查看 /tmp/asmcadc_clean2016-09-18_02-59-21-PM.log。 CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'redhat1' CRS-2673: Attempting to stop 'ora.ctssd' on 'redhat1' CRS-2673: Attempting to stop 'ora.asm' on 'redhat1' CRS-2673: Attempting to stop 'ora.mdnsd' on 'redhat1' CRS-2677: Stop of 'ora.mdnsd' on 'redhat1' succeeded CRS-2677: Stop of 'ora.asm' on 'redhat1' succeeded CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'redhat1' CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'redhat1' succeeded CRS-2677: Stop of 'ora.ctssd' on 'redhat1' succeeded CRS-2673: Attempting to stop 'ora.cssd' on 'redhat1' CRS-2677: Stop of 'ora.cssd' on 'redhat1' succeeded CRS-2673: Attempting to stop 'ora.crf' on 'redhat1' CRS-2677: Stop of 'ora.crf' on 'redhat1' succeeded CRS-2673: Attempting to stop 'ora.gipcd' on 'redhat1' CRS-2677: Stop of 'ora.gipcd' on 'redhat1' succeeded CRS-2673: Attempting to stop 'ora.gpnpd' on 'redhat1' CRS-2677: Stop of 'ora.gpnpd' on 'redhat1' succeeded CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'redhat1' has completed CRS-4133: Oracle High Availability Services has been stopped. Removing Trace File Analyzer Successfully deconfigured Oracle clusterware stack on this node [root@redhat1 install]#
六、重新配置grid infrastructure
切换到grid用户
$GRID_HOME/crs/config/config.sh
[root@redhat1 ~]# [root@redhat1 ~]# /tmp/CVU_11.2.0.4.0_grid/runfixup.sh Response file being used is :/tmp/CVU_11.2.0.4.0_grid/fixup.response Enable file being used is :/tmp/CVU_11.2.0.4.0_grid/fixup.enable Log file location: /tmp/CVU_11.2.0.4.0_grid/orarun.log Installing Package /tmp/CVU_11.2.0.4.0_grid//cvuqdisk-1.0.9-1.rpm Preparing... ########################################### [100%] 1:cvuqdisk ########################################### [100%] [root@redhat1 ~]# [root@redhat2 ~]# id uid=0(root) gid=0(root) 组=0(root),492(sfcb) 环境=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 [root@redhat2 ~]# [root@redhat2 ~]# /tmp/CVU_11.2.0.4.0_grid/runfixup.sh Response file being used is :/tmp/CVU_11.2.0.4.0_grid/fixup.response Enable file being used is :/tmp/CVU_11.2.0.4.0_grid/fixup.enable Log file location: /tmp/CVU_11.2.0.4.0_grid/orarun.log Installing Package /tmp/CVU_11.2.0.4.0_grid//cvuqdisk-1.0.9-1.rpm Preparing... ########################################### [100%] 1:cvuqdisk ########################################### [100%] [root@redhat2 ~]#
[root@redhat1 11.2.0.4]# pwd /oracle/app/11.2.0.4 [root@redhat1 11.2.0.4]# [root@redhat1 11.2.0.4]# ./root.sh Performing root user operation for Oracle 11g The following environment variables are set as: ORACLE_OWNER= grid ORACLE_HOME= /oracle/app/11.2.0.4 Enter the full pathname of the local bin directory: [/usr/local/bin]: The contents of "dbhome" have not changed. No need to overwrite. The contents of "oraenv" have not changed. No need to overwrite. The contents of "coraenv" have not changed. No need to overwrite. 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 script. Now product-specific root actions will be performed. Relinking oracle with rac_on option Using configuration parameter file: /oracle/app/11.2.0.4/crs/install/crsconfig_params User ignored Prerequisites during installation Installing Trace File Analyzer OLR initialization - successful root wallet root wallet cert root cert export peer wallet profile reader wallet pa wallet peer wallet keys pa wallet keys peer cert request pa cert request peer cert pa cert peer root cert TP profile reader root cert TP pa root cert TP peer pa cert TP pa peer cert TP profile reader pa cert TP profile reader peer cert TP peer user cert pa user cert Adding Clusterware entries to upstart CRS-2672: Attempting to start 'ora.mdnsd' on 'redhat1' CRS-2676: Start of 'ora.mdnsd' on 'redhat1' succeeded CRS-2672: Attempting to start 'ora.gpnpd' on 'redhat1' CRS-2676: Start of 'ora.gpnpd' on 'redhat1' succeeded CRS-2672: Attempting to start 'ora.cssdmonitor' on 'redhat1' CRS-2672: Attempting to start 'ora.gipcd' on 'redhat1' CRS-2676: Start of 'ora.cssdmonitor' on 'redhat1' succeeded CRS-2676: Start of 'ora.gipcd' on 'redhat1' succeeded CRS-2672: Attempting to start 'ora.cssd' on 'redhat1' CRS-2672: Attempting to start 'ora.diskmon' on 'redhat1' CRS-2676: Start of 'ora.diskmon' on 'redhat1' succeeded CRS-2676: Start of 'ora.cssd' on 'redhat1' succeeded 已成功创建并启动 ASM。 已成功创建磁盘组OCRDG。 clscfg: -install mode specified Successfully accumulated necessary OCR keys. Creating OCR keys for user 'root', privgrp 'root'.. Operation successful. CRS-4256: Updating the profile Successful addition of voting disk 5e9d14c415e34fb3bf8b1d7626b898b5. Successfully replaced voting disk group with +OCRDG. CRS-4256: Updating the profile CRS-4266: Voting file(s) successfully replaced ## STATE File Universal Id File Name Disk group -- ----- ----------------- --------- --------- 1. ONLINE 5e9d14c415e34fb3bf8b1d7626b898b5 (/dev/asm-ocr1) [OCRDG] Located 1 voting disk(s). CRS-2672: Attempting to start 'ora.asm' on 'redhat1' CRS-2676: Start of 'ora.asm' on 'redhat1' succeeded CRS-2672: Attempting to start 'ora.OCRDG.dg' on 'redhat1' CRS-2676: Start of 'ora.OCRDG.dg' on 'redhat1' succeeded Configure Oracle Grid Infrastructure for a Cluster ... Succeeded [root@redhat2 11.2.0.4]# pwd /oracle/app/11.2.0.4 [root@redhat2 11.2.0.4]# [root@redhat2 11.2.0.4]# ./root.sh Performing root user operation for Oracle 11g The following environment variables are set as: ORACLE_OWNER= grid ORACLE_HOME= /oracle/app/11.2.0.4 Enter the full pathname of the local bin directory: [/usr/local/bin]: The contents of "dbhome" have not changed. No need to overwrite. The contents of "oraenv" have not changed. No need to overwrite. The contents of "coraenv" have not changed. No need to overwrite. 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 script. Now product-specific root actions will be performed. Relinking oracle with rac_on option Using configuration parameter file: /oracle/app/11.2.0.4/crs/install/crsconfig_params User ignored Prerequisites during installation Installing Trace File Analyzer OLR initialization - successful Adding Clusterware entries to upstart CRS-4402: The CSS daemon was started in exclusive mode but found an active CSS daemon on node redhat1, number 1, and is terminating An active cluster was found during exclusive startup, restarting to join the cluster Configure Oracle Grid Infrastructure for a Cluster ... succeeded [root@redhat2 11.2.0.4]#
是oracle 的bug可跳过。
七、手动挂载原有asm磁盘组
[root@redhat1 11.2.0.4]# su - grid [grid@redhat1 ~]$ id uid=1001(grid) gid=1001(oinstall) 组=1001(oinstall),1002(asmadmin),1003(asmdba),1005(dba) [grid@redhat1 ~]$ [grid@redhat1 ~]$ [grid@redhat1 ~]$ sqlplus "/as sysasm" SQL*Plus: Release 11.2.0.4.0 Production on Sun Sep 18 16:53:58 2016 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - Production With the Real Application Clusters and Automatic Storage Management options SQL> alter diskgroup datadg mount; Diskgroup altered. SQL> alter diskgroup fradg mount; Diskgroup altered. SQL> [root@redhat2 11.2.0.4]# su - grid [grid@redhat2 ~]$ [grid@redhat2 ~]$ [grid@redhat2 ~]$ [grid@redhat2 ~]$ sqlplus "/as sysasm" SQL*Plus: Release 11.2.0.4.0 Production on Sun Sep 18 16:57:45 2016 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - Production With the Real Application Clusters and Automatic Storage Management options SQL> alter diskgroup datadg mount; Diskgroup altered. SQL> alter diskgroup fradg mount; Diskgroup altered. SQL> SQL>
八、查看修改后的集群名称
[grid@redhat1 ~]$ olsnodes -c rh-cluster [grid@redhat1 ~]$ [grid@redhat2 ~]$ olsnodes -c rh-cluster [grid@redhat2 ~]$
经检查 集群名称修改完成。
九、添加数据库实例
9.1 原始的数据库属性
[grid@redhat1 ~]$ srvctl config database -d redhat; 数据库唯一名称: redhat 数据库名: Oracle 主目录: /oracle/app/oracle/product/11.2.0/dbhome_1 Oracle 用户: oracle Spfile: +DATADG/redhat/spfileredhat.ora 域: 启动选项: open 停止选项: immediate 数据库角色: PRIMARY 管理策略: AUTOMATIC 服务器池: redhat 数据库实例: 磁盘组: DATADG,FRADG 装载点路径: 服务: redhat_00 类型: RACOneNode 联机重新定位超时: 30 实例名前缀: redhat 候选服务器: redhat1,redhat2 数据库是管理员管理的
9.2 根据原始数据库属性确定的添加实例语句
srvctl add database -d redhat -o /oracle/app/oracle/product/11.2.0/dbhome_1 -c RACOneNode -p +DATADG/redhat/spfileredhat.ora -e redhat1,redhat2 -w 30
参考:srvctl add database -h 将数据库配置添加到 Oracle Clusterware。 用法: srvctl add database -d <db_unique_name> -o <oracle_home> [-c {RACONENODE | RAC | SINGLE} [-e <server_list>] [-i <inst_name>] [-w <timeout>]]
[-m <domain_name>] [-p <spfile>] [-r {PRIMARY | PHYSICAL_STANDBY | LOGICAL_STANDBY | SNAPSHOT_STANDBY}]
[-s <start_options>] [-t <stop_options>] [-n <db_name>] [-y {AUTOMATIC | MANUAL | NORESTART}] [-g \"<serverpool_list>\"] [-x <node_name>] [-a \"<diskgroup_list>\"] [-j \"<acfs_path_list>\"]
-d <db_unique_name> 数据库的唯一名称 -o <oracle_home> ORACLE_HOME 路径 -c <type> 数据库的类型: RAC One Node, RAC 或单实例 -e <server_list> RAC One Node 数据库的候选服务器列表 -i <inst_name> 管理员管理的 RAC One Node 数据库的实例名前缀 (默认值为 <db_unique_name> 的前 12 个字符) -w <timeout> 联机重新定位超时 (分钟) -x <node_name> 节点名。为单实例数据库指定 -x 选项 -m <domain> 数据库的域。如果数据库设置了 DB_DOMAIN, 则必须设置此项。 -p <spfile> 服务器参数文件路径 -r <role> 数据库的角色 (primary, physical_standby, logical_standby, snapshot_standby) -s <start_options> 数据库启动选项。启动选项的示例包括 OPEN, MOUNT 或 'READ ONLY'。 -t <stop_options> 数据库停止选项。关闭选项的示例包括 NORMAL, TRANSACTIONAL, IMMEDIATE 或 ABORT。 -n <db_name> 数据库名 (DB_NAME), 如果该名称不同于由 -d 选项提供的唯一名称 -y <dbpolicy> 数据库的管理策略 (AUTOMATIC, MANUAL 或 NORESTART) -g "<serverpool_list>" 逗号分隔的数据库服务器池名称列表 -a "<diskgroup_list>" 逗号分隔的磁盘组列表 -j "<acfs_path_list>" 将设置数据库相关性的 ACFS 路径的逗号分隔列表 -h 输出用法
9.3 启动数据库
[root@redhat1 11.2.0.4]# su - oracle [oracle@redhat1 ~]$ export ORACLE_SID=redhat_1 [oracle@redhat1 ~]$ sqlplus "/as sysdba" SQL*Plus: Release 11.2.0.4.0 Production on Sun Sep 18 17:06:21 2016 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to an idle instance. SQL> startup ORACLE instance started. Total System Global Area 782573568 bytes Fixed Size 1367480 bytes Variable Size 574620232 bytes Database Buffers 201326592 bytes Redo Buffers 5259264 bytes Database mounted. Database opened. SQL>
9.4 重建监听(略)、添加服务
[oracle@redhat1 ~]$ srvctl add service -d redhat -s redhat_00; [oracle@redhat1 ~]$ srvctl start service -d redhat -s redhat_00; [oracle@redhat1 ~]$
后续可能会有监听配置,不同的生产环境配置有所不同,请按实际情况作调整。
9.5 查看集群状态
[grid@redhat1 ~]$ crsctl status res -t -------------------------------------------------------------------------------- NAME TARGET STATE SERVER STATE_DETAILS -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.DATADG.dg ONLINE ONLINE redhat1 ONLINE ONLINE redhat2 ora.FRADG.dg ONLINE ONLINE redhat1 ONLINE ONLINE redhat2 ora.LISTENER.lsnr ONLINE ONLINE redhat1 ONLINE ONLINE redhat2 ora.OCRDG.dg ONLINE ONLINE redhat1 ONLINE ONLINE redhat2 ora.asm ONLINE ONLINE redhat1 Started ONLINE ONLINE redhat2 Started ora.gsd OFFLINE OFFLINE redhat1 OFFLINE OFFLINE redhat2 ora.net1.network ONLINE ONLINE redhat1 ONLINE ONLINE redhat2 ora.ons ONLINE ONLINE redhat1 ONLINE ONLINE redhat2 -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE redhat1 ora.cvu 1 ONLINE ONLINE redhat1 ora.oc4j 1 ONLINE ONLINE redhat1 ora.redhat.db 1 ONLINE ONLINE redhat1 Open ora.redhat.redhat_00.svc 1 ONLINE ONLINE redhat1 ora.redhat1.vip 1 ONLINE ONLINE redhat1 ora.redhat2.vip 1 ONLINE ONLINE redhat2 ora.scan1.vip 1 ONLINE ONLINE redhat1
十、补充 RAC添加实例的方法
10.1 oracle RAC 数据库属性
db1:/home/oracle$ srvctl config database -d aixdb Database unique name: aixdb Database name: aixdb Oracle home: /oracle/app/oracle/product/11.2.0/dbhome_1 Oracle user: oracle Spfile: +DATADG/aixdb/spfileaixdb.ora Domain: Start options: open Stop options: immediate Database role: PRIMARY Management policy: AUTOMATIC Server pools: aixdb Database instances: aixdb1,aixdb2 Disk Groups: DATADG,FRADG Mount point paths: Services: Type: RAC Database is administrator managed
10.2 添加实例
db1:/home/oracle$ id uid=2000(oracle) gid=2000(oinstall) groups=2100(dba),2300(asmdba) db1:/home/oracle$ db1:/home/oracle$ srvctl add database -d aixdb -o /oracle/app/oracle/product/11.2.0/dbhome_1 -c RAC -p +DATADG/aixdb/spfileaixdb.ora -y AUTOMATIC db1:/home/oracle$ srvctl add instance -d aixdb -i aixdb1 -n db1 db1:/home/oracle$ srvctl add instance -d aixdb -i aixdb2 -n db2 db1:/home/oracle$ db1:/home/oracle$ srvctl status database -d aixdb Instance aixdb1 is not running on node db1 Instance aixdb2 is not running on node db2 db1:/home/oracle$ db1:/home/oracle$ srvctl start db -d aixdb db1:/home/oracle$ db1:/home/oracle$ srvctl status database -d aixdb Instance aixdb1 is running on node db1 Instance aixdb2 is running on node db2 db1:/home/oracle$
10.3 集群状态
db1:/home/oracle$ db1:/home/oracle$ crsctl status res -t -------------------------------------------------------------------------------- NAME TARGET STATE SERVER STATE_DETAILS -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.DATADG.dg ONLINE ONLINE db1 ONLINE ONLINE db2 ora.FRADG.dg ONLINE ONLINE db1 ONLINE ONLINE db2 ora.LISTENER.lsnr ONLINE ONLINE db1 ONLINE ONLINE db2 ora.OCRDG.dg ONLINE ONLINE db1 ONLINE ONLINE db2 ora.asm ONLINE ONLINE db1 Started ONLINE ONLINE db2 Started ora.gsd OFFLINE OFFLINE db1 OFFLINE OFFLINE db2 ora.net1.network ONLINE ONLINE db1 ONLINE ONLINE db2 ora.ons ONLINE ONLINE db1 ONLINE ONLINE db2 ora.registry.acfs ONLINE ONLINE db1 ONLINE ONLINE db2 -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE db1 ora.cvu 1 ONLINE ONLINE db1 ora.db1.vip 1 ONLINE ONLINE db1 ora.db2.vip 1 ONLINE ONLINE db2 ora.aixdb.db 1 ONLINE ONLINE db1 Open 2 ONLINE ONLINE db2 Open ora.oc4j 1 ONLINE ONLINE db1 ora.scan1.vip 1 ONLINE ONLINE db1 db1:/home/oracle$
如果之前有手工创建的服务,需重建。
十一、参考mos文档
1、How to Deconfigure/Reconfigure(Rebuild OCR) or Deinstall Grid Infrastructure (Doc ID 1377349.1) 2、How to change the cluster name in RAC (Doc ID 1967916.1) 3、How to backup a Grid Infrastructure installation (Doc ID 1482803.1)