用srvctl命令配置service

.用srvctl命令配置service

除了用DBCA图形方式,还能够使用命令方式配置service,这样的方法对于维护远程尤事实上用。不管是创建还是维护都是用一个命令srvctl,先看一下srvctl命令和service相关的语法。例如以下:

创建service

[[email protected] ~]$ srvctl add service -h

Usage: srvctl add service -d <name> -s<service_name> -r "<preferred_list>" [-a"<available_list>"] [-P <TAF_policy>]

-d<name>           Unique name forthe database

-s<service>        Service name

-r"<pref_list>"    List ofpreferred instances

-a"<avail_list>"   List ofavailable instances

-P<TAF_policy>     TAF policy (NONE,BASIC, or PRECONNECT)

Usage: srvctl add service -d <name> -s<service_name> -u {-r "<new_pref_inst>" | -a"<new_avail_inst>"}

-d<name>           Unique name forthe database

-s<service>        Service name

-u                  Add a new instance to serviceconfiguration

-r<new_pref_inst>  Name of newpreferred instance

-a<new_avail_inst> Name of new available instance

-h                  Print usage

[[email protected] ~]$

示比例如以下:

Felix1。felix2为实例名。Felix是数据库名;策略是:BASIC

[[email protected]~]$ srvctl add service -d felix -s taf_srvctl -r felix2 -a felix1 -P BASIC

[[email protected]~]$

查看service配置

[[email protected] ~]$ srvctl config service -d felix-a

taf_server PREF: felix1 AVAIL: felix2 TAF: basic

taf_srvctl PREF: felix2 AVAIL: felix1 TAF: BASIC

[[email protected] ~]$

[[email protected] ~]$ srvctl config service -d felix-h

Usage: srvctl config service -d <name> [-s<service_name>] [-a] [-S <level>]

-d<name>           Unique name forthe database

-s<service>        Service name

-a                  Additional attributes

-S<level>          Additionalinformation for EM Console

-h                  Print usage

[[email protected] ~]$

假设不指定“-s service_name”,就会显示全部的service配置。这些配置仅仅包含preferred和avilable instance。

使用-a选项,还会显示TAF的信息。

是否自己主动执行

数据库启动时,会自己主动启动全部的service。有时为了维护的须要,须要禁用这个特性。在维护完毕之后再启动这个特性。

[[email protected] ~]$ srvctl disable service -h

Usage: srvctl disable service -d <name> -s"<service_name_list>" [-i <inst_name>]

-d<name>           Unique name forthe database

-s"<serv,...>"     Commaseparated service names

-i<inst>           Instance name

-h                  Print usage

[[email protected] ~]$

[[email protected] ~]$ srvctl disable service -d felix-s taf_server -i felix1

[[email protected] ~]$ srvctl config service -d felix-a

taf_server PREF: felix1 AVAIL: felix2 TAF: basic

Service taf_server is disabled on instance(s) felix1.

taf_srvctl PREF: felix2 AVAIL: felix1 TAF: BASIC

[[email protected] ~]$

[[email protected] ~]$ srvctl disable service -d felix-s taf_server

PRKP-1024 : The service taf_server is stillrunning.

关闭服务service并diable:

[[email protected] ~]$ srvctl stop service -h

Usage: srvctl stop service -d <name> [-s"<service_name_list>" [-i <inst_name>]] [-f]

-d<name>           Unique name forthe database

-s"<serv,...>"     Commaseparated service names

-i<inst>           Instance name

-f                  Disconnect all sessionsduring stop or relocate service operations

-h                  Print usage

[[email protected] ~]$ srvctl stop service  -d felix -staf_server

[[email protected] ~]$ srvctl config service -d felix-a

taf_server PREF: felix1 AVAIL: felix2 TAF: basic

taf_srvctl PREF: felix2 AVAIL: felix1 TAF: BASIC

[[email protected] ~]$ srvctl disable service -d felix-s taf_server

[[email protected] ~]$ srvctl config service -d felix-a

taf_server PREF: felix1 AVAIL: felix2 TAF: basic

Service taf_server is disabled.

taf_srvctl PREF: felix2 AVAIL: felix1 TAF: BASIC

[[email protected] ~]$

启动service

[[email protected] ~]$ srvctl start service  -h

Usage: srvctl start service -d <name> [-s"<service_name_list>" [-i <inst_name>]] [-o<start_options>]

-d<name>           Unique name forthe database

-s"<serv,...>"     Commaseparated service names

-i<inst>           Instance name

-o<start_options>  Options to startupcommand (e.g. open, mount, or nomount)

-h                  Print usage

[[email protected] ~]$

[[email protected] ~]$ srvctl start service  -d felix -s taf_server

[[email protected] ~]$

查看service状态。

