集群管理命令:
- CRSCTL命令:
查看集群中所有资源状态 crsctl status res -t 守护进程状态: crsctl status res -t -init 启动/关闭 集群服务: crsctl start/stop crs 关闭OHASD: crsctl stop ohas -f 独占模式启动集群: crsctl start crs -excl -nocrs 检查集群服务状态: crsctl check crs 集群自启动: crsctl enable/disable crs 关闭启动指定资源: crsctl start/stop res res_name //有的无法单独关闭,因为存在资源依赖关系 查看资源属性: crsctl status res res_name -f 修改资源属性 : crsctl modify resource res_name -attr 从12c开始crsctl start/stop resource 与 crsctl modify resource 不再支持 但是可以添加-unsupported使用 crsctl modify resource res_name -attr <> -unsupported crsctl start/stop res res_name -unsupported 关闭集群后台进程: [root@rac2 ~]# /oracle/grid/crs_1/bin/crsctl stop res ora.cluster_interconnect.haip -init CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'rac2' CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'rac2' succeeded 启动指定后台进程: [root@rac2 ~]# /oracle/grid/crs_1/bin/crsctl start res ora.crsd -init CRS-2672: Attempting to start 'ora.asm' on 'rac2' CRS-2676: Start of 'ora.asm' on 'rac2' succeeded CRS-2672: Attempting to start 'ora.crsd' on 'rac2' CRS-2676: Start of 'ora.crsd' on 'rac2' succeeded 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 status database -d racdb 查询单节点实例的状态 srvctl status instance -d racdb -i racdb1 关闭所有节点的实例 srvctl stop database -d racdb 关闭单节点的实例 srvctl stop instance -d racdb -i racdb2 查看数据库配置 srvctl config database -d racdb 使用srvctl资源控制命令: srvctl config network srvctl config vip srvctl status vip srvctl config scan srvctl status scan srvctl config listener srvctl status listener srvctl start/stop listener srvctl config scan_listener srvctl status scan_listener srvctl config asm srvctl status asm srvctl status diskgroup -g data srvctl remove database -d orcl 删除数据库资源 srvctl config nodeapps -a 查看集群VIP oifcfg getif 查看集群网卡 oifcfg delif 删除集群网卡 oifcfg setif 重新配置集群网卡 手动漂移SCAN到另外节点 SCAN漂移: [grid@hzzxdb1 ~]$ srvctl relocate scan_listener -i 1 -n hzzxdb1 [grid@hzzxdb1 ~]$ srvctl relocate scan_listener -i 1 -n hzzxdb2 olsnodes命令: [grid@rac11gn2 ~]$ olsnodes -h Usage: olsnodes [ [-n] [-i] [-s] [-t] [<node> | -l [-p]] | [-c] ] [-g] [-v] where -n print node number with the node name -p print private interconnect address for the local node -i print virtual IP address with the node name <node> print information for the specified node -l print information for the local node -s print node status - active or inactive -t print node type - pinned or unpinned -g turn on logging -v Run in debug mode; use at direction of Oracle Support only. -c print clusterware name
复制
- ASM管理命令:
创建磁盘组: create diskgroup FLASH_DISK external redundancy disk '/dev/oracleasm/disks/ASMDISK1' ; 查看磁盘组状态: select name,state from v$asm_diskgroup; 磁盘组挂载与卸载: alter diskgroup FLASH_DISK mount/dismount; 查看磁盘名与设备的关系: select name,path from v$asm_disk_stat; 查看每个磁盘组可用大小: select name,allocation_unit_size,free_mb,total_mb from v$asm_diskgroup; 向磁盘组中增加一个磁盘: ALTER DISKGROUP ARCH_DISK ADD DISK '/dev/oracleasm/disks/ASMDISK3' (name ARCHDISK2); 从磁盘组中删除一个磁盘: ALTER DISKGROUP ARCH_DISK DROP DISK ARCHDISK2; 删除一个磁盘组:(确保该磁盘被所有实例所卸载dismount) drop diskgroup FLASH_DISK; 删除一个有内容的磁盘组: drop diskgroup ocr2 including contents; 手动重新平衡磁盘组: ALTER DISKGROUP data2 REBALANCE ALTER DISKGROUP data2 REBALANCE power 5 如果不指定power,以初始化参数值ASM_POWER_LIMIT为默认值 对于ASM磁盘组兼容性设定为11.2.0.2或更高,值的操作范围是0到1024用于重新平衡能力。 对于ASM磁盘组兼容性设定为小于11.2.0.2,该值的操作范围是0到11。如果ASM_POWER_LIMIT大于11,则使用11. 关闭ASM: (需要与crs一起关闭) srvctl stop crs
复制
- OCR管理命令:
ocrcheck ocrconfig -add +data2 ocrconfig -delete +data2 ocrconfig -manualbackup ocrconfig -showbackup ocrconfig -export file_name ocrconfig -import file_name
复制
- OLR管理命令:
ocrconfig -local -manualbackup ocrconfig -local -showbackup ocrconfig -local -export file_name ocrconfig -local -import file_name
复制
- Voting file管理命令:
crsctl replace votedisk diskgroup_name crsctl query css votedisk v$asm_disk --> voting file v$asm_diskgroup --> voting files select name,path,voting_file from v$asm_disk;
复制
最后修改时间:2021-01-18 23:44:04
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
相关阅读
数据库国产化替代深化:DBA的机遇与挑战
代晓磊
1204次阅读
2025-04-27 16:53:22
2025年4月国产数据库中标情况一览:4个千万元级项目,GaussDB与OceanBase大放异彩!
通讯员
687次阅读
2025-04-30 15:24:06
【纯干货】Oracle 19C RU 19.27 发布,如何快速升级和安装?
Lucifer三思而后行
684次阅读
2025-04-18 14:18:38
Oracle RAC 一键安装翻车?手把手教你如何排错!
Lucifer三思而后行
634次阅读
2025-04-15 17:24:06
数据库,没有关税却有壁垒
多明戈教你玩狼人杀
586次阅读
2025-04-11 09:38:42
国产数据库需要扩大场景覆盖面才能在竞争中更有优势
白鳝的洞穴
566次阅读
2025-04-14 09:40:20
Oracle数据库一键巡检并生成HTML结果,免费脚本速来下载!
陈举超
543次阅读
2025-04-20 10:07:02
【活动】分享你的压箱底干货文档,三篇解锁进阶奖励!
墨天轮编辑部
491次阅读
2025-04-17 17:02:24
【ORACLE】记录一些ORACLE的merge into语句的BUG
DarkAthena
488次阅读
2025-04-22 00:20:37
【ORACLE】你以为的真的是你以为的么?--ORA-38104: Columns referenced in the ON Clause cannot be updated
DarkAthena
475次阅读
2025-04-22 00:13:51