Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

42

积分

0

好友

0

主题
1#
发表于 2012-5-31 17:18:21 | 查看: 9034| 回复: 2
没想明白一个事,11gR2 RAC ASM资源的启动过程
启动ASM时应该是需要spfile的,这在Gpnp文件里有指定:
<gpnp:GPnP-Profile Version="1.0">
    ......
    <orcl:CSS-Profile id="css" DiscoveryString="+asm" LeaseDuration="400"/>
    <orcl:ASM-Profile id="asm" DiscoveryString="/dev/mapper/*" SPFile="+OCRDG/test-cluster/asmparameterfile/registry.253.781218349"/>
   .....

但是spfile是在OCR磁盘组里,当启动Cluster时,ASM还没有起来时,OCRDG肯定是不能读的,不能读那如何读spfile?读不到spfile又如何启ASM实例?蛮矛盾

How to restore ASMbased OCR after complete loss of the CRS diskgroup on Linux/Unix systems [ID1062983.1]
里讲,在排它模式启CRS时,可以不需要OCRDG就起ASM,相应也不需要spfile了

但正常情况下,肯定是需要的吧?难不成oraagent在启ora.asm时,不需要spfile就可以把ASM实例拉起来?再mount ocrdg?
不大可能吧!


难不成是直接读盘的?



[ 本帖最后由 teapot 于 2012-5-31 17:21 编辑 ]
2#
发表于 2012-6-1 00:26:18
可以

请参考这个帖子http://t.askmaclean.com/thread-521-1-1.html

使用

11.2.0.2:
# $CRS_HOME/bin/crsctl start crs -excl -nocrs


11.2.0.1:
# $CRS_HOME/bin/crsctl start crs -excl

回复 只看该作者 道具 举报

3#
发表于 2012-6-1 09:13:08
从启动过程日志来看:asm是由oraagent来启动,并且是启动asm后,mount所有diskgroup
oraagent:

