ORACLE 11G RAC常用命令有哪些
这篇文章给大家分享的是有关ORACLE 11G RAC常用命令有哪些的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。
ORACLE 11G RAC常用命令(grid用户查看)
1:检查OHAS状态和集群状态
[root@rac1 ~]# 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
2:检查所有实例运行状态
[root@rac1 ~]# srvctl status database -d racdb
Instance racdb1 is running on node rac1
Instance racdb2 is running on node rac2
3:检查单个实例状态(实例名分别为racdb1和racdb2,数据库名为racdb)
[root@rac1 ~]# srvctl status instance -d racdb -i racdb1
Instance racdb1 is running on node rac1
[root@rac1 ~]# srvctl status instance -d racdb -i racdb2
Instance racdb2 is running on node rac2
4:节点应用程序状态
[root@rac1 ~]# srvctl status nodeapps
VIP rac1-vip is enabled
VIP rac1-vip is running on node: rac1
VIP rac2-vip is enabled
VIP rac2-vip is running on node: rac2
Network is enabled
Network is running on node: rac1
Network is running on node: rac2
GSD is disabled
GSD is not running on node: rac1
GSD is not running on node: rac2
ONS is enabled
ONS daemon is running on node: rac1
ONS daemon is running on node: rac2
节点应用程序配置(VIP、GSD、ONS、监听器)
[root@rac1 ~]# srvctl config nodeapps -a -g -s -l
Warning:-l option has been deprecated and will be ignored.
Network exists: 1/192.168.11.0/255.255.255.0/eth0, type static
VIP exists: /rac1-vip/192.168.11.201/192.168.11.0/255.255.255.0/eth0, hosting node rac1
VIP exists: /rac2-vip/192.168.11.211/192.168.11.0/255.255.255.0/eth0, hosting node rac2
GSD exists
ONS exists: Local port 6100, remote port 6200, EM port 2016
Name: LISTENER
Network: 1, Owner: grid
Home:
/u01/app/11.2.0/grid on node(s) rac2,rac1
End points: TCP:1521
5:列出所有的配置数据库
[root@rac1 ~]# srvctl config database -d racdb -a
Database unique name: racdb
Database name: racdb
Oracle home: /u01/app/oracle/product/11.2.0/db_1
Oracle user: oracle
Spfile: +DATA/racdb/spfileracdb.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: racdb
Database instances: racdb1,racdb2
Disk Groups: DATA,FRA
Mount point paths:
Services:
Type: RAC
Database is enabled
Database is administrator managed
6:ASM状态及ASM配置
[root@rac1 ~]# srvctl status asm
ASM is running on rac2,rac1
[root@rac1 ~]# srvctl config asm -a
ASM home: /u01/app/11.2.0/grid
ASM listener: LISTENER
ASM is enabled.
[root@rac1 ~]#
7:TNS监听器状态及配置
[root@rac1 ~]# srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s): rac2,rac1
[root@rac1 ~]# srvctl config listener -a
Name: LISTENER
Network: 1, Owner: grid
Home:
/u01/app/11.2.0/grid on node(s) rac2,rac1
End points: TCP:1521
[root@rac1 ~]#
8:SCAN状态及配置
[root@rac1 ~]# srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node rac1
[root@rac1 ~]# srvctl config scan
SCAN name: rac-scan, Network: 1/192.168.11.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /rac-scan/192.168.11.199
9:VIP各个节点的状态及配置
[root@rac1 ~]# srvctl status vip -n rac1
VIP rac1-vip is enabled
VIP rac1-vip is running on node: rac1
[root@rac1 ~]# srvctl status vip -n rac2
VIP rac2-vip is enabled
VIP rac2-vip is running on node: rac2
[root@rac1 ~]# srvctl config vip -n rac1
VIP exists: /rac1-vip/192.168.11.201/192.168.11.0/255.255.255.0/eth0, hosting node rac1
[root@rac1 ~]# srvctl config vip -n rac2
VIP exists: /rac2-vip/192.168.11.211/192.168.11.0/255.255.255.0/eth0, hosting node rac2
10:集群中所有正在运行的实例(SQL)
SQL> select inst_id,instance_number,instance_name,parallel,status,database_status,active_state,host_name from gv$instance;
INST_ID INSTANCE_NUMBER INSTANCE_NAME PAR STATUS DATABASE_STATUS ACTIVE_ST HOST_NAME
---------- --------------- ---------------- --- ------------ ----------------- --------- --------------
1 1 racdb1 YES OPEN ACTIVE NORMAL rac1
2 2 racdb2 YES OPEN ACTIVE NORMAL rac2
用root用户执行以下所有检查
1:启动或关闭数据库实例
[root@rac1 ~]# srvctl stop instance -d racdb -n rac1
[root@rac1 ~]#
[root@rac1 ~]# srvctl stop instance -d racdb -n rac2
[root@rac1 ~]#
[root@rac1 ~]# srvctl status database -d racdb
Instance racdb1 is not running on node rac1
Instance racdb2 is not running on node rac2
也可以通过如下命令,检查每一个实例的状态
[root@rac1 ~]# srvctl status instance -d racdb -i racdb1
Instance racdb1 is not running on node rac1
[root@rac1 ~]# srvctl status instance -d racdb -i racdb2
Instance racdb2 is not running on node rac2
2:启动或关闭asm实例
[root@rac1 ~]# srvctl stop asm -n rac1
PRCR-1014 : Failed to stop resource ora.asm
PRCR-1065 : Failed to stop resource ora.asm
CRS-2529: Unable to act on 'ora.asm' because that would require stopping or relocating 'ora.DATA.dg', but the force option was not specified
[root@rac1 ~]#
可以用 crsctl status resource -t -init 检查集群资源的状态
3:本地服务器上停止oracle clusterware 使用crsctl stop cluster 命令,这个命令执行之后,如果oracle clusterware管理的资源中有任何一个还在运行,
则整个命令失败。使用-f选项,表示无条件的停止所有资源,并停止oracle clusterware系统。
另外,可通过指定-all选项在集群中所有服务器上停止oracle clusterware系统,如下:
crsctl stop cluster -all -f
也可以使用 crsctl start cluster -n rac1 rac2
感谢各位的阅读!关于"ORACLE 11G RAC常用命令有哪些"这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!