从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实例启动时候,寻找参数文件的顺序如下,直接找到为止:
2. spfile+ASM.ora
3. init+ASM.ora
请注意: 以上红色字体部分!!!
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
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>
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>
ASMCMD> ls -l
Type Redund Striped Time Sys Name
ASMPARAMETERFILE UNPROT COARSE DEC 14 19:00:00 Y REGISTRY.253.866316081
N
ASMCMD>
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
同样,其他数据库节点需要spset更新spfile路径,重启生效即可,此部分操作省略...
Oracle 11gR2 RAC中修改数据库的SPFILE文件位置
在CentOS 6.4下安装Oracle 11gR2(x64)
Oracle 11gR2 在VMWare虚拟机中安装步骤
Debian 下 安装 Oracle 11g XE R2
Oracle性能优化 之 共享池
: