oracle srvctl命令,用srvctl命令配置service

oracle srvctl命令,用srvctl命令配置service.用srvctl命令配置service除了用DBCA图形方式,还可以使用命令方式配置service,这种方法对于维护远程尤其有用。无论是创建还是维护都是用一个命令srvctl,先看一下srvctl命令和service相关的语法,如下:创建service[oracle@felix1~]$srvctladdservi.用srvctl命令配置service除了用DBCA图形方式,还可以使用…

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

Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺

5268f80b9b1e01f982625ef6fac83ca1.png

.用srvctl命令配置service 除了用DBCA图形方式,还可以使用命令方式配置service,这种方法对于维护远程尤其有用。无论是创建还是维护都是用一个命令srvctl,先看一下srvctl命令和service相关的语法,如下: 创建service [oracle@felix1 ~]$ srvctl add servi

.用srvctl命令配置service

除了用DBCA图形方式,还可以使用命令方式配置service,这种方法对于维护远程尤其有用。无论是创建还是维护都是用一个命令srvctl,先看一下srvctl命令和service相关的语法,如下:

创建service

[oracle@felix1 ~]$ srvctl add service -h

Usage: srvctl add service -d -s-r “” [-a””] [-P ]

-dUnique name forthe database

-sService name

-r”” List ofpreferred instances

-a”” List ofavailable instances

-PTAF policy (NONE,BASIC, or PRECONNECT)

Usage: srvctl add service -d -s-u {-r “” | -a””}

-dUnique name forthe database

-sService name

-u Add a new instance to serviceconfiguration

-rName of newpreferred instance

-aName of new available instance

-h Print usage

[oracle@felix1 ~]$

示例如下:

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

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

[oracle@felix1~]$

查看service配置

[oracle@felix1 ~]$ srvctl config service -d felix-a

taf_server PREF: felix1 AVAIL: felix2 TAF: basic

taf_srvctl PREF: felix2 AVAIL: felix1 TAF: BASIC

[oracle@felix1 ~]$

[oracle@felix1 ~]$ srvctl config service -d felix-h

Usage: srvctl config service -d [-s] [-a] [-S ]

-dUnique name forthe database

-sService name

-a Additional attributes

-SAdditionalinformation for EM Console

-h Print usage

[oracle@felix1 ~]$

如果不指定“-s service_name”,就会显示所有的service配置,这些配置只包括preferred和avilable instance。使用-a选项,还会显示TAF的信息。

是否自动运行

数据库启动时,会自动启动所有的service。有时为了维护的需要,需要禁用这个特性。在维护完成之后再启动这个特性。

[oracle@felix1 ~]$ srvctl disable service -h

Usage: srvctl disable service -d -s”” [-i ]

-dUnique name forthe database

-s”” Commaseparated service names

-iInstance name

-h Print usage

[oracle@felix1 ~]$

[oracle@felix1 ~]$ srvctl disable service -d felix-s taf_server -i felix1

[oracle@felix1 ~]$ 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

[oracle@felix1 ~]$

[oracle@felix1 ~]$ srvctl disable service -d felix-s taf_server

PRKP-1024 : The service taf_server is stillrunning.

关闭服务service并diable:

[oracle@felix1 ~]$ srvctl stop service -h

Usage: srvctl stop service -d [-s”” [-i ]] [-f]

-dUnique name forthe database

-s”” Commaseparated service names

-iInstance name

-f Disconnect all sessionsduring stop or relocate service operations

-h Print usage

[oracle@felix1 ~]$ srvctl stop service -d felix -staf_server

[oracle@felix1 ~]$ srvctl config service -d felix-a

taf_server PREF: felix1 AVAIL: felix2 TAF: basic

taf_srvctl PREF: felix2 AVAIL: felix1 TAF: BASIC

[oracle@felix1 ~]$ srvctl disable service -d felix-s taf_server

[oracle@felix1 ~]$ 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

[oracle@felix1 ~]$

启动service

[oracle@felix1 ~]$ srvctl start service -h