2012-05-29 16:42:27.722: [    AGFW][1092651328] {0:0:2} ora.asm 1 1 state changed from: UNKNOWN to: STARTING
......
2012-05-29 16:42:27.769: [ora.asm][1124170048] {0:0:2} [start] ConfigFile::setAltValue altValue = /orasoft/app/grid/11.2.0:N
2012-05-29 16:42:27.775: [ora.asm][1124170048] {0:0:2} [start] AsmAgent:getOracleSid 2 oracle_sid =
2012-05-29 16:42:27.775: [ora.asm][1124170048] {0:0:2} [start] AsmAgent:getOracleSid 4 oracle_sid =
2012-05-29 16:42:27.776: [ora.asm][1124170048] {0:0:2} [start] Node 0 doesn't exist
2012-05-29 16:42:27.776: [ora.asm][1124170048] {0:0:2} [start] AsmAgent::getOracleSid: Exception IntException
2012-05-29 16:42:27.776: [ora.asm][1124170048] {0:0:2} [start] AsmAgent::getOracleSidAttrib getCssNodeName Error: Agents: clssnsqlnum ret = 12:
2012-05-29 16:42:27.776: [ora.asm][1124170048] {0:0:2} [start] AsmAgent:getOracleSid 5 oracle_sid = +ASM2
2012-05-29 16:42:27.776: [ora.asm][1124170048] {0:0:2} [start] AsmAgent:getOracleSid oracle_sid = +ASM2
2012-05-29 16:42:27.776: [ora.asm][1124170048] {0:0:2} [start] ConfigFile::getAltEntry altEntry = +ASM2
2012-05-29 16:42:27.776: [ora.asm][1124170048] {0:0:2} [start] ConfigFile::getValue name +asm2 value /orasoft/app/grid/11.2.0:N
2012-05-29 16:42:27.776: [ora.asm][1124170048] {0:0:2} [start] sUpdateOratab entry exists with dbName +ASM2 value /orasoft/app/grid/11.2.0:N
2012-05-29 16:42:27.781: [ora.asm][1124170048] {0:0:2} [start] makeConnectStr = (DESCRIPTION=(ADDRESS=(PROTOCOL=beq)(PROGRAM=/orasoft/app/grid/11.2.0/bin/oracle)(ARGV0=oracle+ASM2)(ENVS='ORACLE_HOME=/orasoft/app/grid/11.2.0,ORACLE_SID=+ASM2')(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))'))(CONNECT_DATA=(SID=+ASM2)))
2012-05-29 16:42:28.729: [ora.mdnsd][1096853824] {0:0:2} [check] clsdmc_respget return: status=0, ecode=0

2012-05-29 16:42:30.496: [ora.asm][1124170048] {0:0:2} [start] InstAgent::startup
2012-05-29 16:42:30.997: [ora.gpnpd][1090550080] {0:0:2} [check] clsdmc_respget return: status=0, ecode=0
2012-05-29 16:42:32.064: [ora.gipcd][1096853824] {0:0:2} [check] clsdmc_respget return: status=0, ecode=0
2012-05-29 16:42:42.613: [ora.asm][1124170048] {0:0:2} [start] InstConnection::connectInt: server not attached
2012-05-29 16:42:42.705: [ora.asm][1124170048] {0:0:2} [start] AsmAgent::startCbk: {
2012-05-29 16:42:42.705: [ora.asm][1124170048] {0:0:2} [start] AsmAgent::startCbk mount stmt ALTER DISKGROUP ALL MOUNT /* asm agent call crs *//* {0:0:2} */ enable stmt ALTER DISKGROUP ALL ENABLE VOLUME ALL /* asm agent *//* {0:0:2} */
2012-05-29 16:42:42.705: [ora.asm][1124170048] {0:0:2} [start] AsmAgent::startCbk: ALTER DISKGROUP ALL MOUNT /* asm agent call crs *//* {0:0:2} */
2012-05-29 16:42:50.220: [ora.asm][1124170048] {0:0:2} [start] AsmAgent::startCbk: ALTER DISKGROUP ALL ENABLE VOLUME ALL /* asm agent *//* {0:0:2} */
.....
2012-05-29 16:42:50.502: [    AGFW][1124170048] {0:0:2} Command: start for resource: ora.asm 1 1 completed with status: SUCCESS


ASM alert日志:
Tue May 29 16:42:35 2012
NOTE: No asm libraries found in the system
* instance_number obtained from CSS = 2, checking for the existence of node 0...
* node 0 does not exist. instance_number = 2
Starting ORACLE instance (normal)
****************** Huge Pages Information *****************
Huge Pages memory pool detected (total: 51200 free: 51200)
DFLT Huge Pages allocation successful (allocated: 0)
***********************************************************
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0

ASM启动时spfile到底如何读取的呢?在启动ASM前,所有磁盘组是没有mount的
ASM Spfile Is Not Used when ASM Instance Starts Even It Exists Inside of OCR Diskgroup (11.2) [ID 1384692.1]
好像给出了答案:

Based on Oracle documentation, when an Oracle ASM instance searches for an initialization parameter file, the search order is:
1. The location of the initialization parameter file specified in the GridPlug and Play (GPnP) profile
2. If the location has not been set in the GPnP profile, then the search order changes to:
- SPFILE in the Oracle ASM instance home
$ORACLE_HOME/dbs/spfile+ASM.ora
- PFILE in the Oracle ASM instance home

前面Gpnp里指定了启动asm时的spfile,这篇文档里提到了以下一点:
One of the reason why ASM not able to find the SPFILE could be because of "ERROR: -5(Duplicate disk OCR_VOTE:OCR_VOTE_0001)" and ASM is using default parameter settings.

相关日志:
NOTE: No asm libraries found in the system
ERROR: -5(Duplicate disk OCR_VOTE:OCR_VOTE_0001) <---
* instance_number obtained from CSS = 1, checking for the existence of node 0...
* node 0 does not exist. instance_number = 1
Starting ORACLE instance (normal)
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Private Interface ... configured from GPnP for use as a private interconnect.
...
Public Interface ... configured from GPnP for use as a public interface.
...
Using LOG_ARCHIVE_DEST_1 parameter default value as /u01/app/11.2.0/grid/dbs/arch
Autotune of undo retention is turned on.
LICENSE_MAX_USERS = 0
SYS auditing is disabled
NOTE: Volume support enabled
Starting up:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options.
WARNING: using default parameter settings without any parameter file <-----

所以我猜测:ASM是直接读相关磁盘的数据块,这通过kfed来查看CRSDG的0号AU的0号块来查kfdhdb.f1b1locn,得到FILEDIR的AU
ASM的参数文件号应该是固定的,具体多少号没研究,通过查看FILEDIR的AU里的相关块,就找到SPFILE的AU
这个基本上就跟读祼盘的spfile一致了。

回复 只看该作者 道具 举报

您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-11-15 18:01 , Processed in 0.057896 second(s), 21 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569