Oracle 11gR2 have many new futures in Grid Computing area. One of them is Oracle Local Repository (OLR), this repository designed to store information and profiles for local resources, resources that dedicated to particular node. It improves the performance of accessing local resources profile information, redundancy and manageability. In Grid Infrastructure RAC configuration there is usual one global shared OCR and OLR’s on each node. In Oracle Restart environment there is only OLR repository. In 11g R2 there is also new feature, Grid Plug and Play (GPNP), as the name implies, it helps to automate and simplify some of the aspects of grid administration. GPNP maintains profile, it is XML file that stores the configuration information of some components maintained by GPNP, for example vips and interconnect information is stored here.
But in this post, I wont to discuss another new feature of 11g R2, it is the possibility to store the server parameter file (spfile) on the ASM disks, also for ASM instance itself! And there is some reasonable questions arise:
- How process can read the spfile from ASM disks, if they are not mounted yet
- How process knows where to get spfile if there is no init.ora file in $ORACLE_HOME/dbs with spfile=[path to spfile] parameter
- What about asm_diskstring parameter?
Third point is important for ASM instance because, before reading spfile from ASM disks, we need to identify them, to identify them we need spfile to get asm_diskstring parameter!
To make clear all this points I will use system calls tracing tools, to trace oracle processes. We can use tools like Dtrace, strace, truss and so on, it depends on platform, I will use strace because I am on Linux.
My environment is Oracle Grid Infrastructure 11g R2 (11.2.0.1.0) in Oracle Restart mode. I simulated ASM disks using loop devices, /dev/loop*, I have 5 disks
bash> /etc/init.d/oracleasm listdisks
DISK1
DISK2
DISK3
DISK4
DISK5
SQL> conn / as sysasm
Connected.
SQL> col path format a15
SQL> select a.name,a.state,b.name,b.path from v$asm_diskgroup a, v$asm_disk b where a.group_number=b.group_number order by b.name;
NAME STATE NAME PATH
------------------------------ ----------- ------------------------------ ---------------
DGROUP1 MOUNTED DISK1 ORCL:DISK1
DGROUP1 MOUNTED DISK2 ORCL:DISK2
DGROUP2 MOUNTED DISK3 ORCL:DISK3
DGROUP2 MOUNTED DISK4 ORCL:DISK4
DGROUP2 MOUNTED DISK5 ORCL:DISK5
As seen from the listing, I have two disk groups DGROUP1 and DGROUP2. My spfile is located on DGROUP1
SQL> show parameter spfile;
NAME TYPE VALUE
------------------------------------ ----------- ----------------------------------------------------
spfile string +DGROUP1/asm/asmparameterfile/registry.253.740659373
Lets make some tests
SQL> conn / as sysasm
Connected.
SQL> startup
ASM instance started
Total System Global Area 284565504 bytes
Fixed Size 1336036 bytes
Variable Size 258063644 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL>
SQL> show parameter power
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
asm_power_limit integer 1
SQL> alter system set asm_power_limit=3;
System altered.
SQL> show parameter power
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
asm_power_limit integer 3
SQL>--We set asm_power_limit to 3 in spfile
SQL> shutdown immediate;
ASM diskgroups dismounted
ASM instance shutdown
SQL> !crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.DGROUP1.dg ora....up.type OFFLINE OFFLINE
ora.DGROUP2.dg ora....up.type OFFLINE OFFLINE
ora....ER.lsnr ora....er.type ONLINE ONLINE testdb03
ora.asm ora.asm.type OFFLINE OFFLINE
ora.cssd ora.cssd.type ONLINE ONLINE testdb03
ora.diskmon ora....on.type ONLINE ONLINE testdb03
SQL>-- Lets start instance in nomount mode, it will not mount the diskgroups
SQL> startup nomount;
ASM instance started
Total System Global Area 284565504 bytes
Fixed Size 1336036 bytes
Variable Size 258063644 bytes
ASM Cache 25165824 bytes
SQL> show parameter spfile;
NAME TYPE VALUE
------------------------------------ ----------- ----------------------------------------------------
spfile string +DGROUP1/asm/asmparameterfile/registry.253.740659373
SQL> show parameter power
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
asm_power_limit integer 3
SQL> select * from v$spparameter;
select * from v$spparameter
*
ERROR at line 1:
ORA-15001: diskgroup "DGROUP1" does not exist or is not mounted
SQL> alter system set asm_power_limit=10;
alter system set asm_power_limit=10
*
ERROR at line 1:
ORA-32000: write to SPFILE requested but SPFILE is not modifiable
SQL> !asmcmd
ASMCMD> ls
ASMCMD> exit
SQL> !crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.DGROUP1.dg ora....up.type OFFLINE OFFLINE
ora.DGROUP2.dg ora....up.type OFFLINE OFFLINE
ora....ER.lsnr ora....er.type ONLINE ONLINE testdb03
ora.asm ora.asm.type ONLINE ONLINE testdb03
ora.cssd ora.cssd.type ONLINE ONLINE testdb03
ora.diskmon ora....on.type ONLINE ONLINE testdb03
So, what we see, we were able to start ASM instance without mounting the disks, our process picked up correct spfile. The command SHOW PARAMETER reads the parameter values from the memory, but if we try to read directly from spfile (select from v$spparameter) or write to it (alter system set) we will get errors, because diskgroups not mounted yet. It means that our process was read spfile directly from ASM disks. The design about from which disk to read it made based on information from disk header. I use ASMlib, and my asm_diskstring parameter is equal to default value null, ASM instance by default scans the /dev/oracleasm/disks/* on Linux, that is why process found my disks properly. But what if we use HP-UX and our disks is multipathing disks in /dev/rdisk/*, ASM will not scan them by default, we need to use asm_diskstring parameter, how our process will read asm_diskstring parameter before accessing spfile?
Lets start sqlplus, after we will connect as sysasm it will initialize server process, this process will do all job, that is why I will trace this server process
bash> sqlplus /nolog
SQL> conn / as sysasm
Connected.
SQL> !ps -aefH
.
.
oracle 15505 4255 0 13:26 pts/1 00:00:00 sqlplus
oracle 15507 15505 0 13:26 ? 00:00:00 oracle+ASM (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
.
.
SQL>
Our server process number is 15507, now I will use strace to trace it
bash> strace -o userproc.out -p 15507
start the instance with nomount option, OCSSD must be running, or instance will not start
SQL> startup nomount;
Total System Global Area 284565504 bytes
Fixed Size 1336036 bytes
Variable Size 258063644 bytes
ASM Cache 25165824 bytes
SQL>
Now we can analyze the contents of the userproc.out, I will not list all contents, just useful parts of it
First row is
read(9, "001\6\3\212\6\376\377\377\377\1\376\377\377\377\376\377\377\377"..., 8208) = 49
it is our “startup nomount” command transmitted to server process from sqlplus by socket
connect(6, {sa_family=AF_FILE, path="/var/tmp/.oracle/sOCSSD_LL_testhost_"...}, 110) = 0
open("/u01/oracle/product/grid11g/auth/css/testdb03/A6857753/84b0b692", O_WRONLY|O_CREAT|O_EXCL, 0644) = 13
write(13, "\nS\336[", 4) = 4
close(13)
from this lines we can see that our process connects to socket file of OCSSD /var/tmp/.oracle/sOCSSD_LL_testhost_ to communicate with it and authenticates itself. That is why it impossible to start instance without OCSSD, if process could not connect to this socket, it would fail. Then it establishes communication with OHASD (Oracle High Availability Services Deamon) through the socket file /var/tmp/.oracle/sCRSD_UI_SOCKET, after exchange messages with OHASD it will get information about the location of spfile and asm_diskstring parameter
access("/var/tmp/.oracle/sCRSD_UI_SOCKET", F_OK) = 0
connect(14, {sa_family=AF_FILE, path="/var/tmp/.oracle/sCRSD_UI_SOCKET"...}, 110) = 0
open("/u01/oracle/product/grid11g/auth/ohasd/testdb03/A4972914/5140f6df", O_WRONLY|O_CREAT|O_EXCL, 0644) = 15
write(15, "\20\7\3519", 4) = 4
close(15)
write(14, "4\2\2\1\1\1\1\3\1T\235\376\t"..., 52) = 52
write(14, "8\3\2\1\1\1\1\4\1T\235\376\t"..., 56) = 56
read(14, "8\3\2\1\1\1\1\3\1T\235\376\t"..., 32768) = 56
write(14, "\212\1PC\v\2\2\5\1T\235\376\t"..., 394) = 394
read(14, "\366\nPC\v\2\2\4\1T\235\376\t"..., 32768) = 2806
write(14, "0\2\20\1\1T\235\376\t"..., 48) = 48
write(3, "kggpnpSIHAGetItem 1 = +dgroup1/ASM/asmparameterfile/registry.253.740659373"..., 75) = 7
write(3, "kfspFileNameGet name=+dgroup1/ASSM/asmparameterfile/registry.253.740659373"..., 78) = 78
write(3, "kggpnpSIHAGetItem 2 = ", 23) = 23
write(3, "kgfspb_shallow_discover dscstr=\"\""..., 33) = 33
As we can see our process got spfile location (+dgroup1/ASM/asmparameterfile/registry.253.740659373) and asm_diskstring=”” which is null by default from OHASD. Now, lets see where OHASD itself gets this information. To identify that I traced the OHASD process, and I found this lines
open("/etc/oracle/olr.loc", O_RDONLY) = 4
read(4, "olrconfig_loc=/u01/oracle/produc"..., 4096) = 108
read(4, "", 4096) = 0
close(4) = 0
open("/u01/oracle/product/grid11g/cdata/localhost/testhost.olr", O_RDONLY|O_SYNC|O_LARGEFILE) = 4
pread64(4, "\1\202VD\31\4\3OCR\226\361nA"..., 4096, 102400) = 4096
pread64(4, "\1\202\300I#\4\3OCR\226\361nA"..., 4096, 143360) = 4096
pread64(4, "\1\202VD\31\4\3OCR\226\361nA"..., 4096, 102400) = 4096
pread64(4, "\1\202hq\33\4\3OCR\226\361nA"..., 4096, 110592) = 4096
pread64(4, "\1\202\271\311#\4\20\3OCR\226\361nA"..., 4096, 4337664) = 4096
pread64(4, "\1\202\276\262$\4\20\3OCR\226\361nA"..., 4096, 4341760) = 4096
pread64(4, "\1\202VD\31\4\3OCR\226\361nA"..., 4096, 102400) = 4096
pread64(4, "\1\202hq\33\4\3OCR\226\361nA"..., 4096, 110592) = 4096
pread64(4, "\1\202\271\311#\4\20\3OCR\226\361nA"..., 4096, 4337664) = 4096
pread64(4, "\1\202\276\262$\4\20\3OCR\226\361nA"..., 4096, 4341760) = 4096
pread64(4, "\1\202\236\363%\4\2\3OCR\226\361nA"..., 4096, 4345856) = 4096
pread64(4, "\1\202\334\n&\4\2\3OCR\226\361nA"..., 4096, 4349952) = 4096
pread64(4, "\1\202\325\357-\4\2\3OCR\226\361nA"..., 4096, 4378624) = 4096
pread64(4, "\1\202VD\31\4\3OCR\226\361nA"..., 4096, 102400) = 4096
pread64(4, "\1\202hq\33\4\3OCR\226\361nA"..., 4096, 110592) = 4096
pread64(4, "\1\202\271\311#\4\20\3OCR\226\361nA"..., 4096, 4337664) = 4096
pread64(4, "\1\202\276\262$\4\20\3OCR\226\361nA"..., 4096, 4341760) = 4096
pread64(4, "\1\202\325\357-\4\2\3OCR\226\361nA"..., 4096, 4378624) = 4096
As one would expect OHASD reads this information from OLR, the path to it, it gets from /etc/oracle/olr.loc. I want to note that it is true for Oracle Restart mode, in Oracle RAC environment information is stored in GPNP profile and there is GPNPD process that maintains and manages this profile information. In Oracle Restart, as we can see OHASD process executes this role, and because there is no PGNP profile it stores information in OLR file. So, what next? Our process starts to scan all disks to identify ASM headers, after identifying them, it identifies which disks belongs to which diskgroups by information from header. There is many other metadata in the ASM diskheader that it reads, including pointers to spfile and votig disk file, it is kfdhdb.spfile, kfdhdb.spfflg (first block and number of blocks) and kfdhdb.vfstart, kfdhdb.vfend (begin block and end block). It is possible to read disk header using kfed utility from $ORACLE_HOME/bin directory. For example, lets read disk header of the /dev/loop1 which corresponds to ORCL:DISK1, spfile is on this disk.
shell> kfed read /dev/loop1 | more
kfbh.type: 1 ; 0x002: KFBTYP_DISKHEAD --Indicates that this is ASM disk header
.
kfdhdb.grptyp: 2 ; 0x026: KFDGTP_NORMAL --Indicates mirroring level, in my case it is NORMAL
kfdhdb.hdrsts: 3 ; 0x027: KFDHDR_MEMBER --Indicates that disk is the member disk of diskgroup
.
kfdhdb.dskname: DISK1 ; 0x028: length=5 --Disk name
kfdhdb.grpname: DGROUP1 ; 0x048: length=7 --Disk group name, to which this disk belongs
kfdhdb.fgname: DISK1 ; 0x068: length=5 --To which failure group this disk belongs
.
kfdhdb.secsize: 512 ; 0x0b8: 0x0200 --Disk sector size
kfdhdb.blksize: 4096 ; 0x0ba: 0x1000 --Disk block size
kfdhdb.ausize: 1048576 ; 0x0bc: 0x00100000 --Allocation Unit size, by default 1M
.
kfdhdb.vfstart: 0 ; 0x0ec: 0x00000000 --Begin block address of voting disk file
kfdhdb.vfend: 0 ; 0x0f0: 0x00000000 --End block address of voting disk file
kfdhdb.spfile: 59 ; 0x0f4: 0x0000003b --Begin block address of spfile
kfdhdb.spfflg: 1 ; 0x0f8: 0x00000001 --Number of blocks containing spfile
Now, lets see what will be next steps of our process
open("/opt/oracle/extapi/32/asm/orcl/1/libasm.so", O_RDONLY) = 17
read(17, "\177ELF\1\1\1\3\3\1000\v004"..., 512) = 512
close(17) = 0
open("/dev/oracleasm/.query_version", O_RDWR|O_LARGEFILE) = 17
write(17, "MSA\2\1\20", 16) = 16
read(17, "MSA\2\1\20", 16) = 16
close(17) = 0
open("/dev/oracleasm/.get_iid", O_RDWR|O_LARGEFILE) = 17
write(17, "MSA\2\2\30", 24) = 24
read(17, "MSA\2\2\30\3", 24) = 24
close(17) = 0
open("/dev/oracleasm/.check_iid", O_RDWR|O_LARGEFILE) = 17
write(17, "MSA\2\3\30\3", 24) = 24
read(17, "MSA\2\3\30\3", 24) = 24
close(17) = 0
open("/dev/oracleasm/iid/0000000000000003", O_RDWR|O_CREAT|O_LARGEFILE, 0770) = 17
open("/dev/oracleasm/disks/DISK1", O_RDONLY|O_LARGEFILE) = 18
read(17, "MSA\2\5 \22T/v\17\200-%\310", 32) = 32
close(18) = 0
read(17, "MSA\2\7P@\364\311\20\320\301\225\277"..., 80) = 80
open("/dev/oracleasm/disks/DISK2", O_RDONLY|O_LARGEFILE) = 18
read(17, "MSA\2\5 \22T/v\17\200+%\310", 32) = 32
close(18) = 0
read(17, "MSA\2\7P@\364\311\20\320\301\225\277"..., 80) = 80
open("/dev/oracleasm/disks/DISK3", O_RDONLY|O_LARGEFILE) = 18
read(17, "MSA\2\5 \22T/v\17\200!%\310", 32) = 32
close(18) = 0
read(17, "MSA\2\7P@\364\311\20\320\301\225\277"..., 80) = 80
open("/dev/oracleasm/disks/DISK4", O_RDONLY|O_LARGEFILE) = 18
read(17, "MSA\2\5 \22T/v\17\200#%\310", 32) = 32
close(18) = 0
read(17, "MSA\2\7P@\364\311\20\320\301\225\277"..., 80) = 80
open("/dev/oracleasm/disks/DISK5", O_RDONLY|O_LARGEFILE) = 18
read(17, "MSA\2\5 \22T/v\17\200)%\310", 32) = 32
close(18) = 0
read(17, "MSA\2\7P@\364\311\20\320\301\225\277"..., 80) = 80
read(17, "MSA\2\7P@\364\311\20"..., 80) = 80
read(17, "MSA\2\7P@\364\311\20"..., 80) = 80
read(17, "MSA\2\7P@\364\311\20"..., 80) = 80
read(17, "MSA\2\7P@\364\311\20"..., 80) = 80
read(17, "MSA\2\7P@\364\311\20"..., 80) = 80
.
.
open("/u01/oracle/diag/asm/+asm/+ASM/trace/alert_+ASM.log", O_WRONLY|O_CREAT|O_APPEND|O_LARGEFILE, 0660) = 16
write(16, "Tue Jan 18 17:45:13 2011\n", 25) = 25
write(16, "Starting ORACLE instance (normal"..., 33) = 33
write(16, "\n", 1) = 1
close(16)
.
.
It opens /opt/oracle/extapi/32/asm/orcl/1/libasm.so library, reads it. Then it opens special files /dev/oracleasm/.query_version, /dev/oracleasm/.get_iid and /dev/oracleasm/.check_iid, this files is interfaces to ASM device manager. First one is used to get managers version, second one is used to get identifier of the ASM disk device manager instance (not ASM instance) and third for verifying of this instance identifier. In our case ASM device managers instance identifier is 0000000000000003. Then, our process opens /dev/oracleasm/iid/0000000000000003, in other words it establishes connection to the ASM device manager instance. Process will use this interface to read and write to ASM disks. Then it checks all disks from DISK1 to DISK5. After it gets all information about disks, i.e. groups, mirroring level, AU size, failure group and so on it starts reading ASM disk through established interface. I think in this step it reads the spfile. After it gets initialization parameters it starts to allocate memory structures and starting necessary background processes.
Now lets see what is stored in OLR regarding ora.asm resource
shell> cd $ORACLE_HOME/cdata/localhost
shell> strings testhost.olr | grep dgroup1/ASM/asmparameterfile/registry | sed 's/~/\n/g'
DEFAULT_TEMPLATE=PROPERTY(RESOURCE_CLASS=asm) ELEMENT(INSTANCE_NAME= %GEN_USR_ORA_INST_NAME%)
DEGREE=1
DESCRIPTION=Oracle ASM resource
ENABLED=1
GEN_USR_ORA_INST_NAME=+ASM
LOAD=1
LOGGING_LEVEL=1
NAME=ora.asm
NLS_LANG=
NOT_RESTARTING_TEMPLATE=
OFFLINE_CHECK_INTERVAL=0
PROFILE_CHANGE_TEMPLATE=
RESTART_ATTEMPTS=5
SCRIPT_TIMEOUT=60
SPFILE=+dgroup1/ASM/asmparameterfile/registry.253.740659373
START_DEPENDENCIES=hard(ora.cssd) weak(ora.LISTENER.lsnr)
START_TIMEOUT=900
STATE_CHANGE_TEMPLATE=
STOP_DEPENDENCIES=hard(ora.cssd)
STOP_TIMEOUT=600
TYPE=ora.asm.type
TYPE_ACL=owner:oracle:rwx,pgrp:dba:rwx,other::r--
UPTIME_THRESHOLD=1d
USR_ORA_ENV=
USR_ORA_INST_NAME=+ASM
USR_ORA_OPEN_MODE=mount
USR_ORA_OPI=false
USR_ORA_STOP_MODE=immediate
VERSION=11.2.0.1.0
We can found there information about spfile “SPFILE=+dgroup1/ASM/asmparameterfile/registry.253.740659373”, we also can see that ora.cssd is hard dependency resource, because OCSSD is responsible for synchronization between ASM and database instance. But what about asm_diskstring parameter, where is it?
shell> strings testhost.olr | grep ASM_DISKSTRING | sed 's/~/\n/g'
nothing, it is because my asm_diskstring parameter equals to null, default value, lets change it
SQL> alter system set asm_diskstring='ORCL:DISK1,ORCL:DISK2' scope=spfile;
System altered.
check OLR file again
strings testdb03.olr | grep ASM_DISKSTRING | sed 's/~/\n/g'
bASM_DISKSTRING
ACL=owner:oracle:rwx,pgrp:dba:rwx,other::r--
ACTION_FAILURE_TEMPLATE=
ACTION_SCRIPT=
AGENT_FILENAME=%CRS_HOME%/bin/oraagent%CRS_EXE_SUFFIX%
ALIAS_NAME=
ASM_DISKSTRING=ORCL:DISK1,ORCL:DISK2
AUTO_START=restore
BASE_TYPE=ora.local_resource.type
Now we can see that information about asm_diskstring is also stored in OLR profile. And next time, at ASM instance startup it will scan only specified disk strings. If we specify disks on which spfile not present, our instance will not start
SQL> alter system set asm_diskstring='ORCL:DISK3,ORCL:DISK4,ORCL:DISK5' scope=spfile;
System altered.
SQL> startup nomount force;
ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file '+DGROUP1/asm/asmparameterfile/registry.253.740659373'
ORA-17503: ksfdopn:2 Failed to open file +DGROUP1/asm/asmparameterfile/registry.253.740659373
SQL>
You can also use the ocrdump utility to extract this entries on any platform in XML format:
shell> ocrdump -local -keyname SYSTEM.OHASD.RESOURCES.ora\!asm.CONFIG -xml -noheader
shell> more OCRDUMPFILE
SYSTEM.OHASD.RESOURCES.ora!asm.CONFIG
<value_type>ORATEXT
ASM_DISKSTRING=ORCL:DISK3,ORCL:D
ISK4,ORCL:DISK5~AUTO_START=restore~BASE_TYPE=ora.local_resource.type~CHECK_INTERVAL=1~CHECK_TIMEOUT=600~DEFAULT_TEMPLATE=PROPERTY(RESOURCE_CLASS=asm) ELEMENT(INSTANCE_NAME= %GEN_USR_ORA_INST_NAME%)~DE
GREE=1~DESCRIPTION=Oracle ASM resource~ENABLED=1~GEN_USR_ORA_INST_NAME=+ASM~LOAD=1~LOGGING_LEVEL=1~NAME=ora.asm~NLS_LANG=~NOT_RESTARTING_TEMPLATE=~OFFLINE_CHECK_INTERVAL=0~PROFILE_CHANGE_TEMPLATE=~RES
TART_ATTEMPTS=5~SCRIPT_TIMEOUT=60~SPFILE=+dgroup1/ASM/asmparameterfile/registry.253.740659373~START_DEPENDENCIES=hard(ora.cssd) weak(ora.LISTENER.lsnr)~START_TIMEOUT=900~STATE_CHANGE_TEMPLATE=~STOP_DE
PENDENCIES=hard(ora.cssd)~STOP_TIMEOUT=600~TYPE=ora.asm.type~TYPE_ACL=owner:oracle:rwx,pgrp:dba:rwx,other::r--~UPTIME_THRESHOLD=1d~USR_ORA_ENV=~USR_ORA_INST_NAME=+ASM~USR_ORA_OPEN_MODE=mount~USR_ORA_O
PI=false~USR_ORA_STOP_MODE=immediate~VERSION=11.2.0.1.0~]]>
<user_permission>PROCR_ALL_ACCESS
<group_permission>PROCR_NONE
<other_permission>PROCR_NONE
<user_name>oracle
<group_name>dba
So, draw conclusions, gentlemen!
(c) Aychin Gasimov, 01/2011, Azerbaijan Republic
Very good…Thanks
Pingback: Unlocking: How startup instance ASM with SPFILE stored in your own ASM Diskgroup « Levi Pereira
Pingback: Unlocking: How startup instance ASM with SPFILE stored in your own ASM Diskgroup « Levi Pereira
Pingback: Unlocking: How the ASM instance starts with SPFILE stored in your own ASM Diskgroup « Levi Pereira
Have you ever thought about writing an ebook or guest authoring on other websites? I have a blog based upon on the same information you discuss and would really like to have you share some stories/information. I know my audience would appreciate your work. If you’re even remotely interested, feel free to shoot me an e mail.
Thank You for Your interest and attention! Where can I get Your email address? ))
You explained it so well, thanks boss.
Imp info..Thanks a lot.
Hi
crsctl stat res ora.asm -p | grep ASM_DISKSTRING
ASM_DISKSTRING=
Although there is no pfile or spfile under $ORACLE_HOME/dbs and
asm diskstring parameter is not set, I can sucessfully start the asm instance.
How come this happen ?
SQL> startup
ORA-32004: obsolete or deprecated parameter(s) specified for ASM instance
ASM instance started
Total System Global Area 284565504 bytes
Fixed Size 1343692 bytes
Variable Size 258055988 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
ASM diskgroups volume enabled
sorry about above question
I just read your post carefully and realized that
if we use asmlib, and my asm_diskstring parameter is equal to default value null, ASM instance by default scans the /dev/oracleasm/disks/* on Linux, that is why process found my disks properly
Hi
I am using asmlib.
Asm instance is using the spfile in asm and Asm instance doesnt have spfile or init.ora in $Oracle_home/dbs.
I can successfully start the asm instance and mount the disk groups.
[oracle@vm2 dbs]$ crsctl stat res ora.asm -p | grep ASM_DISKSTRING
ASM_DISKSTRING=
[oracle@vm2 dbs]$ crsctl stat res ora.asm -p | grep SPFILE
SPFILE=+DATA/asm/asmparameterfile/registry.253.756597771
SQL> startup
ORA-32004: obsolete or deprecated parameter(s) specified for ASM instance
ASM instance started
Total System Global Area 284565504 bytes
Fixed Size 1343692 bytes
Variable Size 258055988 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
ASM diskgroups volume enabled
Here is my question:
I am unable to start the database instance without init.ora pointer under $oracle_home/dbs
. oraenv
orcl
SQL> show parameter spfile
NAME TYPE VALUE
———————————— ———– ——————————
spfile string +DATA/orcl/parameterfile/spfil
e.266.755839187
[oracle@vm2 dbs]$ crsctl stat res ora.orcl.db -p | grep SPFILE
SPFILE=+DATA/ORCL/PARAMETERFILE/spfile.266.755839187
I realized that there is a init.ora pointer in $oracle_home/dbs
[oracle@vm2 dbs]$ cat initorcl.ora
SPFILE=’+DATA/ORCL/PARAMETERFILE/spfile.266.755839187′ # line added by Agent
If I remove this pointer, I am unable to start the database instance.
mv initorcl.ora initorcl.ora_bkp
SQL> startup
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file ‘/oracle/11gR2/product/11.2.0/dbhome_1/dbs/initorcl.ora’
The database starts up successfully if I run below command because an init.ora pointer was created automatically and put in $ORACLE_HOME/dbs.
crs_start ora.orcl.db
[oracle@vm2 dbs]$ ls -l initorcl.ora
-rw-r–r– 1 oracle oinstall 78 Jul 15 22:19 initorcl.ora
[oracle@vm2 dbs]$ cat initorcl.ora
SPFILE=’+DATA/ORCL/PARAMETERFILE/spfile.266.755839187′ # line added by Agent
Why does the database instance require a initora pointer which points spfile ? Is this mandotary ?
I can successfully start the asm instance without init.ora pointer however for the database, it requires an init.ora pointer.
I am really confused.
Appreciate your assistance.
Hi John,
Sorry for delay, I was on a trip 🙂
I was read Your comment. I don’t have testing environment at the moment, to make some checks, but I will write my personal opinion about this. I think that Oracle programmers made changes in the source code that affects the instance_type ASM, because to give it capability to start from the asm formatted disks it was Mandatory to make this changes. For instance_type RDBMS it was not mandatory, at least what you will do if You didn’t installed Grid Infrastructure, I mean that RDBMS doesn’t require OLR to function but ASM requires it! I think they didn’t touch this part of code that responsible for identifying the place of spfile. And as we know, by default, it checks for spfileSID.ora then for initSID.ora for parameter “spfile”. They didn’t change the source code for this not mandatory feature, to read lcation of spfile directly from OLR, but they made some kind of automation by adding the line into initSID.ora, I think it is better than nothing 🙂 May be, in the future releases they will make it similar to the ASM instance type.
Many thanks for your reply and preparing this article.
Thanks again for sharing your knowledge with oracle users.
This type slighty reminds me of why i love free hip hop music downloads.
Pingback: VMCD.ORG » Blog Archive » 11gR2 rac ora.asm error (ASM)
Pingback: Where is my Oracle ASM Instance spfile? « me + oracle
Hi Aychin,
just wanna say thanks for the article! It helped answer my question.
I hope you don’t mind I link your article in my blog.
Cheers,
Hi Aychin,
Great info! Thanks for sharing it!
I have simulated the scenario of moving “OLR” file and tried starting up the ASM instance.
I was able to “nomount” the ASM instance successfully.
i have a question –
– As you mentioned above “OHASD” process gets the info of spfile location from “OLR” file.
In this case i have moved the OLR file.
How did process gets the spfile info?
Can you please throw some light on this?
Steps –>
$ cd /oracle/app/11.2.0/grid/cdata/localhost
$ mv temp-dba01.olr temp-dba01.olr.bkp
$ pwd
/oracle/app/11.2.0/grid/cdata/localhost
$ ls -altr
total 2844
drwxrwx— 4 grid oinstall 4096 Aug 14 10:55 ..
-rw-r—– 1 grid oinstall 272756736 Aug 14 10:55 local.ocr.bkp
drwxr-x— 2 grid oinstall 4096 Sep 12 15:24 .
-rw——- 1 grid oinstall 272756736 Sep 12 15:50 temp-dba01.olr.bkp
[grid@temp-dba01 gpnp]$ crsctl stat resource -t
——————————————————————————–
NAME TARGET STATE SERVER STATE_DETAILS
——————————————————————————–
Local Resources
——————————————————————————–
ora.DATA.dg
OFFLINE OFFLINE temp-dba01
ora.DG1.dg
OFFLINE OFFLINE temp-dba01
ora.FRA.dg
OFFLINE OFFLINE temp-dba01
ora.LISTENER.lsnr
ONLINE ONLINE temp-dba01
ora.asm
OFFLINE OFFLINE temp-dba01 Instance Shutdown
ora.ons
OFFLINE OFFLINE temp-dba01
——————————————————————————–
Cluster Resources
——————————————————————————–
ora.cssd
1 ONLINE ONLINE temp-dba01
ora.diskmon
1 ONLINE ONLINE temp-dba01
ora.evmd
1 ONLINE ONLINE temp-dba01
ora.orcl.db
1 OFFLINE OFFLINE Instance Shutdown
ora.tmp.db
1 OFFLINE OFFLINE
1st session –
$ sqlplus / as sysasm
SQL*Plus: Release 11.2.0.2.0 Production on Wed Sep 12 15:26:31 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to an idle instance.
SQL>
2nd session –
$ ps -ef|grep -ri ASM
grid 15480 12057 0 15:26 pts/1 00:00:00 sqlplus as sysasm
grid 15481 15480 0 15:26 ? 00:00:00 oracle+ASM (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
grid 15631 15486 0 15:45 pts/2 00:00:00 grep -ri asm
$ ps -ef|grep -ri ohasd
root 3618 1 0 Sep09 ? 00:00:29 /bin/sh /etc/init.d/init.ohasd run
grid 12290 1 0 09:27 ? 00:00:02 /oracle/app/11.2.0/grid/bin/ohasd.bin reboot
grid 15638 15486 0 15:46 pts/2 00:00:00 grep -ri ohasd
$ strace -o usr_asm.out -p 15481
3rd session –
$ strace -o usr-ohsd.out -p 12290
1st session –
SQL> startup nomount;
ASM instance started
Total System Global Area 283930624 bytes
Fixed Size 2225792 bytes
Variable Size 256539008 bytes
ASM Cache 25165824 bytes
SQL> show parameter spfile;
NAME TYPE VALUE
———————————— ———– ——————————
spfile string +DATA/asm/asmparameterfile/reg
istry.253.793279291
SQL>
$ crsctl stat res -t
——————————————————————————–
NAME TARGET STATE SERVER STATE_DETAILS
——————————————————————————–
Local Resources
——————————————————————————–
ora.DATA.dg
OFFLINE OFFLINE temp-dba01
ora.DG1.dg
OFFLINE OFFLINE temp-dba01
ora.FRA.dg
OFFLINE OFFLINE temp-dba01
ora.LISTENER.lsnr
ONLINE ONLINE temp-dba01
ora.asm
ONLINE ONLINE temp-dba01 Started
ora.ons
OFFLINE OFFLINE temp-dba01
——————————————————————————–
Cluster Resources
——————————————————————————–
ora.cssd
1 ONLINE ONLINE temp-dba01
ora.diskmon
1 ONLINE ONLINE temp-dba01
ora.evmd
1 ONLINE ONLINE temp-dba01
ora.orcl.db
1 OFFLINE OFFLINE Instance Shutdown
ora.tmp.db
1 OFFLINE OFFLINE
Thanks,
Kumar TG
Hi Kumar!
First of all try ti restart OHAS on this server and check again.
> crsctl stop has
> crsctl start has
Hi Aychin,
Thanks for quick response!
I tried stopping and starting the “OHASD” process , i was unable to start the “OHASD” process
and got below mentioned error.
But after copying the “OLR” location i was able to start “OHASD” process.
How OHASD process gets the SPFILE info if “OLR” file was missing but CRS was running?
Steps –>
$ crsctl stat res -t
——————————————————————————–
NAME TARGET STATE SERVER STATE_DETAILS
——————————————————————————–
Local Resources
——————————————————————————–
ora.DATA.dg
OFFLINE OFFLINE temp-dba01
ora.DG1.dg
OFFLINE OFFLINE temp-dba01
ora.FRA.dg
OFFLINE OFFLINE temp-dba01
ora.LISTENER.lsnr
ONLINE ONLINE temp-dba01
ora.asm
ONLINE ONLINE temp-dba01 Started
ora.ons
OFFLINE OFFLINE temp-dba01
——————————————————————————–
Cluster Resources
——————————————————————————–
ora.cssd
1 ONLINE ONLINE temp-dba01
ora.diskmon
1 ONLINE ONLINE temp-dba01
ora.evmd
1 ONLINE ONLINE temp-dba01
ora.orcl.db
1 OFFLINE OFFLINE Instance Shutdown
ora.tmp.db
1 OFFLINE OFFLINE
$ crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on ‘temp-dba01’
CRS-2673: Attempting to stop ‘ora.LISTENER.lsnr’ on ‘temp-dba01’
CRS-2673: Attempting to stop ‘ora.evmd’ on ‘temp-dba01’
CRS-2673: Attempting to stop ‘ora.asm’ on ‘temp-dba01’
CRS-2677: Stop of ‘ora.asm’ on ‘temp-dba01’ succeeded
CRS-2673: Attempting to stop ‘ora.cssd’ on ‘temp-dba01’
CRS-2677: Stop of ‘ora.cssd’ on ‘temp-dba01’ succeeded
CRS-2673: Attempting to stop ‘ora.diskmon’ on ‘temp-dba01’
CRS-2677: Stop of ‘ora.LISTENER.lsnr’ on ‘temp-dba01’ succeeded
CRS-2677: Stop of ‘ora.diskmon’ on ‘temp-dba01’ succeeded
CRS-2677: Stop of ‘ora.evmd’ on ‘temp-dba01’ succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on ‘temp-dba01′ has completed
CRS-4133: Oracle High Availability Services has been stopped.
$ crsctl start has
CRS-4563: Insufficient user privileges.
CRS-4000: Command Start failed, or completed with errors.
Log –> /oracle/app/11.2.0/grid/log/temp-dba01/client/crsctl_grid.log
2012-09-13 09:42:29.978: [ OCRMSG][1886348816]prom_waitconnect: CONN NOT ESTABLISHED (0,29,1,2)
2012-09-13 09:42:29.978: [ OCRMSG][1886348816]GIPC error [29] msg [gipcretConnectionRefused]
2012-09-13 09:42:29.978: [ OCRMSG][1886348816]prom_connect: error while waiting for connection complete [24]
2012-09-13 09:42:29.979: [ OCROSD][1886348816]utopen:6m’: failed in stat OCR file/disk /oracle/app/11.2.0/grid/cdata/localhost/temp-dba01.olr, errno=2, os err string=No such file or directory
2012-09-13 09:42:29.979: [ OCROSD][1886348816]utopen:7: failed to open any OCR file/disk, errno=2, os err string=No such file or directory
2012-09-13 09:42:29.979: [ OCRRAW][1886348816]proprinit: Could not open raw device
2012-09-13 09:42:29.979: [ default][1886348816]a_init:7!: Backend init unsuccessful : [26]
$ sqlplus / as sysasm
SQL*Plus: Release 11.2.0.2.0 Production on Thu Sep 13 09:46:55 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount;
ORA-01078: failure in processing system parameters
ORA-29701: unable to connect to Cluster Synchronization Service
SQL>
— Copy the OLR file to original location (/oracle/app/11.2.0/grid/cdata/localhost)
$ mv temp-dba01.olr.bkp temp-dba01.olr
$ crsctl start has
CRS-4123: Oracle High Availability Services has been started.
$ crsctl stat res -t
——————————————————————————–
NAME TARGET STATE SERVER STATE_DETAILS
——————————————————————————–
Local Resources
——————————————————————————–
ora.DATA.dg
ONLINE ONLINE temp-dba01
ora.DG1.dg
ONLINE ONLINE temp-dba01
ora.FRA.dg
ONLINE ONLINE temp-dba01
ora.LISTENER.lsnr
ONLINE ONLINE temp-dba01
ora.asm
ONLINE ONLINE temp-dba01 Started
ora.ons
OFFLINE OFFLINE temp-dba01
——————————————————————————–
Cluster Resources
——————————————————————————–
ora.cssd
1 ONLINE ONLINE temp-dba01
ora.diskmon
1 ONLINE ONLINE temp-dba01
ora.evmd
1 ONLINE ONLINE temp-dba01
ora.orcl.db
1 OFFLINE OFFLINE
ora.tmp.db
1 OFFLINE OFFLINE
$ ps -ef|grep pmon
grid 26596 1 0 09:59 ? 00:00:00 asm_pmon_+ASM
grid 26858 25786 0 10:35 pts/1 00:00:00 grep pmon
Sure, You can’t start OHAS because it can’t function without reading parameters from OLR file. At Your first comment the spfile information was read from memory. Also, linux uses inodes to access files, when You start the process it finds the file by name, but on the system level it uses its inode as file descriptor to manipulate it. When You move file (mv) the inode will not change, and because process uses inode it continues to use this file without the problem! You can fill the difference only after the restart of the process, that is why I asked You to do that. Same situation will occur if You will delete file, until process uses it it will be not actually deleted until the process will release this file. For example, on test database create tablespace with one datafile, then rm this file, You will still able to use this tablespace, write to it and read from it.
great one. thanks
When I originally commented I clicked the “Notify me when new comments are added” checkbox and now each time a
comment is added I get three emails with the same comment.
Is there any way you can remove me from that service?
Appreciate it!
Hello Aychin,
I’m not using oracle asmlib on my test RAC installation here since the rpm for oracle linux 6 was not available at the time I installed it.
my current value for the asm_diskstring parameter is /dev/asm*
Let’s just say that I’m stupid enough to change that value to something else, then I stop all services and obviously I won’t be able to start the asm instance anymore.
How can I fix it?
Thanks in advance for your answer.
Regards,
Adhika
Hi Adhika,
If You can’t start ASM instance becuase of wrong asm_diskstring parameter, it is not a big problem. You just need to update the OLR entry for asm_diskstring parameter. You can use srvctl to do it:
srvctl modify asm -d /dev/asm*
Now You will able to start ASM instance.
Regards.
You really make it appear really easy together with your presentation however I in finding this topic to be actually
one thing that I feel I might never understand.
It seems too complex and very extensive for me.
I’m having a look ahead in your next publish, I will attempt to get the grasp of it!
If you are going for best contents like myself, only visit this site all the time for the
reason that it provides feature contents, thanks
Hi to all, the contents existing at this web page are actually amazing for people experience, well, keep up the good work fellows.
This blog was… how do you say it? Relevant!
! Finally I have found something that helped me.
Many thanks!
Hello there, just became alert to your blog through Google, and found that it is truly
informative. I am going to watch out for brussels. I’ll appreciate if you continue this in future. Lots of people will be benefited from your writing. Cheers!
If you are going for finest contents like myself, just pay a quick visit
this web site daily as it gives quality contents, thanks
I am regular reader, how are you everybody? This paragraph
posted at this website is genuinely fastidious.
Hi, I wish for to subscribe for this website to take most recent updates, therefore where can
i do it please assist.
There are many people moving on with the art of
photography in the right manner. Samsung M620 Black mobile is just big enough to display four icons
side by side and measures only 1. Make sure you get a decent resolution LCD with any camera in this category.
My family always say that I am wasting my time here at
web, except I know I am getting familiarity daily by reading such nice articles or reviews.
Very quickly this web site will be famous among all
blogging and site-building users, due to it’s pleasant content
Hello! I know this is somewhat off-topic but I needed to ask.
Does building a well-established blog like yours take a large amount of work?
I am brand new to running a blog but I do write in my diary everyday.
I’d like to start a blog so I can easily share my experience and thoughts online. Please let me know if you have any kind of recommendations or tips for brand new aspiring blog owners. Thankyou!
Wow, fantastic blog structure! How long have you been running a blog for?
you made blogging glance easy. The whole glance of your site is magnificent, let alone
the content material!
Dear Aychin,
Recently, I got issue with my database due to all LUNS went offline and after that my database is not working and it looks that there is issue with ASM.. I cannot run the Oracle listener and database as it gives error while starting the database. This issue started since we got an error from EMC Storage that all LUNS are dead and after restarting the Operating system.. The EMC Storage LUNS issue was solved but the database never got started. I am looking for help and think that I lost my diskgrop which was on Storage but EMC is not ready to take responsibility. Is it possible for you to help me? The
[root@psdb1 root]# cat /etc/oratab
#
# This file is used by ORACLE utilities. It is created by root.sh
# and updated by the Database Configuration Assistant when creating
# a database.
# A colon, ‘:’, is used as the field terminator. A new line terminates
# the entry. Lines beginning with a pound sign, ‘#’, are comments.
#
# Entries are of the form:
# $ORACLE_SID:$ORACLE_HOME::
#
# The first and second fields are the system identifier and home
# directory of the database respectively. The third filed indicates
# to the dbstart utility that the database should , “Y”, or should not,
# “N”, be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
+ASM1:/u02/app/oracle/product/10.2.0/psdb:N
PSDB:/u02/app/oracle/product/10.2.0/psdb:N
—–
drwxr-x— 15 oracle oinstall 4096 May 5 2007 inventory
drwxr-x— 7 oracle oinstall 4096 May 5 2007 cfgtoollogs
drwxr-xr-t 3 oracle oinstall 4096 May 5 2007 log
drwxr—– 3 oracle oinstall 4096 May 6 2007 psdb1_PSDB1
drwxr-x— 5 oracle oinstall 4096 May 6 2007 install
drwxr-x— 8 oracle oinstall 4096 May 6 2007 racg
-rw-r—– 1 oracle oinstall 777648 May 14 2007 sqlnet.log
drwxr-xr-x 4 oracle oinstall 4096 Jan 16 2010 cpu
drwxr-x— 3 oracle oinstall 8192 Jan 16 2010 lib
drwxr-xr-x 3 root root 4096 Jul 21 2010 admin
drwxr-xr-x 2 oracle oinstall 8192 Jul 8 10:13 bin
-rw-r–r– 1 root root 1577 Jul 11 09:12 listener.log
drwxr-x— 2 oracle oinstall 4096 Jul 15 22:50 dbs
[root@psdb1 10.2.0]# ls -lrt
total 4
drwxr-x— 58 oracle oinstall 4096 Jul 4 13:50 psdb
[root@psdb1 10.2.0]# cd psdb1_PSDB1
-bash: cd: psdb1_PSDB1: No such file or directory
[root@psdb1 10.2.0]#
[root@psdb1 10.2.0]# tail -100f listner.log
tail: listner.log: No such file or directory
tail: no files remaining
————
[oracle@psdb1 localhost]$ sqlplus ‘/as sysdba’
SQL*Plus: Release 10.2.0.2.0 – Production on Mon Jul 15 23:20:51 2013
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup
ORA-01565: error in identifying file ‘+DATA/PSDB/spfilePSDB.ora’
ORA-17503: ksfdopn:2 Failed to open file +DATA/PSDB/spfilePSDB.ora
ORA-15077: could not locate ASM instance serving a required diskgroup
SQL>
——-
[oracle@psdb1 localhost]$ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.2.0 – Production on 15-JUL-2013 23:21:16
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
——-
[oracle@psdb1 localhost]$ asmcmd
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory (DBD ERROR: OCISessionBegin)
——
[root@psdb1 init.d]# powermt display
Symmetrix logical device count=0
CLARiiON logical device count=7
==============================================================================
—– Host Bus Adapters ——— —— I/O Paths —– —— Stats ——
### HW Path Summary Total Dead IO/Sec Q-IOs Errors
==============================================================================
0 QLogic Fibre Channel 2300 optimal 14 0 – 0 0
1 QLogic Fibre Channel 2300 optimal 14 0 – 0 0
obviously like your web-site but you need to test the spelling
on several of your posts. Many of them are rife with spelling problems and I
in finding it very bothersome to tell the reality however I will surely come back again.
I’m extremely pleased to find this website. I wanted to thank you for your time just for this wonderful read!! I definitely liked every little bit of it and I have you saved as a favorite to look at new stuff on your web site.
Hello, I think your blog might be having browser compatibility issues.
When I look at your blog in Firefox, it looks fine but when opening in
Internet Explorer, it has some overlapping. I just wanted to give you a
quick heads up! Other then that, wonderful blog!
I every time spent my half an hour to read
this webpage’s articles everyday along with a cup of coffee.
Thanks to my father who told me concerning this weblog, this website is genuinely amazing.
Having read this I believed it was very enlightening.
I appreciate you taking the time and effort to put this information together.
I once again find myself spending a significant amount of time both reading and commenting.
But so what, it was still worth it!
This is very good information.I appreciate your effort & clarity.
Beautifully explained !!!
Pingback: How process can read the spfile from ASM disks, if they are not mounted yet | hiteshgondalia(OCE,OCP)