Oracle RAC 12c 引入了两个新概念:

中心节点:   和以前的版本一样,它们通过专用网络相互连接,并且可以直接访问共享存储。这些节点可以直接访问 Oracle 集群注册表 (OCR) 和表决磁盘 (VD)。

叶节点:   这些节点是轻型节点,彼此不互连,也不能像中心节点一样访问共享存储。每个叶节点与所连接的中心节点通信,并通过所连接的中心节点连接到集群。

此拓扑允许松散耦合的应用服务器与紧密耦合的数据库服务器形成一个集群。紧密耦合的服务器是中心服务器,与集群中的其他中心服务器共享数据库、OCR 和表决设备的存储并进行对等通信。松耦合的服务器是叶服务器,与集群中的单个中心服务器形成松散通信关联,不需要与集群中的其他中心服务器或叶服务器共享存储,也不需要与之进行对等通信,只与所关联的中心服务器通信。在 12.1.0.1 中,叶服务器旨在提高应用的高可用性和实现多层资源管理。

在 Oracle 12c 之前,对于要使用 ASM 的数据库实例来说,所有节点上的 ASM 实例必须已处于运行状态,才能启动数据库实例。如果 ASM 实例未运行,则意味着在存储级使用 ASM 的数据库实例不能启动。这实际上意味着无论采用何种技术(即 RAC、ASM 和共享存储),均不能访问数据库实例。

随着 Oracle 12c 的推出,一个名为 Oracle Flex ASM 的特性解除了上述限制,它的一个主要特性是故障切换到集群中的其他节点。本质上是一个中心和叶架构,Oracle Clusterware 通过一个替代 ASM 实例将故障节点的连接将无缝转移到另一个成员节点。在给定集群中运行的 ASM 实例数被称作 ASM 基数,默认值为 3。但此基数值可以使用 Clusterware 命令修改。

Flex ASM 主要作用:Oracle 在12c 中引入Oracle Flex ASM特性, 其可以使ASM实例和数据库实例在不同的节点上运行,而不是之前的ASM实例必须和数据库实例运行在同一个节点上。也就是说当某个节点上的ASM 实例挂掉后,其上的数据库实例还可以正常运行。

Oracle Flex 集群

从架构上来说,Oracle Flex 集群包括一个中心和叶架构,其中只有中心节点可以直接访问 Oracle 集群注册表 (OCR) 和表决磁盘 (VD)。但是应用可以通过叶节点访问数据库,而不必在叶节点上运行 ASM 实例。通过中心节点连接到数据库使得它对应用透明。

图 1:描绘了一个典型的 Oracle Flex 集群,包含 4 个叶节点和 2 个中心节点。简单地说,Oracle Flex 集群需要 Oracle Flex ASM。


Oracle Flex ASM 的实现方面

Oracle Flex ASM 可通过两种方式实现:

  • 纯 12c Flex ASM(相同版本)
  • Grid Infrasctructure (GI) 和数据库都运行在 Oracle 12c 上
  • Oracle 12c 之前的混合版本(不同版本)
  • 和平常一样,ASM 实例将在每个节点上运行,Flex 配置支持 12c 之前的数据库。使用 ASM 磁盘组的兼容性参数管理各数据库实例之间的兼容性。这种方法的优点是,如果 Oracle 12c 数据库实例与一个 ASM 实例的连接断开,数据库连接将故障切换至其他服务器上的另一个 ASM 实例。通过将基数设置为 all 即可以实现这种故障切换。


使用 Oracle Flex ASM 的 Oracle RAC 12c

标准 Oracle Flex ASM 配置:

Oracle Flex ASM 配置上的 ASM 实例故障:

1. 登录 RAC 数据库实例 1 (rac1)

[oracle@oel6-112-rac1 Desktop]$ hostname
oel6-112-rac1.localdomain

2. 检查 ASM 实例和 RAC 数据库实例的状态

[oracle@oel6-112-rac1 Desktop]$ ps -ef | grep pmon
oracle    3325     1  0 17:39 ?        00:00:00 asm_pmon_+ASM1
oracle    3813     1  0 17:40 ?        00:00:00 mdb_pmon_-MGMTDB
oracle    5806     1  0 17:42 ?        00:00:00 ora_pmon_orcl1
oracle    6193     1  0 17:42 ?        00:00:00 apx_pmon_+APX1

3. 从实例 1 (rac1) 检查 RAC 数据库实例中 ASM 实例的状态

[oracle@oel6-112-rac1 Desktop]$ srvctl status asm
ASM is running on oel6-112-rac2,oel6-112-rac1

4. 在实例 1 (rac1) 中检查集群状态

[oracle@oel6-112-rac1 Desktop]$ crsctl check cluster
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online

5. 用于检查 Oracle Flex ASM 是否启用的命令 (rac1)

[oracle@oel6-112-rac1 Desktop]$ asmcmd
ASMCMD> showclustermode 
ASM cluster : Flex mode enabled
ASMCMD> showclusterstate
Normal

6. 用于更改 ASM 基数的命令 (rac1)

[oracle@oel6-112-rac1 Desktop]$ srvctl status asm -detail
ASM is running on oel6-112-rac2,oel6-112-rac1
ASM is enabled.
[oracle@oel6-112-rac1 Desktop]$ srvctl config asm -detail
ASM home: /u01/app/12.1.0/grid
Password file: +DATA/orapwASM
ASM listener: LISTENER
ASM is enabled.
ASM instance count: 3
Cluster ASM listener: ASMNET1LSNR_ASM

7. 用于检查 Oracle Flex ASM 是否启用的命令 (rac2)

[oracle@oel6-112-rac2 Desktop]$ asmcmd
ASMCMD> showclustermode
ASM cluster : Flex mode enabled
ASMCMD> showclusterstate
Normal
ASMCMD> exit

8. 如何更改 ASM 基数 (rac2)

[oracle@oel6-112-rac2 Desktop]$ srvctl config  asm -detail
ASM home: /u01/app/12.1.0/grid
Password file: +DATA/orapwASM
ASM listener: LISTENER
ASM is enabled.
ASM instance count: 3
Cluster ASM listener: ASMNET1LSNR_ASM

9. 在 RAC 数据库实例 1 (rac1) 中关闭 ASM 实例

[oracle@oel6-112-rac1 Desktop]$ srvctl stop asm -node oel6-112-rac1 -stopoption abort -force

10. 在 RAC 数据库实例 1 (rac1) 中检查 ASM 实例的状态

[oracle@oel6-112-rac1 Desktop]$ srvctl status asm
PRCR-1070 : Failed to check if resource ora.asm is registered
Cannot communicate with crsd

11. 在 RAC 数据库实例 1 (rac1) 中检查集群服务的状态

[oracle@oel6-112-rac1 Desktop]$ crsctl check cluster
CRS-4535: Cannot communicate with Cluster Ready Services
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online

12. 在实例 1 (rac1) 中检查 ASM 和 RAC 数据库的状态

[oracle@oel6-112-rac1 Desktop]$ ps -ef | grep pmon
oracle    3813     1  0 17:40 ?        00:00:00 mdb_pmon_-MGMTDB
oracle    5806     1  0 17:42 ?        00:00:00 ora_pmon_orcl1
oracle    6193     1  0 17:42 ?        00:00:00 apx_pmon_+APX1

注: 在这里,数据库实例与特定节点中运行的特定 ASM 实例关联。如果因为某种原因,ASM 实例无法启动/服务关闭,数据库实例仍然可以启动,因为数据库实例将查找同一集群中运行的 ASM 实例。图 3 描绘了 Flex ASM 的高可用特性。

13. 在 RAC 数据库实例 1 (rac1) 中检查没有 ASM 实例的正在运行的 RAC 数据库实例的状态

[oracle@oel6-112-rac1 Desktop]$ . oraenv
ORACLE_SID = [orcl1] ? orcl1
ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/12.1.0/db_1
The Oracle base remains unchanged with value /u01/app/oracle

14. 从 RAC 数据库实例 1 (rac1) 登录数据库实例

