[12C] learn more about Oracle flex ASM and its advantages

Time:2021-2-22

brief introduction

Oracle Real Application Cluster (RAC) is a famous product in Oracle solutions, which is used to maintain the high availability of business data. Oracle RAC allows all cluster nodes to share load, and adopts n-1 fault-tolerant configuration to deal with node failure, where n is the total number of nodes. Oracle RAC has been improving every version, and this time is no exception. The new version 12.1.0.1 contains two attributes of “flex ASM” and “flex cluster”, which support various harsh requirements of cloud computing environment.

Oracle RAC 12C introduces two new concepts

Central node:As in previous versions, they are connected to each other over a private network and have direct access to shared storage. These nodes can directly access Oracle cluster Registry (OCR) and voting disk (VD).

Leaf node:These nodes are light nodes, they are not interconnected with each other, and they can not access the shared storage as the central node. Each leaf node communicates with the connected central node and connects to the cluster through the connected central node.

This topology allows loosely coupled application servers to form a cluster with tightly coupled database servers. The tightly coupled server is the central server, which shares the storage of database, OCR and voting equipment with other central servers in the cluster and carries out peer-to-peer communication. Loosely coupled servers are leaf servers, which form loose communication association with a single central server in the cluster. They do not need to share storage with other central servers or leaf servers in the cluster, and they do not need peer-to-peer communication. They only communicate with the associated central server. In 12.1.0.1, leaf server aims to improve the high availability of application and realize multi-layer resource management.

Before Oracle 12C, for database instances that want to use ASM, the ASM instances on all nodes must be running before starting the database instance. If the ASM instance is not running, it means that the database instance using ASM at the storage level cannot be started. This actually means that no matter what technology (RAC, ASM, and shared storage) is used, the database instance cannot be accessed.

With the introduction of Oracle 12C, a feature called Oracle flex ASM has removed the above restrictions. One of its main features is to fail over to other nodes in the cluster. In essence, it is a central and leaf architecture. Oracle clusterware seamlessly transfers the connection of the failed node to another member node through an alternative ASM instance. The number of ASM instances running in a given cluster is called the ASM cardinality, and the default value is 3. However, this base value can be modified with the clusterware command.

Oracle flex cluster

Architecturally, Oracle flex cluster includes a central and leaf architecture, in which only the central node can directly access Oracle cluster Registry (OCR) and voting disk (VD). However, the application can access the database through the leaf node without running the ASM instance on the leaf node. Connecting to the database through the central node makes it transparent to the application.

Figure 1: depicts a typical Oracle flex cluster with four leaf nodes and two central nodes. In short, Oracle flex ASM is required for Oracle flex cluster.

 

Implementation of Oracle flex ASM

Oracle flex ASM can be implemented in two ways:

  • Pure 12C flex ASM (same version)
    • Grid infrastructure (GI) and database run on Oracle 12C
  • Mixed versions before Oracle 12C (different versions)
    • As usual, ASM instances will run on each node, and flex configuration supports databases before 12C. The compatibility parameters of ASM disk group are used to manage the compatibility among database instances. The advantage of this method is that if the Oracle 12C database instance is disconnected from one ASM instance, the database connection will fail over to another ASM instance on another server. This is achieved by setting the cardinality to all.

Oracle RAC 12C using Oracle flex ASM

Standard Oracle flex ASM configuration:

 

ASM instance failure on Oracle flex ASM configuration:

1. Login RAC database instance 1 (Rac1)

[oracl[email protected] Desktop]$ hostname
oel6-112-rac1.localdomain

2. Check the status of ASM instance and Rac database instance

