Oracle RAC 常用维护工具和命令(一)

2014-11-24 13:09:13 · 作者: · 浏览: 4
Oracle 的管理可以通过OEM或者命令行接口。Oracle Clusterware的命令集可以分为以下4种:
节点层:osnodes
网络层:oifcfg
集群层:crsctl, ocrcheck,ocrdump,ocrconfig
应用层:srvctl,onsctl,crs_stat
下面分别来介绍这些命令。
一. 节点层
只有一个命令: osnodes, 这个命令用来显示集群点列表,可用的参数如下,这些参数可以混合使用。
[root@raw1 bin]# ./olsnodes --help
Usage: olsnodes [-n] [-p] [-i] [ | -l] [-g] [-v]
where
-n print node number with the node name
-p print private interconnect name with the node name
-i print virtual IP name with the node name
print information for the specified node
-l print information for the local node
-g turn on logging
-v run in verbose mode
[root@raw1 bin]# ./olsnodes -n -p -i
raw1 1 raw1-priv raw1-vip
raw2 2 raw2-priv raw2-vip
二. 网络层
网络层由各个节点的网络组件组成,包括2个物理网卡和3个IP 地址。 也只有一个命令:oifcfg.
Oifctg 命令用来定义和修改Oracle 集群需要的网卡属性,这些属性包括网卡的网段地址,子网掩码,接口类型等。 要想正确的使用这个命令, 必须先知道Oracle 是如何定义网络接口的,Oracle的每个网络接口包括名称,网段地址,接口类型3个属性。
Oifcfg 命令的格式如下:interface_name/subnet:interface_type
这些属性中没有IP地址,但接口类型有两种,public和private,前者说明接口用于外部通信,用于Oracle Net和VIP 地址,而后者说明接口用于Interconnect。
接口的配置方式分为两类:global 和node-specific。 前者说明集群所有节点的配置信息相同,也就是说所有节点的配置是对称的;而后者意味着这个节点的配置和其他节点配置不同,是非对称的。
Iflist:显示网口列表
Getif: 获得单个网口信息
Setif:配置单个网口
Delif:删除网口
[root@raw1 bin]# ./oifcfg --help
PRIF-9: incorrect usage
Name:
oifcfg - Oracle Interface Configuration Tool.
Usage: oifcfg iflist [-p [-n]]
oifcfg setif {-node | -global} {/:}...
oifcfg getif [-node | -global] [ -if [/] [-type ] ]
oifcfg delif [-node | -global] [[/]]
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
- type of the interface { cluster_interconnect | public | storage }
[root@raw1 bin]# ./oifcfg iflist
eth0 10.85.10.0
eth1 192.168.1.0
[root@raw1 bin]# ./oifcfg getif
eth0 10.85.10.119 global public
eth0 10.85.10.121 global public
eth0 10.85.10.0 global public
eth1 192.168.1.119 global cluster_interconnect
eth1 192.168.1.121 global cluster_interconnect
eth1 192.168.1.0 global cluster_interconnect
-- 查看public 类型的网卡
[root@raw1 bin]# ./oifcfg getif -type public
eth0 10.85.10.119 global public
eth0 10.85.10.121 global public
eth0 10.85.10.0 global public
-- 删除接口配置
[root@raw1 bin]# ./oifcfg delif -global
-- 添加接口配置
[root@raw1 bin]# ./oifcfg setif -global eth0/192.168.1.119:public
[root@raw1 bin]# ./oifcfg setif -global eth1/10.85.10.119:cluster_interconnect
三. 集群层
集群层是指由Clusterware组成的核心集群, 这一层负责维护集群内的共享设备,并为应用集群提供完整的集群状态视图,应用集群依据这个视图进行调整。 这一层共有4个命令:crsctl, ocrcheck,ocrdump,ocrconfig. 后三个是针对OCR 磁盘的。
3.1 CRSCTL
Crsctl 命令可以用来检查CRS 进程栈,每个crs 进程状态,管理Votedisk,跟踪CRS进程功能。
[root@raw1 bin]# ./crsctl
Usage: crsctl check crs - checks the viability of the CRS stack
crsctl check cssd - checks the viability of CSS
crsctl check crsd - checks the viability of CRS
crsctl check evmd - checks the viability of EVM
crsctl set css - sets a parameter override
crsctl get css - gets the value of a CSS parameter
crsctl unset css - sets CSS parameter to its default
crsctl query css votedisk - lists th