Oracle Rac 常用命令

--Oracle Rac 常用命令


--(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状态下)

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值