.用srvctl命令配置service

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

创建service

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

[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 <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

[oracle@felix1 ~]$

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

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

是否自己主动执行

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

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

[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 <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

[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 <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

[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 <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

[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 <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

[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 <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

[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--张晓明】

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

  1. 对Oracle10g rac srvctl命令使用理解

    srvctl命令是RAC维护中最常用到的命令,也最为复杂,使用这个命令可以操作CRS上的Database,Instance,ASM,Service.Listener和Node Application资 ...

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

    Oracle Clusterware提供了丰富的工具,我们把常用的工具按照rac的四层机构做了划分,然后分别介绍: 节点层: olsnodes 参数-n -i -p 网络层: oifcfg 四个子命令 ...

  3. Srvctl命令具体解释(10g)

    版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/lovedieya/article/details/28169481 Srvctl命令   Srvct ...

  4. srvctl 命令

    SRVCTL命令可以控制RAC数据库中的instance,listener以及services.通常SRVCTL在ORACLE用户下执行.下面我们来介绍srvctl命令.1.通过SRVCTL命令来st ...

  5. oracle srvctl 命令

    SRVCTL命令可以控制RAC数据库中的instance,listener以及services. 通常SRVCTL在ORACLE用户下执行.下面我们来介绍srvctl命令. 1.通过SRVCTL命令来 ...

  6. [置顶] Oracle 11g R2 RAC:使用 srvctl 工具管理 service 资源

    1.使用 srvctl 工具创建 service 资源 srvctl add service -d db_unique_name -s service_name {-r "preferred ...

  7. Centos7下的systemctl命令与service和chkconfig

    博主使用的操作系统是最新的CentOS 7,所以可能和网上一些老的博文有一定出入,那是因为版本更新的原因. 这里写图片描述1 service service命令用于对系统服务进行管理,比如启动(sta ...

  8. linux常用命令:service 命令

    service命令用于对系统服务进行管理,比如启动(start).停止(stop).重启(restart).查看状态(status)等.相关的命令还包括chkconfig.ntsysv等,chkcon ...

  9. centos MySQL主从配置 ntsysv chkconfig setup命令 配置MySQL 主从 子shell MySQL备份 kill命令 pid文件 discuz!论坛数据库读写分离 双主搭建 mysql.history 第二十九节课

    centos  MySQL主从配置 ntsysv   chkconfig  setup命令  配置MySQL 主从 子shell  MySQL备份  kill命令  pid文件  discuz!论坛数 ...

随机推荐

  1. %( $# > 1 %? if (tid() in trace) %) 是什么意思

    http://blog.csdn.net/sunnybeike/article/details/7769663 http://blog.163.com/digoal@126/blog/static/1 ...

  2. arcgis runtime 100 Create geometries

    1 /* Copyright 2016 EsriEsri 2 * 3 * Licensed under the Apache License, Version 2.0 (the "Licen ...

  3. 通过微软的HTML Help Workshop 利用.html文件 生成简单的chm帮助类的文件

    1.下载并安装Microsoft HTML Help Workshop 下载链接:http://www.microsoft.com/en-us/download/details.aspx?id=211 ...

  4. 在oracle中查询已知表名的表中所有字段名,每个字段是否是主键,是否是外键,是否为空的sql语句

    查询表的所有列及其属性:select t.*,c.COMMENTS from user_tab_columns t,user_col_comments c where t.table_name = c ...

  5. strncpy实现

    #include<stdio.h> char *my_strncpy(char *dest,char *src,int n) { int i; ;i<n && src ...

  6. Handler Thread 内部类引起内存泄露分析

    非静态内部类引起内存泄漏的原因 内部类的实现其实是通过编译器的语法糖(Syntactic sugar)实现的,通过生成相应的子类即以OutClassName$InteriorClassName命名的C ...

  7. windows10(64位)Anaconda3+Python3.6搭建Tensorflow(cpu版本)及keras

    转自:windows10(64位)Anaconda3+Python3.6搭建Tensorflow(cpu版本)及keras 1.本来电脑安装的是anaconda3 5.3.1,但安装的python版本 ...

  8. 一直出现 Enter passphrase for key '/root/.ssh/gitkey12.pub'

    案例: 我一下没有设置密码的pub key, 一使用就要求: Enter passphrase for key '/root/.ssh/gitkey12.pub',   原因:本该设置私钥的地方,设置 ...

  9. (转)Unity3d UnityEditor编辑器定制和开发插件

    在阅读本教程之前,你需要对Unity的操作流程有一些基础的认识,并且最好了解内置的GUI系统如何使用. 如何让编辑器运行你的代码 Unity3D可以通过事件触发来执行你的编辑器代码,但是我们需要一些编 ...

  10. 在Foreda8上试安装Apchehttpd-2.4.6.tar.gz

    下文是我边试边做的记录,不保证内容的完整性和正确性. 由于我的Apsire机器是最简安装Foreda8,所以需要安装httpd,熟悉一遍也是很好的嘛. 我从网上搜罗并下载了apchehttpd-2.4 ...