Oracle Rac常用命令有哪些

56次阅读
没有评论

共计 2067 个字符,预计需要花费 6 分钟才能阅读完成。

这篇文章主要介绍“Oracle Rac 常用命令有哪些”,在日常操作中,相信很多人在 Oracle Rac 常用命令有哪些问题上存在疑惑,丸趣 TV 小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Oracle Rac 常用命令有哪些”的疑惑有所帮助!接下来,请跟着丸趣 TV 小编一起来学习吧!

–(cd $ORACLE_HOME/bin/)

– 查询

– 查询节点

olsnodes -s

– 查看集群名称

cemutlo -n

– 查询群集状态

– 也可以加 -all 查询所有节点

crsctl check cluster

– 检查 crs 状态

crsctl check crs

– 检查集群中资源的状态

–crs_* 命令 oracle 官方已经不建议使用了

crsctl stat res -t

crs_stat -t

– 查询节点应用程序状态

srvctl status nodeapps

– 节点应用程序配置(VIP、GSD、ONS、监听器)

srvctl config nodeapps

–ASM 查询

srvctl status asm

srvctl status asm -a

– 查看 asm 配置

srvctl config asm -a

– 监听查看

– 查看监听状态

srvctl status listener

– 查看监听配置

srvctl config listener -a

– 查看 scan 监听器的状态

srvctl status scan_listener

– 查看 scan 网络配置

srvctl config scan

– 查看 vip 网络

srvctl status vip -n hking1

srvctl config vip -n hking2

– 数据库查看

– 数据库名称

srvctl config database

– 数据库状态

srvctl status database -d hking

srvctl status database -d hking -f -v

– 检查指定实例的状态

srvctl status instance -d hking -i hking1

– 查看数据库配置

srvctl config database -d hking -a

– 管理命令

–RAC 群集管理命令

– 停止 启动节点集群服务,须要以 root 用户

–crs_start 命令

– 启动

crs_start -all

– 查看              

crs_start -t

– 关闭

crs_stop -all

–crsctl 命令

– 启动

crsctl start crs -wait

– 查看              

crsctl stat res -t

– 关闭

crsctl stop crs -wait

– 停止所有节点集群服务

crsctl stop cluster -all

– 停止本节点集群服务

crsctl stop cluster

– 自启动设置

– 查询状态

crsctl config crs

–(查询结果)

CRS-4622: Oracle High Availability Services autostart is enabled.

– 如果上面检查出来的状态是 disable 可以通过以下命令进行启用

crsctl enable crs

– 关闭 database

srvctl stop database -d hking

srvctl status database -d hking

– 从 OCR 中删除已有的数据库

srvctl remove database -d hking

– 向 OCR 中添加一个数据库的实例

srvctl add instance -d -i -n

– 通过 srvctl 命令管理一个节点的 rac

srvctl start|stop|status nodeapps -n node1

– 查看节点 1 状态

srvctl status nodeapps -n hking1

–ORACLE 数据库管理命令

– 通过 SRVCTL 命令来 start/stop/check 所有的实例

srvctl start|stop|status database -d db_name

srvctl status database -d hking

– 通过 SRVCTL 命令来 start/stop/check 管理指定实例

srvctl start|stop|status instance -d -i 

– 查询实例 1 状态

srvctl status instance -d hking -i hking1

–ASM 管理命令

– 启动前确保 css、has 服务启动

– 启动 ASM 实例

sqlplus / as sysasm

startup

select instance_name,status from v$instance;

– 进入 ASM

asmcmd -p 

– 重启 RAC 数据库

– 关闭顺序:关闭 PDB– 关闭数据库 – 关闭集群服务 (先关闭 PDB 在关闭数据库实例,否则 smon 将有一个自动恢复过程)

– 启动顺序:开机自启动集群服务查看集群服务器是否正常 – 打开数据库 – 启动 PDB(默认是在 mount 状态下)

到此,关于“Oracle Rac 常用命令有哪些”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注丸趣 TV 网站,丸趣 TV 小编会继续努力为大家带来更多实用的文章!

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-07-26发表,共计2067字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)