Overview of Oracle Flex ASM In Oracle 19c RAC-20220111

lovehewenyu發表於2022-03-21

Overview of Oracle Flex ASM  In Oracle 19c RAC-20220111

導讀:

1.Oracle Flex ASM使Oracle ASM例項能夠在一個獨立的伺服器為更多不同的資料庫提供服務 。   

2.Oracle Flex ASM特性:解決了本地asm例項於本地oracle例項強繫結的問題。配置Oracle Flex ASM後:本地asm例項down時,本地oracle例項可隨機分配至其他節點的asm例項中,保證了oracle例項執行的強壯性。


實驗來證明Oracle Flex ASM特性:

本地asm例項down時,本地oracle例項故障轉移驗證。

1.檢視gi版本

[grid@rac3:/home/grid]$sqlplus / as sysasm
SQL*Plus: Release 19.0.0.0.0 - Production on Tue Jan 4 21:34:39 2022
Version 19.9.0.0.0
Copyright (c) 1982, 2019, Oracle.  All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.9.0.0.0

2.檢視是否開啟oracle flex asm(預設開啟)

[grid@rac3:/home/grid]$asmcmd showclustermode
ASM cluster : Flex mode enabled - Direct Storage Access

3.檢視flex asm配置資訊

[grid@rac3:/home/grid]$srvctl config asm
ASM home: <CRS home>
Password file: +OCR/orapwASM
Backup of Password file: +OCR/orapwASM_backup
ASM listener: LISTENER
ASM instance count: 3
Cluster ASM listener: ASMNET1LSNR_ASM

4.檢視flex asm監聽狀態

[grid@rac3:/home/grid]$lsnrctl status ASMNET1LSNR_ASM
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 04-JAN-2022 20:42:15
Copyright (c) 1991, 2020, 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 19.0.0.0.0 - Production
Start Date                04-JAN-2022 20:35:00
Uptime                    0 days 0 hr. 7 min. 14 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/19.0.0/grid/network/admin/listener.ora
Listener Log File         /u01/app/grid/diag/tnslsnr/rac3/asmnet1lsnr_asm/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=ASMNET1LSNR_ASM)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.203)(PORT=1525)))
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...
Service "+ASM_ARCH" 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...
Service "+ASM_DATA" 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...
Service "+ASM_OCR" 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

5.節點3可以訪問節點1的asm例項

[grid@rac3:/home/grid]$sqlplus sys/oracle@192.168.56.201:1525/+ASM as sysasm
SQL*Plus: Release 19.0.0.0.0 - Production on Tue Jan 4 20:45:39 2022
Version 19.9.0.0.0
Copyright (c) 1982, 2019, Oracle.  All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.9.0.0.0
SQL> select instance_name from v$instance;
INSTANCE_NAME
--------------------------------
+ASM1
# 正因為節點3可用訪問節點1的asm例項這個特點。進而使flex asm解決了本地asm例項於oracle例項強繫結的問題。
# 配置flex asm後,本地asm例項down時,本地oracle例項可隨機分配至其他節點的asm例項中,保證了oracle例項執行的強壯性。

6.關閉節點3的asm例項,instance例項仍是open

[grid@rac3:/home/grid]$srvctl stop asm -n rac3
節點3的oracle例項仍open,程式ora_smon_racdb3是ok
[grid@rac3:/home/grid]$ps -ef | grep smon
root        4059       1  1 20:31 ?        00:00:20 /u01/app/19.0.0/grid/bin/osysmond.bin
oracle      9036       1  0 20:36 ?        00:00:00 ora_smon_racdb3
grid       31026    5165  0 20:59 pts/0    00:00:00 grep --color=auto smon 
[grid@rac3:/home/grid]$srvctl status database -d racdb -detail
Instance racdb1 is running on node rac1
Instance racdb1 is connected to ASM instance +ASM1
Instance racdb2 is not running on node rac2  <=手動關閉節點2
Instance racdb3 is running on node rac3
Instance racdb3 is connected to ASM instance +ASM1  <=instance從+asm3轉移至+asm1
# 節點3的instance racdb3已連線+asm1例項
節點1透過v$asm_client檢視檢視連線asm例項的資訊
SQL> select INST_ID,instance_name,db_name,status from gv$asm_client order by 2;
   INST_ID INSTANCE_NAME    DB_NAME      STATUS
---------- -------------------- ---------------- ------------------------
     1 +ASM1        +ASM         CONNECTED
     1 +ASM1        +ASM         CONNECTED
     1 rac1         _OCR         CONNECTED
     1 racdb1       racdb        CONNECTED
     1 racdb1       racdb        CONNECTED
     1 racdb3       racdb        CONNECTED
