Oracle 11gR2 RAC环境重建ASM spfile(二)

2015-02-02 13:34:53 · 作者: · 浏览: 71
ted


Total System Global Area 1135747072 bytes
Fixed Size? ? ? 2260728 bytes
Variable Size? 1108320520 bytes
ASM Cache? ? 25165824 bytes
ASM diskgroups mounted
ASM diskgroups volume enabled
ASMCMD> spget
/home/grid/REGISTRY.253.866325101? <<<<<已经生效


ASMCMD> rm REGISTRY.253.866325101
ORA-15032: not all alterations performed
ORA-15028: ASM file '+OCR_VOTE/rac-cluster/ASMPARAMETERFILE/REGISTRY.253.866325101' not dropped; currently being accessed (DBD ERROR: OCIStmtExecute)
<<<<<<提示不让删除,因为有实例在占用.关闭实例1即可


[grid@rac1 ~]$ asmcmd
ASMCMD> shutdown --abort
ASM instance shutdown
Connected to an idle instance.
ASMCMD> exit
[grid@rac1 ~]$ ps -ef | grep pmon
grid? ? ? 5793? 5674? 0 10:50 pts/0? ? 00:00:00 grep pmon


?


+++4) 重建spfile:


SQL> create spfile='+OCR_VOTE/rac-cluster/spfilecss.ora' from pfile='/tmp/css.ora';


File created.


[grid@rac2 ~]$ asmcmd spget
+OCR_VOTE/rac-cluster/spfilecss.ora? ? ? <<<<<<<<<<<<<<<<自动修改了gpnp profile配置


[grid@rac2 ~]$ asmcmd ls -l +OCR_VOTE/rac-cluster/spfilecss.ora
Type? ? ? ? ? ? ? Redund? Striped? Time? ? ? ? ? ? Sys? Name
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? N? ? spfilecss.ora => +OCR_VOTE/rac-cluster/ASMPARAMETERFILE/REGISTRY.253.866371967
<<<<<<<<<<<<<我们手工创建的spfile实际上还是指向了+OCR_VOTE/rac-cluster/ASMPARAMETERFILE/REGISTRY.253.866371967


以下尝试创建pfile,而后指向我们手工创建的路径,看看数据库能否顺利打开:


[grid@rac2 ~]$ cd $GRID_HOME/dbs
[grid@rac2 dbs]$ ps -ef | grep pmon
grid? ? ? 5850? ? 1? 0 10:46 ?? ? ? ? 00:00:00 asm_pmon_+ASM1
oracle? ? 6216? ? 1? 0 10:46 ?? ? ? ? 00:00:00 ora_pmon_luyan1
grid? ? ? 6990? 5516? 0 10:55 pts/0? ? 00:00:00 grep pmon
[grid@rac2 dbs]$ cat > init+ASM1.ora <> spfile='+OCR_VOTE/rac-cluster/spfilecss.ora'
> EOF
[grid@rac2 dbs]$ cat init+ASM1.ora
spfile='+OCR_VOTE/rac-cluster/spfilecss.ora'? ? ? ? ? ? <<<<<<<<<<<<<<<<

重启ASM...


SQL> show parameter spfile;?


NAME? ? ? ? TYPE
------------------------------------ ----------------------
VALUE
------------------------------
spfile? ? ? ? string
/home/grid/REGISTRY.253.866325101
SQL> shutdown abort;
ASM instance shutdown
SQL> startup pfile='?/dbs/init+ASM1.ora';? ? ? <<<<<<<<<以pfile启动
ASM instance started


Total System Global Area 1135747072 bytes
Fixed Size? ? ? 2260728 bytes
Variable Size? 1108320520 bytes
ASM Cache? ? 25165824 bytes
ASM diskgroups mounted
ASM diskgroups volume enabled
SQL> show parameter spfile;


NAME? ? ? ? TYPE
------------------------------------ ----------------------
VALUE
------------------------------
spfile? ? ? ? string
+OCR_VOTE/rac-cluster/spfilecss.ora


[grid@rac2 dbs]$ asmcmd spget
+OCR_VOTE/rac-cluster/spfilecss.ora
[grid@rac2 dbs]$ asmcmd ls -l +OCR_VOTE/rac-cluster/spfilecss.ora
Type? ? ? ? ? ? ? Redund? Striped? Time? ? ? ? ? ? Sys? Name
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? N? ? spfilecss.ora => +OCR_VOTE/rac-cluster/ASMPARAMETERFILE/REGISTRY.253.866371967
[grid@rac2 dbs]$ asmcmd shutdown --abort
ASM instance shutdown
[grid@rac2 dbs]$ sqlplus? / as sysasm


SQL*Plus: Release 11.2.0.4.0 Production on Mon Dec 15 11:21:09 2014


Copyright (c) 1982, 2013, Oracle.? All rights reserved.


Connected to an idle instance.


SQL> startup
ASM instance started


Total System Global Area 1135747072 bytes
Fixed Size? ? ? 2260728 bytes
Variable Size? 1108320520 bytes
ASM Cache? ? 25165824 bytes
ASM diskgroups mounted
ASM diskgroups volume enabled
SQL> show parameter spfile;


NAME? ? ? ? TYPE
------------------------------------ ----------------------
VALUE
------------------------------
spfile? ? ? ? string
+OCR_VOTE/rac-cluster/spfilecs
s.ora


节点一启动也能正常启动:
[grid@rac1 ~]$ ps -ef | grep pmon
grid? ? ? 5793? 5674? 0 10:50 pts/0? ? 00:00:00 grep pmon
[grid@rac1 ~]$
[grid@rac1 ~]$
[grid@rac1 ~]$ sqlplus? / as sysasm


SQL*Plus: Release 11.2.0.4.