返回顶部
首页 > 资讯 > 数据库 >【12c】Oracle Restart中的SRVCTL命令详解
  • 517
分享到

【12c】Oracle Restart中的SRVCTL命令详解

【12c】OracleRestart中的SRVCTL命令详解 2018-12-23 15:12:02 517人浏览 无得
摘要

SRVCTL,服务控制实用工具(Service Control Utility),可用于对oracle Restart和Oracle RAC

【12c】Oracle Restart中的SRVCTL命令详解

SRVCTL,服务控制实用工具(Service Control Utility),可用于对oracle Restart和Oracle RAC的配置和管理,本篇主要介绍SRVCTL命令在Oracle Restart中的应用,其中,详细介绍config、status命令,并列出其它命令的用法。

1 srvctl命令语法

Usage: srvctl []

commands: enable|disable|start|stop|status|add|remove|modify|update|getenv|setenv|unsetenv|config|upgrade|downgrade

objects: database|service|asm|diskgroup|listener|home|ons

2 config命令

srvctl config命令可以展示特定组件或一组组件的Oracle Restart配置信息。

2.1 srvctl config asm

展示asm实例的Oracle Restart配置信息。

1)语法结构

Usage: srvctl config asm [-all]

2)示例

[grid@sz ~]$ srvctl config asm

ASM home:

PassWord file: +DATA/orapwasm

ASM listener: LISTENER

Spfile: +DATA/ASM/ASMPARAMETERFILE/reGIStry.253.1037659875