Usage: srvctl start service -d [-s”” [-i ]] [-o]

-dUnique name forthe database

-s”” Commaseparated service names

-iInstance name

-oOptions to startupcommand (e.g. open, mount, or nomount)

-h Print usage

[oracle@felix1 ~]$

[oracle@felix1 ~]$ srvctl start service -d felix -s taf_server

[oracle@felix1 ~]$

查看service状态。

[oracle@felix1 ~]$ srvctl status service -h

Usage: srvctl status service -d [-s””] [-f] [-v] [-S ]

-dUnique name forthe database

-s”” Commaseparated service names

-f Include disabled applications

-v Verbose output

-SAdditionalinformation for EM Console

-h Print usage

[oracle@felix1 ~]$

[oracle@felix1 ~]$ srvctl status service -d felix -s taf_server -f -v

Service taf_server is running on instance(s)felix2

[oracle@felix1 ~]$ 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}

[oracle@felix1 ~]$

删除service。

[oracle@felix1 ~]$ srvctl remove service -h

Usage: srvctl remove service -d -s[-i ] [-f]

-dUnique name forthe database

-sService name

-iInstance name

-f Force remove

-h Print usage

[oracle@felix1 ~]$

[oracle@felix1 ~]$ srvctl status service -d felix

Service taf_server is running oninstance(s) felix1

Service taf_srvctl is not running.

[oracle@felix1 ~]$ 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.

[oracle@felix1 ~]$

[oracle@felix1 ~]$ 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.

[oracle@felix1 ~]$ srvctl config service -d felix -a

taf_server PREF: felix1 AVAIL: felix2 TAF: basic

taf_srvctl PREF: felix2 AVAIL: felix1 TAF: BASIC

[oracle@felix1 ~]$

[oracle@felix1 ~]$ srvctl remove service -d felix -staf_srvctl -f

[oracle@felix1 ~]$ srvctl config service -d felix -a

taf_server PREF: felix1 AVAIL: felix2 TAF: basic

[oracle@felix1 ~]$ srvctl remove service -d felix-s taf_server -f

PRKP-1024: The service taf_server is still running.

[oracle@felix1 ~]$ srvctl stop service -d felix -staf_server

[oracle@felix1 ~]$ srvctl remove service -d felix-s taf_server -f

[oracle@felix1 ~]$ srvctl config service -d felix -a

[oracle@felix1 ~]$

修改服务

[oracle@felix1 ~]$ srvctl modify service -h

Usage: srvctl modify service -d -s-i -t [-f]

-dUnique name forthe database

-sService name

-iOld instance name

-tNew instance name

-f Disconnect all sessionsduring stop or relocate service operations

Usage: srvctl modify service -d -s-i -r [-f]

-dUnique name forthe database

-sService name

-iInstance name

-r Upgrade instance to preferred

-f Disconnect all sessionsduring stop or relocate service operations

Usage: srvctl modify service -d -s-n -i [-a ][-f]

-dUnique name forthe database

-sService name

-n Modify service configuration

-r “” List of preferred instances

-a”” List ofavailable instances

-f Disconnect all sessionsduring stop or relocate service operations

Usage: srvctl modify service -d -s-P [-f]

-dUnique name forthe database

-sService name

-PTAF policy (NONE,BASIC, or PRECONNECT)

-f Disconnect all sessionsduring stop or relocate service operations

-h Print usage

[oracle@felix1 ~]$

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

[oracle@felix2 ~]$ srvctl config service -d felix -a

taf_srvctlPREF: felix1 felix2 AVAIL: TAF: basic

[oracle@felix2 ~]$

【参考大话RAC–张晓明】

1428d0e076c3959ab11d28a39bc84fab.png

5268f80b9b1e01f982625ef6fac83ca1.png

本条技术文章来源于互联网,如果无意侵犯您的权益请点击此处反馈版权投诉

本文系统来源:php中文网

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

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

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

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

(0)


相关推荐

发表回复

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

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