今天启动了一下ASM,发现只挂载了一个SYS_DG磁盘组(用于存放OCR和VOTING DISK信息),另外两个磁盘组DATA_DG,DG_FRA都没有mount。
环境:OS=RHEL 6 DB=Oracle11GR2
[grid@myrac1 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.DATA_DG.dg ora....up.type OFFLINE OFFLINE
ora.DG_FRA.dg ora....up.type OFFLINE OFFLINE
ora....ER.lsnr ora....er.type ONLINE ONLINE myrac1
ora.SYS_DG.dg ora....up.type ONLINE ONLINE myrac1
ora.asm ora.asm.type ONLINE ONLINE myrac1
ora.cssd ora.cssd.type ONLINE ONLINE myrac1
ora.diskmon ora....on.type ONLINE ONLINE myrac1
ora.hjj.db ora....se.type OFFLINE OFFLINE
查看参数disk_groups发现没有值,按理来说应该是这三个磁盘组。
SQL> show parameter disk
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
asm_diskgroups string
asm_diskstring string
进行修改
[grid@myrac1 ~]$ sqlplus / as sysasm
SQL> startup nomount
ASM instance started
Total System Global Area 284565504 bytes
Fixed Size 1336036 bytes
Variable Size 258063644 bytes
ASM Cache 25165824 bytes
SQL> alter system set asm_diskgroups=sys_dg,data_dg,dg_fra scope=spfile;
alter system set asm_diskgroups=sys_dg,data_dg,dg_fra scope=spfile
*
ERROR at line 1:
ORA-32000: write to SPFILE requested but SPFILE is not modifiable
SQL> !oerr ora 32000
32000, 00000, "write to SPFILE requested but SPFILE is not modifiable"
// *Cause: An ALTER SYSTEM command or an internal self-tuning mechanism
// requested a write to the SPFILE but the SPFILE was not modifiable.
// *Action: Perform an in-memory parameter update only.
提示只能在memory中进行修改,尝试修改
SQL> alter system set asm_diskgroups=sys_dg,data_dg,dg_fra scope=memory;
System altered.
是可以修改,但是没办法永久保存,要修改的是spfile中的disk_groups参数,让ASM实例每次启动都能加载所有的diskgroup。
那问题就是如何修改spfile中的asm_diskgroups参数
通过create pfile 然后修改pfile,再通过pfile创建spfile,重启实例即可。
SQL> show parameter pfile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string +SYS_DG/asm/asmparameterfile/registry.253.837910359
SQL> select instance_name,host_name,version,status from v$instance;
INSTANCE_NAME HOST_NAME VERSION STATUS
---------------- ---------------------------------------------------------------- ----------------- ------------
+ASM myrac1.oracle.com 11.2.0.1.0 STARTED
SQL> create pfile='/g01/app/grid/product/11.2.0/grid/dbs/asmpfile.ora' from spfile;
File created.
[grid@myrac1 dbs]$ vi asmpfile.ora
+ASM.__oracle_base='/g01/app/grid'#ORACLE_BASE set from in memory value
+ASM.asm_diskgroups='SYS_DG,DATA_DG,DG_FRA'#Manual Mount 不能在这里直接修改
*.asm_power_limit=1
*.diagnostic_dest='/g01/app/grid'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='EXCLUSIVE'
~
SQL> create spfile from pfile='/g01/app/grid/product/11.2.0/grid/dbs/asmpfile.ora';