ORACLE 11g RAC 集群的管理与维护(1)

您所在的位置:网站首页 查看集群数据节点的命令是什么意思 ORACLE 11g RAC 集群的管理与维护(1)

ORACLE 11g RAC 集群的管理与维护(1)

2024-07-12 14:25| 来源: 网络整理| 查看: 265

ORACLE 11g RAC 集群的管理与维护(1) —— crsctl 命令之(一) :概述

crsctl 是用户和 Oracle Clusterware 之间的一个接口。可以使用这些命令在集群上执行检查、启动和停止操作。可以使用 crsctl 命令在 oracle clusterware 上执行以下操作:

(1)启动和停止 Oracle Clusterware resources; (2)启用和禁用 Oracle Clusterware 守护进程; (3)检查集群的健康状况; (4)管理代表第三方应用的资源; (5)将 Intelligent Platform Management Interface(IPMI,智能平台管理接口)与 Oracle Clusterware 集成,提供故障隔离支持,保证集群的完整性; (6)调试 Oracle Clusterware components。

可以在一个节点上运行集群命令,在集群中的另一个节点上执行操作,称为远程操作,从而简化了集群的管理。例如,您不再需要登录到每个节点来检查所有节点上的 Oracle Clusterware 的状态。集群命令完全独立于操作系统,它们依赖于 Oracle High Availability Services Daemon(OHASD,Oracle 高可用性服务守护进程)。如果 OHASD 守护进程正在运行,就可以执行远程操作。比如:启动、停止和检查远程节点的状态。

一、crsctl 命令概述 1、crsctl 命令位于 grid 用户的 $ORACLE_HOME/bin 目录 [grid@rac1 ~]$ cd $ORACLE_HOME/bin [grid@rac1 bin]$ ll crsctl -rwxr-xr-x 1 root oinstall 8572 Apr 21 15:44 crsctl 2、 crsctl 命令的一般格式

要运行 crsctl 命令,在操作系统提示符处输入 crsctl,然后输入 command 和 arguments,例如:

[grid@rac1 bin]$ crsctl check cluster CRS-4537: Cluster Ready Services is online CRS-4529: Cluster Synchronization Services is online CRS-4533: Event Manager is online 3、使用帮助查看 crsctl 命令的用法 (1)查看 crsctl 命令的帮助信息 [grid@rac2 admin]$ crsctl -h Usage: crsctl add - add a resource, type or other entity crsctl check - check a service, resource or other entity crsctl config - output autostart configuration crsctl debug - obtain or modify debug state crsctl delete - delete a resource, type or other entity crsctl disable - disable autostart crsctl discover - discover DHCP server crsctl enable - enable autostart crsctl get - get an entity value crsctl getperm - get entity permissions crsctl lsmodules - list debug modules crsctl modify - modify a resource, type or other entity crsctl query - query service state crsctl pin - pin the nodes in the node list crsctl relocate - relocate a resource, server or other entity crsctl replace - replaces the location of voting files crsctl release - release a DHCP lease crsctl request - request a DHCP lease crsctl setperm - set entity permissions crsctl set - set an entity value crsctl start - start a resource, server or other entity crsctl status - get status of a resource or other entity crsctl stop - stop a resource, server or other entity crsctl unpin - unpin the nodes in the node list crsctl unset - unset an entity value, restoring its default (2)查看某个特定命令的帮助

比如需要查看 crsctl start,使用如下格式:

[grid@rac1 bin]$ crsctl start -? Parse error: '-?' is an invalid argument Brief usage: crsctl start resource { [...]|-w ]|-all} [-n ] [-k ] [-d ] [-env "env1=val1,env2=val2,..."] [-f] [-i] crsctl start crs [-excl [-nocrs]|-nowait] Start OHAS on this server where -excl Start Oracle Clusterware in exclusive mode -nocrs Start Oracle Clusterware in exclusive mode without starting CRS -nowait Do not wait for OHAS to start crsctl start cluster [[-all]|[-n [...]]] crsctl start ip -A {|}// Start an IP on the given interface with specified net mask Where IP_name Name which resolves to an IP. If it is not a fully qualified domain name then standard name search will be used. IP_address IP address net_mask Subnet mask for the IP to start interface_name Interface on which to start the IP crsctl start testdns [-address ] [-port ][-domain ] [-once][-v] Start a test DNS listener that listens on the given address at the given port and for specified domain Where IP_address IP address to be used by the listener (defaults to hostname) port The port on which the listener will listen. Default value is 53. domain The domain query for which to listen. By default, all domain queries are processed. -once Flag indicating that DNS listener should exit after one DNS query packet is received -v Verbose output For complete usage, use: crsctl [-h | --help] For detailed help on each command and object and its options use: crsctl -h For example, crsctl relocate resource -h 二、crsctl 命令的分类 1、Oracle Restart Environment CRSCTL Commands(在 Oracle Restart 环境中使用)

在 Oracle Restart 环境中使用的 crsctl 命令如下:

crsctl check has ## 检查 HAS 的状态 crsctl config has ## 显示 HAS 的自动启动/配置 crsctl disable has ## 禁用 HAS 的自动启动 crsctl enable has ## 启用 HAS 的自动启动 crsctl start has ## 启动本地服务器上的 HAS crsctl stop has ## 停止本地服务器上的 HAS 2、Oracle RAC Environment CRSCTL Commands(在 Oracle RAC 环境中使用)

