19cOCP 9月周末班 正在授课 欢迎试听         RHCE9 9月周末班 正在授课 欢迎试学         PGCE 认证专家,周末班报名中,欢迎垂询         数据库运维工程师招聘         RHCE认证培训钜惠学习         OCP认证培训组团活动特惠中!!!         MySQL认证周末班 正在招生 欢迎垂询!         

Oracle 11g RAC ocr&votedisk重建(七)添加资源到集群服务

更新时间: 2023-04-20 02:05

集群服务已就绪,但其余ASM磁盘组尚未挂载,数据库相关资源也未添加到集群服务。需要手动挂载磁盘中和添加资源。
 报重庆思庄OCP官方认证培训,送RHCE培训课程,点击领取
[root@rac1 grid]# crsctl status res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS      
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ASMOCR.dg
               ONLINE  ONLINE       rac1                                         
               ONLINE  ONLINE       rac2                                        
ora.asm
               ONLINE  ONLINE       rac1                     Started            
               ONLINE  ONLINE       rac2                     Started            
ora.gsd
               OFFLINE OFFLINE      rac1                                        
               OFFLINE OFFLINE      rac2                                        
ora.net1.network
               ONLINE  ONLINE       rac1                                        
               ONLINE  ONLINE       rac2                                        
ora.ons
               ONLINE  ONLINE       rac1                                        
               ONLINE  ONLINE       rac2                                        
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       rac1                                        
ora.cvu
      1        ONLINE  ONLINE       rac1                                        
ora.oc4j
      1        ONLINE  ONLINE       rac1                                        
ora.rac1.vip
      1        ONLINE  ONLINE       rac1                                        
ora.rac2.vip
      1        ONLINE  ONLINE       rac2                                        
ora.scan1.vip
      1        ONLINE  ONLINE       rac1                                         
 
 
 
手动挂载ASM磁盘组:
[grid@rac1 ~]$ sqlplus / as sysasm
 
SQL*Plus: Release 11.2.0.4.0 Production on Wed Nov 16 10:30:36 2016
 
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
 
 
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
 
SQL> select name,state from v$asm_diskgroup;
 
NAME                           STATE
------------------------------ -----------
ASMOCR                         MOUNTED
ASMDATA                        DISMOUNTED
ASMFRA                         DISMOUNTED
 
SQL> alter diskgroup asmdata mount;
 
Diskgroup altered.
 
SQL> alter diskgroup asmfra mount; 
 
Diskgroup altered.
 
SQL> select name,state from v$asm_diskgroup;
 
NAME                           STATE
------------------------------ -----------
ASMOCR                         MOUNTED
ASMDATA                        MOUNTED
ASMFRA                         MOUNTED
 
SQL> exit
  报重庆思庄OCP官方认证培训,送RHCE培训课程,点击领取
 
[grid@rac2 ~]$ sqlplus / as sysasm
 
SQL*Plus: Release 11.2.0.4.0 Production on Wed Nov 16 10:32:07 2016
 
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
 
 
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
 
SQL> select name,state from v$asm_diskgroup;
 
NAME                           STATE
------------------------------ -----------
ASMOCR                         MOUNTED
ASMFRA                         DISMOUNTED
ASMDATA                        DISMOUNTED
 
SQL> alter diskgroup asmdata mount;
 
Diskgroup altered.
 
SQL> alter diskgroup asmfra mount;
 
Diskgroup altered.
 
SQL> select name,state from v$asm_diskgroup;
 
NAME                           STATE
------------------------------ -----------
ASMOCR                         MOUNTED
ASMFRA                         MOUNTED
ASMDATA                        MOUNTED
 
SQL> exit
  报重庆思庄OCP官方认证培训,送RHCE培训课程,点击领取