[oracle@oel6-112-rac1 Desktop]$ sqlplus /nolog
SQL*Plus: Release 12.1.0.1.0 Production on Wed Sep 25 18:24:36 2013
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
SQL> connect sys/oracle@orcl as sysdba
Connected.
SQL> select instance_name,instance_number from gv$instance;
INSTANCE_NAME           INSTANCE_NUMBER
-------------------------------------------
orcl2                         2
orcl1                         1
SQL> select instance_name,instance_number from v$instance;
INSTANCE_NAME           INSTANCE_NUMBER
-------------------------------------------
orcl2                         2
SQL> connect sys/oracle@orcl as sysdba
Connected.
SQL> select instance_name,instance_number from gv$instance;
INSTANCE_NAME           INSTANCE_NUMBER
-------------------------------------------
orcl1                         1

15. 从 RAC 数据库实例 1 (rac1) 连接到 RAC 数据库实例 2 (rac2) 的 ASM 实例

[oracle@oel6-112-rac1 Desktop]$ . oraenv
ORACLE_SID = [orcl1] ? +ASM2
ORACLE_HOME = [/home/oracle] ? /u01/app/12.1.0/grid
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@oel6-112-rac1 Desktop]$ asmcmd --privilege sysasm --inst +ASM2
ASMCMD> lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512   4096  1048576     15342     4782                0            4782              0             Y  DATA/
ASMCMD>

总结: 数据库实例使用一个专用 ASM 实例,我们强制该 ASM 实例被停止工作来模拟故障,因此数据库实例重新连接到另一节点(在本示例中为节点 2 (rac2))上的现有 ASM 实例。

Oracle Database 11.2 或早期版本

如前面针对 Oracle 12c 的介绍所述,ASM 与数据库实例的关联本质上是特定的。这意味着,如果 ASM 实例无法启动,该节点/ASM 中的关联数据库实例也无法启动,从而导致该数据库无法访问。

1. 登录 RAC 数据库实例 1 (rac1)

login as: oracle
oracle@192.168.xx.xx's password:
Last login: Fri Sep 27 06:05:44 2013

2. 检查 ASM 实例和 RAC 数据库实例的状态:

[oracle@rac1 ~]$ ps -ef | grep pmon
oracle    3053     1  0 05:56 ?        00:00:00 asm_pmon_+ASM1
oracle    3849     1  0 05:57 ?        00:00:00 ora_pmon_flavia1

3. 在 RAC 数据库实例 1 (rac1) 中检查 ASM 实例的状态

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

4. 在 RAC 数据库实例 1 (rac1) 中检查集群的状态

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

5. 在 RAC 数据库实例 1 (rac1) 中停止 ASM 实例

[oracle@rac1 ~]$ srvctl stop asm -n rac1 -o abort -f

6. 在 RAC 数据库实例 1 (rac1) 中检查 ASM 实例的状态

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

7. 检查 ASM 实例和 RAC 数据库实例 (rac1) 的状态

[oracle@rac1 ~]$ ps -ef | grep pmon
oracle    7885  5795  0 06:20 pts/0    00:00:00 grep pmon

总结: 数据库实例与 ASM 实例强关联。如果 ASM 实例发生故障,同一节点上的数据库实例也会发生故障。

为何使用 Oracle Flex ASM

  • Oracle Flex ASM 支持 Oracle Database 12c 客户端使用更大的 LUN 大小。
  • 支持的最大磁盘组数为 511。
  • 可以灵活地重命名磁盘组中的 ASM 磁盘。
  • ASM 实例的补丁级验证
  • 滚动补丁期间禁用补丁级验证
  • 复制物理元数据

Oracle Flex ASM 中的网络增强

  • 在早期版本中,集群要求:
  • 一个供客户端应用访问的公共网络
  • 一个或多个用于集群内节点间通信(包括 ASM 通信)的专用网络
  • Flex ASM 增加 ASM 网络,可用于 ASM 与其客户端之间的通信,以便隔离和分流 ASM 通信。

部署 Flex ASM

下面是 Flex ASM 安装程序的屏幕截图。

  • 选择选项“Advanced Installation”
  • 有三个存储选项:

标准 ASM

12c 之前的 ASM 配置模式

Oracle Flex ASM

推荐

非 ASM 托管的存储

  • 管理 Flex ASM:
  • 无需 Flex ASM 特定的实例参数
  • ASM 服务器实例使用自动内存管理 (AMM) 转:http://www.oracle.com/technetwork/cn/articles/database/flexasm-flexcluster-benefits-odb12c-2177371-zhs.html
     


Oracle 18c Flex ASM 功能测试

1. Flex ASM说明

Oracle 在12c 中引入Oracle Flex ASM特性, 其可以使ASM实例和数据库实例在不同的节点上运行,而不是之前的ASM实例必须和数据库实例运行在同一个节点上。也就是说当某个节点上的ASM 实例挂掉后,其上的数据库实例还可以正常运行。

在Oracle 12c中,在创建数据库的时候还需要选择是否启用Oracle Flex 集群和Flex ASM, 但是到了18c中,默认就是Flex 集群和Flex ASM,不再需要选择。 下图是12c中使用ASMCA工具将普通ASM 实例转换成Flex ASM。

Oracle Flex ASM与Flex集群详解_oracle

2. Flex ASM 测试

因为在Oracle 18c 中默认就是Flex ASM。 所以我们这里直接在RAC 环境上测试该功能。

