建立ASM啟動SPFILE報錯ORA-17502

yangtingkun發表於2011-12-21

客戶的資料庫的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檔案。

 

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

相關文章