【RAC】asm_diskgroups 参数

初始化参数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 状态有关!
上一篇:二本院校学弟大二开始实习,大三收割阿里、腾讯实习offer


下一篇:海外统计学硕士的BAT大数据开发面经,已拿offer