什么是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。
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,但这个转化是不可逆的。这样做的目的可能是为了推广这个特性,这个特性确实不错
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> exitFlex 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.shCRS-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_ASMLSNRCTL 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
