返回首頁
當前位置: 主頁 > 網絡編程 > Jsp實例教程 >

Oracle RAC 常用維護工具和命令大全

時間:2011-06-08 18:35來源:知行網www.bccsxs.icu 編輯:麥田守望者

Oracle 的管理可以通過OEM或者命令行接口。 Oracle Clusterware的命令集可以分為以下4種:

節點層:osnodes

網絡層:oifcfg

集群層:crsctl, ocrcheck,ocrdump,ocrconfig

應用層:srvctl,onsctl,crs_stat

下面分別來介紹這些命令。
一. 節點層

只有一個命令: osnodes, 這個命令用來顯示集群點列表,可用的參數如下,這些參數可以混合使用。
 


[[email protected] bin]# ./olsnodes --help

Usage: olsnodes [-n] [-p] [-i] [<node> | -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

<node> print information for the specified node

-l print information for the local node

-g turn on logging

-v run in verbose mode

[[email protected] 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:刪除網口

[[email protected] bin]# ./oifcfg --help

PRIF-9: incorrect usage
 


Name:

oifcfg - Oracle Interface Configuration Tool.
 


Usage: oifcfg iflist [-p [-n]]

oifcfg setif {-node <nodename> | -global} {<if_name>/<subnet>:<if_type>}...

oifcfg getif [-node <nodename> | -global] [ -if <if_name>[/<subnet>] [-type <if_type>] ]

oifcfg delif [-node <nodename> | -global] [<if_name>[/<subnet>]]

oifcfg [-help]
 


<nodename> - name of the host, as known to a communications network

<if_name> - name by which the interface is configured in the system

<subnet> - subnet address of the interface

<if_type> - type of the interface { cluster_interconnect | public | storage }
 

 


[[email protected] bin]# ./oifcfg iflist

eth0 10.85.10.0

eth1 192.168.1.0

[[email protected] 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 類型的網卡

[[email protected] 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

-- 刪除接口配置

[[email protected] bin]# ./oifcfg delif -global

-- 添加接口配置

[[email protected] bin]# ./oifcfg setif -global eth0/192.168.1.119:public

[[email protected] 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進程功能。

[[email protected] 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 <parameter> <value> - sets a parameter override

crsctl get css <parameter> - gets the value of a CSS parameter

crsctl unset css <parameter> - sets CSS parameter to its default

crsctl query css votedisk - lists the voting disks used by CSS

crsctl add css votedisk <path> - adds a new voting disk

crsctl delete css votedisk <path> - removes a voting disk

crsctl enable crs - enables startup for all CRS daemons

crsctl disable crs - disables startup for all CRS daemons

crsctl start crs - starts all CRS daemons.

crsctl stop crs - stops all CRS daemons. Stops CRS resources in case of cluster.

crsctl start resources - starts CRS resources.

crsctl stop resources - stops CRS resources.

crsctl debug statedump evm - dumps state info for evm objects

crsctl debug statedump crs - dumps state info for crs objects

crsctl debug statedump css - dumps state info for css objects

crsctl debug log css [module:level]{,module:level} ...

- Turns on debugging for CSS

crsctl debug trace css - dumps CSS in-memory tracing cache

crsctl debug log crs [module:level]{,module:level} ...

- Turns on debugging for CRS

crsctl debug trace crs - dumps CRS in-memory tracing cache

crsctl debug log evm [module:level]{,module:level} ...

- Turns on debugging for EVM

crsctl debug trace evm - dumps EVM in-memory tracing cache

crsctl debug log res <resname:level> turns on debugging for resources

crsctl query crs softwareversion [<nodename>] - lists the version of CRS software installed

crsctl query crs activeversion - lists the CRS software operating version

crsctl lsmodules css - lists the CSS modules that can be used for debugging

crsctl lsmodules crs - lists the CRS modules that can be used for debugging

crsctl lsmodules evm - lists the EVM modules that can be used for debugging
 


If necesary any of these commands can be run with additional tracing by

adding a "trace" argument at the very front.

Example: crsctl trace check css
 


3.1.1 檢查CRS 狀態

[[email protected] bin]# ./crsctl check crs

CSS appears healthy

CRS appears healthy

EVM appears healthy
 


-- 檢查單個狀態

[[email protected] bin]# ./crsctl check cssd

CSS appears healthy

[[email protected] bin]# ./crsctl check crsd

CRS appears healthy

[[email protected] bin]# ./crsctl check evmd

EVM appears healthy
 


3.1.2 配置CRS 棧是否自啟動

CRS 進程棧默認隨著操作系統的啟動而自啟動,有時出于維護目的需要關閉這個特性,可以用root 用戶執行下面命令。

[[email protected] bin]# ./crsctl disable crs

[[email protected] bin]# ./crsctl enable crs

這個命令實際是修改了/etc/oracle/scls_scr/raw/root/crsstart 這個文件里的內容。
 

------分隔線----------------------------
標簽(Tag):數據庫 Oracle
------分隔線----------------------------
推薦內容
猜你感興趣
赛车pk10官网开奖记录