2.1 当前RAC 环境
[grid@www.cndba.cn ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr
               ONLINE  ONLINE       rac1                     STABLE
               ONLINE  ONLINE       rac2                     STABLE
ora.DATA.dg
               ONLINE  ONLINE       rac1                     STABLE
               ONLINE  ONLINE       rac2                     STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       rac1                     STABLE
               ONLINE  ONLINE       rac2                     STABLE
ora.MGMT.GHCHKPT.advm
               OFFLINE OFFLINE      rac1                     STABLE
               OFFLINE OFFLINE      rac2                     STABLE
ora.MGMT.dg
               ONLINE  ONLINE       rac1                     STABLE
               ONLINE  ONLINE       rac2                     STABLE
ora.OCR.dg
               ONLINE  ONLINE       rac1                     STABLE
               ONLINE  ONLINE       rac2                     STABLE
ora.helper
               OFFLINE OFFLINE      rac1                     IDLE,STABLE
               OFFLINE OFFLINE      rac2                     IDLE,STABLE
ora.mgmt.ghchkpt.acfs
               OFFLINE OFFLINE      rac1                     STABLE
               OFFLINE OFFLINE      rac2                     STABLE
ora.net1.network
               ONLINE  ONLINE       rac1                     STABLE
               ONLINE  ONLINE       rac2                     STABLE
ora.ons
               ONLINE  ONLINE       rac1                     STABLE
               ONLINE  ONLINE       rac2                     STABLE
ora.proxy_advm
               ONLINE  ONLINE       rac1                     STABLE
               ONLINE  ONLINE       rac2                     STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       rac2                     STABLE
ora.MGMTLSNR
      1        ONLINE  ONLINE       rac2                     169.254.11.39 192.16
                                                             8.56.101,STABLE
ora.asm
      1        ONLINE  ONLINE       rac1                     Started,STABLE
      2        ONLINE  ONLINE       rac2                     Started,STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.cndba.db
      1        ONLINE  ONLINE       rac2                     Open,HOME=/u01/app/o
                                                             racle/product/18.3.0
                                                             /db_1,STABLE
      2        ONLINE  ONLINE       rac1                     Open,HOME=/u01/app/o
                                                             racle/product/18.3.0
                                                             /db_1,STABLE
ora.cvu
      1        ONLINE  ONLINE       rac2                     STABLE
ora.mgmtdb
      1        ONLINE  ONLINE       rac2                     Open,STABLE
ora.qosmserver
      1        ONLINE  ONLINE       rac2                     STABLE
ora.rac1.vip
      1        ONLINE  ONLINE       rac1                     STABLE
ora.rac2.vip
      1        ONLINE  ONLINE       rac2                     STABLE
ora.rhpserver
      1        OFFLINE OFFLINE                               STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       rac2                     STABLE
--------------------------------------------------------------------------------
[grid@www.cndba.cn ~]$
[grid@www.cndba.cn ~]$ srvctl -version
srvctl version: 18.0.0.0.0
[grid@www.cndba.cn ~]$ crsctl check cluster
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
[grid@rac1 ~]$
2.2 查看Flex ASM中实例信息
[grid@www.cndba.cn ~]$ asmcmd showclustermode
ASM cluster : Flex mode enabled - Direct Storage Access
[grid@www.cndba.cn ~]$ asmcmd showclusterstate
Normal
[grid@www.cndba.cn ~]$
[grid@www.cndba.cn ~]$ srvctl status asm -detail
ASM is running on rac1,rac2
ASM is enabled.
ASM instance +ASM1 is running on node rac1
Number of connected clients: 3
Client names: +APX1:+APX:rac cndba1:cndba:rac rac1:_OCR:rac
ASM instance +ASM2 is running on node rac2
Number of connected clients: 4
Client names: +APX2:+APX:rac -MGMTDB:_mgmtdb:rac cndba2:cndba:rac rac2:_OCR:rac
[grid@www.cndba.cn ~]$
[grid@www.cndba.cn ~]$ srvctl config asm -detail
ASM home: <CRS home>
Password file: +OCR/orapwASM
Backup of Password file: 
ASM listener: LISTENER
ASM is enabled.
ASM is individually enabled on nodes: 
ASM is individually disabled on nodes: 
ASM instance count: 3
Cluster ASM listener: ASMNET1LSNR_ASM
[grid@www.cndba.cn ~]$
2.3 模拟ASM 实例故障
SQL>select instance_name,instance_number from gv$instance;
INSTANCE_NAME             INSTANCE_NUMBER
-------------------------------- ---------------
cndba1                           1
cndba2                           2
[grid@www.cndba.cn ~]$ srvctl status database -d cndba -detail
Instance cndba1 is running on node rac1
Instance cndba1 is connected to ASM instance +ASM1
Instance cndba2 is running on node rac2
Instance cndba2 is connected to ASM instance +ASM2

关闭节点1上的ASM 实例

[grid@www.cndba.cn ~]$ ps -ef|grep pmon
grid      8425 12500  0 09:00 pts/2    00:00:00 grep --color=auto pmon
oracle   15875     1  0 06:19 ?        00:00:00 ora_pmon_cndba1
grid     27886     1  0 05:21 ?        00:00:00 asm_pmon_+ASM1
grid     29346     1  0 05:21 ?        00:00:00 apx_pmon_+APX1
[grid@www.cndba.cn ~]$ srvctl stop asm -node rac1 -stopoption abort -force
[grid@www.cndba.cn ~]$ ps -ef|grep pmon
grid      8620 12500  0 09:00 pts/2    00:00:00 grep --color=auto pmon
oracle   15875     1  0 06:19 ?        00:00:00 ora_pmon_cndba1
grid     29346     1  0 05:21 ?        00:00:00 apx_pmon_+APX1
[grid@www.cndba.cn ~]$

此时ASM 实例只在节点2上运行:

[grid@www.cndba.cn ~]$ srvctl status asm
ASM is running on rac2
[grid@www.cndba.cn ~]$ srvctl status database -d cndba -detail
Instance cndba1 is running on node rac1
Instance cndba1 is connected to ASM instance +ASM2
Instance cndba2 is running on node rac2
Instance cndba2 is connected to ASM instance +ASM2
[grid@www.cndba.cn ~]$ srvctl status asm -detail
ASM is running on rac2
ASM is enabled.
ASM instance +ASM2 is running on node rac2
Number of connected clients: 6
Client names: +APX1:+APX:rac +APX2:+APX:rac -MGMTDB:_mgmtdb:rac cndba1:cndba:rac cndba2:cndba:rac rac2:_OCR:rac
[grid@www.cndba.cn ~]$

我们可以看到+ASM2上也运行这节点1上的db 实例。

但是节点1上的数据库实例正常运行:

SQL> select instance_name,instance_number from gv$instance;
INSTANCE_NAME             INSTANCE_NUMBER
-------------------------------- ---------------
cndba1                           1
cndba2                           2

启动节点1上的ASM实例,又恢复原状:

[grid@www.cndba.cn ~]$ srvctl start asm -node rac1
[grid@www.cndba.cn ~]$ srvctl status asm -detail
ASM is running on rac1,rac2
ASM is enabled.
ASM instance +ASM1 is running on node rac1
Number of connected clients: 3
Client names: +APX1:+APX:rac cndba1:cndba:rac rac1:_OCR:rac
ASM instance +ASM2 is running on node rac2
Number of connected clients: 4
Client names: +APX2:+APX:rac -MGMTDB:_mgmtdb:rac cndba2:cndba:rac rac2:_OCR:rac
[grid@www.cndba.cn ~]$ 
[grid@www.cndba.cn ~]$ srvctl status database -d cndba -detail
Instance cndba1 is running on node rac1
Instance cndba1 is connected to ASM instance +ASM1
Instance cndba2 is running on node rac2
Instance cndba2 is connected to ASM instance +ASM2

通过实验,可以验证任意一个节点的ASM实例的意外关闭/启动,都不会影响该节点上的数据库状态,这极大的增强了RAC的高可用性。


Flex ASM的配置和转换

从12c开始,推出了Flex ASM特性,允许RAC节点访问远程节点的ASM实例,而自身无需运行ASM实例。

一般在Flex集群,中心节点运行ASM实例,叶节点远程访问中心节点的ASM实例。

但是中心节点也可以不运行ASM实例而访问其他节点的ASM实例;另外,标准集群也可以启用Flex ASM。

由于有通过网络远程访问ASM实例的状况,因此也形成了ASM网络,ASM网络可与Private网络共用,即ASM&Private网络,可在安装界面指定。

确认当前ASM状态

点击( 此处 )折叠或打开

  1. $ asmcmd showclustermode
  2. ASM cluster   Flex mode disabled

以上说明是标准ASM


运行asmca,转换ASM为Flex ASM,以下是部分步骤截图

Oracle Flex ASM与Flex集群详解_数据库_02


Oracle Flex ASM与Flex集群详解_oracle_03


ASM的subnet与Public不同,将不能使用与Public相同的端口号

Oracle Flex ASM与Flex集群详解_数据库_04



Oracle Flex ASM与Flex集群详解_oracle_05



以root用户运行上图所示的脚本,将对集群内所有节点重启CRS


最后,确认当前集群模式


点击( 此处 )折叠或打开

  1. $ asmcmd showclustermode
  2. ASM cluster   Flex mode enabled

  3. #后两项是Flex ASM才有的
  4. $ srvctl config asm
    ASM home: <CRS home>
    Password file: +OCRV/orapwASM
    ASM listener: LISTENER
    ASM instance count: ALL
    Cluster ASM listener: ASMNET1LSNR_ASM

查看ASM监听器


点击( 此处 )折叠或打开

  1. $ lsnrctl status ASMNET1LSNR_ASM

  2. LSNRCTL  for  Linux  Version 12 . . 0   Production on 01 JUN 2016 15 08 11

  3. Copyright   1991  2014  Oracle  All rights reserved .

  4. Connecting to  DESCRIPTION = ( ADDRESS = ( PROTOCOL IPC ) ( KEY ASMNET1LSNR_ASM ) ) )
  5. STATUS  of  the LISTENER
  6. - - - - - - - - - - - - - - - - - - - - - - - -
  7. Alias ASMNET1LSNR_ASM
  8. Version TNSLSNR  for  Linux  Version 12 . . 0   Production
  9. Start Date 01 JUN 2016 15 02 46
  10. Uptime 0 days 0 hr  5 min  24 sec
  11. Trace Level off
  12. Security ON   Local  OS Authentication
  13. SNMP OFF
  14. Listener Parameter File /u01/app/12 0/grid/network/admin/listener ora
  15. Listener Log File /u01/app/grid/diag/tnslsnr/node2/asmnet1lsnr_asm/alert/log xml
  16. Listening Endpoints Summary . . .
  17.  DESCRIPTION = ( ADDRESS = ( PROTOCOL ipc ) ( KEY ASMNET1LSNR_ASM ) ) )
  18.  DESCRIPTION = ( ADDRESS = ( PROTOCOL tcp ) ( HOST 10 ) ( PORT 1522 ) ) )
  19. Services Summary . . .
  20. Service  "+ASM"  has 2 instance ) .
  21.  "+ASM1"  status READY  has 1 handler   for   this  service . . .
  22.  "+ASM2"  status READY  has 2 handler   for   this  service . . .
  23. The command completed successfully


