11gR2 RAC环境重建ASM SPFILE

有关11gR2 ASM spfile说明能够看

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

下面粘出spfile重新启动过程:

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

[[email protected] ~]$ 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配置

[[email protected] ~]# su - grid

s[[email protected] ~]$ 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

[[email protected] ~]$ 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)

<<<<<<提示不让删除,由于有实例在占用.关闭实例1就可以

[[email protected] ~]$ asmcmd

ASMCMD> shutdown --abort

ASM instance shutdown

Connected to an idle instance.

ASMCMD> exit

[[email protected] ~]$ 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.

[[email protected] ~]$ asmcmd spget

+OCR_VOTE/rac-cluster/spfilecss.ora      <<<<<<<<<<<<<<<<自己主动改动了gpnp profile配置

[[email protected] ~]$ 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,而后指向我们手工创建的路径,看看数据库是否能顺利打开:

[[email protected] ~]$ cd $GRID_HOME/dbs

[[email protected] 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

[[email protected] dbs]$ cat > init+ASM1.ora <<EOF

> spfile=‘+OCR_VOTE/rac-cluster/spfilecss.ora‘

> EOF

[[email protected] dbs]$ cat init+ASM1.ora

spfile=‘+OCR_VOTE/rac-cluster/spfilecss.ora‘            <<<<<<<<<<<<<<<<<pfile内容指定了spfile为我们手工创建的路径

重新启动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

[[email protected] dbs]$ asmcmd spget

+OCR_VOTE/rac-cluster/spfilecss.ora

[[email protected] 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

[[email protected] dbs]$ asmcmd shutdown --abort

ASM instance shutdown

[[email protected] 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

节点一启动也能正常启动:

[[email protected] ~]$ ps -ef | grep pmon

grid      5793  5674  0 10:50 pts/0    00:00:00 grep pmon

[[email protected] ~]$

[[email protected] ~]$

[[email protected] ~]$ 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           <<<<<<<<<<<<<<<<以正确的SPFILE路径启动实例

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

[[email protected] 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

[[email protected] dbs]$ asmcmd spget

+OCR_VOTE/rac-cluster/spfilecss.ora

[[email protected] 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

[[email protected] dbs]$ asmcmd spset +OCR_VOTE/rac-cluster/ASMPARAMETERFILE/REGISTRY.253.866371967

[[email protected] dbs]$ asmcmd shutdown --abort

ASM instance shutdown

[[email protected] 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

[[email protected] dbs]$ asmcmd spget

+OCR_VOTE/rac-cluster/ASMPARAMETERFILE/REGISTRY.253.866371967

远程节点也重新启动,自己主动生效:

[[email protected] ~]$ asmcmd shutdown --abort

ASM instance shutdown

[[email protected] ~]$ 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

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

时间: 2024-10-08 17:55:38

11gR2 RAC环境重建ASM SPFILE的相关文章

【翻译自mos文章】在11gR2 rac环境中,文件系统使用率紧张,并且lsof显示有很多oraagent_oracle.l10 (deleted)

在11gR2 rac环境中,文件系统使用率紧张,并且lsof显示有很多oraagent_oracle.l10 (deleted) 参考原文: High Space Usage and "lsof" Output Shows Many 'oraagent_oracle.l10 (deleted)' in GI environment (Doc ID 1598252.1) 适用于: Oracle Database - Enterprise Edition - Version 11.2.0.

Oracle Study之--Oracle 11gR2 RAC crs启动故障

Oracle Study之--Oracle 11gR2 RAC crs启动故障 系统环境:     操作系统:RedHat EL5     Cluster:  Oracle 11gR2 Grid     Oracle:   Oracle 11gR2  RAC环境中,其中一个节点crsd进程启动失败: [[email protected] ~]$ crsctl check crsCRS-4638: Oracle High Availability Services is onlineCRS-453

验证11gR2 RAC中ASM实例通过gpnp profile获得spfile信息来启动ASM实例

主要为了验证11gR2 RAC中ASM实例通过gpnp profile获得spfile信息来启动ASM实例,同时验证了gpnp profile的修改等内容:结论与实验如下: 验证结论: 1./u01/app/11.2.0/grid/gpnp/profiles/peer下的cat profile.xml内容是旧的,使用spset/spmove时均未被更新,一些文档说这个 profile.xml是全局的. gpnp使用的是/u01/app/11.2.0/grid/gpnp/rac1/profiles

RAC 环境下参数文件(spfile)管理

RAC环境下,初始化参数文件与但实例下参数文件有些异同,主要表现在初始化参数可以为多个实例公用,也可以单独设置各个实例的初始化参数.对于那些非共用的初始化参数则必须要单独设置,而共用的则可以单独设置,但一般不建议这么用.本文描述RAC 环境下参数文件(spfile)的相关管理工作. 有关RAC环境下的重要参数描述,请参考:RAC 环境下重要参数 [python] view plain copy print? 1.参数文件的位置 SQL> show parameter instance_name

RAC环境下控制文件损坏重建过程

处理过程参考了: https://blogs.oracle.com/Database4CN/entry/%E5%A6%82%E4%BD%95%E9%87%8D%E5%BB%BArac%E7%9A%84%E6%8E%A7%E5%88%B6%E6%96%87%E4%BB%B6 问题现象: 现场有学校提报 登录PL/SQL连接数据库是报错“ORA-12541: TNS:无监听程序 ”:排查日志,发现 Tue Nov 25 14:46:58 2014 Thread 2 advanced to log s

如何获取 oracle RAC 11g asm spfile 的位置

 方法一: [[email protected] ~]# su - grid [[email protected] ~]$ sqlplus / as sysasm SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 3 09:36:27 2014 Copyright (c) 1982, 2011, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise

Oracle 11gR2 RAC 新特性说明

最近接触了一下Oracle 11g R2 的RAC,发现变化很大. 所以在自己动手做实验之前还是先研究下它的新特性比较好. 一.    官网介绍 先看一下Oracle 的官网文档里对RAC 新特性的一点说明. Oracle Database 11g Release 2 (11.2.0.2) New Features in Oracle RAC http://download.oracle.com/docs/cd/E11882_01/rac.112/e16795/whatsnew.htm#CHDJ

11gR2 RAC 独占模式replace votedisk遭遇PROC-26,restore ocr遭遇CRS-4000、PROT-35

原文链接:http://blog.itpub.net/23135684/viewspace-748816/ 11gR2 RAC系统的存储数据全然丢失,全部节点的软件都安装在本地磁盘中.本地磁盘保留了OCR的备份,以下讨论通过replace votedisk和restore ocr的方式恢复Clusterware的正常执行: 1.启动CRS到独占模式. [[email protected] bin]#./crsctl stop has -f [[email protected] bin]#./cr

【RAC】rac环境下的数据库备份与还原

[RAC]rac环境下的数据库备份与还原 一.1 BLOG文档结构图 一.2 前言部分 一.2.1 导读 各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的知识,~O(∩_∩)O~: ① rac环境下的数据库备份与还原 ② rman恢复数据库的一般步骤 ③ rac环境的简单操作 注意:本篇BLOG中代码部分需要特别关注的地方我都用***背景和红色字体来表示,比如下边的例子中,thread 1的最大归档日志号为33,thread 2的最大归档日志号为43是需要特别关注