资源启动顺序: 先
1、HACMP
2、crs#crs_start -all 此命令用来启动所有的集群服务,但是启动的前提是 资源状态State不能是UNKNOWN。
#crs_stop -all
$crs_stop ora.rac1.LISTENER_RAC1.lsnr
$crsctl query css votedisk 查看 vote disk
资源关闭顺序:
1、先关闭 数据库
#srvctl stop database -d szdig -o ///szdig 实例名,有多少个实例,就要执行多少个这样的命令
2、关闭listener
#srvctl stop listner -n rac1
#srvctl stop listner -n rac2
3、关闭节点应用
#srvctl stop nodeapps -n rac1
#srvctl stop nodeapps -n rac2
4、关闭crs
#srvctl stop crs
5、查看crs 状态
#crs_stat -t 所有资源显示为offline
6、关闭 hacmp
#smitty clstop
$ORA_CRS_HOME/bin/crsctl check crs用于检查后台进程状态
$ORA_CRS_HOME/bin/crsctl start resources启动crs资源
$ORA_CRS_HOME/bin/crsctl start crs启动crs,需要超级用户操作。
$ORA_CRS_HOME/bin/crsctl stop crs关闭crs,需要超级用户操作。
$ORA_CRS_HOME/bin/crs_unregister取消注册crs
$ORA_CRS_HOME/bin/ocrcheck检查ocr设置信息用ocrcheck
$ORA_CRS_HOME/bin/crsctl query css votedisk检查表决磁盘信息
0. 0 /dev/rhdisk6
1. 0 /dev/rhdisk7
2. 0 /dev/rhdisk8
located 3 votedisk(s).
执行crsctl命令的可以是root用户,也可以是oracle用户,如果是root用户要指定绝对路径,但是对于crsctl start crs和crsctl stop crs必须是root用户来执行。
crs主要进程
(1)crsd
负责管理ha操作
管理crs资源,如linstener,vip,ons,gsn等
由root用户管理、启动
(2)ocssd
管理各节点的关系,用于节点间通信
由oracle用户运行管理
(3)oprocd
集群进程管理 -Process monitor for the cluster.
仅在没有使用vendor的集群软件状态下运行
(4)evmd
事件检测进程,由oracle用户运行管理
(5)主要log位置
$ORA_CRS_HOME/log/节点主机名/racg
$ORA_CRS_HOME/log/节点主机名/crsd
$ORA_CRS_HOME/crs/init
$ORA_CRS_HOME/css/log
$ORA_CRS_HOME/css/init
$ORA_CRS_HOME/evm/log
$ORA_CRS_HOME/evm/init
$ORA_CRS_HOME/srvm/log
察看数据库服务器本地监听:
134
#more $ORACLE_HOME/network/admin/listener.ora看看
[oracle@ywa:/oracle/app/oracle/product/10.2.0/db_1/network/admin]$more $ORACLE_HOME/network/admin/listener.ora
# listener.ora.ywa Network Configuration File: /oracle/app/oracle/product/10.2.0/db_1/network/admin/listener.ora.ywa
# Generated by Oracle configuration tools.
LISTENER_YWA =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ywa-vip)(PORT = 1521)(IP = FIRST))
(ADDRESS = (PROTOCOL = TCP)(HOST = 202.116.193.133)(PORT = 1521)(IP = FIRST))
)
)
SID_LIST_LISTENER_YWA =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /oracle/app/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
)
136
[oracle@ywb:/oracle/app/oracle/product/10.2.0/db_1/network/admin]$more $ORACLE_HOME/network/admin/listener.ora
# listener.ora.ywb Network Configuration File: /oracle/app/oracle/product/10.2.0/db_1/network/admin/listener.ora.ywb
# Generated by Oracle configuration tools.
LISTENER_YWB =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ywb-vip)(PORT = 1521)(IP = FIRST))
(ADDRESS = (PROTOCOL = TCP)(HOST = 202.116.193.135)(PORT = 1521)(IP = FIRST))
)
)
SID_LIST_LISTENER_YWB =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /oracle/app/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
)
lsnrctl status LISTENER_YWA
CRSCTL命令用法(zt)
主要内容:
. CRS 的组成
. CRSCTL命令的用法举例
. Start/Stop RAC Instance
1. How the crs related services startup when OS startup or reboot:
OS: Linux
From the directory (/etc/init.d), There are four executable shell scripts:
init.crs (Combination of all services' start)
init.crsd (crs daemon)
init.cssd (cluster synchronization service)
init.evmd (event manager)
Note: /etc/init.d/init.crs start is not supported until 10.1.0.4
/etc/init.d/init.crs stop is supported since 10.1.0.2
2. How to start/stop crs related services ?
From the directory: $CRS_HOME/bin, there are several executable shell scripts (Start with crs_):
crsctl (Combination of all crs conctrl command)
crsd (crs daemon)
crs_getperm (Get parameter)
crs_profile
crs_register (Register targets on the host)
crs_unregister (Unregister targets on the host)
Maybe this command is useful when you want to remove error register information which has been detected by CRS.
Steps:
#list all listener of cluster env
crs_stat |grep lsnr
# resource_name comes from: crs_stat |grep name
crs_unregister resource_name -q
crs_relocate (Relocate targets on the host)
3. Detailed usage
3.1 crsctl
Note: There are some relationship between CSS,CRS,EVM services.Bouncing CRS service will start CRS resources first, then bounce CSS and EVM service automatically;
Shutting down CRS service will stop CRS resources only, It doesn't affect other related services(CSS,EVM)
If user wanna shutdown CSS service, CRS, EVM service will be stopped as well;
If user wanna shutdown CRS or CSS service, EVM service will be stopped as well;
So, In order to eliminate the dependency of these services, we'd better use command line tool "crsctl" to bounce crs service. Issue the command "crsctl" and it will list all available commands:
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 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.
Note: Since 10.2, User can choose either "init.crs start/stop" or "crsctl start/stop crs" to start/stop all CRS daemons.
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 turns on debugging for resources
crsctl query crs softwareversion []
- 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.2 Startup/shutdown steps
In windows, the correct startup/shutdown steps is:
Shutdown:
1. Shutdown db console service if it's running
2. Shutdown OraService via "control panel" ->"services"
3. srvctl stop instance -d -i
4. srvctl stop asm -n if using asm
5. srvctl stop nodeapps -n
6. Shutdown crs service via "control panel" ->"services"
Startup:
1. Startup crs service via "control panel" ->"services"
2. srvctl start nodeapps -n
3. srvctl start asm -n if using asm
4. srvctl start instance -d -i
5. Startup OraService via "control panel" ->"services"
6. Startup db console service if it's running
In Linux, almost all steps are same except how to startup/shutdown crs service. You can execute "/etc/init.d/init.crs stop/start" or issue "crsctl start/stop crs" to bounce or shutdown crs service.
EXAMPLE:
$ date
Thu Nov 15 08:31:02 BEIST 2007
$ hostname
Db01
$ ls /etc/*init*
/etc/init /etc/init.cssd /etc/inittab.nocrs10203 /etc/telinit
/etc/init.crs /etc/init.evmd /etc/inittab.orig
/etc/init.crsd /etc/inittab /etc/inittab.pre10203
$
$ crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
$
$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....01.lsnr application ONLINE ONLINE db01
ora.db01.gsd application ONLINE ONLINE db01
ora.db01.ons application ONLINE ONLINE db01
ora.db01.vip application ONLINE ONLINE db01
ora....a1.inst application ONLINE ONLINE db01
ora....02.lsnr application ONLINE ONLINE db02
ora.db02.gsd application ONLINE ONLINE db02
ora.db02.ons application ONLINE ONLINE db02
ora.db02.vip application ONLINE ONLINE db02
ora.oa.db application ONLINE ONLINE db02
ora....a2.inst application ONLINE ONLINE db02
$ crs_stat
NAME=ora.db01.LISTENER_DB01.lsnr
TYPE=application
TARGET=ONLINE
STATE=ONLINE on db01
NAME=ora.db01.gsd
TYPE=application
TARGET=ONLINE
STATE=ONLINE on db01
NAME=ora.db01.ons
TYPE=application
TARGET=ONLINE
STATE=ONLINE on db01
NAME=ora.db01.vip
TYPE=application
TARGET=ONLINE
STATE=ONLINE on db01
NAME=ora.db02.LISTENER_DB02.lsnr
TYPE=application
TARGET=ONLINE
STATE=ONLINE on db02
NAME=ora.db02.gsd
TYPE=application
TARGET=ONLINE
STATE=ONLINE on db02
NAME=ora.db02.ons
TYPE=application
TARGET=ONLINE
STATE=ONLINE on db02
NAME=ora.db02.vip
TYPE=application
TARGET=ONLINE
STATE=ONLINE on db02
NAME=ora.oa.db
TYPE=application
TARGET=ONLINE
STATE=ONLINE on db02
NAME=ora.oa.oa1.inst
TYPE=application
TARGET=ONLINE
STATE=ONLINE on db01
NAME=ora.oa.oa2.inst
TYPE=application
TARGET=ONLINE
STATE=ONLINE on db02
$ crsctl check cssd
CSS appears healthy
$ crsctl check crsd
CRS appears healthy
$ crsctl check evmd
EVM appears healthy
$ crsctl query css votedisk
0. 0 /dev/rrac_vote512m
$ crsctl query crs softwareversion
CRS software version on node [db02] is [10.2.0.3.0]
$ crsctl query crs activeversion
CRS active version on the cluster is [10.2.0.3.0]
$