ASM diskgroup discovery string: /dev/oracleasm/disks/*

2.2 srvctl config database

展示数据库相关信息。

1)语法结构

Usage: srvctl config database [-db [-all]] [-verbose]

2)示例

[grid@sz ~]$ srvctl config database -db orcl -all

Database unique name: orcl

Database name: orcl

Oracle home: /u01/app/oracle/product/12.1.0/dbhome_1

Oracle user: oracle

Spfile: +DATA/ORCL/PARAMETERFILE/spfile.267.1037831659

Password file:

Domain:

Start options: open

Stop options: immediate

Database role: PRIMARY

Management policy: AUTOMATIC

Disk Groups: FRA,DATA

Services:

Database is enabled

OSDBA group:

OSOPER group:

Database instance: orcl

2.3 srvctl config listener

展示监听器相关信息。

1)语法结构

Usage: srvctl config listener [-listener ]

2)示例

[grid@sz ~]$ srvctl config listener

Name: LISTENER

Type: Database Listener

Home: /u01/app/grid/product/12.1.0/grid

End points: tcp:1521

Listener is enabled.

2.4 srvctl config ons

展示Oracle通知服务信息。

1)语法结构

Usage: srvctl config ons

2)示例

[grid@sz ~]$ srvctl config ons

ONS exists: Local port 6100, remote port 6200, EM port 2016, Uses SSL: false

2.5 srvctl config service

展示服务信息。

1)语法结构

Usage: srvctl config service -db [-service ] [-verbose]

2)示例

[grid@sz ~]$ srvctl config service -db orcl

3 status命令

srvctl status命令用于展示组件对应的运行状态信息。

3.1 srvctl status asm

1)语法结构

Usage: srvctl status asm [-all] [-verbose]

2)示例

[grid@sz ~]$ srvctl status asm -detail

ASM is running on sz

ASM is enabled.

3.2 srvctl status database

1)语法结构

Usage: srvctl status database {-db | -thisversion | -thishome} [-force] [-verbose]

2)示例

[grid@sz ~]$ srvctl status database -db orcl -verbose

Database orcl is running. Instance status: Open.

3.3 srvctl status diskgroup

1)语法结构

Usage: srvctl status diskgroup -diskgroup [-all] [-verbose]

2)示例

[grid@sz ~]$ srvctl status diskgroup -diskgroup DATA -detail

Disk Group DATA is running on sz

Disk Group DATA is enabled

3.4 srvctl status home

展示特定的ORACLE HOME下的所有组件的运行状态。

1)语法结构

Usage: srvctl status home -oraclehome -statefile

2)示例

[grid@sz ~]$ srvctl status home -oraclehome /u01/app/grid/product/12.1.0/grid -statefile /home/grid/grid.txt

Disk Group ora.DATA.dg is running on sz

Disk Group ora.FRA.dg is running on sz

ASM is running on sz

Listener LISTENER is running on node sz

[grid@sz ~]$ cat grid.txt

diskgroup-ora.DATA.dg

diskgroup-ora.FRA.dg

asm-ora.asm

lsnr-LISTENER

3.5 srvctl status listener

1)语法结构

Usage: srvctl status listener [-listener ] [-verbose]

2)示例

[grid@sz ~]$ srvctl status listener

Listener LISTENER is enabled

Listener LISTENER is running on node(s): sz

3.6 srvctl status ons

1)语法结构

Usage: srvctl status ons [-verbose]

2)示例

[grid@sz ~]$ srvctl status ons

ONS is disabled

ONS daemon is not running

3.7 srvctl status service

1)语法结构

Usage: srvctl status service -db [-service ""] [-force] [-verbose]

2)示例

[grid@sz ~]$ srvctl status service -db orcl

4 stop命令

srvctl stop用于停止特定的组件或组件集。

[grid@sz ~]$ srvctl stop -help

 

The SRVCTL stop command stops, Oracle Restart enabled, starting or running objects.

 

Usage: srvctl stop database -db [-stopoption ] [-force]

Usage: srvctl stop service -db [-service ""] [-global_override] [-force] [-verbose]

Usage: srvctl stop asm [-stopoption ] [-force]

Usage: srvctl stop listener [-listener ] [-force]

Usage: srvctl stop diskgroup -diskgroup [-force]

Usage: srvctl stop ons [-verbose]

Usage: srvctl stop home -oraclehome -statefile [-stopoption ] [-force]

For detailed help on each command and object and its options use:

srvctl -help [-compatible]

5 start命令

srvctl start用于启动组件及其服务。

[grid@sz ~]$ srvctl start -help

 

The SRVCTL start command starts, Oracle Restart enabled, non-running objects.

 

Usage: srvctl start database -db [-startoption ]

Usage: srvctl start service -db [-service ""] [-startoption ] [-global_override] [-verbose]

Usage: srvctl start asm [-startoption ]

Usage: srvctl start listener [-listener ]

Usage: srvctl start diskgroup -diskgroup

Usage: srvctl start ons [-verbose]

Usage: srvctl start home -oraclehome -statefile

For detailed help on each command and object and its options use:

srvctl -help [-compatible]

6 remove命令

[grid@sz ~]$ srvctl remove -help

 

The SRVCTL remove command removes the configuration, for the object from the Oracle Restart. Environment settings for the object are also removed.

 

Usage: srvctl remove database -db [-force] [-noprompt] [-verbose]

Usage: srvctl remove service -db -service [-global_override] [-force]

Usage: srvctl remove asm [-force]

Usage: srvctl remove listener [-listener | -all] [-force]

Usage: srvctl remove diskgroup -diskgroup [-force]

Usage: srvctl remove ons [-force] [-verbose]

For detailed help on each command and object and its options use:

srvctl -help [-compatible]

7 add命令

[grid@sz ~]$ srvctl add -help

 

The SRVCTL add command adds the configuration and the Oracle Restart application to the OCR for the cluster database, named instances, named services, or for the named nodes.

 

Usage: srvctl add database -db -oraclehome [-domain ] [-spfile ] [-pwfile ] [-role {PRIMARY | PHYSICAL_STANDBY | LOGICAL_STANDBY | SNAPSHOT_STANDBY | FAR_SYNC}] [-startoption ] [-stopoption ] [-dbname ] [-instance ] [-policy {AUTOMATIC | MANUAL | NORESTART}] [-diskgroup ""]

Usage: srvctl add service -db -service [-role [PRIMARY][,PHYSICAL_STANDBY][,LOGICAL_STANDBY][,SNAPSHOT_STANDBY]] [-policy {AUTOMATIC | MANUAL}][-notification {TRUE|FALSE}] [-clbGoal {SHORT|LONG}] [-rlbgoal {NONE|SERVICE_TIME|THROUGHPUT}][-failovertype {NONE|SESSION|SELECT|TRANSACTION}] [-failovermethod {NONE|BASIC}][-failoverretry ] [-failoverdelay ] [-edition ] [-pdb ] [-global ] [-maxlag ] [-sql_translation_profile ] [-commit_outcome {TRUE|FALSE}] [-retention ] [replay_init_time ] [-session_state {STATIC|DYNAMIC}] [-force]

Usage: srvctl add asm [-listener ] [-spfile ] [-pwfile ] [-diskstring ]

Usage: srvctl add listener [-listener ] [-skip] [-endpoints "[TCP:][, ...][/IPC:][/NMP:][/TCPS:] [/SDP:]"] [-oraclehome ]

Usage: srvctl add ons [-emport ] [-onslocalport ] [-onsremoteport ] [-remoteservers [:][,[:]...]] [-verbose]

For detailed help on each command and object and its options use:

srvctl -help [-compatible]

8 modify命令

[grid@sz ~]$ srvctl modify -help

 

The SRVCTL modify command enables user to modify configuration of the object without removing and adding Oracle Restart resources. The changes takes effect when the application is restarted.

 

Usage: srvctl modify database -db [-dbname ] [-instance ] [-oraclehome ] [-user ] [-domain ] [-spfile ] [-pwfile ] [-role {PRIMARY | PHYSICAL_STANDBY | LOGICAL_STANDBY | SNAPSHOT_STANDBY}] [-startoption ] [-stopoption ] [-policy {AUTOMATIC | MANUAL | NORESTART}] [-diskgroup ""|-nodiskgroup] [-force]

Usage: srvctl modify service -db -service [-role [PRIMARY][,PHYSICAL_STANDBY][,LOGICAL_STANDBY][,SNAPSHOT_STANDBY]] [-policy {AUTOMATIC | MANUAL}][-notification {TRUE|FALSE}] [-clbgoal {SHORT|LONG}] [-rlbgoal {NONE|SERVICE_TIME|THROUGHPUT}] [-failovertype {NONE|SESSION|SELECT|TRANSACTION}] [-failovermethod {NONE|BASIC}] [-failoverretry ] [-failoverdelay ] [-edition ] [-pdb ] [-sql_translation_profile ] [-commit_outcome {TRUE|FALSE}] [-retention ] [replay_init_time ] [-session_state {STATIC|DYNAMIC}] [-global_override]

Usage: srvctl modify asm [-listener ] [-spfile ] [-pwfile ] [-diskstring ]

Usage: srvctl modify listener [-listener ] [-oraclehome ] [-endpoints "[TCP:][, ...][/IPC:][/NMP:][/TCPS:] [/SDP:]"]

Usage: srvctl modify ons [-emport ] [-onslocalport ] [-onsremoteport ] [-remoteservers [:][,[:]...]] [-verbose]

For detailed help on each command and object and its options use:

srvctl -help [-compatible]

9 disable命令

[grid@sz ~]$ srvctl disable -help

 

The SRVCTL disable command disables the named object so that it is unavailable to run under Oracle Restart for automatic startup, failover, or restart.

 

Usage: srvctl disable database -db

Usage: srvctl disable service -db -service "" [-global_override]

Usage: srvctl disable asm

Usage: srvctl disable listener [-listener ]

Usage: srvctl disable diskgroup -diskgroup

Usage: srvctl disable ons [-verbose]

For detailed help on each command and object and its options use:

srvctl -help [-compatible]

10 enable命令

[grid@sz ~]$ srvctl enable -help

 

The SRVCTL enable command enables the named object so that it can run under Oracle Restart for automatic startup, failover, or restart.

 

Usage: srvctl enable database -db

Usage: srvctl enable service -db -service "" [-global_override]

Usage: srvctl enable asm

Usage: srvctl enable listener [-listener ]

Usage: srvctl enable diskgroup -diskgroup

Usage: srvctl enable ons [-verbose]

For detailed help on each command and object and its options use:

srvctl -help [-compatible]

11 getenv命令

[grid@sz ~]$ srvctl getenv -help

 

The SRVCTL getenv command Gets and displays values for the environment from the configuration file. It allows users to administer environment configuration for the objects.

 

Usage: srvctl getenv database -db [-envs "[,...]"]

Usage: srvctl getenv asm [-envs "[,...]"]

Usage: srvctl getenv listener [-listener ] [-envs "[,...]"]

For detailed help on each command and object and its options use:

srvctl -help [-compatible]

12 setenv命令

[grid@sz ~]$ srvctl setenv -help

 

The SRVCTL setenv command sets values for the environment in the configuration file. It allows users to administer environment configuration for the objects.

 

Usage: srvctl setenv database -db {-envs "=[,...]" | -env "="}

Usage: srvctl setenv asm {-envs "=[,...]" | -env "="}

Usage: srvctl setenv listener [-listener ] -envs "=[,...]" | -env "="

For detailed help on each command and object and its options use:

srvctl -help [-compatible]

13 update命令

[grid@sz ~]$ srvctl update -help

 

The SRVCTL update command requests specified running object to use the new configuration infORMation stored in the OCR.

 

Usage: srvctl update database -db -startoption

For detailed help on each command and object and its options use:

srvctl -help [-compatible]

14 upgrade命令

[grid@sz ~]$ srvctl upgrade -help

 

Upgrades the resources types and resources from an older version to a newer version.

 

Usage: srvctl upgrade database -db -oraclehome

srvctl -help [-compatible]

15 downgrade命令

[grid@sz ~]$ srvctl downgrade -help

 

The SRVCTL downgrade command enables the user to downgrade resources from their current software version to an older version.

 

Usage: srvctl downgrade database -db -oraclehome -targetversion

srvctl -help [-compatible]

 

您可能感兴趣的文档:

--结束END--

本文标题: 【12c】Oracle Restart中的SRVCTL命令详解

本文链接: https://lsjlt.com/news/6324.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

猜你喜欢
  • 【12c】Oracle Restart中的SRVCTL命令详解
    SRVCTL,服务控制实用工具(Service Control Utility),可用于对Oracle Restart和Oracle RAC...
    99+
    2018-12-23
    【12c】Oracle Restart中的SRVCTL命令详解
  • Srvctl命令详解
    **srvctl命令详解**`srvctl`是Oracle数据库的一个管理工具,用于管理和配置Oracle实例、数据库、服务和集群组...
    99+
    2023-09-21
    Srvctl
  • Oracle中srvctl命令的用法是什么
    Oracle中的srvctl命令是用于管理Oracle数据库集群环境的命令行工具。以下是srvctl命令的常见用法:1. 创建数据库...
    99+
    2023-10-19
    Oracle
  • Oracle 11g与12c的审计详解
    最近遇到一些脚本诱发的审计相关BUG,感觉有必要重新梳理一下11g与12c的审计模式,于是根据官网修正了一下以前的一篇笔记这里发出来。 一、审计功能的开启: SQL> show parameter audit --主要有以下四个参数: A...
    99+
    2019-05-29
    Oracle 11g与12c的审计详解
  • docker 安装Oracle-12C的方法详解
    docker search Oracle docker pull truevoly/oracle-12c docker images 挂载目录 mkdir -p /data/o...
    99+
    2024-04-02
  • 详解 Shell中的grep命令
    用‘grep'搜索文本文件 如果您要在几个文本文件中查找一字符串,可以使用‘grep'命令。‘grep'在文本中搜索指定的字符串。举个例子:假设您正在‘/usr/src/linux/Documentatio...
    99+
    2022-06-04
    详解 命令 Shell
  • 详解Linux中的wget命令
    wget命令用来从指定的URL下载文件。wget非常稳定,它在带宽很窄的情况下和不稳定网络中有很强的适应性,如果是由于网络的原因下载失败,wget会不断的尝试,直到整个文件下载完毕。如果是服务器打断下载过程...
    99+
    2022-06-04
    详解 命令 Linux
  • 详解Linux中的awk命令
    简介 awk是一个强大的文本分析工具,相对于grep的查找,sed的编辑,awk在其对数据分析并生成报告时,显得尤为强大。简单来说awk就是把文件逐行的读入,以空格为默认分隔符将每行切片,切开的部分再进行各种分析处理。...
    99+
    2022-06-04
    linux awk 命令 linux awk
  • Android中的dumpsys命令详解
    目录一、dumpsys命令介绍1.命令说明2.系统服务查询二、包信息查询三、activity信息查询四、网络信息查询五、其他常用服务信息查询一、dumpsys命令介绍 1.命令说明 ...
    99+
    2024-04-02
  • oracle中解决锁表的命令
    oracle 锁表问题可以通过以下命令解决:查看已锁定的表:select * from v$locked_objects;释放表锁:alter system kill sess...
    99+
    2024-05-09
    oracle
  • linux中top命令详解
    简介 top命令是Linux下常用的性能分析工具,能够实时显示系统中各个进程的资源占用状况,类似于Windows的任务管理器。 top显示系统当前的进程和其他状况,是一个动态显示过程,即可以通过用户按键来...
    99+
    2022-06-04
    详解 命令 linux
  • linux 中ls命令详解
    ls命令用来显示目标列表,在Linux中是使用率较高的命令。ls命令的输出信息可以进行彩色加亮显示,以分区不同类型的文件。 语法 ls(选项)(参数) 选项 -a:显示所有档案及目录(ls内定...
    99+
    2022-06-04
    详解 命令 linux
  • linux中 pmap 命令详解
    通过查看帮助,返回了如下信息: Usage: pmap [options] pid [pid ...] Options: -x, --extended show details -X ...
    99+
    2022-06-04
    详解 命令 linux
  • Linux中mkdir命令详解
    linux mkdir用来创建目录,要求创建目录的用户在当前目录中具有写权限,并且指定的目录名不能是当前目录中已有的oVjIB目录。 1. 新建一个文件夹 one 2. 新建三个文件夹three,four,five ...
    99+
    2022-06-04
    linux mkdir 命令
  • Linux中nmcli命令详解
    nmcli 是 NetworkManager 的命令行工具。 nm 代表 NetworkManager,cli 代表 Command-Line 命令行。 NetworkManager 使用 nmcli...
    99+
    2023-09-23
    linux 网络 服务器
  • Linux中grep命令详解
    目录一、grep基本介绍二、正则表达式grep实践2.1、输出以 I 开头的行(不区分大小写)2.2、输出以.结尾的行2.3、$符号 注意在linux平台下, 所有文件的结尾都有一个$符可以利用cat -A 查看文件2....
    99+
    2023-02-13
    Linux中grep详解 Linux中grep命令
  • K8S 中 kubectl 命令详解
    目录一、资源管理办法1.1 陈述式资源管理方法查看版本信息查看资源对象简写查看集群信息配置kubectl自动补全node 节点查看日志1.2基本信息查看查看master 节点状态查看...
    99+
    2022-11-13
    K8S  kubectl 命令 K8S  kubectl
  • 详解Python中命令行参数argparse的常用命令
    目录1、参数个数控制2、参数互斥3、子命令1、参数个数控制 parser.add_argument('-i', '--integers', nargs='', const=100, ...
    99+
    2023-01-29
    Python argparse常用命令 Python argparse命令 Python argparse
  • Linux中的tcpdump命令示例详解
    前言 用简单的话来定义tcpdump,就是:dump the traffic on a network,根据使用者的定义对网络上的数据包进行截获的包分析工具。 tcpdump可以将网络中传送的数据包的“头”完全截获下来...
    99+
    2022-06-04
    linux tcpdump ftp包 linux traceroute linux 抓包 tcpdump
  • Linux中的screen命令使用详解
    GUN Screen: 官方网址:http://www.gnu.org/software/screen/ 1、简介 Screen是一款由GNU计划开发的用于命令行终端切换的自由软件。用户可以通过该软件同时连接多个本地...
    99+
    2022-06-04
    Linux screen命令 Linux screen
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作