[[email protected] ~]$ srvctl status  service -h

Usage: srvctl status service -d <name> [-s"<service_name_list>"] [-f] [-v] [-S <level>]

-d<name>           Unique name forthe database

-s"<serv,...>"     Commaseparated service names

-f                  Include disabled applications

-v                  Verbose output

-S<level>          Additionalinformation for EM Console

-h                  Print usage

[[email protected] ~]$

[[email protected] ~]$ srvctl status  service -d felix -s taf_server -f -v

Service taf_server is running on instance(s)felix2

[[email protected] ~]$ srvctl status  service -d felix -s taf_server -f -v -S 3

#@=info: operation={status} config={full}ver={10.2.0.0.0}

#@=service[0]: name={taf_server} enabled={true}pref={felix1} avail={felix2} disabled_insts={felix1} tafpolicy={basic}type={user}

#@=service[1]: name={felix} enabled={true}pref={felix1, felix2} avail={} disabled_insts={} tafpolicy={NONE}type={internal}

Service taf_server is running on instance(s)felix2

#@=result[0]: up={felix2} down={felix1}disabled={felix1} unknown={}

#@=result[1]: up={felix1, felix2} down={}disabled={} unknown={}

#@=done: status={0}

[[email protected] ~]$

删除service。

[[email protected] ~]$ srvctl remove service -h

Usage: srvctl remove service -d <name> -s<service_name> [-i <inst_name>] [-f]

-d<name>           Unique name forthe database

-s<service>        Service name

-i<inst>           Instance name

-f                  Force remove

-h                  Print usage

[[email protected] ~]$

[[email protected] ~]$ srvctl status service -d felix

Service taf_server is running oninstance(s) felix1

Service taf_srvctl is not running.

[[email protected] ~]$ srvctl remove service -d felix-s taf_server -i felix1

taf_server PREF: felix1 AVAIL: felix2

Remove service taf_server from the instancefelix1?

(y/[n]) y

PRKP-1024 : The service taf_server is still running.

[[email protected] ~]$

[[email protected] ~]$ srvctl remove service -d felix-s taf_srvctl -i felix1

taf_srvctl PREF: felix2 AVAIL: felix1

Remove service taf_srvctl from the instancefelix1? (y/[n]) y

PRKP-1067 : Instance felix1 is the last availableinstance for service taf_srvctl. Try modify service instead.

[[email protected] ~]$ srvctl config  service -d felix -a

taf_server PREF: felix1 AVAIL: felix2 TAF: basic

taf_srvctl PREF: felix2 AVAIL: felix1 TAF: BASIC

[[email protected] ~]$

[[email protected] ~]$ srvctl remove service -d felix -staf_srvctl  -f

[[email protected] ~]$ srvctl config  service -d felix -a

taf_server PREF: felix1 AVAIL: felix2 TAF: basic

[[email protected] ~]$ srvctl remove service -d felix-s taf_server  -f

PRKP-1024: The service taf_server is still running.

[[email protected] ~]$ srvctl stop service -d felix -staf_server 

[[email protected] ~]$ srvctl remove service -d felix-s taf_server  -f

[[email protected] ~]$ srvctl config  service -d felix -a

[[email protected] ~]$

改动服务

[[email protected] ~]$ srvctl modify service -h

Usage: srvctl modify service -d <name> -s<service_name> -i <old_inst_name> -t <new_inst_name> [-f]

-d<name>           Unique name forthe database

-s<service>        Service name

-i<old_inst>       Old instance name

-t<new_inst>       New instance name

-f                  Disconnect all sessionsduring stop or relocate service operations

Usage: srvctl modify service -d <name> -s<service_name> -i <avail_inst_name> -r [-f]

-d<name>           Unique name forthe database

-s<service>        Service name

-i<inst>           Instance name

-r                  Upgrade instance to preferred

-f                  Disconnect all sessionsduring stop or relocate service operations

Usage: srvctl modify service -d <name> -s<service_name> -n -i <prefered_inst> [-a <available_list>][-f]

-d<name>           Unique name forthe database

-s<service>        Service name

-n                  Modify service configuration

-r "<pref_list>"    List of preferred instances

-a"<avail_list>"   List ofavailable instances

-f                  Disconnect all sessionsduring stop or relocate service operations

Usage: srvctl modify service -d <name> -s<service_name> -P <TAF_policy> [-f]

-d<name>           Unique name forthe database

-s<service>        Service name

-P<TAF_policy>     TAF policy (NONE,BASIC, or PRECONNECT)

-f                  Disconnect all sessionsduring stop or relocate service operations

-h                  Print usage

[[email protected] ~]$

[[email protected] ~]$ srvctl modify service -d felix-s taf_srvctl -n -i felix1,felix2 -f

