11G RAC 简单命令

时间:2023-08-05 13:58:01

1、查看集群状态:

[root@rac1 ~]# su - grid

[grid@rac1 ~]$ crsctl check cluster
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online

2、数据库实例状态:

[grid@rac1 ~]$ srvctl status database -d yoon
Instance yoon1 is running on node rac1
Instance yoon2 is running on node rac2

3、单实例状态:

[grid@rac1 ~]$ srvctl status instance -d yoon -i yoon1
Instance yoon1 is running on node rac1

[grid@rac1 ~]$ srvctl status instance -d yoon -i yoon2
Instance yoon2 is running on node rac2

4、node应用程序状态:

[grid@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

5、所有的配置数据库:

[grid@rac1 ~]$ srvctl config database
yoon

7、数据库配置信息:

[grid@rac1 ~]$ srvctl config database -d yoon -a
Database unique name: yoon
Database name: yoon
Oracle home: /u01/app/oracle/11.2.0/db_1
Oracle user: oracle
Spfile: +DATA/yoon/spfileyoon.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: yoon
Database instances: yoon1,yoon2
Disk Groups: DATA,FLUSH
Mount point paths:
Services:
Type: RAC
Database is enabled
Database is administrator managed

8、ASM状态:

[grid@rac1 ~]$ srvctl status asm
ASM is running on rac2,rac1

9、ASM配置信息:

[grid@rac1 ~]$ srvctl config asm -a
ASM home: /u01/app/grid/11.2.0
ASM listener: LISTENER
ASM is enabled.

10、监听状态:

[grid@rac1 ~]$ srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s): rac2,rac1

11、监听配置信息:

[grid@rac1 ~]$ srvctl config listener -a
Name: LISTENER
Network: 1, Owner: grid
Home:
/u01/app/grid/11.2.0 on node(s) rac2,rac1
End points: TCP:1521

12、SCAN状态:

[grid@rac1 ~]$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node rac2

13、SCAN配置信息:

[grid@rac1 ~]$ srvctl config scan
SCAN name: rac-scan, Network: 1/192.168.1.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /rac-scan/192.168.1.10

14、节点VIP状态:

[grid@rac1 ~]$ srvctl status vip -n rac1
VIP rac1-vip is enabled
VIP rac1-vip is running on node: rac1

[grid@rac1 ~]$ srvctl status vip -n rac2
VIP rac2-vip is enabled
VIP rac2-vip is running on node: rac2

15、VIP配置信息:

[grid@rac1 ~]$ srvctl config vip -n rac1
VIP exists: /rac1-vip/192.168.1.18/192.168.1.0/255.255.255.0/eth0, hosting node rac1

[grid@rac1 ~]$ srvctl config vip -n rac2
VIP exists: /rac2-vip/192.168.1.19/192.168.1.0/255.255.255.0/eth0, hosting node rac2

16、节点应用程序配置系信息:

[grid@rac1 ~]$ srvctl config nodeapps -a -g -s -l
Warning:-l option has been deprecated and will be ignored.
Network exists: 1/192.168.1.0/255.255.255.0/eth0, type static
VIP exists: /rac1-vip/192.168.1.18/192.168.1.0/255.255.255.0/eth0, hosting node rac1
VIP exists: /rac2-vip/192.168.1.19/192.168.1.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/grid/11.2.0 on node(s) rac2,rac1
End points: TCP:1521

17、启动和停止集群:

[root@rac1 ~]#/u01/app/grid/11.2.0/bin/crsctl stop cluster -all

[root@rac1 ~]#/u01/app/grid/11.2.0/bin/crsctl start cluster -all

[root@rac1 ~]#srvctl stop database -d yoon

[root@rac1 ~]#srvctl start database -d yoon