【RAC】asm_diskgroups 引數

不一樣的天空w發表於2018-03-26
初始化引數asm_diskgroups指定了在ASM例項啟動時,或執行alter diskgroup all mount語句時,被掛載的磁碟組的名字,即當ASM例項啟動的時候,會掛載這個引數指定的所有磁碟組,或當執行alter diskgroup all mount/dismount語句時,也會掛載這個引數指定的所有磁碟組。
關於此引數的值,是由ASM自動維護的,不需要人去幹預,修改。
1 當成功建立一個磁碟組或是掛載一個磁碟組時,磁碟組的名字將會自動新增到此引數中。
2 當刪除或解除安裝一個磁碟組時,磁碟組的名字也將相應地從這個引數中移除。
注意:
如果掛載或解除安裝使用的是alter diskgroup all mount或alter diskgroup all dismount,此引數的值將不會發生變化!
只有在掛載或解除安裝時執行alter diskgroup xxx mount或alter diskgroup xxx dismount時,才會影響此引數的值。
做實驗如下:
SQL> select name,STATE from v$asm_diskgroup; 
NAME    STATE
-----   --------
DATA1   MOUNTED

SQL> create diskgroup DATA2 external redundancy  disk 'ORCL:VOL201','ORCL:VOL202','ORCL:VOL203','ORCL:VOL204'; 
Diskgroup created.
SQL> select name,STATE from v$asm_diskgroup; 
NAME            STATE
--------------- ---------------
DATA1           MOUNTED
DATA2           MOUNTED
SQL> show parameter asm_diskgroups; 
NAME            TYPE       VALUE
-------------- --------   -------------
asm_diskgroups  string     DATA2
SQL> create pfile='/tmp/asm_20110905.ora' from spfile;
File created.
檢視檔案內容:
[root@rac1 tmp]# cat asm_20110905.ora 
+ASM1.__oracle_base='/opt/rac/grid'#ORACLE_BASE set from in memory value
+ASM2.__oracle_base='/opt/rac/grid'#ORACLE_BASE set from in memory value
+ASM1.asm_diskgroups='DATA2'#Manual Mount
*.asm_power_limit=1
*.diagnostic_dest='/opt/rac/grid'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='EXCLUSIVE'

在節點2上
SQL> alter system set asm_diskgroups='DATA2' scope=spfile sid='+ASM2';
System altered.
SQL> show parameter asm_diskgroups; 
##這裡手工操作以後,asm_diskgroups裡面是沒有資訊的!!
NAME             TYPE         VALUE
--------------- ------------ ---------------
asm_diskgroups  string  
SQL> create pfile='/tmp/asm_20110905.ora' from spfile;
File created.  
檢視生成的檔案!
[root@rac2 tmp]# cat asm_20110905.ora 
+ASM1.__oracle_base='/opt/rac/grid'#ORACLE_BASE set from in memory value
+ASM2.__oracle_base='/opt/rac/grid'#ORACLE_BASE set from in memory value
+ASM1.asm_diskgroups='DATA2'#Manual Mount
+ASM2.asm_diskgroups='DATA2'--手工加上的!
*.asm_power_limit=1
*.diagnostic_dest='/opt/rac/grid'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='EXCLUSIVE'
在節點2上檢查DATA2的狀態:
grid@rac2:/home/grid>crsctl  status resource   ora.DATA2.dg              
NAME=ora.DATA2.dg
TYPE=ora.diskgroup.type
TARGET=ONLINE        , OFFLINE
STATE=ONLINE on rac1, OFFLINE 在節點2上未啟動!!

grid@rac2:/home/grid>sqlplus "/as sysasm"
SQL*Plus: Release 11.2.0.1.0 Production on Mon Sep 5 14:18:25 2011
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
SQL> select name,STATE from v$asm_diskgroup; 
NAME        STATE
----------------------
DATA1       MOUNTED
DATA2       DISMOUNTED

SQL> alter diskgroup DATA2 MOUNT;
Diskgroup altered.
SQL> show parameter asm_diskgroups;  ###mount DATA2磁碟之後,asm_diskgroups 顯示了資料DATA2
NAME              TYPE       VALUE
----------------  --------   -------------------
asm_diskgroups    string     DATA2
SQL> create pfile='/tmp/asm2_1.ora' from spfile;
File created.
SQL> exit

[root@rac2 tmp]# cat asm2_1.ora 
+ASM1.__oracle_base='/opt/rac/grid'#ORACLE_BASE set from in memory value
+ASM2.__oracle_base='/opt/rac/grid'#ORACLE_BASE set from in memory value
+ASM1.asm_diskgroups='DATA2'#Manual Mount
+ASM2.asm_diskgroups='DATA2'#Manual Mount  
##oracle 自己新增上去的!!!不過要注意 Manual Mount 提示,手動mount。
*.asm_power_limit=1
*.diagnostic_dest='/opt/rac/grid'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='EXCLUSIVE'
這裡11.2.0.1 有一個bug 8663101 !和磁碟的mount 狀態有關!

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

相關文章