创建ASM启动SPFILE报错ORA-17502

客户的数据库的ASM启动存在问题,通过手工创建PFILE,解决了ASM启动的问题,但是尝试利用PFILE生成SPFILE时报错。
详细错误信息为:

[grid@rptdb ~]$ sqlplus / AS sysasm
SQL*Plus: Release 11.2.0.2.0 Production ON Tue DEC 20 19:05:33 2011
Copyright (c) 1982, 2010, Oracle. ALL rights reserved.
Connected.
SQL> shutdown abort
ASM instance shutdown
SQL> startup pfile=/home/grid/init+ASM.ora
ASM instance started
Total System Global Area 283930624 bytes
Fixed SIZE 2225792 bytes
Variable SIZE 256539008 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL> CREATE spfile FROM pfile='/home/grid/init+ASM.ora';
CREATE spfile FROM pfile='/home/grid/init+ASM.ora'
*
ERROR at line 1:
ORA-17502: ksfdcre:4 Failed TO CREATE file +DATA/asm/asmparameterfile/registry.253.770384221
ORA-15177: cannot operate ON system aliases

查询ASM状态,并无异常存在:

SQL> SELECT name, group_number, alias_directory, system_created FROM v$asm_alias;
NAME                             GROUP_NUMBER A S
-------------------------------- ------------ - -
RPTALL                                      1 Y Y
DATAFILE                                    1 Y Y
SYSTEM.256.770384991                        1 N Y
SYSAUX.257.770384991                        1 N Y
UNDOTBS1.258.770384991                      1 N Y
USERS.259.770384991                         1 N Y
CONTROLFILE                                 1 Y Y
CURRENT.261.770385125                       1 N Y
CURRENT.260.770385125                       1 N Y
ONLINELOG                                   1 Y Y
group_1.262.770385127                       1 N Y
group_1.263.770385129                       1 N Y
group_2.264.770385129                       1 N Y
group_2.265.770385129                       1 N Y
group_3.266.770385129                       1 N Y
group_3.267.770385129                       1 N Y
TEMPFILE                                    1 Y Y
TEMP.268.770385133                          1 N Y
PARAMETERFILE                               1 Y Y
spfile.269.770385249                        1 N Y
spfilerptall.ora                            1 N N
21 ROWS selected.

可以看到,ASM磁盘组中并不存在asm/asmparameterfile目录,那么导致问题的原因多半是由于这个目录属于Oracle自动创建的目录,而一旦原始的spfile被删除,则目录自动删除,从而导致新创建的操作出现异常。

SQL> CREATE spfile='+DATA' FROM pfile='/home/grid/init+ASM.ora';
File created.
SQL> SELECT name, group_number, alias_directory, system_created FROM v$asm_alias;
NAME                          GROUP_NUMBER A S
----------------------------- ------------ - -
ASM                                      1 Y Y
ASMPARAMETERFILE                         1 Y Y
REGISTRY.253.770411755                   1 N Y
RPTALL                                   1 Y Y
DATAFILE                                 1 Y Y
SYSTEM.256.770384991                     1 N Y
SYSAUX.257.770384991                     1 N Y
UNDOTBS1.258.770384991                   1 N Y
USERS.259.770384991                      1 N Y
CONTROLFILE                              1 Y Y
CURRENT.261.770385125                    1 N Y
CURRENT.260.770385125                    1 N Y
ONLINELOG                                1 Y Y
group_1.262.770385127                    1 N Y
group_1.263.770385129                    1 N Y
group_2.264.770385129                    1 N Y
group_2.265.770385129                    1 N Y
group_3.266.770385129                    1 N Y
group_3.267.770385129                    1 N Y
TEMPFILE                                 1 Y Y
TEMP.268.770385133                       1 N Y
PARAMETERFILE                            1 Y Y
spfile.269.770385249                     1 N Y
spfilerptall.ora                         1 N N
24 ROWS selected.

果然再次尝试同样的命令,参数文件顺利创建成功,且对应的ASM目录也自动生成。因此,导致问题的原因应该是第一次创建ASM的参数文件时,导致最早创建的ASM参数文件被删除,引发了ASM目录被删除,而使得创建操作失败。
第二次创建ASM参数文件,则不存在这个问题,因此Oracle会自动创建ASM目录和SPFILE文件。

This entry was posted in ORACLE and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *