Oracle 11gR2用gpnp profile存放ASM的spfile路径
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Oracle 11gR2用gpnp profile存放ASM的spfile路径相关的知识,希望对你有一定的参考价值。
从Oracle 11gR2开始,GI集成了ASM,OCR/VOTEDISK也存放在ASM磁盘组了(11gR2以前需要存放于裸设备中),同时ASM的功能较10g也有很大增强。
我们先引入一个问题:11gR2中,OCR/VOTEDISK存放在ASM磁盘组,这也就意味着在GI能够启动的前提是能够顺利启动ASM实例并且能够将相应磁盘组MOUNT起来;而ASM的spfile却放在ASM磁盘组里,这也同样意味着要先启动ASM实例并且能读到参数文件。那如何解决这个问题呢? 11gR2中引入了pgnp profile,用于存放ASM参数文件路径,这允许oracle在ASM实例启动以前读到参数文件。
11gR2的RAC环境中,ASM的参数文件存放于ASM磁盘组里面.ASM实例启动时候,寻找参数文件的顺序如下,直接找到为止:
1. Grid Plug and Play (GPnP) profile
2. spfile+ASM<node_number>.ora
3. init+ASM<node_number>.ora
请注意: 以上红色字体部分!!!
因此,11gR2中可以没有pfile,可以将ASM参数保存在gpnp profile中,在管理上省下了很多工作.
11gR2RAC环境中,ASM的参数文件支持备份(spbackup),拷贝(spcopy),移动(spmove),查询gpnp profile(spget),设置(spset)等操作特别需要注意一点,ASM的参数文件最好放在ASM磁组里,同时确保每个集群成员的gpnp都为同一个路径
以简单例子说明,如何将ASM的spfile重新保存至ASM磁盘组
=============================================
准备环境
ASMCMD> ls -l
Type Redund Striped Time Sys Name
ASMPARAMETERFILE UNPROT COARSE DEC 14 15:00:00 Y REGISTRY.253.866303695
N spfileasm.ora => +OCR_VOTE/rac-cluster/ASMPARAMETERFILE/REGISTRY.253.866303695 ----注意这里是链接
ASMCMD> pwd
+OCR_VOTE/rac-cluster/ASMPARAMETERFILE
ASMCMD> spcopy +OCR_VOTE/rac-cluster/ASMPARAMETERFILE/REGISTRY.253.866303695 +OCR_VOTE/rac-cluster/ASMPARAMETERFILE/spcopy.ora
ORA-15056: additional error message
ORA-17502: ksfdcre:4 Failed to create file +OCR_VOTE/rac-cluster/ASMPARAMETERFILE/spcopy.ora
ORA-15268: internal Oracle file +OCR_VOTE.253.1 already exists.
ORA-06512: at line 7 (DBD ERROR: OCIStmtExecute)
ASMCMD>spget
/home/grid/registry.253.839197161 --当前gpnp profile配置。该spfile是用spcopy命令生成的
ASMCMD> spmove REGISTRY.253.866303695 old_ora.bak ---删除默认的SPFILE将导致路径缺失
ASMCMD> ls -l
ASMCMD-8002: entry ‘ASMPARAMETERFILE‘ does not exist in directory ‘+OCR_VOTE/rac-cluster/‘
实例环境就绪,以下是解决办法:
ASMCMD> spget
/home/grid/registry.253.839197161
ASMCMD>spcopy /home/grid/registry.253.839197161 +OCR_VOTE/rac-cluster/ASMPARAMETERFILE/registry.ora --将本地磁盘上的spfile复制至ASM磁盘
ASMCMD> ls -l
Type Redund Striped Time Sys Name
ASMPARAMETERFILE UNPROT COARSE DEC 14 19:00:00 Y REGISTRY.253.866316081
N
registry.ora => +OCR_VOTE/rac-cluster/ASMPARAMETERFILE/REGISTRY.253.866316081 --注意这里是链接!!!!
ASMCMD>spset +OCR_VOTE/rac-cluster/ASMPARAMETERFILE/REGISTRY.253.866316081 --更新gpnp profile至链接
ASMCMD> spget
+OCR_VOTE/rac-cluster/ASMPARAMETERFILE/REGISTRY.253.866316081
重启实例生效...
ASMCMD> shutdown --abort
ASM instance shutdown
Connected to an idle instance.
ASMCMD>
ASMCMD>
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> lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 4094 926 0 926 0 N DATA/
MOUNTED EXTERN N 512 4096 4194304 2032 1592 0 1592 0 Y OCR_VOTE/
ASMCMD> spget
+OCR_VOTE/rac-cluster/ASMPARAMETERFILE/REGISTRY.253.866316081
SQL> show parameter spfile;
NAME TYPE
------------------------------------ ----------------------
VALUE
------------------------------
spfile string
+OCR_VOTE/rac-cluster/asmparameterfile/registry.253.866316081 --证实是通过gpnp profile里spfile启动实例
同样,其他数据库节点需要spset更新spfile路径,重启生效即可,此部分操作省略...
Oracle 11gR2 RAC中修改数据库的SPFILE文件位置http://www.linuxidc.com/Linux/2012-09/70718.htm
在CentOS 6.4下安装Oracle 11gR2(x64)http://www.linuxidc.com/Linux/2014-02/97374.htm
Oracle 11gR2 在VMWare虚拟机中安装步骤http://www.linuxidc.com/Linux/2013-09/89579p2.htm
Debian 下 安装 Oracle 11g XE R2http://www.linuxidc.com/Linux/2014-03/98881.htm
Oracle性能优化 之 共享池http://www.linuxidc.com/Linux/2012-02/54062.htm
更多Oracle相关信息见Oracle专题页面http://www.linuxidc.com/topicnews.aspx?tid=12
本文永久更新链接地址:http://www.linuxidc.com/Linux/2015-01/112535.htm
以上是关于Oracle 11gR2用gpnp profile存放ASM的spfile路径的主要内容,如果未能解决你的问题,请参考以下文章
[转]Oracle 11g RAC SCAN ip的原理及配置