参考《Real Application Clusters Administration and Deployment Guide》
Oracle Clusterware的命令集可以分为以下4种:
节点层:olsnodes
网络层:oifcfg
集群层:crsctl, ocrcheck,ocrdump,ocrconfig
应用层:srvctl,onsctl,crs_stat
下面分别来介绍这些命令
olsnodes --- 显示集群点列表
[grid@rac1 root]$ olsnodes --help
Usage: olsnodes [ [ [-n] [-i] [-s] [-t] [ | -l [-p]] [-a] ] | [-f] | [-c] ] [-g] [-v]
where
-n print node number with the node name
-p print private interconnect address for the local node
-i print virtual IP name or address with the node name
print information for the specified node
-l print information for the local node
-s print node status - active or inactive
-t print node type - pinned or unpinned
-g turn on logging
-v Run in debug mode; use at direction of Oracle Support only.
-c print clusterware name
-a print active node roles of the nodes in the cluster
-f print historical Leaf Nodes (active and recent)
oifcfg ---
[grid@rac1 ~]$ oifcfg --help
PRIF-9: incorrect usage
Name:
oifcfg - Oracle Interface Configuration Tool.
Usage:
oifcfg iflist [-p] [-n] [-hdr]
Lists the network interfaces known to the operating system on this node that can be configured with 'oifcfg setif'.
-p displays a heuristic assumption of the interface type (PRIVATE, PUBLIC, or UNKNOWN).
-n displays the netmask.
-hdr displays column headings.
oifcfg setif {-node | -global} [/:[,...]][,...]
'oifcfg setif -global' or 'oifcfg setif -node ' is used to synchronize the interface details in the GPnP profile and OCR.
oifcfg getif [-node | -global] [ -if [/] [-type ]] [-hdr]
oifcfg delif {{-node | -global} [[/]] [-force] | -force}
oifcfg [-help]
- name of the host, as known to a communications network
- name by which the interface is configured in the system
- subnet address of the interface
- one or more comma-separated interface types { cluster_interconnect | public | asm}
oifctg命令用来定义和修改Oracle集群需要的网卡属性,这些属性包括网卡的网段地址,子网掩码,接口类型等。要想正确的使用这个命令,必须先知道Oracle是如何定义网络接口的,Oracle的每个网络接口包括名称,网段地址,接口类型3个属性:interface_name、subnet、interface_type。
这些属性中没有IP地址,但接口类型有两种,public和private,前者说明接口用于外部通信,用于Oracle Net和VIP地址,而后者说明接口用于Interconnect。
接口的配置方式分为两类:
global和node-specific。前者说明集群所有节点的配置信息相同,也就是说所有节点的配置是对称的;而后者意味着这个节点的配置和其他节点配置不同,是非对称的。
Iflist:显示网口列表
getif:获得单个网口信息
setif:配置单个网口
delif:删除网口
集群层是指由Clusterware组成的核心集群, 这一层负责维护集群内的共享设备,并为应用集群提供完整的集群状态视图,应用集群依据这个视图进行调整。这一层共有4个命令:crsctl、ocrcheck、ocrdump、ocrconfig,后三个是针对OCR磁盘的。
crsctl命令可以用来检查crs进程栈,每个crs进程状态,管理Votedisk,跟踪crs进程功能。
crsctl
3.1.1 检查crs状态
crsctl check crs
crsctl check cssd
crsctl check crsd
crsctl check evmd
crsctl check cluster -all
3.1.2 配置crs自启动
CRS进程栈默认随着操作系统的启动而自启动,有时出于维护目的需要关闭这个特性,可以用root用户执行下面命令。
crsctl disable crs
crsctl enable crs
此命令修改/etc/oracle/scls_scr/rac1/root/crsstart中的配置,但此次配置之后crsstart中的内容并未更改。待深入研究
3.1.3 启、停crs服务
crsctl start crs
crsctl stop crs
3.1.4 查看votingdisk状态
[grid@rac1 ~]$ crsctl query --help
Usage:
crsctl query crs administrator
Display admin list
crsctl query crs autostart
Gets the value of automatic start delay and server count
crsctl query crs activeversion [-f]
Lists the Oracle Clusterware active version
where
-f List the cluster state and active patch level
crsctl query crs releaseversion
Lists the Oracle Clusterware release version
crsctl query crs softwareversion [| -all]
Lists the version of Oracle Clusterware software installed
where
Default List software version of the local node
nodename List software version of named node
-all List software version for all the nodes in the cluster
crsctl query crs releasepatch
Lists the Oracle Clusterware release patch level
crsctl query crs softwarepatch []
Lists the patch level of Oracle Clusterware software installed
where
Default List software patch level of the local host
host List software path level of the named host
crsctl query crs lastactivetimestamp []
Lists the Last active timestamp of a leaf node.
where
Default Lists the last active timestamp of the local leaf node
host Lists the last active timestamp of the named leaf node
crsctl query crs site {-n | -d }
List the site with which the node or disk is associated.
Where
node_name The name of the node to be queried
disk_name The name of the disk to be queried
crsctl query css ipmiconfig
Checks whether Oracle Clusterware has been configured for IPMI
crsctl query css ipmidevice
Checks whether the IPMI device/driver is present
crsctl query css votedisk
Lists the voting files used by Cluster Synchronization Services
crsctl query wallet -type [-name ] [-user ]
Check if the designated wallet or user exists
where
wallet_type Type of wallet i.e. APPQOSADMIN, APPQOSUSER, APPQOSDB, MGMTDB, OSUSER or CVUDB.
name Name is required for APPQOSDB and CVUDB wallets.
user_name User to be queried from wallet.
crsctl query dns -servers
Lists the system configured DNS server, search paths, attempt and timeout values
crsctl query dns -name [-dnsserver ] [-type ] [-port ] [-attempts ] [-timeout ] [-v]
Returns a list of addresses returned by DNS lookup of the name with the specified DNS server
Where
name Fully qualified domain name to lookup
DNS_server_address Address of the DNS server on which name needs to be looked up
query_type The query type is A or AAAA for IPv4 or IPv6 respectively. The default query_type is A.
port Port on which DNS server is listening
attempts Number of retry attempts
timeout Timeout in seconds
crsctl query socket udp [-address ] [-port ]
Verifies that a daemon can listen on specified address and port
Where
address IP address on which socket needs to be created
port port on which socket needs to be created
crsctl query calog [-aftertime ] [-beforetime ] [-duration | -follow] [-filter ] [-fullfmt | -xmlfmt]
Lists the cluster activity log activities matching the specified criteria
crsctl query credentials targetlist
Lists the valid credentials targets to be used with credentials commands
crsctl query credentials -target
Lists the valid credentials under a specific target
crsctl query cluster site { | -all}
List the nodes and disks associated with the sites.
Where
site_name The site name to be queried
-all List all sites.
crsctl query member_cluster_configuration []
where
member_cluster_name Name of the Member Cluster
If no member cluster name is provided then the details of all
the member clusters are displayed.
crsctl query driver activeversion [ | -all] [-f]
List the active version of the drivers.
Where
node_name List drivers of the named node
-all List drivers of all nodes.
Default List drivers of the local node.
-f Display the BugHash and BugsFixed.
crsctl query driver softwareversion [ | -all] [-f]
List the software installed version on the drivers.
Where
node_name List drivers of the named node
-all List drivers of all nodes.
Default List drivers of the local node.
-f Display the BugHash and BugsFixed.
crsctl query css votedisk
3.1.5 查看、配置css参数
查看参数使用get
[grid@rac1 ~]$ crsctl get --help
Usage:
crsctl get log {mdns|gpnp|css|crf|crs|ctss|evm|gipc} ",..."
Get the log levels for specific modules
crsctl get log res
Get the log level for an agent
crsctl get hostname
Displays the host name
crsctl get nodename
Displays the node name
crsctl get cluster mode {config|status}
Get the cluster mode
crsctl get clientid dhcp -cluname -viptype [-vip ] [-n ]
Generate client ID's as used by RAC agents for configured cluster resources
where
cluster_name name of the cluster to be configured
vip_type Type of VIP resource: HOSTVIP, SCANVIP, or APPVIP
VIPResName User defined application VIP name (required for APPVIP vip_type)
nodename Node for which the client ID is required (required for HOSTVIP vip_type)
crsctl get calog
Gets the value of an Oracle cluster activity log parameter
crsctl get history
Gets the cluster history
crsctl get cluster type
Display the type of resources the current cluster can run.
crsctl get cluster extended
Display whether the current cluster is extended.
crsctl get cluster class
Get the cluster class
crsctl get cluster name
Displays the current cluster name
crsctl get node role {config|status} [-node | -all]
Gets the current role of nodes in the cluster
crsctl get credentials
Exports the specified credentials to an XML file
crsctl get css
Displays the value of a Cluster Synchronization Services parameter
clusterguid
disktimeout
misscount
reboottime
noautorestart
priority
crsctl get css ipmiaddr
Displays the IP address of the local IPMI device as set in the Oracle registry.
crsctl get {css |hostname|nodename}
crsctl get tracefileopts {mdns|gpnp|css|crf|crs|ctss|evm|gipc}
crsctl get diagstat {css | gipc | ohas | crs | evm | gns | gpnp | ologger | osysmon | mdns | evmlogger | ctss | scriptagent | jagent | [crsd_oraagent | crsd_orarootagent | ohasd_oraagent | ohasd_orarootagent | ohasd_cssdmonitor | ohas
d_cssdagent | crsd_appagent [-user ]] } {-all | -k } Gets the diagnostic shared memory statistics for the specific component
crsctl get cpu equivalency
Gets the current configured value for server attribute CPU_EQUIVALENCY
crsctl get resource use
Gets the current configured value for server attribute RESOURCE_USE_ENABLED
crsctl get server label
Gets the current configured value for server attribute SERVER_LABEL
crsctl get server css_critical
Gets the current configured value for server attribute CSS_CRITICAL
crsctl get ipmi binaryloc
Gets the current configured value for server attribute IPMI_BIN_PATH
配置参数使用set
[grid@rac1 ~]$ crsctl set --help
Usage:
crsctl set log {mdns|gpnp|css|crf|crs|ctss|evm|gipc} "=,..."
Set the log levels for specific modules within daemons
crsctl set log res =
Set the log levels for agents
crsctl set css
Sets the value of a Cluster Synchronization Services parameter
crsctl set css {ipmiaddr|ipmiadmin}
Sets IPMI configuration data in the Oracle registry
crsctl set css votedisk asm [...]
Defines the set of voting disks to be used by CRS
crsctl set crs autostart [delay ] [servercount ]
Sets the Oracle Clusterware automatic resource start criteria
crsctl set calog [-f]
Sets the value of an Oracle cluster activity log parameter
crsctl set tracefileopts {mdns|gpnp|css|crf|crs|ctss|evm|gipc} [-filesize [K|k|M|m|G|g]] [-numsegments ]
Note: You must specify at least one of the clauses -filesize or -numsegments
crsctl set credentials
Imports the specified credentials from an XML file
crsctl set cluster mode flex
Set the cluster mode
crsctl set cluster class {standalone|domainservices|member}
Sets the cluster class
crsctl set cpu equivalency
Sets the configuration value for server attribute CPU_EQUIVALENCY
crsctl set resource use
Sets the configuration value for server attribute RESOURCE_USE_ENABLED
crsctl set server label
Sets the configuration value for server attribute SERVER_LABEL
crsctl set server css_critical {yes|no}
Sets the configuration value for server attribute CSS_CRITICAL
crsctl set ipmi binaryloc
Sets the configuration value for server attribute IPMI_BIN_PATH
注:crs参数配置需谨慎
3.1.6 追踪crs,提供辅助功能
CRS由CRS,CSS,EVM三个服务组成,每个服务又是由一系列module组成,crsctl允许对每个module进行跟踪,并把跟踪内容记录到日志中。
--- 查看服务对应的模块
[grid@rac1 ~]$ crsctl lsmodules --help
Usage:
crsctl lsmodules {mdns|gpnp|css|crf|crs|ctss|evm|gipc}
where
mdns multicast Domain Name Server
gpnp Grid Plug-n-Play Service
css Cluster Synchronization Services
crf Cluster Health Monitor
crs Cluster Ready Services
ctss Cluster Time Synchronization Service
evm EventManager
gipc Grid Interprocess Communications
--- 追踪服务状态
[grid@rac1 ~]$ crsctl debug --help
Usage:
crsctl debug statedump {crs|css|evm}
where
crs Cluster Ready Services
css Cluster Synchronization Services
evm Event Manager
[grid@rac1 ~]$ crsctl debug log --help
Usage:
DEPRECATED: use crsctl set log {css|crs|evm}
--- example
[grid@rac1 ~]$ crsctl debug log css "CSSD:1"
3.1.7 维护votingdisk
[grid@rac1 ~]$ crsctl add --help
Usage:
crsctl add {resource|type|resourcegroup|resourcegrouptype|serverpool|policy}
where
name Name of the CRS entity
options Options to be passed to the add command
See individual CRS entity help for more details
crsctl add crs administrator -u [-f]
where
user_name User name to be added to the admin list or "*"
-f Override user name validity check
crsctl add wallet -type
where
wallet_type Type of wallet i.e. APPQOS, APPQOSUSER, APPQOSDB, MGMTDB, OSUSER or CVUDB.
options Options to be passed to the add command
crsctl add css votedisk [...]
where
vdisk [...] One or more blank-separated voting file paths
options Options to be passed to the add command
crsctl add category [-attr "=[,...]"] [-i]
where
categoryName Name of server category to be added
attrName Attribute name
value Attribute value
-i Fail if request cannot be processed immediately
crsctl add credentials -target [[-user ] [-passwd]|[-keylength ]]
where
target Target as is listed by 'crsctl query credentials targetlist'
user_name User to be added to wallet. If not specified, will
be pseudo-randomly generated. Can only be specified with 'userpass' credentials.
-passwd Indication that password will be specified. Password
will be read from standard input. If not specified,
will be pseudo-randomly generated. Can only be specified with 'userpass' credentials.
nbits Length of the key. If not specified, defaults to 128.
Can only be specified with 'keypair' credentials.
crsctl add cluster site [-guid ]
Add the site to the cluster.
Where
site_name The site name of the new site
site_guid The site GUID (global unique ID) of the new site
尝试增加一块votingdisk
--- 查看votingdisk状态
[root@rac1 bin]# ./crsctl query css votedisk
--- 停止所有节点的CRS服务:
[root@rac1 bin]# ./crsctl stop crs
--- 添加Votingdisk
[root@rac1 bin]# ./crsctl add css votedisk /dev/asmdisk07 -force
注意:即使在CRS关闭后,也必须通过-force参数来添加和删除Votedisk,并且-force参数只有在CRS关闭的场合下使用才安全,否则会报:Cluter is not a ready state for online disk addition.
--- 确认添加后的状态:
[root@rac1 bin]# ./crsctl query css votedisk
--- 启动CRS服务
[root@rac1 bin]# ./crsctl start crs
注:添加和删除Votedisk的操作非常危险,必须停止数据库,停止ASM,停止CRS 后操作,并且操作时必须使用-force参数
Oracle Clusterware把整个集群的配置信息放在共享存储上,这个存储就是OCR Disk.在整个集群中,只有一个节点能对OCR Disk进行读写操作,这个节点叫作Master Node,所有节点都会在内存中保留一份OCR的拷贝,同时有一个OCR Process从这个内存中读取内容。OCR内容发生改变时,由Master Node的OCR Process负责同步到其他节点的OCR Process。
OCR的内容如此重要,Oracle每4个小时对其做一次备份,并且保留最后的3个备份,以及前一天,前一周的最后一个备份。这个备份由Master Node CRSD进程完成,备份的默认位置是$CRS_HOME\crs\cdata\
3.2.1 ocrdump
该命令能以ASCII的方式打印出OCR的内容,但不能用作OCR的备份,产生的文件只能用作阅读,而不能用于恢复
[grid@rac1 ~]$ ocrdump --help
Name:
ocrdump - Dump contents of Oracle Cluster/Local Registry to a file.
Synopsis:
ocrdump [-local] [|-stdout] [-backupfile ] [-keyname ] [-xml] [-noheader]
Description:
Default filename is OCRDUMPFILE. Examples are:
prompt> ocrdump
writes cluster registry contents to OCRDUMPFILE in the current directory
prompt> ocrdump MYFILE
writes cluster registry contents to MYFILE in the current directory
prompt> ocrdump -stdout -keyname SYSTEM
writes the subtree of SYSTEM in the cluster registry to stdout
prompt> ocrdump -local -stdout -xml
writes local registry contents to stdout in xml format
prompt> ocrdump -backupfile /oracle/CRSHOME/backup.ocr -stdout -xml
writes registry contents in the backup file to stdout in xml format
Notes:
* The header information will be retrieved based on best effort basis.
* Use option '-local' to indicate that the operation is to be performed on the Oracle Local Registry.
3.2.2 ocrcheck
ocrcheck命令用于检查OCR内容的一致性,这个命令不需要参数。
[grid@rac1 ~]$ ocrcheck --help
Name:
ocrcheck - Displays health of Oracle Cluster/Local Registry.
Synopsis:
ocrcheck [-config | -backupfile ] [-details] [-local]
-config Displays the configured locations of the Oracle Cluster Registry.
This can be used with the -local option to display the configured
location of the Oracle Local Registry
-details Displays detailed configuration information.
-local The operation will be performed on the Oracle Local Registry.
-backupfile The operation will be performed on the backup file.
Notes:
* This command for Oracle Cluster Registry is not supported from a Leaf node.
3.2.3 ocrconfig
该命令用于维护OCR磁盘,安装clusterware过程中,如果选择External Redundancy冗余方式,则只能输入一个OCR磁盘位置。但是Oracle允许配置两个OCR磁盘互为镜像,以防止OCR磁盘的单点故障。OCR磁盘和Votedisk磁盘不一样,OCR磁盘最多只能有两个,一个Primary OCR和一个Mirror OCR
[grid@rac1 ~]$ ocrconfig --help
Name:
ocrconfig - Configuration tool for Oracle Cluster/Local Registry.
Synopsis:
ocrconfig [option]
option:
[-local] -export
- Export OCR/OLR contents to a file
[-local] -import - Import OCR/OLR contents from a file
[-local] -upgrade [ []]
- Upgrade OCR from previous version
-downgrade [-version ]
- Downgrade OCR to the specified version
[-local] -backuploc { | + }
- Configure OCR/OLR backup location
[-local] -showbackuploc - Show OCR/OLR backup location
[-local] -showbackup [auto|manual] - Show OCR/OLR backup information
[-local] -manualbackup - Perform OCR/OLR backup
[-local] -restore { + | }
- Restore OCR/OLR from physical backup
-replace { + | } -replacement { + | }
- Replace first specified OCR device or file with second specified device/file
-add { + | }
- Add a new OCR device/file
-delete { + | }
- Remove an OCR device/file
-overwrite - Overwrite OCR configuration on disk
-repair -add { + | } | -delete { + | } | -replace { + | } -replacement { + | }
- Repair OCR configuration on the local node
-copy
- Copy OCR physical backup from source to destination
[-local] -delbackup { + | }
- Delete OCR/OLR physical backup file
-help - Print out this help information
Notes:
* Use option '-local' to indicate that the operation is to be performed on the Oracle Local Registry.
查看OCR备份状态
3.2.4 OCR备份与恢复
Oracle推荐在对集群做调整时,比如增加,删除节点之前,应该对OCR做一个备份,可以使用export备份到指定文件,如果做了replace或者restore等操作,Oracle建议使用cluvfy comp ocr -n all命令来做一次全面的检查。cluvfy命令在clusterware的安装目录
--- 关闭所有节点的CRS
[root@rac1 bin]# /app/product/19.2.0/crs/bin/crsctl stop crs
--- 导出OCR内容
[root@rac1 bin]# /app/product/19.2.0/crs/bin/ocrconfig -export /app/ocr.exp
--- 启动CRS
[root@rac1 bin]# /app/product/19.2.0/crs/bin/crsctl start crs
--- 检查CRS状态
[root@rac1 bin]# /app/product/19.2.0/crs/bin/crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
--- 模拟OCR损坏
[root@rac1 bin]# dd if=/dev/zero f=/dev/asmdisk01 bs=1024 count=102400
102400+0 records in
102400+0 records out
--- 检查OCR一致性
[root@rac1 bin]# /app/product/19.2.0/crs/bin/ocrcheck
PROT-601: Failed to initialize ocrcheck
--- 使用cluvfy工具检查一致性
[root@rac1 cluvfy]# /app/product/19.2.0/crs/bin/runcluvfy.sh comp ocr -n all
Verifying OCR integrity
Unable to retrieve nodelist from Oracle clusterware.
Verification cannot proceed.
--- 使用Import恢复OCR内容
[root@rac1 bin]# /app/product/19.2.0/crs/bin/ocrconfig -import /app/ocr.exp
--- 再次检查OCR一致性
[root@rac1 bin]# /app/product/19.2.0/crs/bin/ocrcheck
--- 再次使用cluvfy工具检查一致性
[root@rac1 cluvfy]# /app/product/19.2.0/crs/bin/runcluvfy.sh comp ocr -n all
3.2.5 迁移OCR磁盘
实验演示将OCR从/dev/asmdisk01 迁移至/dev/asmdisk08
--- 查看OCR备份
[root@rac1 bin]# /app/product/19.2.0/crs/bin/ocrconfig -showbackup
如果没有备份,立即执行一次导出作为备份:
[root@rac1 bin]# /app/product/19.2.0/crs/bin/ocrconfig -export /u01/ocrbackup -s online
--- 查看OCR配置
[root@rac1 bin]# /app/product/19.2.0/crs/bin/ocrcheck
--- 添加一个Mirror OCR
[root@rac1 bin]# /app/product/19.2.0/crs/bin/ocrconfig -replace ocrmirror /dev/asmdisk08
--- 确认添加成功
[root@rac1 bin]# /app/product/19.2.0/crs/bin/ocrcheck
--- 改变primary OCR位置
[root@rac1 bin]# /app/product/19.2.0/crs/bin/ocrconfig -replace ocr /dev/asmdisk08
确认修改成功:
[root@rac1 bin]# /app/product/19.2.0/crs/bin/ocrcheck
--- 使用ocrconfig命令修改后,所有RAC节点上的/etc/oracle/ocr.loc文件内容也会自动同步了,如果没有自动同步,可以手工的改成以下内容。
[root@rac1 bin]#more /etc/oracle/ocr.loc
ocrconfig_loc=/dev/asmdisk01
ocrmirrorconfig_loc=/dev/asmdisk08
local_only=FALSE
应用层就是指RAC数据库了,这一层有若干资源组成,每个资源都是一个进程或者一组进程组成的完整服务,这一层的管理和维护都是围绕这些资源进行的。有如下命令:srvctl, onsctl, crs_stat三个命令
crs_stat这个命令用于查看CRS维护的所有资源的运行状态,如果不带任何参数时,显示所有资源的概要信息。每个资源显示是各个属性:资源名称,类型,目录,资源运行状态等。18c之后此命令已不再被支持
crs_stat -t
crs_stat -ls
这个命令用于管理配置ONS(Oracle Notification Service). ONS是Oracle Clusterware实现FAN Event Push模型的基础。在传统模型中,客户端需要定期检查服务器来判断服务端状态,本质上是一个pull模型,Oracle 10g引入了一个全新的PUSH机制–FAN(Fast Application Notification),当服务端发生某些事件时,服务器会主动的通知客户端这种变化,这样客户端就能尽早得知服务端的变化。而引入这种机制就是依赖ONS实现, 在使用onsctl命令之前,需要先配置ONS服务
[grid@rac1 bin]$ onsctl
usage: onsctl [verbose] []
The verbose option enables debug tracing and logging (for the server start).
Permitted / combinations are:
command options
------- ---------
start - Start ons
shutdown - Shutdown ons
reload - Trigger ons to reread its configuration file
debug [= ..] - Display ons server debug information
set [= ..] - Set ons log parameters
query [=] - Query ons log parameters
ping [] - Ping local ons
help - Print brief usage description (this)
usage [] - Print detailed usage description
--- example
--- 查看进程状态
[root@rac1 bin]#ps -aef|grep ons
--- 查看ONS服务的状态
[root@rac1 bin]# /app/product/19.2.0/crs/bin/onsctl ping
--- 启动ONS服务
[root@rac1 bin]# /app/product/19.2.0/crs/bin/onsctl start
--- 使用debug选项,可以查看详细信息,其中最有意义的就是能显示所有连接
[root@rac1 bin]# /app/product/19.2.0/crs/bin/onsctl debug
ONS状态检查
该命令是RAC维护中最常用的命令,也是最复杂的命令。 这个工具可以操作下面的几种资源:Database,Instance,ASM,Service,Listener和Node Application,其中Node application又包括GSD,ONS,VIP。 这些资源除了使用srvctl工具统一管理外,某些资源还有自己独立的管理工具,比如ONS可以使用onsctl命令进行管理、Listener可以通过lsnrctl管理
[grid@rac1 bin]$ srvctl -help
Usage: srvctl {-version | -version -fullversion | -fullversion}
Usage: srvctl config all
Usage: srvctl add database -db -oraclehome [-dbtype {RACONENODE | RAC | SINGLE} [-server ""] [-instance ] [-timeout ]] [-domain ] [-spfile ] [-pwfile <
password_file_path>] [-role {PRIMARY | PHYSICAL_STANDBY | LOGICAL_STANDBY | SNAPSHOT_STANDBY | FAR_SYNC}] [-startoption ] [-stopoption ] [-startconcurrency ] [-stopconcurrency ] [-dbname ] [-policy {AUTOMATIC | MANUAL | NORESTART | USERONLY}] [-serverpool "" [-pqpool ]] [-node ] [-diskgroup ""] [-acfspath ""] [-eval] [-fixed] [-css_critical {YES | NO}] [-cpucount ] [-memorytarget ] [-maxmemory ] [-defaultnetnum ] [-verbose]Usage: srvctl config database [-db [-all] | -serverpool | -home] [-verbose]
Usage: srvctl start database -db [-startoption ] [-startconcurrency ] [-node | -serverpool ""] [-eval] [-verbose]
Usage: srvctl stop database -db [-stopoption ] [-stopconcurrency ] [-serverpool ""] [-drain_timeout ] [-force] [-eval] [-verbose]
Usage: srvctl status database {-db {[-serverpool ] | [-sid] [-home]} | -serverpool | -thisversion | -thishome} [-force] [-detail] [-verbose]
Usage: srvctl enable database -db [-node ]
Usage: srvctl disable database -db [-node ]
Usage: srvctl modify database -db [-dbname ] [-instance ] [-oraclehome ] [-user ] [-server ""] [-timeout ] [-domain ] [-spfile ] [-
pwfile ] [-role {PRIMARY | PHYSICAL_STANDBY | LOGICAL_STANDBY | SNAPSHOT_STANDBY}] [-startoption ] [-stopoption ] [-startconcurrency ] [-stopconcurrency ][-policy {AUTOMATIC | MANUAL | NORESTART | USERONLY}] [-serverpool "" [-node ]] [-pqpool ] [-diskgroup ""|-nodiskgroup] [-acfspath ""] [-css_critical {YES | NO}] [-cpucount [-overridepools ]] [-memorytarget ] [-maxmemory ] [-defaultnetnum ] [-disabledreason {DECOMMISSIONED}] [-force] [-eval] [-verbose]Usage: srvctl remove database -db [-force] [-noprompt] [-verbose]
Usage: srvctl getenv database -db [-envs "[,...]"]
Usage: srvctl setenv database -db {-envs "=[,...]" | -env "="}
Usage: srvctl unsetenv database -db -envs "[,...]"
Usage: srvctl predict database -db [-verbose]
Usage: srvctl convert database -db -dbtype RAC [-node ]
Usage: srvctl convert database -db -dbtype RACONENODE [-instance ] [-timeout ]
Usage: srvctl relocate database -db {[-node ] [-timeout ] [-stopoption ] | -abort [-revert]} [-drain_timeout ] [-verbose]
Usage: srvctl upgrade database -db -oraclehome
Usage: srvctl downgrade database -db -oraclehome -targetversion
Usage: srvctl update database -db [-startoption [-node | -serverpool ""]]
Usage: srvctl add instance -db -instance -node [-force]
Usage: srvctl start instance {-node "" | -db {-node [-instance ] | -node "" | -instance ""}} [-startoption ]
Usage: srvctl stop instance {-node "" | -db {-node "" | -instance ""}} [-stopoption ] [-drain_timeout ] [-force] [-failover] [-verbose]
Usage: srvctl status instance -db {-node | -instance } [-force] [-detail] [-verbose]
Usage: srvctl enable instance -db -instance ""
Usage: srvctl disable instance -db -instance ""
Usage: srvctl modify instance -db -instance -node
Usage: srvctl remove instance -db -instance [-force] [-noprompt]
Usage: srvctl update instance -db [-instance "" | -node ""] [-startoption ] [-targetinstance ]
Usage: srvctl add service -db -service ""
{-preferred "" [-available ""] [-tafpolicy {BASIC | NONE | PRECONNECT}] | -serverpool [-cardinality {UNIFORM | SINGLETON}] }
[-netnum ] [-role "[PRIMARY][,PHYSICAL_STANDBY][,LOGICAL_STANDBY][,SNAPSHOT_STANDBY]"] [-policy {AUTOMATIC | MANUAL}]
[-notification {TRUE | FALSE}] [-dtp {TRUE | FALSE}] [-clbgoal {SHORT | LONG}] [-rlbgoal {NONE | SERVICE_TIME | THROUGHPUT}]
[-failovertype {NONE | SESSION | SELECT | TRANSACTION | AUTO}] [-failovermethod {NONE | BASIC}] [-failoverretry ] [-failoverdelay ] [-failover_restore {NONE | LEVEL1}] [-failback {YES | NO}]
[-edition ] [-pdb ] [-global {TRUE | FALSE}] [-maxlag ] [-sql_translation_profile ]
[-commit_outcome {TRUE | FALSE}] [-retention ] [-replay_init_time ] [-session_state {STATIC | DYNAMIC}]
[-pqservice ] [-pqpool ""] [-gsmflags ] [-tablefamilyid ] [-drain_timeout ] [-stopoption ] [-css_critical {YES | NO}] [-rfpool -hubsvc
] [-force] [-eval] [-verbose]
Usage: srvctl add service -db -service "" -update {-preferred "" | -available ""} [-force] [-verbose]
Usage: srvctl config service {-db [-service ] | -serverpool [-db ]} [-verbose]
Usage: srvctl enable service -db -service "" [-instance | -node ] [-global_override]
Usage: srvctl disable service -db -service "" [-instance | -node ] [-global_override]
Usage: srvctl status service {-db [-service "" | -pdb ] | -serverpool [-db ]} [-force] [-verbose]
Usage: srvctl predict service -db -service [-verbose]
Usage: srvctl modify service -db -service
{[-oldinst -newinst | -available -toprefer | -modifyconfig -preferred "" [-available ""]]
| [-serverpool ] [-pqservice ] [-pqpool ""] [-cardinality {UNIFORM | SINGLETON}] [-tafpolicy {BASIC | NONE}]
[-role [PRIMARY][,PHYSICAL_STANDBY][,LOGICAL_STANDBY][,SNAPSHOT_STANDBY]] [-policy {AUTOMATIC | MANUAL}] [-notification {TRUE | FALSE}]
[-dtp {TRUE | FALSE}] [-clbgoal {SHORT | LONG}] [-rlbgoal {NONE | SERVICE_TIME | THROUGHPUT}]
[-failovertype {NONE | SESSION | SELECT | TRANSACTION | AUTO}] [-failoverretry ] [-failoverdelay ] [-failover_restore {NONE | LEVEL1 | AUTO}] [-failback {YES | NO}]
[-edition ] [-pdb ] [-sql_translation_profile ] [-commit_outcome {TRUE|FALSE}] [-retention ]
[-replay_init_time ] [-session_state {STATIC | DYNAMIC | AUTO}] [-maxlag ] [-gsmflags ] [-tablefamilyid ] [-drain_timeout ] [-stopoption ]
[-global_override] [-css_critical {YES | NO}] [-rfpool -hubsvc ]} [-eval] [-verbose] [-force]
Usage: srvctl relocate service -db [-service | -pdb ] {-oldinst [-newinst ] | -currentnode [-targetnode ]} [-drain_timeout ] [-wait ] [-pq] [-force [-noreplay] [-stopoption ]] [-eval] [-verbose]Usage: srvctl remove service -db -service [-global_override] [-force]
Usage: srvctl start service { -node | -db [-node | -instance ] [-service "" [-pq] | -pdb | -serverpool ] [-global_override] [-rol
e] [-startoption ] [-eval]} [-verbose]Usage: srvctl stop service {-node | -db [-pq] [-pdb | -service "" [-eval]] [-node | -instance | -serverpool ]} [-stopoption ] [-drain_timeout ] [-wait {YES | NO}] [-force [-noreplay]] [-global_override] [-verbose]Usage: srvctl add nodeapps { { -node -address {|}/[/if1[|if2...]] [-skip]} | { -subnet /[/if1[|if2...]] } } [-emport ] [-onslocalport ] [-onsremoteport ] [-remoteservers [:][,[:]...]] [-clientdata [-scanclient]] [-pingtarget ""] [-vipless] [-verbose]Usage: srvctl config nodeapps [-viponly] [-onsonly]
Usage: srvctl modify nodeapps {[-node -address {|}/[/if1[|if2...]] [-skip]] | [-subnet