[[email protected] ~]$ srvctl config  service -d felix  -a

taf_srvctlPREF: felix1 felix2 AVAIL:  TAF: basic

[[email protected] ~]$

【參考大话RAC--张晓明】

时间: 2024-10-02 19:44:52

用srvctl命令配置service的相关文章

RAC6——crsctl 和 srvctl 命令的区别理解

Oracle Clusterware提供了丰富的工具,我们把常用的工具按照rac的四层机构做了划分,然后分别介绍: 节点层: olsnodes 参数-n -i -p 网络层: oifcfg 四个子命令可以通过oifcfg -help查看下 iflist 显示网口列表 getif 可以获得单个网口信息 setif 配置单个网口 delif 删除网口 集群层: crstcl .orccheck .ocrdump.ocrconfig 应用层: srvctl .onsctl.crs_stat ----=

对Oracle10g rac srvctl命令使用理解

srvctl命令是RAC维护中最常用到的命令,也最为复杂,使用这个命令可以操作CRS上的Database,Instance,ASM,Service.Listener和Node Application资源,其中Node Application资源又包括了GSD.ONS.VIP.这些资源还有独立的管理工具,比如ONS可以使用onsctl命令进行管理:  http://www.cnblogs.com/myrunning/p/4265522.htmllistener还可以通过lsnrctl命令进行管理:

oracle srvctl 命令

SRVCTL命令可以控制RAC数据库中的instance,listener以及services. 通常SRVCTL在ORACLE用户下执行.下面我们来介绍srvctl命令. 1.通过SRVCTL命令来start/stop/check所有的实例:$ srvctl start|stop|status database -d 2.start/stop指定的实例: $ srvctl start|stop|status instance -d -i 3.列出当前RAC下所有数据库 $ srvctl con

srvctl 命令

SRVCTL命令可以控制RAC数据库中的instance,listener以及services.通常SRVCTL在ORACLE用户下执行.下面我们来介绍srvctl命令.1.通过SRVCTL命令来start/stop/check所有的实例:$ srvctl start|stop|status database -d <db_name>2.start/stop指定的实例:$ srvctl start|stop|status instance -d <db_name> -i <i

思科命令配置小技巧三:alias 命令

大家都用过手机上的快捷拨号设置 思科设备是否支持命令的快捷键定义呢 答案是肯定的 suzhouxiaoniu(config)#alias exec xx show ip inter bri  xx是自定义的快捷键名称,可以是数字 suzhouxiaoniu#xx 直接敲定义好的名称Interface                  IP-Address      OK? Method Status                ProtocolFastEthernet1/0          

思科命令配置小技巧四:用ACL控制debug 输出

使用debug命令可以帮助我们TS,但是使用debug命令往往会输出一大堆信息,很多是我们不需要用的,也会造成CPU高负荷,这种情况下我们可以限制debug的输出 可以应用ACL到debug以限定仅输出要求的debug信息. 如仅查看从1.1.1.1到1.1.1.2的ICMP包: Router(config)# access-list 100 permit icmp host 1.1.1.1 host 1.1.1.2 Router# debug ip packet detail 100 思科命令

ifcfg系列命令配置网络属性

Linux网络属性配置: 将linux接到网络中的方式: 1. 本地通信:配置IP/NATMASK 2.跨网络通信:配置路由(网关) 3.基于主机名通信:配置DNS服务器地址(域名解析),linux可以配置3个DNS指向 Linux配置网络的方式: 静态指定 动态指定 1.静态指定 指定命令 配置有关网络的配置文件 (1)指定命令,只对当前系统有效 ifcfg家族 iproute2家族 在CentOS7上新增的nm(network Manager)家族 DNS服务器的配置文件位置:/etc/re

思科命令配置小技巧一:rang命令

在交换机的配置中,经常会对一组端口进行相同的操作,为简化配置,提高设备性能 可以在配置中使用range命令: suzhouxiaoniu(config)#inter range fa1/1-10  对10个连续的端口同时进行操作suzhouxiaoniu(config-if-range)#swi mo accsuzhouxiaoniu(config-if-range)#swi acc vlan 2 suzhouxiaoniu(config)#inter range fa1/1 ,fa1/3 ,f

思科命令配置小技巧二:macro命令

在 思科命令配置小技巧一中,我们谈到,使用range命令可以简化我们的配置 但是如果我们经常对一组不连续的端口进行操作 比如 interface-range  fa1/1 ,fa1/3 ,fa1/5 ,fa1/7 ,fa1/11 即使使用range命令也会显得很繁琐 我们总想越简单越好(命令敲再多,工资还是那个数,要是按命令字数算工资多好) 此时交换机的宏命令就派上用场了 suzhouxiaoniu(config)#define interface-range abc fa1/1 ,fa1/3