详细的oracle rac维护命令集合

一、查看命令

所有实例和服务的状态

bash 复制代码
$srvctl status database -d orcl
Instance orcl1 is running on node db1
Instance orcl2 is running on node db2

单个实例的状态

bash 复制代码
$ srvctl status instance -d orcl -i orcl2
Instance orcl2 is running on node db2

单个节点的应用程序状态

bash 复制代码
$ srvctl status nodeapps -n db1
VIP is running on node: db1
GSD is running on node: db1
Listener is running on node: db1
ONS daemon is running on node: db1

asm实例的状态

bash 复制代码
$ srvctl status asm
ASM instance +ASM1 is running on node db1.
ASM instance +ASM2 is running on node db2.

数据库全局命名服务的状态

bash 复制代码
$ srvctl status service -d orcl -s orcl
Service orcl is running on instance(s) orcl2, orcl1

列出配置的所有数据库

bash 复制代码
$ srvctl config database
orcl

显示数据库的配置

bash 复制代码
$ srvctl config database -d orcl
db1 orcl1 /u01/app/oracle/product/10.2.0/db_1
db2 orcl2 /u01/app/oracle/product/10.2.0/db_1

显示节点应用程序的配置 ---(VIP、GSD、ONS、监听器)

bash 复制代码
$ srvctl config nodeapps -n db1 -a -g -s -l
VIP exists.: /linux1-vip/192.168.1.10/255.255.255.0/eth0:eth1
GSD exists.
ONS daemon exists.
Listener exists.

二、启动集群

对于oracle rac,我们需要在每个节点上执行crsctl命令,进行集群服务启动:

bash 复制代码
crsctl start crs //11g的集群启动

查看命令:

bash 复制代码
crsctl stat res -t
crsctl check crs

或者

bash 复制代码
crs_stat -t -v 

三、停止集群

停止集群的时候,我们需要正常停止实例,然后再停止集群其他服务

停止实例:

bash 复制代码
srvctl stop instance -d orcl -n db1   //我们先停止实例1
srvctl stop instance -d orcl -n db2  //我们再停止实例2

停止其他服务:

bash 复制代码
crsctl stop crs    //每个数据库节点都执行

四、其他说明

srvctl命令需要在grid用户下执行,该命令可以对集群中的节点很多服务进行操作,具体如下:

bash 复制代码
[grid@rac1 ~]$ srvctl database
Usage: srvctl <command><object> [<options>]
   commands:enable|disable|start|stop|relocate|status|add|remove|modify|getenv|setenv|unsetenv|config|convert|upgrade
   objects: database|instance|service|nodeapps|vip|network|asm|diskgroup|listener|srvpool|server|scan|scan_listener|oc4j|home|filesystem|gns|cvu
For detailed help on each command andobject and its options use:
 srvctl <command> -h or
 srvctl <command> <object> -h

我们可以停止、启动、启用、停用等命令完成实例、服务、vi、asm等各种类型的服务的操作。

相关推荐
Genie cloud2 小时前
外贸独立站建站完整教程
服务器·数据库·云计算
2301_822365032 小时前
数据分析与科学计算
jvm·数据库·python
brave_zhao2 小时前
达梦数据库导出表结构语句(很好用)(在达梦工具上可执行)
数据库
Gauss松鼠会2 小时前
【openGauss】openGauss 中一个数据库可以被多个用户访问
数据库·sql·性能优化·database·opengauss
h7ml2 小时前
高并发场景下查券返利机器人的请求合并与缓存预热策略(Redis + Caffeine 实践)
数据库·redis·缓存
tudficdew2 小时前
使用Flask快速搭建轻量级Web应用
jvm·数据库·python
茁壮成长的露露2 小时前
PMM监控MongoDB
数据库·mongodb
Funky_oaNiu2 小时前
Oracle如何将用户下的一个表空间的数据迁移到另一个表空间
数据库·oracle
爱学习的阿磊2 小时前
使用XGBoost赢得Kaggle比赛
jvm·数据库·python
Full Stack Developme2 小时前
数据存储的底层都是字符,但在使用时候怎么能变化出各种字段类型
数据库