sqlplus / as sysasm
crs_stat -t
ora.scan1.vip服务默认是在第一台主机上的,第一台主机挂掉之后,以秒计切换到第二台主机上
正常情况下:ora.gsd和ora.ons这两个服务是不开的
ora.ons --数据库与中间件相连的,作为通讯用的
ora.gsd --全局服务进程,兼容oracle9i
ora.cvu --集群验证服务
#检查crs服务状态
crsctl check crs
#查看asm的命令
asmcmd
lsdg
#查看监听状态
lsnrctl status
#查看资源情况
crsctl status res -t
数据库状态
#查看数据库模式select name,open_mode from v$database;#查看实例状态:select instance_name,status,DATABASE_TYPE from v$instance;
RAC的启动与停止
#启动su - root
crsctl start crs
crsctl check crs
crsctl status res -t
crs_stat -tsu - oracle
sqlplus "/as sysdba"
startup
select name,open_mode from v$database;select instance_name,status,DATABASE_TYPE from v$instance;#停止su - oracle
sqlplus "/as sysdba"shutdown immediate
su - root
crsctl stop crs
RAC日常检查与操作
crsctl check crs
crsctl status res -t
crs_stat -t
asmcmd lsdg
ocrcheck
再检查grid,db日志,是否有异常
#检查数据库运行状态
srvctl status database -d testdb
#检查数据库实例的运行状态
srvctl status instance -d testdb -i testpdb1
#显示已配置的数据库信息
srvctl config database
#显示已配置的数据库的具体信息
srvctl config database -d testdb
#查看ASM状态
srvctl status asm
#停止数据库testdb的实例testpdb1
srvctl stop instance -d testdb -i testpdb1
RAC常用命令
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
srvctl
Usage: srvctl <command><object>[<options>]
commands: enable|disable|start|stop|relocate|status|add|remove|modify|getenv|setenv|unsetenv|config|convert|upgrade
objects: database|instance|service|nodeapps|vip|network|asm