在 Oracle RAC 环境中使用的 crsctl 命令如下:

crsctl add crs administrator # 添加管理员 crsctl add css votedisk # 将一个或多个表决磁盘添加到集群 crsctl add serverpool # 将一个服务器池添加到 oracle clusterware 中 crsctl check cluster # 检查 oracle clusterware stack 的状态 crsctl check crs # 查询本地服务器上 OHAS 和 Oracle Clusterware 的状态 crsctl check resource crsctl check ctss # 检查群集时间同步服务的状态 crsctl config crs # 查询 HAS 自动启动配置 crsctl delete crs administrator # 删除crs 管理员 crsctl delete css votedisk # 删除表决磁盘 crsctl delete node crsctl delete serverpool crsctl disable crs # 禁用 CRS 的自动启动 crsctl discover dhcp crsctl enable crs # 启用 CRS 的自动启动 crsctl get clientid dhcp crsctl get css # 获取特定 cluster synchronization 服务参数的值 crsctl get nodename crsctl getperm serverpool crsctl lsmodules crsctl modify serverpool # 修改现有服务器池 crsctl pin css crsctl query crs administrator # 查询具有 Oracle Clusterware 管理权限的用户列表 crsctl query crs activeversion # 查询集群中运行的 Oracle Clusterware 软件的 activex 版本 crsctl query crs releaseversion # 查询本地节点上二进制文件中存储的 Oracle Clusterware 软件的版本 crsctl query crs softwareversion # 查询在指定节点上成功启动的软件的最新版本: crsctl query css votedisk # 显示集群同步服务使用的表决磁盘、表决磁盘的状态以及磁盘的位置 crsctl query dns crsctl release dhcp crsctl relocate resource crsctl relocate server # 将服务器重新定位到不同的服务器池 crsctl replace discoverystring crsctl replace votedisk # 移动或替换现有的投票磁盘 crsctl request dhcp crsctl set css # 设置集群 synchronization services 参数的值 crsctl setperm serverpool # 获取特定服务器池的状态和配置信息 crsctl start cluster # 启动集群或特定服务器上的 oracle clusterware stack crsctl start crs # 启动本地服务器上的 CRS crsctl start ip crsctl start testdns crsctl status ip crsctl status server # 获取特定服务器的状态和配置信息 crsctl status serverpool crsctl status testdns crsctl stop cluster # 停止集群或特定服务器上的 oracle clusterware stack crsctl stop crs # 停止本地服务器上的 CRS crsctl stop ip crsctl stop testdns crsctl unpin css crsctl unset css # 将集群 synchronization services 参数的值还原为默认值 3、Dual Environment CRSCTL Commands(在 Oracle RAC环境和 Oracle Restart 环境中均可使用)

在 Oracle RAC环境和 Oracle Restart 环境中均可使用的 crsctl 命令如下:

crsctl add resource crsctl add type crsctl check css # 检查 css(集群同步服务)的状态 crsctl check evm crsctl delete resource # 从 oraclelusterware 配置中删除资源 crsctl delete type crsctl get hostname crsctl getperm resource crsctl getperm type crsctl modify resource crsctl modify type crsctl setperm resource crsctl setperm type crsctl start resource crsctl status resource crsctl status type crsctl stop resource 三、Oracle 11g R2 RAC 弃用的命令及替代命令

比如:原有的 crsctl check crsd 被替换为 crsctl check crs。

[grid@rac1 bin]$ crsctl check crsd CRS-272: This command remains for backward compatibility only ##该命令只是为了提供向下兼容 Cluster Ready Services is online [grid@rac1 bin]$ crsctl check crs CRS-4638: Oracle High Availability Services is online CRS-4537: Cluster Ready Services is online CRS-4529: Cluster Synchronization Services is online CRS-4533: Event Manager is online

Oracle 11g R2 RAC 弃用的命令及替代命令对照表:

不推荐使用的命令crsct 命令crs_statcrsctl check cluster -allcrsctl stat res -tcrs_registercrsctl add resourcecrsctl add typecrsctl modify resourcecrsctl modify typecrs_unregistercrsctl stop resourcecrsctl modify resource resource_name -attr"AUTO_START=never"crs_startcrsctl start resourcecrsctl start crscrsctl start clustercrs_stopcrsctl stop resourcecrsctl stop crscrsctl stop clustercrs_getpermcrsctl getperm resourcecrsctl getperm typecrs_profilecrsctl add resourcecrsctl add typecrsctl status resourcecrsctl status typecrsctl modify resourcecrsctl modify typecrs_relocatecrsctl relocate resourcecrs_setpermcrsctl setperm resourcecrsctl setperm typecrsctl check crsdcrsctl check crscrsctl check cssdcrsctl check csscrsctl check evmdcrsctl check evmcrsctl debug res logresource_name:levelcrsctl set logcrsctl set css votediskcrsctl add css votediskcrsctl delete css votediskcrsctl query css votediskcrsctl replace votediskcrsctl start resourcescrsctl start resource -allcrsctl stop resourcescrsctl stop resource -all


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3