6 rows selected.
# instance racdb3已連線+asm1例項(即inst_id=1)
# 節點rac3此時asm例項已經down,但是oracle例項仍然open。
# 說明:本地asm例項與本地oracle例項不是強制繫結,本地asm例項是否open對oracle例項影響不是決定的。

7.檢視crs資源節點3的asm例項已offline,但節點3的instance仍是online。

證明:本地asm例項down時,本地oracle例項故障轉移驗證。

[grid@rac3:/home/grid]$crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
               ONLINE  ONLINE       rac1                     STABLE
               ONLINE  ONLINE       rac2                     STABLE
               ONLINE  ONLINE       rac3                     STABLE
ora.chad
               ONLINE  ONLINE       rac1                     STABLE
               ONLINE  ONLINE       rac2                     STABLE
               ONLINE  ONLINE       rac3                     STABLE
ora.net1.network
               ONLINE  ONLINE       rac1                     STABLE
               ONLINE  ONLINE       rac2                     STABLE
               ONLINE  ONLINE       rac3                     STABLE
ora.ons
               ONLINE  ONLINE       rac1                     STABLE
               ONLINE  ONLINE       rac2                     STABLE
               ONLINE  ONLINE       rac3                     STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.ARCH.dg(ora.asmgroup)
      1        ONLINE  ONLINE       rac1                     STABLE
      2        ONLINE  ONLINE       rac2                     STABLE
      3        OFFLINE OFFLINE                               STABLE
# +ASM3關閉,所以例項3服務的磁碟組也會offline
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
      1        ONLINE  ONLINE       rac1                     STABLE
      2        ONLINE  ONLINE       rac2                     STABLE
      3        OFFLINE OFFLINE                               STABLE
# +ASM3關閉,所以例項3服務的監聽也會offline
ora.DATA.dg(ora.asmgroup)
      1        ONLINE  ONLINE       rac1                     STABLE
      2        ONLINE  ONLINE       rac2                     STABLE
      3        OFFLINE OFFLINE                               STABLE
# +ASM3關閉,所以例項3服務的磁碟組也會offline
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       rac1                     STABLE
ora.OCR.dg(ora.asmgroup)
      1        ONLINE  ONLINE       rac1                     STABLE
      2        ONLINE  ONLINE       rac2                     STABLE
      3        OFFLINE OFFLINE                               STABLE
# +ASM3關閉,所以例項3服務的磁碟組也會offline
ora.asm(ora.asmgroup)
      1        ONLINE  ONLINE       rac1                     Started,STABLE
      2        ONLINE  ONLINE       rac2                     Started,STABLE
      3        OFFLINE OFFLINE                               Instance Shutdown,ST
                                                             ABLE
# +ASM3關閉,所以例項+ASM的服務會offline
ora.asmnet1.asmnetwork(ora.asmgroup)
      1        ONLINE  ONLINE       rac1                     STABLE
      2        ONLINE  ONLINE       rac2                     STABLE
      3        OFFLINE OFFLINE                               STABLE
# +ASM3關閉,所以例項3服務的asm network資源也會offline
ora.cvu
      1        ONLINE  ONLINE       rac1                     STABLE
ora.qosmserver
      1        ONLINE  ONLINE       rac1                     STABLE
ora.rac1.vip
      1        ONLINE  ONLINE       rac1                     STABLE
ora.rac2.vip
      1        ONLINE  ONLINE       rac2                     STABLE
ora.rac3.vip
      1        ONLINE  ONLINE       rac3                     STABLE
ora.racdb.db
      1        ONLINE  ONLINE       rac1                     Open,HOME=/u01/app/o
                                                             racle/product/19.0.0
                                                             /db_1,STABLE
      2        ONLINE  ONLINE       rac2                     Open,HOME=/u01/app/o
                                                             racle/product/19.0.0
                                                             /db_1,STABLE
      3        ONLINE  ONLINE       rac3                     Open,HOME=/u01/app/o
                                                             racle/product/19.0.0
                                                             /db_1,STABLE
# flex asm 特性,雖然+ASM3例項不可用,但是rac3資料庫例項由其他asm例項提供服務rac3資料庫例項仍可執行
ora.scan1.vip
      1        ONLINE  ONLINE       rac1                     STABLE
--------------------------------------------------------------------------------

8.結論

   a)oracle 19c 預設的asm儲存選項就是使用flex asm。

   b) flex asm解決了本地asm例項於oracle例項強繫結的問題;同時本地asm例項down時,本地oracle例項故障轉移驗證。


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26442936/viewspace-2871666/,如需轉載,請註明出處,否則將追究法律責任。

相關文章