oracleRAC 常用管理

[root@orc2 ~]# su - grid
1、检查集群状态:
[grid@orc2 ~]$ 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@orc2 ~]$ srvctl status database -d orc
Instance orc1 is running on node orc1
Instance orc2 is running on node orc2


3、检查单个实例状态:
[grid@orc2 ~]$ srvctl status instance -d orc -i orc1
Instance orc1 is running on node orc1
[grid@orc2 ~]$ srvctl status instance -d orc -i orc2
Instance orc2 is running on node orc2


4、检查节点应用程序状态:
[grid@orc2 ~]$ srvctl status nodeapps
VIP orc1-vip is enabled
VIP orc1-vip is running on node: orc1
VIP orc2-vip is enabled
VIP orc2-vip is running on node: orc2
Network is enabled
Network is running on node: orc1
Network is running on node: orc2
GSD is disabled
GSD is not running on node: orc1
GSD is not running on node: orc2
ONS is enabled
ONS daemon is running on node: orc1
ONS daemon is running on node: orc2



5、列出所有的配置数据库:

[grid@orc2 ~]$ srvctl config database
orc


6、列出数据库配置:
[grid@orc2 ~]$ srvctl config database -d orc -a
Database unique name: orc
Database name: orc
Oracle home: /oracle/db/oracle/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: +DATA/orc/spfileorc.ora
Domain: 
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: orc
Database instances: orc1,orc2
Disk Groups: DATA,BACKUPDG
Mount point paths: 
Services: 
Type: RAC
Database is enabled
Database is administrator managed


ASM状态以及ASM配置:
[grid@orc2 ~]$ srvctl status asm
ASM is running on orc2,orc1
[grid@orc2 ~]$ srvctl config asm -a
ASM home: /oracle/grid/app/11.2.0/grid
ASM listener: LISTENER
ASM is enabled.



7、TNS监听器状态以及配置:

[grid@orc2 ~]$ srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s): orc2,orc1
[grid@orc2 ~]$ srvctl config listener -a
Name: LISTENER
Network: 1, Owner: grid
Home: <CRS home>
  /oracle/grid/app/11.2.0/grid on node(s) orc2,orc1
End points: TCP:1521



8、SCAN状态以及配置:

[grid@orc2 ~]$  srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node orc1
[grid@orc2 ~]$ srvctl config scan
SCAN name: dbscan, Network: 1/192.192.3.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /dbscan/192.192.3.65



9、VIP各个节点的状态以及配置:

[grid@orc2 ~]$ srvctl status vip -n orc1
VIP orc1-vip is enabled
VIP orc1-vip is running on node: orc1
[grid@orc2 ~]$ srvctl status vip -n orc2
VIP orc2-vip is enabled
VIP orc2-vip is running on node: orc2
[grid@orc2 ~]$  srvctl config vip -n orc1
VIP exists: /orc1-vip/192.192.3.63/192.192.3.0/255.255.255.0/eth0, hosting node orc1
[grid@orc2 ~]$  srvctl config vip -n orc2
VIP exists: /orc2-vip/192.192.3.64/192.192.3.0/255.255.255.0/eth0, hosting node orc2



10、节点应用程序配置 —(VIP、GSD、ONS、监听器):

[grid@orc2 ~]$ srvctl config nodeapps -a -g -s -l
Warning:-l option has been deprecated and will be ignored.
Network exists: 1/192.192.3.0/255.255.255.0/eth0, type static
VIP exists: /orc1-vip/192.192.3.63/192.192.3.0/255.255.255.0/eth0, hosting node orc1
VIP exists: /orc2-vip/192.192.3.64/192.192.3.0/255.255.255.0/eth0, hosting node orc2
GSD exists
ONS exists: Local port 6100, remote port 6200, EM port 2016
Name: LISTENER
Network: 1, Owner: grid
Home: <CRS home>
  /oracle/grid/app/11.2.0/grid on node(s) orc2,orc1
End points: TCP:1521



11、验证所有集群节点间的时钟同步:(本例中未配置NTP服务)

[grid@orc2 ~]$ cluvfy comp clocksync -verbose

Verifying Clock Synchronization across the cluster nodes 

Checking if Clusterware is installed on all nodes...
Check of Clusterware install passed

Checking if CTSS Resource is running on all nodes...
Check: CTSS Resource running on all nodes
  Node Name                             Status                  
  ------------------------------------  ------------------------
  orc2                                  passed                  
Result: CTSS resource check passed

Querying CTSS for time offset on all nodes...
Result: Query of CTSS for time offset passed

Check CTSS state started...
Check: CTSS state
  Node Name                             State                   
  ------------------------------------  ------------------------
  orc2                                  Observer                
CTSS is in Observer state. Switching over to clock synchronization checks using NTP


Starting Clock synchronization checks using Network Time Protocol(NTP)...

NTP Configuration file check started...
The NTP configuration file "/etc/ntp.conf" is available on all nodes
NTP Configuration file check passed


Checking daemon liveness...


Check: Liveness for "ntpd"
  Node Name                             Running?                
  ------------------------------------  ------------------------
  orc2                                  no                      
Result: Liveness check failed for "ntpd"
PRVF-5494 : The NTP Daemon or Service was not alive on all nodes
PRVF-5415 : Check to see if NTP daemon or service is running failed
Result: Clock synchronization check using Network Time Protocol(NTP) failed

PRVF-9652 : Cluster Time Synchronization Services check failed
Verification of Clock Synchronization across the cluster nodes was unsuccessful on all the specified nodes. 



12、查看集群中所有正在运行的实例:

SQL>select INSTANCE_NUMBER,INSTANCE_NAME,HOST_NAME,STATUS,DATABASE_STATUS,ACTIVE_STATE,VERSION from v$instance;



13、查看ASM 磁盘组和磁盘:

SQL> select state,name from v$asm_diskgroup;
SQL> select path,group_number from v$asm_disk;




14、启动和停止集群:


以下操作需用root用户执行。
(1)在本地服务器上停止Oracle Clusterware 系统:
[grid@orc2]# /oracle/grid/app/11.2.0/grid/bin/crsctl stop cluster

 注:在运行“crsctl stop cluster”命令之后,如果 Oracle Clusterware管理的
资源中有任何一个还在运行,则整个命令失败。使用 -f 选项无条件地停止所有资源并
停止 Oracle Clusterware 系统。

 另请注意,可通过指定 -all 选项在集群中所有服务器上停止 Oracle Clusterware
系统。如下所示,在rac01和rac02上停止oracle clusterware系统:
[grid@orc2]# /oracle/grid/app/11.2.0/grid/bin/crsctl stop cluster –all



(2)在本地服务器上启动oralce clusterware系统:

[grid@orc2]# /oracle/grid/app/11.2.0/grid/bin/crsctl start cluster

 注:可通过指定 -all 选项在集群中所有服务器上启动 Oracle Clusterware 系统。
[grid@orc2]# /oracle/grid/app/11.2.0/grid/bin/crsctl start cluster –all
  
还可以通过列出服务器(各服务器之间以空格分隔)在集群中一个或多个指定的
服务器上启动 Oracle Clusterware 系统:
[grid@orc2]# /oracle/grid/app/11.2.0/grid/bin/crsctl start cluster -n rac01 rac02


(3)使用 SRVCTL 启动/停止所有实例:

[oracle@orc2]#srvctl stop database -d orc
[oracle@orc2]#srvctl start database -d orc

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

king_harry

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值