添加数据库和实例到集群服务:
[oracle@rac1 ~]$ srvctl add database -d ol11g -o /u01/app/oracle/db_1
[oracle@rac1 ~]$ srvctl status database -d ol11g
Database is not running.
[oracle@rac1 ~]$ srvctl add instance -i ol11g1 -d ol11g -n rac1
[oracle@rac1 ~]$ srvctl add instance -i ol11g2 -d ol11g -n rac2
 
 
[root@rac1 grid]# srvctl start database -d ol11g
[root@rac1 grid]# crsctl status res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS      
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ASMDATA.dg
               ONLINE  ONLINE       rac1                                        
               ONLINE  ONLINE       rac2                                        
ora.ASMFRA.dg
               ONLINE  ONLINE       rac1                                        
               ONLINE  ONLINE       rac2                                        
ora.ASMOCR.dg
               ONLINE  ONLINE       rac1                                         
               ONLINE  ONLINE       rac2                                        
ora.asm
               ONLINE  ONLINE       rac1                     Started            
               ONLINE  ONLINE       rac2                     Started             
ora.gsd
               OFFLINE OFFLINE      rac1                                        
               OFFLINE OFFLINE      rac2                                        
ora.net1.network
               ONLINE  ONLINE       rac1                                         
               ONLINE  ONLINE       rac2                                        
ora.ons
               ONLINE  ONLINE       rac1                                        
               ONLINE  ONLINE       rac2                                         
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       rac1                                        
ora.cvu
      1        ONLINE  ONLINE       rac1                                        
ora.oc4j
      1        ONLINE  ONLINE       rac1                                         
ora.ol11g.db
      1        ONLINE  ONLINE       rac1                     Open               
      2        ONLINE  ONLINE       rac2                     Open               
ora.rac1.vip
      1        ONLINE  ONLINE       rac1                                         
ora.rac2.vip
      1        ONLINE  ONLINE       rac2                                        
ora.scan1.vip
      1        ONLINE  ONLINE       rac1                                        
 
  报重庆思庄OCP官方认证培训,送RHCE培训课程,点击领取
[root@rac1 grid]# srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node rac1
[root@rac1 grid]# srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node rac1
 
[grid@rac1 ~]$ lsnrctl status listener_scan1
 
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 16-NOV-2016 10:47:02
 
Copyright (c) 1991, 2013, Oracle.  All rights reserved.
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN1
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                16-NOV-2016 10:24:45
Uptime                    0 days 0 hr. 22 min. 16 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/grid/network/admin/listener.ora
Listener Log File         /u01/app/grid/log/diag/tnslsnr/rac1/listener_scan1/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.220)(PORT=1521)))
Services Summary...
Service "ol11g" has 2 instance(s).
  Instance "ol11g1", status READY, has 1 handler(s) for this service...
  Instance "ol11g2", status READY, has 1 handler(s) for this service...
Service "ol11gXDB" has 2 instance(s).
  Instance "ol11g1", status READY, has 1 handler(s) for this service...
  Instance "ol11g2", status READY, has 1 handler(s) for this service...
The command completed successfully
 
至此,数据库集群服务恢复正常。查看ocr和votedisk,状态均正常。
[root@rac1 grid]# ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2932
         Available space (kbytes) :     259188
         ID                       :  784216217
         Device/File Name         :    +asmocr
                                    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 succeeded
  报重庆思庄OCP官方认证培训,送RHCE培训课程,点击领取
[root@rac1 grid]# crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   87b6dd543f7b4fffbf78739fd2054094 (/dev/raw/raw1) [ASMOCR]
Located 1 voting disk(s).

开班信息MORE>>

课程名称 开课时间 上课类型 状态
RHCE培训 11月 周末班 授课中...
OCP培训 10月 周末班 授课中...
PGCE 专家 11月 周末班 报名中...
OCP培训 12月 精英班 报名中...
OCM培训 11月 周末班 报名中...
RHCE培训 常年 周末班 报名中...
MySQL培训 常年 周末班 报名中...
<<