12c 如何将Standard ASM转化为Flex ASM

什么是Flex ASM?

我们知道在12c之前的版本里,ASM实例需要在每一个节点运行,而ASM 的客户端(Database,ACFS,ADVM)只可以访问本地的ASM 实例。如果使用了Oracle Flex ASM,情况就不一样了,ASM的客户端就可以通过ASM网络访问远程的ASM实例。如果一个运行ASM实例的节点宕掉,Oracle集群会在另外一个节点上启动一个新的ASM实例以此维持它的节点基数(Cardinality)。 同样,如果一个12c数据库实例连接了某一个ASM 实例,而这个ASM 实例crash掉或者实例运行出错,这个数据库的实例会尝试重新连接在另一个节点的一个已经存在的ASM实例,这就是 Oracle Flex ASM。

Oracle Flex ASM与Flex集群详解_oracle_06


Flex Cluster和Flex ASM的区别

Flex Cluster需要Flex ASM的支持

Flex ASM可以在StandardCluster和Flex Cluster运行


如何控制ASM实例的个数

[orgrid@ohs1 ~]$ srvctl modify asm -count 2
 [orgrid@ohs1 ~]$ srvctl config asm
 ASM home: <CRS home>
 Password file: +SYSTEMDG/orapwASM
 ASM listener: LISTENER
 ASM instance count: 2
 Cluster ASM listener: ASMNET1LSNR_ASM
 [orgrid@ohs1 ~]$
 [orgrid@ohs1 ~]$ srvctl modify asm -count 1
 PRCA-1123 : The specified ASM cardinality 1 is less than the minimum cardinality of 2.

注意:ASM实例至少的有2个实例,这样不至于单点故障


Flex ASM和Standard ASM的转化

我们可以把Standard ASM转化为Flex ASM,但这个转化是不可逆的。这样做的目的可能是为了推广这个特性,这个特性确实不错


如果没有使用Flex ASM,不设置SID会出现连接到空实例,但在Flex ASM情况下,会随机选择一个

Standard ASM输出

[orgrid@ohs1 ~]$ asmcmd
 Connected to an idle instance.
 ASMCMD> exit
 [orgrid@ohs1 ~]$ export ORACLE_SID=+ASM1
 [orgrid@ohs1 ~]$ asmcmd
 ASMCMD> showclustermode
 ASM cluster : Flex mode disabled
 ASMCMD> showclusterstate
 Normal
 ASMCMD> lsdsk
 Path
 ORCL:ASMDISK1
 ORCL:ASMDISK2
 ORCL:ASMDISK3
 ORCL:ASMDISK4
 ASMCMD> lsattr -G systemdg -l
 Name                     Value       
 access_control.enabled   FALSE       
 access_control.umask     066         
 au_size                  1048576     
 cell.smart_scan_capable  FALSE       
 compatible.asm           12.1.0.0.0  
 compatible.rdbms         10.1.0.0.0  
 content.check            FALSE       
 content.type             data        
 disk_repair_time         3.6h        
 failgroup_repair_time    24.0h       
 idp.boundary             auto        
 idp.type                 dynamic     
 phys_meta_replicated     true        
 sector_size              512         
 thin_provisioned         FALSE       
 ASMCMD>
 ASMCMD> exit

Flex ASM输出

[orgrid@ohs1 ~]$ echo $ORACLE_SID
 [orgrid@ohs1 ~]$ asmcmd
 ASMCMD> showclustermode
 ASM cluster : Flex mode enabled
 ASMCMD> showclusterstate
 Normal
 ASMCMD>


asmca帮助信息

