srvctl config database -d orcl -a
srvctl enable database -d orcl
srvctl disable service -d orcl -s servicename -i orcl1
srvctl config service -d orcl -s servicename -o orcl2
srvctl remove service -d orcl -i orcl1
srvctl start database -d orc
srvctl start database -d orcl -i orcl2 -o nomount/mount
srvctl stop instance -d orcl -i orcl2 -o immediate
[root@juliaz3 ~]# srvctl status scan -i 1SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node juliaz3
[root@juliaz3 ~]#
[root@juliaz3 ~]# srvctl status diskgroup -g sysdb
Disk Group sysdb is running on juliaz2,juliaz3
[root@juliaz3 ~]#
[root@juliaz3 ~]# srvctl stop database -d orcl
[root@juliaz3 ~]# srvctl status database -d orcl
Instance orcl1 is not running on node juliaz2
Instance orcl2 is not running on node juliaz3
[root@juliaz3 ~]# srvctl stop database -d orcl -o immediate
[root@juliaz3 ~]# srvctl status database -d orcl
Instance orcl1 is running on node juliaz2
Instance orcl2 is running on node juliaz3
PRCR-1004 : Resource ora.orcl.db is already running
管理RAC中的网络
当rac集群投入使用以后,如果发现节点的IP地址设置不合理,需要对其进行修改。因为节点的IP地址配置信息都记录在OCR中,所以为了更新IP地址需要更新两个地方:
1.DNS 或/etc/hosts
2.OCR中的信息
以上可以通过srvctl 和oicfg完成
rac中客户端通过VIP 11.2后可以vip或scan访问数据库。在不停止数据库的情况下对vip进行修改。
vip信息
[root@juliaz3 ~]# srvctl config vip -n juliaz2
VIP exists.:juliaz2
VIP exists.: /juliaz2-vip/9.115.17.94/255.255.255.0/eth0
[root@juliaz3 ~]# srvctl config vip -n juliaz3
VIP exists.:juliaz3
VIP exists.: /juliaz3-vip/9.115.17.95/255.255.255.0/eth0
[root@juliaz3 ~]#
修改vip,需要停止数据库service的运行,service也是ocr中的一种资源,它的功能是提高数据库高可能性,在默认情况下,它的名称和数据库名称相同。
停止节点juliaz2上的service
参考书上的命令行不通,可以用srvctl stop service -d orcl -n juliaz2
[root@juliaz3 ~]# srvctl stop service -d orcl -s orcl -n juliaz2
PRCR-1001 : Resource ora.orcl.orcl.svc does not exist
然后需要关闭这个节点上的vip资源。
[root@juliaz3 ~]# srvctl stop vip -n juliaz2
PRCR-1014 : Failed to stop resource ora.juliaz2.vip
PRCR-1065 : Failed to stop resource ora.juliaz2.vip
CRS-2529: Unable to act on 'ora.juliaz2.vip' because that would require stopping or relocating 'ora.LISTENER.lsnr', but the force option was not specified
[root@juliaz3 ~]# srvctl stop vip -n juliaz2 -f
[root@juliaz3 ~]# srvctl status vip -n juliaz2
VIP juliaz2-vip is enabled
VIP juliaz2-vip is not running
确保你要更新的ip已经,添加到DNS或者/etc/hosts文件中。
[root@juliaz3 ~]# srvctl modify nodeapps -n juliaz2 -A 9.115.17.98/255.255.255.0/eth0
[root@juliaz3 ~]# srvctl start vip -n juliaz2
IP修改成功以后,就可以启动这个资源,在启动VIP时,数据库的service资源将一起启动。
[root@juliaz3 ~]# srvctl status vip -n juliaz2
VIP juliaz2-vip is enabled
VIP juliaz2-vip is running on node: juliaz2
网上找来的可以了通过stop nodesapps 来停服务,记得修改/etc/hosts。
[root@juliaz3 ~]# srvctl stop nodeapps -n juliaz2
PRCR-1065 : Failed to stop resource ora.juliaz2.vip
CRS-2529: Unable to act on 'ora.juliaz2.vip' because that would require stopping or relocating 'ora.LISTENER.lsnr', but the force option was not specified
PRCR-1014 : Failed to stop resource ora.net1.network
PRCR-1065 : Failed to stop resource ora.net1.network
CRS-2529: Unable to act on 'ora.net1.network' because that would require stopping or relocating 'ora.juliaz2.vip', but the force option was not specified
[root@juliaz3 ~]# srvctl stop nodeapps -n juliaz2 -f
PRKO-2426 : ONS is already stopped on node(s): juliaz2
PRKO-2427 : eONS is already stopped on node(s): juliaz2
[root@juliaz3 ~]# srvctl status nodeapps
VIP juliaz2-vip is enabled
VIP juliaz2-vip is not running
VIP juliaz3-vip is enabled
VIP juliaz3-vip is running on node: juliaz3
Network is enabled
Network is not running on node: juliaz2
Network is running on node: juliaz3
GSD is disabled
GSD is not running on node: juliaz2
GSD is not running on node: juliaz3
ONS is enabled
ONS daemon is not running on node: juliaz2
ONS daemon is running on node: juliaz3
eONS is enabled
eONS daemon is not running on node: juliaz2
eONS daemon is running on node: juliaz3
[root@juliaz3 ~]# srvctl modify nodeapps -n juliaz2 -A 9.115.17.94/255.255.255.0/eth0
[root@juliaz3 ~]# srvctl start nodeapps -n juliaz2
[root@juliaz3 ~]#
11.2中,scan是oracle推荐使用的ip地址,客户端应用程序通过scan,可以把请求轮流发送到各个节点上。scan代表的是一个整个集群,这个scan可以被映射成一个或者多个ip地址,通过scan可以实现客户端访问负载均衡。 首先要保证scan所对应的名称和ip地址记录在dns中,能够通过nslookup解析。
[root@juliaz3 ~]# srvctl config scan
SCAN name: juliaz-cluster, Network: 1/9.115.17.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /9.115.17.96/9.115.17.96
[root@juliaz3 ~]# srvctl status scan -i 1
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node juliaz3
[root@juliaz3 ~]#
[root@juliaz3 ~]# srvctl stop scan -i 1
PRCR-1065 : Failed to stop resource ora.scan1.vip
CRS-2529: Unable to act on 'ora.scan1.vip' because that would require stopping or relocating 'ora.LISTENER_SCAN1.lsnr', but the force option was not specified
[root@juliaz3 ~]# srvctl stop scan -i 1 -f
[root@juliaz3 ~]# srvctl modify scan -n rac-clusster
PRCS-1016 : Failed to resolve Single Client Access Name rac-clusster
[root@juliaz3 ~]#
/*因为我没有配置dbs,所以命令失败。
修改私有和公共ip地址
[root@juliaz3 ~]# oifcfg getif
eth0 9.115.17.0 global public
eth1 192.168.1.0 global cluster_interconnect
[root@juliaz3 ~]#
暂时到这,。。后续
参考 大话 oracle RAC