11gR2RAC环境重建ASMSPFILE

php中文网
发布: 2016-06-07 16:12:26
原创
1465人浏览过

有关11gr2 asm spfile说明可以看 http://blog.csdn.net/robo23/article/details/41930051 以下粘出spfile重启过程: 1)当前集群资源运行状态 [grid@rac2 ~]$ crsctl stat res -t --------------------------------------------------------------------------

有关11gr2 asm spfile说明可以看

http://blog.csdn.net/robo23/article/details/41930051

以下粘出spfile重启过程:

+++1)当前集群资源运行状态


[grid@rac2 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.LISTENER.lsnr
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.OCR_VOTE.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.asm
ONLINE ONLINE rac1 Started
ONLINE ONLINE rac2 Started
ora.gsd
OFFLINE OFFLINE rac1
OFFLINE OFFLINE rac2
ora.net1.network
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.ons
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.registry.acfs
ONLINE ONLINE rac1
ONLINE ONLINE rac2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac1
ora.cvu
1 ONLINE ONLINE rac2
ora.luyan.db
1 ONLINE ONLINE rac2 Open
2 ONLINE ONLINE rac1 Open
ora.oc4j
1 ONLINE ONLINE rac2
ora.rac1.vip
1 ONLINE ONLINE rac1
ora.rac2.vip
1 ONLINE ONLINE rac2
ora.scan1.vip
1 ONLINE ONLINE rac1

+++2)当前ASM spfile配置


[root@rac2 ~]# su - grid
s[grid@rac2 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Mon Dec 15 10:43:25 2014

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options

SQL> show parameter spfile;

NAME TYPE
------------------------------------ ----------------------
VALUE
------------------------------
spfile string
+OCR_VOTE/rac-cluster/asmparameterfile/registry.253.866325101

[grid@rac2 ~]$ asmcmd spget
+OCR_VOTE/rac-cluster/ASMPARAMETERFILE/REGISTRY.253.866325101

+++3) 备份spfile,删除旧的spfile

ASMCMD> cd +OCR_VOTE/rac-cluster/ASMPARAMETERFILE/
ASMCMD> ls
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)
ASMCMD> spcopy +OCR_VOTE/rac-cluster/ASMPARAMETERFILE/REGISTRY.253.866325101 /home/grid
ASMCMD> spset /home/grid/REGISTRY.253.866325101
ASMCMD> shutdown --abort
ASM instance shutdown
Connected to an idle instance.
ASMCMD> 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
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)

[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

[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

以下尝试创建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'; 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.

Dora
Dora

创建令人惊叹的3D动画网站,无需编写一行代码。

Dora 547
查看详情 Dora

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.0 Production on Mon Dec 15 11:21:56 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/spfilecss.ora


+++5) 替换手工创建的spfile至链接路径(可选)


[grid@rac2 dbs]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.LISTENER.lsnr
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.OCR_VOTE.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.asm
ONLINE ONLINE rac1 Started
ONLINE ONLINE rac2 Started
ora.gsd
OFFLINE OFFLINE rac1
OFFLINE OFFLINE rac2
ora.net1.network
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.ons
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.registry.acfs
ONLINE ONLINE rac1
ONLINE ONLINE rac2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac1
ora.cvu
1 ONLINE ONLINE rac2
ora.luyan.db
1 ONLINE ONLINE rac2 Open
2 ONLINE ONLINE rac1 Open
ora.oc4j
1 ONLINE ONLINE rac2
ora.rac1.vip
1 ONLINE ONLINE rac1
ora.rac2.vip
1 ONLINE ONLINE rac2
ora.scan1.vip
1 ONLINE ONLINE rac1
[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 spset +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:43:26 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/asmparameterfile/registry.253.86637196
7
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
[grid@rac2 dbs]$ asmcmd spget
+OCR_VOTE/rac-cluster/ASMPARAMETERFILE/REGISTRY.253.866371967

远程节点也重启,自动生效:
[grid@rac1 ~]$ asmcmd shutdown --abort
ASM instance shutdown
[grid@rac1 ~]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.4.0 Production on Mon Dec 15 11:44:24 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/asmparameterfile/registry.253.866371967

至此,spfile重建完毕:

旧spfile:
+OCR_VOTE/rac-cluster/asmparameterfile/registry.253.866325101
新spfile:
+OCR_VOTE/rac-cluster/asmparameterfile/registry.253.866371967

-------------------------------------------------------------------------------------------------

本文来自于我的技术博客 http://blog.csdn.net/robo23

转载请标注源文链接,否则追究法律责任!

最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号