oraclerac常用的命令(一)

2014-11-24 15:08:37 · 作者: · 浏览: 0
oracle rac常用的命令
节点层:olsnodes
网络层: oifcfg
集群层:crsctl,ocrcheck,ocrdump,ocrconfig
应用层:srvctl,onsctl,crs_stat


一.节点层:
olsnodes 用来显示集群点列表,可以混用
[root@rac1 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@rac1 bin]# ./olsnodes -n -p -i
rac1 1 rac1-priv rac1-vip
rac2 2 rac2-priv rac2-vip
[root@rac1 bin]# ./olsnodes -v
prlslms: Initializing LXL global
prlsndmain: Initializing CLSS context
prlsmemberlist: No of cluster members configured = 256
prlsmemberlist: Getting information for nodenum = 1
prlsmemberlist: node_name = rac1
prlsmemberlist: ctx->lsdata->node_num = 1
prls_printdata: Printing the node data
rac1
prlsmemberlist: Getting information for nodenum = 2
prlsmemberlist: node_name = rac2
prlsmemberlist: ctx->lsdata->node_num = 2
prls_printdata: Printing the node data
rac2
prlsndmain: olsnodes executed successfully
prlsndterm: Terminating LSF


二.网络层:
网络层由各个节点的网络组件组成,包括2个物理网卡和3个IP 地址。 也只有一个命令:oifcfg.
Oifctg 命令用来定义和修改Oracle 集群需要的网卡属性,这些属性包括网卡的网段地址,子网掩码,接口类型等。 要想正确的使用这个命令, 必须先知道Oracle 是如何定义网络接口的,Oracle的每个网络接口包括名称,网段地址,接口类型3个属性。
这些属性中没有IP地址,但接口类型有两种,public和private,前者说明接口用于外部通信,用于Oracle Net和VIP 地址,而后者说明接口用于Interconnect。
接口的配置方式分为两类: global 和node-specific。 前者说明集群所有节点的配置信息相同,也就是说所有节点的配置是对称的;而后者意味着这个节点的配置和其他节点配置不同,是非对称的。


[root@rac1 bin]# ./oifcfg


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 }


1.iflist:显示网口列表
[root@rac1 bin]# ./oifcfg iflist -p -n
eth0 192.168.90.0 PRIVATE 255.255.255.0
eth1 192.168.91.0 PRIVATE 255.255.255.0


2.getif: 获得单个网口信息
[root@rac1 bin]# ./oifcfg getif
eth0 192.168.90.0 global public
eth1 192.168.91.0 global cluster_interconnect
还可以查看网卡类型
[root@rac1 bin]# ./oifcfg getif -type public
eth0 192.168.90.0 global public


3.delif:删除接口配置
[root@rac1 bin]# ./oifcfg delif -global
[root@rac1 bin]# ./oifcfg getif


4.setif:配置单个网口
[root@rac1 bin]# ./oifcfg getif
eth0 192.168.90.2 global public
eth1 192.168.91.3 global cluster_interconnect


三.集群层:
集群层是指由Clusterware组成的核心集群, 这一层负责维护集群内的共享设备,并为应用集群提供完整的集群状态视图,应用集群依据这个视图进行调整。 这一层共有4个命令: crsctl, ocrcheck,ocrdump,ocrconfig. 后三个是针对OCR 磁盘的。
3.1 CRSCTL
CRSCTL 命令可以用来检查CRS进程栈,每个crs进程状态,管理Votedisk,跟踪CRS进程功能。
[oracle@rac1 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 the voting disks used by CSS
crsctl add css votedisk - adds a new voting disk
crsctl delete css votedisk - removes a voting disk
crsctl enabl