srvctl start_执行命令ls>c

srvctl start_执行命令ls>c==查看数据库信息srvctlconfigdatabase-dorcl-a==数据库随CRS启动而启动srvctlenabledatabase-dorcl==禁止服务在某个实例上运行srvctldisableservice-dorcl-sservicename-iorcl1srvctlconfigservic

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺
==查看数据库信息

srvctl config database -d orcl -a

==数据库随CRS启动而启动

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来启动/关闭数据,这样可以保证及时更新crs中的信息

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 1

SCAN 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 start database -d orcl

[root@juliaz3 ~]# srvctl stop database -d orcl -o immediate

[root@juliaz3 ~]# srvctl start database -d orcl -o mount

[root@juliaz3 ~]# srvctl status database -d orcl

Instance orcl1 is running on node juliaz2

Instance orcl2 is running on node juliaz3

[root@juliaz3 ~]# srvctl start database -d orcl -o open   /*在已经mount的时候不能进一步open了,功能不够强大啊

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

oracle RAC实战指南刘宪军–不错的一本书

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/194754.html原文链接:https://javaforall.cn

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)


相关推荐

发表回复

您的电子邮箱地址不会被公开。

关注全栈程序员社区公众号