---添加服务
su -oracle
srvctl add service -d tyolap -s srv_kfpb2 -r tyolap2 -a tyolap1 -P basic -e select -m basic -z 180 -w 5
---查看服务的状态
srvctl start service -d tyolap -s srv_kfpb1
crsctl status resource -t
crsctl status resource ora.tyolap.srv_kfpb1.svc -t
srvctl status service -d tyolap
srvctl config service -d tyolap -s srv_kfpb1
[grid@dtydb4 ~]$ srvctl config service -d tyolap -s srv_kfpb1
Service name: srv_kfpb1
Service is enabled
Server pool: tyolap_srv_kfpb1
Cardinality: 1
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: false
Failover type: SELECT
Failover method: BASIC
TAF failover retries: 180
TAF failover delay: 5
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: BASIC
Edition:
Preferred instances: tyolap1
Available instances: tyolap2
--删除服务
srvctl remove service -d tyolap -s srv_kfpb2 -f
---查看服务注册情况
[oracle@dtydb3 ~]$ lsnrctl status
--配置客户端的连接tnsnames.ora
srv_kfpb1 =
(DESCRIPTION =
(LOAD_BALANCE = NO)
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.4.1.*)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.4.1.2)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.4.1.3)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.4.1.4)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = srv_kfpb1)
)
)
sqlplus test/test@tydb_kfpb1
本文介绍如何使用srvctl命令在Oracle环境中进行服务的添加、查看状态、配置及删除操作,并展示了具体的命令示例。此外,还提供了如何通过lsnrctl检查服务注册情况的方法以及配置客户端连接tnsnames.ora文件的示例。
625

被折叠的 条评论
为什么被折叠?