[[email protected] 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. Check the status of ASM instance in RAC database instance from instance 1 (Rac1)

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

4. Check the cluster status in instance 1 (Rac1)

[[email protected] 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. Command to check whether Oracle flex ASM is enabled (Rac1)

[[email protected] Desktop]$ asmcmd
ASMCMD> showclustermode 
ASM cluster : Flex mode enabled
ASMCMD> showclusterstate
Normal

6. Commands for changing ASM cardinality (Rac1)

[[email protected] Desktop]$ srvctl status asm -detail
ASM is running on oel6-112-rac2,oel6-112-rac1
ASM is enabled.
[[email protected] 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. Command to check whether Oracle flex ASM is enabled (Rac2)

[[email protected] Desktop]$ asmcmd
ASMCMD> showclustermode
ASM cluster : Flex mode enabled
ASMCMD> showclusterstate
Normal
ASMCMD> exit

8. How to change ASM cardinality (Rac2)

[[email protected] 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. Close the ASM instance in RAC database instance 1 (Rac1)

[[email protected] Desktop]$ srvctl stop asm -node oel6-112-rac1 -stopoption abort -force

10. Check the status of ASM instance in RAC database instance 1 (Rac1)

[[email protected] Desktop]$ srvctl status asm
PRCR-1070 : Failed to check if resource ora.asm is registered
Cannot communicate with crsd

11. Check the status of cluster service in RAC database instance 1 (Rac1)

[[email protected] 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. Check the status of ASM and Rac database in instance 1 (Rac1)

[[email protected] 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

Note:Here, the database instance is associated with a specific ASM instance running in a specific node. If for some reason, the ASM instance cannot be started / the service is shut down, the database instance can still be started, because the database instance will look for ASM instances running in the same cluster. Figure 3 depicts the high availability features of flex ASM.

13. Check the status of running RAC database instance without ASM instance in RAC database instance 1 (Rac1)

[[email protected] 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. Log in to the database instance from RAC database instance 1 (Rac1)

[[email protected] 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/[email protected] 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/[email protected] as sysdba
Connected.

SQL> select instance_name,instance_number from gv$instance;

INSTANCE_NAME           INSTANCE_NUMBER
-------------------------------------------
orcl1                         1

15. Connect from RAC database instance 1 (Rac1) to ASM instance of Rac database instance 2 (Rac2)

[[email protected] 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

[[email protected] 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>

Conclusion:The database instance uses a dedicated ASM instance. We force the ASM instance to stop working to simulate a failure, so the database instance reconnects to an existing ASM instance on another node (in this case, node 2 (Rac2)).

Oracle database 11.2 or earlier

As described in the previous introduction to Oracle 12C, the association between ASM and database instances is specific in nature. This means that if the ASM instance fails to start, the associated database instance in the node / ASM also fails to start, resulting in the inaccessibility of the database.

 

1. Login RAC database instance 1 (Rac1)

login as: oracle
[email protected]'s password:
Last login: Fri Sep 27 06:05:44 2013

2. Check the status of ASM instance and Rac database instance

[[email protected] ~]$ 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. Check the status of ASM instance in RAC database instance 1 (Rac1)

[[email protected] ~]$ srvctl status asm
ASM is running on rac2,rac1

4. Check the status of cluster in RAC database instance 1 (Rac1)

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

5. Stop the ASM instance in RAC database instance 1 (Rac1)

[[email protected] ~]$ srvctl stop asm -n rac1 -o abort -f

6. Check the status of ASM instance in RAC database instance 1 (Rac1)

[[email protected] ~]$ srvctl status asm
ASM is running on rac2

7. Check the status of ASM instance and Rac database instance (Rac1)

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

Conclusion:Database instances are strongly associated with ASM instances. If the ASM instance fails, the database instance on the same node will also fail.

Why use Oracle flex ASM

  • Oracle flex ASM supports larger Lun sizes for Oracle database 12C clients.
  • The maximum number of disk groups supported is 511.
  • You can flexibly rename ASM disks in a disk group.
  • Patch level verification of ASM instances
    • Disable patch level validation during rolling patches
  • Copy physical metadata

Network enhancement in Oracle flex ASM

  • In previous versions, clustering required:
    • A public network for client applications to access
    • One or more private networks for inter node communication (including ASM communication) within a cluster
  • Flex ASM adds ASM network, which can be used for communication between ASM and its clients, so as to isolate and shunt ASM communication.

Deploying flex ASM

Here is a screen capture of the flex ASM setup.

  • Select the option “advanced installation”

There are three storage options:

Standard ASM

  • ASM configuration mode before 12C

Oracle Flex ASM

  • recommend

Non ASM managed storage

 

Manage flex ASM:

  • No flex ASM specific instance parameters are required
  • ASM server instance uses automatic memory management (AMM)

 

About the author

Deiby g ó mez is an expert DBA and Oracle ace, with rich experience in Oracle exadata database cloud server and high availability solutions. He regularly attends Oracle events, including OTN Latin America tour, Java day, Oracle First Symposium and events held in many universities. Deiby is the first Guatemalan to post on Oracle lad, and he often blogs on his blog www.oraclefromguatemala.com.gt Published on the Internet.

Yenugula venkata ravikumar is a DBA with more than 15 years of experience, good at high availability database environment (RAC, data guard, etc.), tuning and performance, migration, backup and recovery, Oracle exadata V1 / V2 / V3, proficient in AIX, HP-UX, Linux and other operating systems. Currently living in India, he has participated in many Oracle events and delivered speeches in India. He was named Oracle Certified Master (OCM) of Oracle Corporation in 2009.

Nassyam Basha is a DBA. He is OCP 11g, proficient in Oracle technologies such as data guard, rman, Rac and performance tuning. He has installed data guard more than 90 times on various platforms from RAC to non RAC, and successfully completed cluster migration of many business critical production databases by using switch and fail over. He actively participated in Oracle related forums (such as OTN), published nearly 10000 posts as CKPT, and published articles on Oracle lists. He often writes on his blog www.oracle-ckpt.com Recently, he co authored the Oracle data guard 11gr2 management guide.

Reprinted:https://www.oracle.com/technetwork/cn/articles/database/flexasm-flexcluster-benefits-odb12c-2177371-zhs.html

 

Recommended Today

Redis design and implementation 4: Dictionary Dict

In redis, the dictionary is the infrastructure. Redis database data, expiration time and hash type all take the dictionary as the underlying structure. Structure of dictionary Hashtable The implementation code of hash table is as follows:dict.h/dictht The dictionary of redis is implemented in the form of hash table. typedef struct dictht { //Hash table array, […]