[orgrid@ohs1 ~]$
 [orgrid@ohs1 ~]$ asmca -h
 asmca [-silent] [-sysAsmPassword <SYS user password>] [-asmsnmpPassword <ASM monitor password>] {<command> <options>}
 Please refer to the manual for details.
 You can enter one of the following commands:
 1. Configure an ASM instance by specifying the following command and parameters:
         -configureASM
                 [-sysAsmPassword <SYS user password>]
                 [-asmsnmpPassword <ASM monitor password>]
                 [(-param <paramname=paramvalue>)]
                 -diskString <disk discovery path>
                 (-diskGroupName <disk group name>
                         (-disk <disk path> [-diskName <disk name>] |
                          -diskList <comma separated disk list>
                                 [-diskSize <disk size in MB>]
                                 [-failuregroup <failure group name>]
                                 [-force|-noforce]
                                 [-quorum|-noquorum])
                         [-redundancy <HIGH|NORMAL|EXTERNAL>]
                         [-au_size <2^0 ~ 2^6 (1 ~ 64)>]
                         [-compatible.asm <10.1 ~ 11.2>]
                         [-compatible.rdbms <10.1 ~ 11.2>]
                         [-compatible.advm <11.2>])
 2. Upgrade an existing ASM instance by specifying the following command and parameters:
         -upgradeASM
                 [-asmsnmpPassword <ASM monitor password>]
 3. Configure ASM parameters by specifying the following command and parameters:
         -configureParameter
                 (-param <paramname=paramvalue>)
                 [-sysAsmPassword <SYS user password>]
 4. Create Disk Groups by specifying the following command and parameters:
         -createDiskGroup
                 [-diskString <disk discovery path>]
                 (-diskGroupName <disk group name>
                         (-disk <disk path> [-diskName <disk name>] |
                          -diskList <comma separated disk list>
                                 [-diskSize <disk size in MB>]
                                 [-failuregroup <failure group name>]
                                 [-force|-noforce]
                                 [-quorum|-noquorum])
                         [-redundancy <HIGH|NORMAL|EXTERNAL>]
                         [-au_size <2^0 ~ 2^6 (1 ~ 64)>]
                         [-compatible.asm <10.1 ~ 11.2>]
                         [-compatible.rdbms <10.1 ~ 11.2>]
                         [-compatible.advm <11.2>])
                 [-sysAsmPassword <SYS user password>]
 5. Add disks to Disk Groups by specifying the following command and parameters:
         -addDisk
                 [-diskString <disk discovery path>]
                 (-diskGroupName <disk group name>
                         (-disk <disk path> [-diskName <disk name>] |
                          -diskList <comma separated disk list>
                                 [-diskSize <disk size in MB>]
                                 [-failuregroup <failure group name>]
                                 [-force|-noforce]
                                 [-quorum|-noquorum])
                 [-sysAsmPassword <SYS user password>]
 6. Create volumes by specifying the following command and parameters:
         -createVolume
                 (-volumeName <ASM volume name>
                 -volumeDiskGroup <ASM disk group name for the volume>
                 -volumeSizeGB <ASM volume size in GB>
                 [-volumeRedundancy <INHERIT|MIRROR|HIGH|UNPROTECTED>])
                 [-sysAsmPassword <SYS user password>]
 7. Create ASM Cluster File Systems by specifying the following command and parameters:
         -createACFS
                 (-acfsVolumeDevice <ASM volume device>)
                 (-acfsMountPoint <existing host file system path>)
                 [-acfsUserName <ACFS User Name>]
                 [-acfsGroupName <ACFS Group Name>]
                 [-sysAsmPassword <SYS user password>]
 8. Delete ASM instance(s) by specifying the following command and parameters:
         -deleteASM
                 [-force]
                 [-dropDiskGroups]
                 [-sysAsmPassword <SYS user password>]

9. Convert Standard ASM into Oracle Flex ASM by specifying the following command and parameters:

        -convertToFlexASM

                -asmNetworks <comma separated ASM Networks each network of the form interface name/subnet>

                -asmListenerPort <ASM listener port number>

[orgrid@ohs1 ~]$ 


借助asmca生成转化为Flex ASM的脚本converttoFlexASM.sh

[orgrid@ohs1 ~]$  asmca -silent -convertToFlexASM -asmNetworks eth1/172.16.0.0 -asmListenerPort  10010

To complete ASM conversion, run the following script as privileged user in local node.
 /pgold/orgrid/grid_base/cfgtoollogs/asmca/scripts/converttoFlexASM.sh  [orgrid@ohs1 ~]$


converttoFlexASM.sh 脚本内容

[orgrid@ohs1 ~]$ cat /pgold/orgrid/grid_base/cfgtoollogs/asmca/scripts/converttoFlexASM.sh

#!/bin/sh
 cd /pgold/orgrid/grid_base/cfgtoollogs/asmca/scripts
 /pgold/orgrid/oracle/product/121/srvm/admin/srvmhelper -updateDepASM
 if [ "$?" != "0" ]; then
         echo "Error updating ASM resource dependencies"
         exit 1
 fi
 for node in ohs1 ohs2 ohs3
 do
         /pgold/orgrid/oracle/product/121/bin/crsctl stop cluster -n $node
         if [ "$?" != "0" ]; then
                 echo "Error stopping Oracle Grid Infrastructure in node $node"
                 exit 1
         fi
         /pgold/orgrid/oracle/product/121/bin/crsctl start cluster -n $node
         stat=1
         cmd="/pgold/orgrid/oracle/product/121/bin/crsctl status server $node"
         while [ $stat = 1 ]
         do
                 sleep 5
                 op=`$cmd`
                 op=`echo $op | /bin/cut -d' ' -f2  | /bin/cut -d'=' -f2`
                 if [ "$op" = "ONLINE" ]
                 then
                         stat=0
                         echo "Oracle Grid Infrastructure restarted in node $node"
                 fi
         done
         if [ "$node" = ohs1 ]; then
                 for lsnr in ASMNET1LSNR_ASM
                 do
                         /pgold/orgrid/oracle/product/121/bin/srvctl start listener -listener $lsnr
                         lsnrret=$?
                         if [ "$lsnrret" = "2" ]; then
                                 echo "ASM listener $lsnr running already"
                         elif [ "$lsnrret" != "0" ]; then
                                 echo "Error starting ASM listener $lsnr"
                                 exit 1
                         fi
                 done
         fi
 done


用root执行 converttoFlexASM.sh 输出

[orgrid@ohs1 ~]$ /pgold/orgrid/grid_base/cfgtoollogs/asmca/scripts/converttoFlexASM.sh

CRS-4563: Insufficient user privileges.

CRS-4000: Command Stop failed, or completed with errors.

Error stopping Oracle Grid Infrastructure in node ohs1

[orgrid@ohs1 ~]$ exit

logout

[root@ohs1 ~]# /pgold/orgrid/grid_base/cfgtoollogs/asmca/scripts/converttoFlexASM.sh

CRS-2673: Attempting to stop 'ora.crsd' on 'ohs1'
 CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'ohs1'
 CRS-2673: Attempting to stop 'ora.cvu' on 'ohs1'
 CRS-2673: Attempting to stop 'ora.mgmtdb' on 'ohs1'
 CRS-2673: Attempting to stop 'ora.gns' on 'ohs1'
 CRS-2673: Attempting to stop 'ora.LISTENER_SCAN3.lsnr' on 'ohs1'
 CRS-2673: Attempting to stop 'ora.oc4j' on 'ohs1'
 CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'ohs1'
 CRS-2673: Attempting to stop 'ora.FRA_PGOLD.dg' on 'ohs1'
 CRS-2673: Attempting to stop 'ora.SYSTEMDG.dg' on 'ohs1'
 CRS-2673: Attempting to stop 'ora.DATA_PGOLD.dg' on 'ohs1'
 CRS-2677: Stop of 'ora.cvu' on 'ohs1' succeeded
 CRS-2672: Attempting to start 'ora.cvu' on 'ohs3'
 CRS-2677: Stop of 'ora.FRA_PGOLD.dg' on 'ohs1' succeeded
 CRS-2676: Start of 'ora.cvu' on 'ohs3' succeeded
 CRS-2677: Stop of 'ora.SYSTEMDG.dg' on 'ohs1' succeeded
 CRS-2677: Stop of 'ora.DATA_PGOLD.dg' on 'ohs1' succeeded
 CRS-2677: Stop of 'ora.LISTENER_SCAN3.lsnr' on 'ohs1' succeeded
 CRS-2673: Attempting to stop 'ora.scan3.vip' on 'ohs1'
 CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'ohs1' succeeded
 CRS-2673: Attempting to stop 'ora.ohs1.vip' on 'ohs1'
 CRS-2677: Stop of 'ora.scan3.vip' on 'ohs1' succeeded
 CRS-2672: Attempting to start 'ora.scan3.vip' on 'ohs2'
 CRS-2677: Stop of 'ora.ohs1.vip' on 'ohs1' succeeded
 CRS-2672: Attempting to start 'ora.ohs1.vip' on 'ohs3'
 CRS-2677: Stop of 'ora.mgmtdb' on 'ohs1' succeeded
 CRS-2673: Attempting to stop 'ora.MGMTLSNR' on 'ohs1'
 CRS-2677: Stop of 'ora.MGMTLSNR' on 'ohs1' succeeded
 CRS-2672: Attempting to start 'ora.MGMTLSNR' on 'ohs2'
 CRS-2677: Stop of 'ora.gns' on 'ohs1' succeeded
 CRS-2673: Attempting to stop 'ora.gns.vip' on 'ohs1'
 CRS-2677: Stop of 'ora.gns.vip' on 'ohs1' succeeded
 CRS-2672: Attempting to start 'ora.gns.vip' on 'ohs2'
 CRS-2676: Start of 'ora.gns.vip' on 'ohs2' succeeded
 CRS-2672: Attempting to start 'ora.gns' on 'ohs2'
 CRS-2677: Stop of 'ora.oc4j' on 'ohs1' succeeded
 CRS-2672: Attempting to start 'ora.oc4j' on 'ohs3'
 CRS-2676: Start of 'ora.MGMTLSNR' on 'ohs2' succeeded
 CRS-2672: Attempting to start 'ora.mgmtdb' on 'ohs2'
 CRS-2676: Start of 'ora.gns' on 'ohs2' succeeded
 CRS-2676: Start of 'ora.scan3.vip' on 'ohs2' succeeded
 CRS-2672: Attempting to start 'ora.LISTENER_SCAN3.lsnr' on 'ohs2'
 CRS-2676: Start of 'ora.oc4j' on 'ohs3' succeeded
 CRS-2676: Start of 'ora.mgmtdb' on 'ohs2' succeeded
 CRS-2676: Start of 'ora.LISTENER_SCAN3.lsnr' on 'ohs2' succeeded
 CRS-2676: Start of 'ora.ohs1.vip' on 'ohs3' succeeded
 CRS-2673: Attempting to stop 'ora.ons' on 'ohs1'
 CRS-2677: Stop of 'ora.ons' on 'ohs1' succeeded
 CRS-2673: Attempting to stop 'ora.net1.network' on 'ohs1'
 CRS-2677: Stop of 'ora.net1.network' on 'ohs1' succeeded
 CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'ohs1' has completed
 CRS-2677: Stop of 'ora.crsd' on 'ohs1' succeeded
 CRS-2673: Attempting to stop 'ora.ctssd' on 'ohs1'
 CRS-2673: Attempting to stop 'ora.evmd' on 'ohs1'
 CRS-2673: Attempting to stop 'ora.storage' on 'ohs1'
 CRS-2677: Stop of 'ora.storage' on 'ohs1' succeeded
 CRS-2673: Attempting to stop 'ora.asm' on 'ohs1'
 CRS-2677: Stop of 'ora.ctssd' on 'ohs1' succeeded
 CRS-2677: Stop of 'ora.evmd' on 'ohs1' succeeded
 CRS-2677: Stop of 'ora.asm' on 'ohs1' succeeded
 CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'ohs1'
 CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'ohs1' succeeded
 CRS-2673: Attempting to stop 'ora.cssd' on 'ohs1'
 CRS-2677: Stop of 'ora.cssd' on 'ohs1' succeeded
 CRS-2672: Attempting to start 'ora.evmd' on 'ohs1'
 CRS-2672: Attempting to start 'ora.cssdmonitor' on 'ohs1'
 CRS-2676: Start of 'ora.cssdmonitor' on 'ohs1' succeeded
 CRS-2672: Attempting to start 'ora.cssd' on 'ohs1'
 CRS-2672: Attempting to start 'ora.diskmon' on 'ohs1'
 CRS-2676: Start of 'ora.diskmon' on 'ohs1' succeeded
 CRS-2676: Start of 'ora.evmd' on 'ohs1' succeeded
 CRS-2676: Start of 'ora.cssd' on 'ohs1' succeeded
 CRS-2672: Attempting to start 'ora.ctssd' on 'ohs1'
 CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'ohs1'
 CRS-2676: Start of 'ora.ctssd' on 'ohs1' succeeded
 CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'ohs1' succeeded
 CRS-2672: Attempting to start 'ora.asm' on 'ohs1'
 CRS-2676: Start of 'ora.asm' on 'ohs1' succeeded
 CRS-2672: Attempting to start 'ora.storage' on 'ohs1'
 CRS-2676: Start of 'ora.storage' on 'ohs1' succeeded
 CRS-2672: Attempting to start 'ora.crsd' on 'ohs1'
 CRS-2676: Start of 'ora.crsd' on 'ohs1' succeeded
 Oracle Grid Infrastructure restarted in node ohs1
 PRCC-1014 : ASMNET1LSNR_ASM was already running
 PRCR-1004 : Resource ora.ASMNET1LSNR_ASM.lsnr is already running
 PRCR-1079 : Failed to start resource ora.ASMNET1LSNR_ASM.lsnr
 CRS-5702: Resource 'ora.ASMNET1LSNR_ASM.lsnr' is already running on 'ohs3'
 CRS-5702: Resource 'ora.ASMNET1LSNR_ASM.lsnr' is already running on 'ohs2'
 CRS-5702: Resource 'ora.ASMNET1LSNR_ASM.lsnr' is already running on 'ohs1'
 ASM listener ASMNET1LSNR_ASM running already
 CRS-2673: Attempting to stop 'ora.crsd' on 'ohs2'
 CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'ohs2'
 CRS-2673: Attempting to stop 'ora.mgmtdb' on 'ohs2'
 CRS-2673: Attempting to stop 'ora.LISTENER_SCAN3.lsnr' on 'ohs2'
 CRS-2673: Attempting to stop 'ora.ASMNET1LSNR_ASM.lsnr' on 'ohs2'
 CRS-2673: Attempting to stop 'ora.SYSTEMDG.dg' on 'ohs2'
 CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'ohs2'
 CRS-2673: Attempting to stop 'ora.DATA_PGOLD.dg' on 'ohs2'
 CRS-2673: Attempting to stop 'ora.FRA_PGOLD.dg' on 'ohs2'
 CRS-2677: Stop of 'ora.SYSTEMDG.dg' on 'ohs2' succeeded
 CRS-2677: Stop of 'ora.DATA_PGOLD.dg' on 'ohs2' succeeded
 CRS-2677: Stop of 'ora.FRA_PGOLD.dg' on 'ohs2' succeeded
 CRS-2677: Stop of 'ora.LISTENER_SCAN3.lsnr' on 'ohs2' succeeded
 CRS-2673: Attempting to stop 'ora.scan3.vip' on 'ohs2'
 CRS-2677: Stop of 'ora.ASMNET1LSNR_ASM.lsnr' on 'ohs2' succeeded
 CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'ohs2' succeeded
 CRS-2673: Attempting to stop 'ora.ohs2.vip' on 'ohs2'
 CRS-2677: Stop of 'ora.scan3.vip' on 'ohs2' succeeded
 CRS-2672: Attempting to start 'ora.scan3.vip' on 'ohs1'
 CRS-2677: Stop of 'ora.ohs2.vip' on 'ohs2' succeeded
 CRS-2672: Attempting to start 'ora.ohs2.vip' on 'ohs3'
 CRS-2677: Stop of 'ora.mgmtdb' on 'ohs2' succeeded
 CRS-2673: Attempting to stop 'ora.MGMTLSNR' on 'ohs2'
 CRS-2677: Stop of 'ora.MGMTLSNR' on 'ohs2' succeeded
 CRS-2672: Attempting to start 'ora.MGMTLSNR' on 'ohs3'
 CRS-2676: Start of 'ora.MGMTLSNR' on 'ohs3' succeeded
 CRS-2672: Attempting to start 'ora.mgmtdb' on 'ohs3'
 CRS-2676: Start of 'ora.scan3.vip' on 'ohs1' succeeded
 CRS-2672: Attempting to start 'ora.LISTENER_SCAN3.lsnr' on 'ohs1'
 CRS-2676: Start of 'ora.LISTENER_SCAN3.lsnr' on 'ohs1' succeeded
 CRS-2673: Attempting to stop 'ora.gns' on 'ohs2'
 CRS-2676: Start of 'ora.ohs2.vip' on 'ohs3' succeeded
 CRS-2676: Start of 'ora.mgmtdb' on 'ohs3' succeeded
 CRS-2677: Stop of 'ora.gns' on 'ohs2' succeeded
 CRS-2673: Attempting to stop 'ora.gns.vip' on 'ohs2'
 CRS-2677: Stop of 'ora.gns.vip' on 'ohs2' succeeded
 CRS-2672: Attempting to start 'ora.gns.vip' on 'ohs3'
 CRS-2676: Start of 'ora.gns.vip' on 'ohs3' succeeded
 CRS-2672: Attempting to start 'ora.gns' on 'ohs3'
 CRS-2676: Start of 'ora.gns' on 'ohs3' succeeded
 CRS-2673: Attempting to stop 'ora.ons' on 'ohs2'
 CRS-2677: Stop of 'ora.ons' on 'ohs2' succeeded
 CRS-2673: Attempting to stop 'ora.net1.network' on 'ohs2'
 CRS-2677: Stop of 'ora.net1.network' on 'ohs2' succeeded
 CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'ohs2' has completed
 CRS-2677: Stop of 'ora.crsd' on 'ohs2' succeeded
 CRS-2673: Attempting to stop 'ora.ctssd' on 'ohs2'
 CRS-2673: Attempting to stop 'ora.evmd' on 'ohs2'
 CRS-2673: Attempting to stop 'ora.storage' on 'ohs2'
 CRS-2677: Stop of 'ora.storage' on 'ohs2' succeeded
 CRS-2673: Attempting to stop 'ora.asm' on 'ohs2'
 CRS-2677: Stop of 'ora.ctssd' on 'ohs2' succeeded
 CRS-2677: Stop of 'ora.evmd' on 'ohs2' succeeded
 CRS-2677: Stop of 'ora.asm' on 'ohs2' succeeded
 CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'ohs2'
 CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'ohs2' succeeded
 CRS-2673: Attempting to stop 'ora.cssd' on 'ohs2'
 CRS-2677: Stop of 'ora.cssd' on 'ohs2' succeeded
 CRS-2672: Attempting to start 'ora.evmd' on 'ohs2'
 CRS-2672: Attempting to start 'ora.cssdmonitor' on 'ohs2'
 CRS-2676: Start of 'ora.cssdmonitor' on 'ohs2' succeeded
 CRS-2672: Attempting to start 'ora.cssd' on 'ohs2'
 CRS-2672: Attempting to start 'ora.diskmon' on 'ohs2'
 CRS-2676: Start of 'ora.diskmon' on 'ohs2' succeeded
 CRS-2676: Start of 'ora.evmd' on 'ohs2' succeeded
 CRS-2676: Start of 'ora.cssd' on 'ohs2' succeeded
 CRS-2672: Attempting to start 'ora.ctssd' on 'ohs2'
 CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'ohs2'
 CRS-2676: Start of 'ora.ctssd' on 'ohs2' succeeded
 CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'ohs2' succeeded
 CRS-2672: Attempting to start 'ora.asm' on 'ohs2'
 CRS-2676: Start of 'ora.asm' on 'ohs2' succeeded
 CRS-2672: Attempting to start 'ora.storage' on 'ohs2'
 CRS-2676: Start of 'ora.storage' on 'ohs2' succeeded
 CRS-2672: Attempting to start 'ora.crsd' on 'ohs2'
 CRS-2676: Start of 'ora.crsd' on 'ohs2' succeeded
 Oracle Grid Infrastructure restarted in node ohs2
 CRS-2673: Attempting to stop 'ora.crsd' on 'ohs3'
 CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'ohs3'
 CRS-2673: Attempting to stop 'ora.oc4j' on 'ohs3'
 CRS-2673: Attempting to stop 'ora.ASMNET1LSNR_ASM.lsnr' on 'ohs3'
 CRS-2673: Attempting to stop 'ora.FRA_PGOLD.dg' on 'ohs3'
 CRS-2673: Attempting to stop 'ora.cvu' on 'ohs3'
 CRS-2673: Attempting to stop 'ora.SYSTEMDG.dg' on 'ohs3'
 CRS-2673: Attempting to stop 'ora.DATA_PGOLD.dg' on 'ohs3'
 CRS-2677: Stop of 'ora.cvu' on 'ohs3' succeeded
 CRS-2672: Attempting to start 'ora.cvu' on 'ohs1'
 CRS-2677: Stop of 'ora.FRA_PGOLD.dg' on 'ohs3' succeeded
 CRS-2677: Stop of 'ora.SYSTEMDG.dg' on 'ohs3' succeeded
 CRS-2677: Stop of 'ora.DATA_PGOLD.dg' on 'ohs3' succeeded
 CRS-2676: Start of 'ora.cvu' on 'ohs1' succeeded
 CRS-2677: Stop of 'ora.ASMNET1LSNR_ASM.lsnr' on 'ohs3' succeeded
 CRS-2673: Attempting to stop 'ora.LISTENER_SCAN2.lsnr' on 'ohs3'
 CRS-2677: Stop of 'ora.LISTENER_SCAN2.lsnr' on 'ohs3' succeeded
 CRS-2673: Attempting to stop 'ora.scan2.vip' on 'ohs3'
 CRS-2677: Stop of 'ora.scan2.vip' on 'ohs3' succeeded
 CRS-2672: Attempting to start 'ora.scan2.vip' on 'ohs2'
 CRS-2677: Stop of 'ora.oc4j' on 'ohs3' succeeded
 CRS-2672: Attempting to start 'ora.oc4j' on 'ohs1'
 CRS-2676: Start of 'ora.scan2.vip' on 'ohs2' succeeded
 CRS-2672: Attempting to start 'ora.LISTENER_SCAN2.lsnr' on 'ohs2'
 CRS-2676: Start of 'ora.oc4j' on 'ohs1' succeeded
 CRS-2676: Start of 'ora.LISTENER_SCAN2.lsnr' on 'ohs2' succeeded
 CRS-2673: Attempting to stop 'ora.mgmtdb' on 'ohs3'
 CRS-2672: Attempting to start 'ora.SYSTEMDG.dg' on 'ohs2'
 CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'ohs3'
 CRS-2673: Attempting to stop 'ora.gns' on 'ohs3'
 CRS-2676: Start of 'ora.SYSTEMDG.dg' on 'ohs2' succeeded
 CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'ohs3' succeeded
 CRS-2673: Attempting to stop 'ora.ohs3.vip' on 'ohs3'
 CRS-2677: Stop of 'ora.ohs3.vip' on 'ohs3' succeeded
 CRS-2672: Attempting to start 'ora.ohs3.vip' on 'ohs2'
 CRS-2677: Stop of 'ora.mgmtdb' on 'ohs3' succeeded
 CRS-2673: Attempting to stop 'ora.MGMTLSNR' on 'ohs3'
 CRS-2677: Stop of 'ora.gns' on 'ohs3' succeeded
 CRS-2673: Attempting to stop 'ora.gns.vip' on 'ohs3'
 CRS-2677: Stop of 'ora.MGMTLSNR' on 'ohs3' succeeded
 CRS-2672: Attempting to start 'ora.MGMTLSNR' on 'ohs1'
 CRS-2677: Stop of 'ora.gns.vip' on 'ohs3' succeeded
 CRS-2672: Attempting to start 'ora.gns.vip' on 'ohs2'
 CRS-2676: Start of 'ora.gns.vip' on 'ohs2' succeeded
 CRS-2672: Attempting to start 'ora.gns' on 'ohs2'
 CRS-2676: Start of 'ora.MGMTLSNR' on 'ohs1' succeeded
 CRS-2672: Attempting to start 'ora.mgmtdb' on 'ohs1'
 CRS-2676: Start of 'ora.gns' on 'ohs2' succeeded
 CRS-2676: Start of 'ora.ohs3.vip' on 'ohs2' succeeded
 CRS-2676: Start of 'ora.mgmtdb' on 'ohs1' succeeded
 CRS-2673: Attempting to stop 'ora.ons' on 'ohs3'
 CRS-2677: Stop of 'ora.ons' on 'ohs3' succeeded
 CRS-2673: Attempting to stop 'ora.net1.network' on 'ohs3'
 CRS-2677: Stop of 'ora.net1.network' on 'ohs3' succeeded
 CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'ohs3' has completed
 CRS-2677: Stop of 'ora.crsd' on 'ohs3' succeeded
 CRS-2673: Attempting to stop 'ora.ctssd' on 'ohs3'
 CRS-2673: Attempting to stop 'ora.evmd' on 'ohs3'
 CRS-2673: Attempting to stop 'ora.storage' on 'ohs3'
 CRS-2677: Stop of 'ora.storage' on 'ohs3' succeeded
 CRS-2673: Attempting to stop 'ora.asm' on 'ohs3'
 CRS-2677: Stop of 'ora.ctssd' on 'ohs3' succeeded
 CRS-2677: Stop of 'ora.evmd' on 'ohs3' succeeded
 CRS-2677: Stop of 'ora.asm' on 'ohs3' succeeded
 CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'ohs3'
 CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'ohs3' succeeded
 CRS-2673: Attempting to stop 'ora.cssd' on 'ohs3'
 CRS-2677: Stop of 'ora.cssd' on 'ohs3' succeeded
 CRS-2672: Attempting to start 'ora.evmd' on 'ohs3'
 CRS-2672: Attempting to start 'ora.cssdmonitor' on 'ohs3'
 CRS-2676: Start of 'ora.cssdmonitor' on 'ohs3' succeeded
 CRS-2672: Attempting to start 'ora.cssd' on 'ohs3'
 CRS-2672: Attempting to start 'ora.diskmon' on 'ohs3'
 CRS-2676: Start of 'ora.diskmon' on 'ohs3' succeeded
 CRS-2676: Start of 'ora.evmd' on 'ohs3' succeeded
 CRS-2676: Start of 'ora.cssd' on 'ohs3' succeeded
 CRS-2672: Attempting to start 'ora.ctssd' on 'ohs3'
 CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'ohs3'
 CRS-2676: Start of 'ora.ctssd' on 'ohs3' succeeded
 CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'ohs3' succeeded
 CRS-2672: Attempting to start 'ora.asm' on 'ohs3'
 CRS-2676: Start of 'ora.asm' on 'ohs3' succeeded
 CRS-2672: Attempting to start 'ora.storage' on 'ohs3'
 CRS-2676: Start of 'ora.storage' on 'ohs3' succeeded
 CRS-2672: Attempting to start 'ora.crsd' on 'ohs3'
 CRS-2676: Start of 'ora.crsd' on 'ohs3' succeeded
 Oracle Grid Infrastructure restarted in node ohs3
 [root@ohs1 ~]#


当前系统Cluster和ASM的类型

[orgrid@ohs1 ~]$ crsctl get cluster mode status
 Cluster is running in "standard" mode
 [orgrid@ohs1 ~]$
 [orgrid@ohs1 ~]$ asmcmd
 ASMCMD> showclustermode
 ASM cluster : Flex mode enabled
 ASMCMD>


ASM配置信息

[orgrid@ohs1 ~]$ srvctl status asm -detail

ASM is running on ohs3,ohs2,ohs1
 ASM is enabled. [orgrid@ohs1 ~]$ srvctl config asm -detail
ASM home: <CRS home>
 Password file: +SYSTEMDG/orapwASM
 ASM listener: LISTENER
 ASM is enabled.
 ASM is individually enabled on nodes:
 ASM is individually disabled on nodes:
 ASM instance count: ALL
 Cluster ASM listener: ASMNET1LSNR_ASM


3个节点上ASM监听状态

这里三个ASM实例共用一个服务名,有点类似SCAN的意思

[orgrid@ ohs1  ~]$ lsnrctl status ASMNET1LSNR_ASM

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 25-SEP-2016 11:25:23
 Copyright (c) 1991, 2014, Oracle.  All rights reserved.
 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=ASMNET1LSNR_ASM)))
 STATUS of the LISTENER
 ------------------------
 Alias                     ASMNET1LSNR_ASM
 Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
 Start Date                25-SEP-2016 11:16:40
 Uptime                    0 days 0 hr. 8 min. 43 sec
 Trace Level               off
 Security                  ON: Local OS Authentication
 SNMP                      OFF
 Listener Parameter File   /pgold/orgrid/oracle/product/121/network/admin/listener.ora
 Listener Log File         /pgold/orgrid/grid_base/diag/tnslsnr/ohs1/asmnet1lsnr_asm/alert/log.xml
 Listening Endpoints Summary...
   (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=ASMNET1LSNR_ASM)))
   (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.0.21)(PORT=10010)))
 Services Summary...
 Service "+ASM" has 3 instance(s).
   Instance "+ASM1", status READY, has 2 handler(s) for this service...
   Instance "+ASM2", status READY, has 1 handler(s) for this service...
   Instance "+ASM3", status READY, has 1 handler(s) for this service...
 The command completed successfully
 [orgrid@ohs1 ~]$

