oracle集管理,OracleRAC集⽇常管理命令-11gR2
CRSCTL:
查看集中所有资源状态:
crsctl status res -t
守护进程状态:
crsctl status res -t -init
启动/关闭 集服务:
crsctl start/stop crs
检查集服务状态:
crsctl check crs
集⾃启动:
Root:Crsctl enable/disable crs
查看集版本:
crsctl query crs activeversion
查看某个ora资源状态:
crsctl status res -p
(-p可以查看每个资源详细的属性)
关闭启动某个ora资源:
crsctl start 4j
(有的⽆法单独关闭,因为存在资源依赖关系)。
crsctl start cluster 与 crsctl start crs区别:
crsctl start cluster 可以对集的所有节点资源进⾏操作。(前提是⽬标节点OHASD进程必须已经启动)
crsctl start crs 对当前节点的资源进⾏操作,包含OHAS。
例如:
[grid@node1 ~]$ crsctl check cluster
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
[grid@node1 ~]$ crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
使⽤srvctl资源控制命令
srvctl核⼼命令:
查询所有实例的状态
srvctl status database -d racdb
SQL> select * from v$active_instances;
查询单节点实例的状态
srvctl status instance -d racdb -i racdb1
关闭所有节点的实例
srvctl stop database -d racdb
关闭单节点的实例
srvctl stop instance -d racdb -i racdb2
查看RAC数据库配置
srvctl config database -d racdb
使⽤srvctl管控其他资源:
Srvctl config network
Srvctl config vip -n node1
Srvctl status vip -n node1
Srvctl config scan
Srvctl status scan
Srvctl config listener
Srvctl status listener
srvctl start/stop listener -n node1 停⽌监听资源
Srvctl config scan_listener
Srvctl status scan_listener
Srvctl config asm -a
srvctl config asm -n node1 查看指定节点的ASM配置。Srvctl status asm
Srvctl status diskgroup -g data1
srvctl config nodeapps -n node1 节点应⽤配置
srvctl status nodeapps 节点应⽤状态
srvctl stop nodeapps 停⽌某节点上的所有应⽤
ASM操作:
登录ASM实例:
grid user:sqlplus / as sysasm
查看ASM实例状态:
srvctl status asm
srvctl status asm -a
asmcmd lsdg 查看磁盘组情况(是否挂载/总空间/可⽤空间)
磁盘组-SQL:
查看每个磁盘组可⽤⼤⼩
SQL> select name,allocation_unit_size,total_mb from v$ asm_diskgroup;查询磁盘组状态:
SQL> select name,state from v$asm_diskgroup;
查看磁盘名与裸设备对应关系
select name,path from v $asm_disk_stat;
ASMCMD命令操作:
oracle登录命令命令⾏ asmcmd > help
ASM⽂件 asmcmd > cp/ls
关闭ASM:
(需要与crs⼀起关闭) srvctl stop crs
管理OCR:
OCR⽂件检查:
ocrcheck
添加/删除OCR镜像磁盘组
ocrconfig -add +data2
ocrconfig -delete +data2
OCR⽂件备份
ocrconfig -manualbackup
查看OCR⽂件备份
ocrconfig -showbackup(⾃动备份,⼿动备份)
管理表决盘:
VF:记录集节点成员信息,磁盘⼼跳信息,⽤于出现脑裂对集的重新配置。查看表决盘信息
crsctl query css votedisk
备份表决盘
dd if=/dev/raw/raw3 of=/tmp/votedisk.bak
恢复表决盘
dd if=/tmp/votedisk.bak of=/dev/raw/raw3

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。