暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

oracle RAC 启停集群单节点

原创 不吃草的牛_Nick 2023-02-11
1833

检查集群状态,正常都为online状态
su - root
/u01/app/12r2/grid/bin/crsctl stat res -t



查会话:
su - oracle
set line 200 pagesize 2000
col username for a30
col machine for a30
select username, machine, status, count(*)
from v$session
group by username, machine, status;

杀会话:
select 'alter system kill session '''||sid||','||serial#||''';' from v$session where username=upper('xxx');

select 'alter system kill session '''||sid||','||serial#||',@'||inst_id||''' immediate;' from v$session where username=upper('xxx');


select inst_id, username, machine, status, count(*)
from gv$session
where username not in ('SYS', 'SYSTEM', 'PUBLIC')
group by inst_id, username, machine, status;

如果没有应用会话,关闭数据库
sqlplus / as sysdba
shutdown immediate

关闭数据库后检查是否还存在oracle 实例进程
ps -ef | grep smon

srvctl config
srvctl stop database -d xxx -i xxx
srvctl status database -d racdb

查找集群命令完全路径
ps -ef | grep d.bin

su - grid
which crsctl



停止单节点集群服务,必须以root用户
su - root
/u01/app/12r2/grid/bin/crsctl stop crs
crsctl disable crs


关了集群以后,检查是否存在ASM smon进程
ps -ef | grep smon

先临时禁用集群开机自启动
su - root
/u01/app/12r2/grid/bin/crsctl disable crs


系统启动后,检查多路径
su - root
multipath -ll
lsblk
lvmdiskscan


系统启动后,启用集群开机自启动,必须以root用户
su - root
/u01/app/12r2/grid/bin/crsctl enable crs


启动单节点集群服务,必须以root用户
su - root
/u01/app/12r2/grid/bin/crsctl start crs

启动集群以后,检查是否存在ASM smon进程
ps -ef | grep smon

检查本节点的集群状态,除数据库外,其他正常都为online状态
su - root
/u01/app/12r2/grid/bin/crsctl stat res -t
--/u01/app/12r2/grid/bin/crsctl check crs


启动数据库
su - oracle
sqlplus / as sysdba

startup


启动数据库后检查是否还存在oracle 实例进程
ps -ef | grep smon


检查集群状态,正常都为online状态
su - root
/u01/app/12r2/grid/bin/crsctl stat res -t





查会话:
set line 200 pagesize 2000
col username for a30
col machine for a30
select username, machine, status, count(*)
from v$session
group by username, machine, status;

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论