[orgrid@ ohs2  ~]$ lsnrctl status ASMNET1LSNR_ASM

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 25-SEP-2016 11:28:49
 Copyright (c) 1991, 2014, Oracle.  All rights reserved.
 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=ASMNET1LSNR_ASM)))
 STATUS of the LISTENER
 ------------------------
 Alias                     ASMNET1LSNR_ASM
 Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
 Start Date                25-SEP-2016 11:17:59
 Uptime                    0 days 0 hr. 10 min. 50 sec
 Trace Level               off
 Security                  ON: Local OS Authentication
 SNMP                      OFF
 Listener Parameter File   /pgold/orgrid/oracle/product/121/network/admin/listener.ora
 Listener Log File         /pgold/orgrid/grid_base/diag/tnslsnr/ohs2/asmnet1lsnr_asm/alert/log.xml
 Listening Endpoints Summary...
   (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=ASMNET1LSNR_ASM)))
   (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.0.22)(PORT=10010)))
 Services Summary...
 Service "+ASM" has 3 instance(s).
   Instance "+ASM1", status READY, has 1 handler(s) for this service...
   Instance "+ASM2", status READY, has 2 handler(s) for this service...
   Instance "+ASM3", status READY, has 1 handler(s) for this service...
 The command completed successfully
 [orgrid@ohs2 ~]$

