首页 > 数据库技术 > 详细

Oracle 11g RAC小结

时间:2017-04-05 23:41:20      阅读:285      评论:0      收藏:0      [点我收藏+]

1.查看数据库所有实例与状态

unixdev$[/home/grid]srvctl status database -d unixdev                           
Instance unixdev11 is running on node unixdev
Instance unixdev12 is running on node unixtest

*注:在oracle或grid下执行均可

2.在特定节点上查看节点应用的状态,可以看到:VIP、NETWORK、GSD、ONS的状态

unixdev$[/home/oracle]srvctl status nodeapps -n unixdev
VIP unixdev-vip is enabled
VIP unixdev-vip is running on node: unixdev
Network is enabled
Network is running on node: unixdev
GSD is disabled
GSD is not running on node: unixdev
ONS is enabled
ONS daemon is running on node: unixdev

3.查看ASM实例状态

unixdev$[/home/grid]srvctl status asm -n unixdev                                
ASM is running on unixdev
unixdev$[/home/grid]srvctl status asm -n unixtest
ASM is running on unixtest

3.1查看ASM实例配置信息

unixdev$[/home/grid]srvctl status asm           #查看asm运行在哪些服务器上
ASM is running on unixdev,unixtest
unixdev$[/home/grid]srvctl config asm -n unixdev        
Warning:-n option has been deprecated and will be ignored.
ASM home: /grid/11.2.0/grid
ASM listener: LISTENER
unixdev$[/home/grid]srvctl config asm -n unixtest
Warning:-n option has been deprecated and will be ignored.
ASM home: /grid/11.2.0/grid
ASM listener: LISTENER

4.显示OCR中所有注册的数据库

unixdev$[/home/grid]srvctl config database
unixdev

4.1查看RAC数据库详细配置

unixdev$[/home/grid]srvctl config database -d unixdev
Database unique name: unixdev
Database name: unixdev
Oracle home: /oracle/app/product/11.2.0
Oracle user: oracle
Spfile: +DATA/unixdev/spfileunixdev.ora
Domain: 
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: unixdev
Database instances: unixdev11,unixdev12
Disk Groups: DATA,ARC
Mount point paths: 
Services: 
Type: RAC
Database is administrator managed

5.关闭RAC数据库

su - grid
srvctl stop database -d node         #停止所有节点上的实例
srvctl status database -d node       #查看实例状态
Instance instance1 is not running on node rac1
Instance instance2 is not running on node rac2

su - root          #必须在root下
cd $grid_HOME/bin
./crsctl stop cluster       #停止本节点集群服务
./crsctl stop cluster -all  #停止所有节点集群服务
或
[./crsctl stop cluster -n rac1 rac2]

5.1关闭单节点RAC

su - grid 
srvctl stop database -d node -i node1  #关闭实例
su - root
srvctl stop cluster -n node1           #停止节点集群服务

6.开启RAC数据库
默认开机会自动启动,如果需要手动启动,执行:

su - root
cd $grid_HOME/bin
./crsctl start cluster -all            #开启集群服务
su - grid
srvctl start database -d node          #开启实例

6.1开启单节点RAC

su - root
srvctl start cluster -n node1          #开启集群服务
su - grid
srvctl start database -d node -i node1 #开启实例

7.ocr检查

[grid@Node1 ~]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2992
         Available space (kbytes) :     259128
         ID                       :  115473992
         Device/File Name         :      +DATA
                                    Device/File integrity check succeeded

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

         Cluster registry integrity check succeeded

         Logical corruption check bypassed due to non-privileged user

7.1 查看ocr备份

[grid@Node1 disks]$ ocrconfig -showbackup     #Oracle每4个小时备份一次,保留3个版本

node1     2014/07/28 13:31:50                                   00.ocr

node1     2014/07/28 09:31:49     /grid/product/11.2.0/cdata/node-cluster/backup01.ocr

node1     2014/07/28 05:31:49     /grid/product/11.2.0/cdata/node-cluster/backup02.ocr

node1     2014/07/27 
05:31:48     /grid/product/11.2.0/cdata/node-cluster/day.ocr
node1     2014/07/22 16:29:28     /grid/product/11.2.0/cdata/node-cluster/week.ocr
PROT-25: Manual backups for the Oracle Cluster Registry are not available

7.2 ocr恢复

su - grid
ocrconfig -restore file_name
例如:
ocrconfig -restore /grid/product/11.2.0/cdata/node-cluster/backup01.ocr

7.3添加ocr镜像

停掉CRS服务
使用命令ocrconfig -export导出ocr信息

8.查看表决磁盘

unixdev$[/]crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   8c8c1105b3574f13bf8b95d79452e45f (/dev/rdisk/disk18) [OCRVOTE]
Located 1 voting disk(s).

Oracle 11g RAC小结

原文:http://www.cnblogs.com/lijiaman/p/6670975.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!