[orgrid@ ohs3  ~]$ lsnrctl status ASMNET1LSNR_ASM

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 25-SEP-2016 11:28:59
 Copyright (c) 1991, 2014, Oracle.  All rights reserved.
 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=ASMNET1LSNR_ASM)))
 STATUS of the LISTENER
 ------------------------
 Alias                     ASMNET1LSNR_ASM
 Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
 Start Date                25-SEP-2016 11:20:08
 Uptime                    0 days 0 hr. 8 min. 50 sec
 Trace Level               off
 Security                  ON: Local OS Authentication
 SNMP                      OFF
 Listener Parameter File   /pgold/orgrid/oracle/product/121/network/admin/listener.ora
 Listener Log File         /pgold/orgrid/grid_base/diag/tnslsnr/ohs3/asmnet1lsnr_asm/alert/log.xml
 Listening Endpoints Summary...
   (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=ASMNET1LSNR_ASM)))
   (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.0.23)(PORT=10010)))
 Services Summary...
 Service "+ASM" has 3 instance(s).
   Instance "+ASM1", status READY, has 1 handler(s) for this service...
   Instance "+ASM2", status READY, has 1 handler(s) for this service...
   Instance "+ASM3", status READY, has 2 handler(s) for this service...
 The command completed successfully
 [orgrid@ohs3 ~]$
 [orgrid@ohs3 ~]$


在节点一上通过服务名连接ASM实例,连接到了+ASM3

[orgrid@ohs1 ~]$ sqlplus sys/oracle@172.16.0.21:10010/+ASM as sysasm
 SQL*Plus: Release 12.1.0.2.0 Production on Sun Sep 25 11:35:33 2016
 Copyright (c) 1982, 2014, Oracle.  All rights reserved.
 Connected to:
 Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
 With the Real Application Clusters and Automatic Storage Management options
 SQL> select instance_name from v$instance;
 INSTANCE_NAME
 ---------------- +ASM3
SQL>


ASM监听service状况

[orgrid@ohs1 ~]$ lsnrctl service ASMNET1LSNR_ASM

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 25-SEP-2016 11:37:14
 Copyright (c) 1991, 2014, Oracle.  All rights reserved.
 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=ASMNET1LSNR_ASM)))
 Services Summary...
 Service "+ASM" has 3 instance(s).
   Instance "+ASM1", status READY, has 2 handler(s) for this service...
     Handler(s):
       "DEDICATED" established:0 refused:0 state:ready
          REMOTE SERVER
          (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.0.21)(PORT=10010)))
       "DEDICATED" established:18 refused:0 state:ready
          LOCAL SERVER
   Instance "+ASM2", status READY, has 1 handler(s) for this service...
     Handler(s):
       "DEDICATED" established:0 refused:0 state:ready
          REMOTE SERVER
          (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.0.22)(PORT=10010)))
   Instance "+ASM3", status READY, has 1 handler(s) for this service...
     Handler(s):
       "DEDICATED" established:5 refused:0 state:ready
          REMOTE SERVER
          (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.0.23)(PORT=10010)))
 The command completed successfully
 [orgrid@ohs1 ~]$


通过服务名连接ASM实例,并关闭它

[orgrid@ohs1 ~]$ sqlplus sys/oracle@172.16.0.22:10010/+ASM as sysasm
 SQL*Plus: Release 12.1.0.2.0 Production on Sun Sep 25 11:38:11 2016
 Copyright (c) 1982, 2014, Oracle.  All rights reserved.
 Connected to:
 Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
 With the Real Application Clusters and Automatic Storage Management options
 SQL> select instance_name from v$instance;
 INSTANCE_NAME
 ----------------
 +ASM2
 SQL> shut immediate
 ASM diskgroups dismounted
 ASM instance shutdown
 SQL> exit
 Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
 With the Real Application Clusters and Automatic Storage Management options

[orgrid@ohs1 ~]$ lsnrctl service ASMNET1LSNR_ASM

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 25-SEP-2016 11:38:51
 Copyright (c) 1991, 2014, Oracle.  All rights reserved.
 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=ASMNET1LSNR_ASM)))
 Services Summary...
 Service "+ASM" has 2 instance(s).
   Instance "+ASM1", status READY, has 2 handler(s) for this service...
     Handler(s):
       "DEDICATED" established:0 refused:0 state:ready
          REMOTE SERVER
          (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.0.21)(PORT=10010)))
       "DEDICATED" established:18 refused:0 state:ready
          LOCAL SERVER
   Instance "+ASM3", status READY, has 1 handler(s) for this service...
     Handler(s):
       "DEDICATED" established:5 refused:0 state:ready
          REMOTE SERVER
          (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.0.23)(PORT=10010)))
 The command completed successfully
 [orgrid@ohs1 ~]$

Reference

http://docs.oracle.com/database/121/OSTMG/GUID-12FCB03D-C006-4E1B-A077-262823F8CA06.htm

http://docs.oracle.com/database/121/OSTMG/GUID-39D13B70-30AE-4DFE-BFF9-2CD3A33A82E0.htm

http://www.oracle.com/technetwork/articles/database/flexasm-flexcluster-benefits-odb12c-2177371.html