10gR2., adding dependency to applications/resources managed by CRS
July 10, 2010 2 Comments
Yesterday we had back to back crashes on two our ETST servers. After analysis we observed that the crash was due to node evictions by CRS due to communication delays with the other servers, reason: faulty network connection. Outside this, after the crash and during auto start of the servers, we encountered another issue. The database would not start automatically. The CRS attempted to start the database instance however it failed. After looking at the log files we found that there was an attempt to start the instance while the ASM instance on that server was not completely up. Not on just on one server but both servers that got evicted. The instance was then started manually and all was fine.
To fix this issue for the future, after deliberating with the DBA team we decided to add a between the database instance and ASM instance on all the instances. The dependency is to be configured in the OCR file and when CRS starts these resources /applications it will apply the rule to the instance startup process.
This is what was done to implement the dependency..
1. execute crsstat to check on all the instances configured on the cluster
[oracle@tstdb1 ~]$ crsstatHA Resource Target State----------- ------ -----
ora.ETST.ETST1.inst ONLINE ONLINE on tstdb1ora.ETST.ETST2.inst ONLINE ONLINE on tstdb2ora.ETST.ETST3.inst ONLINE ONLINE on tstdb3ora.ETST.db ONLINE ONLINE on tstdb1ora.tstdb1.ASM1.asm ONLINE ONLINE on tstdb1ora.tstdb1.ETST_TSTDB1.lsnr ONLINE ONLINE on tstdb1ora.tstdb1.LISTENER_TSTDB1.lsnr ONLINE ONLINE on tstdb1ora.tstdb1.gsd ONLINE ONLINE on tstdb1ora.tstdb1.ons ONLINE ONLINE on tstdb1ora.tstdb1.vip ONLINE ONLINE on tstdb1ora.tstdb2.ASM2.asm ONLINE ONLINE on tstdb2ora.tstdb2.ETST_TSTDB2.lsnr ONLINE ONLINE on tstdb2ora.tstdb2.LISTENER_TSTDB2.lsnr ONLINE ONLINE on tstdb2ora.tstdb2.gsd ONLINE ONLINE on tstdb2ora.tstdb2.ons ONLINE ONLINE on tstdb2ora.tstdb2.vip ONLINE ONLINE on tstdb2ora.tstdb3.ASM3.asm ONLINE ONLINE on tstdb3ora.tstdb3.ETST_TSTDB3.lsnr ONLINE ONLINE on tstdb3ora.tstdb3.LISTENER_TSTDB3.lsnr ONLINE ONLINE on tstdb3ora.tstdb3.gsd ONLINE ONLINE on tstdb3ora.tstdb3.ons ONLINE ONLINE on tstdb3ora.tstdb3.vip ONLINE ONLINE on tstdb32. create a profile file using the current configuration for all instances. You do not have to connect to the respective servers, this can be done from any server.
$ORA_CRS_HOME/bin/crs_stat -p ora.ETST.ETST1.inst >> /app/oracle/product/crs/crs/public/ora.ETST.ETST1.inst.cap$ORA_CRS_HOME/bin/crs_stat -p ora.ETST.ETST2.inst >> /app/oracle/product/crs/crs/public/ora.ETST.ETST2.inst.cap$ORA_CRS_HOME/bin/crs_stat -p ora.ETST.ETST3.inst >> /app/oracle/product/crs/crs/public/ora.ETST.ETST3.inst.capNotice the location of the ‘.cap’ file. It is important the cap file is created in that location. Depending on the type of resource there are two locations where the '.cap’ file can be located. The public folder (/app/oracle/product/crs/crs/public/) is used for all resources owned by Oracle and 'private' folder (/app/oracle/product/crs/crs/private/) is used by resources managed by CRS and owned by root.
3. Update this profile with the dependency$ORA_CRS_HOME/bin/crs_profile -update ora.ETST.ETST1.inst -r ora.tstdb1.ASM1.asm$ORA_CRS_HOME/bin/crs_profile -update ora.ETST.ETST2.inst -r ora.tstdb2.ASM2.asm$ORA_CRS_HOME/bin/crs_profile -update ora.ETST.ETST3.inst -r ora.tstdb3.ASM3.asmAfter the above operation change, the profile is updated and the notice that the ‘REQUIRED_RESOURCES’ parameter is is changed with the ASM instance resource
[oracle@tstdb1 ~]$ cat /app/oracle/product/crs/crs/public/ora.ETST.ETST1.inst.capNAME=ora.ETST.ETST1.instTYPE=applicationACTION_SCRIPT=/ETST/oracle/product/10.2.0/db/bin/racgwrapACTIVE_PLACEMENT=0AUTO_START=1CHECK_INTERVAL=600DESCRIPTION=CRS application for InstanceFAILOVER_DELAY=0FAILURE_INTERVAL=0FAILURE_THRESHOLD=0HOSTING_MEMBERS=tstdb1OPTIONAL_RESOURCES=PLACEMENT=restrictedREQUIRED_RESOURCES=ora.tstdb1.ASM1.asmRESTART_ATTEMPTS=5SCRIPT_TIMEOUT=600START_TIMEOUT=0STOP_TIMEOUT=0UPTIME_THRESHOLD=7dUSR_ORA_ALERT_NAME=USR_ORA_CHECK_TIMEOUT=0USR_ORA_CONNECT_STR=/ as sysdbaUSR_ORA_DEBUG=0USR_ORA_DISCONNECT=falseUSR_ORA_FLAGS=USR_ORA_IF=USR_ORA_INST_NOT_SHUTDOWN=USR_ORA_LANG=USR_ORA_NETMASK=USR_ORA_OPEN_MODE=USR_ORA_OPI=falseUSR_ORA_PFILE=USR_ORA_PRECONNECT=noneUSR_ORA_SRV=USR_ORA_START_TIMEOUT=0USR_ORA_STOP_MODE=immediateUSR_ORA_STOP_TIMEOUT=0USR_ORA_VIP=4. The reminder of the steps should be performed one instance at a time to avoid downtime to the database All these steps are performed as user ‘oracle’
4(a).. shutdown instance 1 using server control
srvctl stop instance -d ETST -i ETST14(b) unregister the resource/entry for the instance from the OCR
$ORA_CRS_HOME/bin/crs_unregister ora.ETST.ETST1.inst4(c) register the resource/entry for the instance back to the OCR
$ORA_CRS_HOME/bin/crs_register ora.ETST.EST1.inst4(d) Start instance 1 using server control
srvctl start instance -d ETST -i ETST24(e) Verify if the change has made it to the OCR file. The command below will list the content /definitions for the resource. You can check for
REQUIRED_RESOURCES=ora.tstdb1.ASM1.asm$ORA_CRS_HOME/bin/crs_stat -p ora.ETST.ETST1.inst4(f) repeat steps 4(a) thru 4(e) for other instances in the cluster
Pingback: Blogroll Report 09/07/2010 – 16/07/2010 « Coskan’s Approach to Oracle
Hi.
It’s really interesting post for adding dependencies between CRS resources,
but WHY You don’t use provided tools ?
Just a ONE line to add dependency between DB instance and ASM instance
srvctl modify instance -d EBSTST -i EBSTST1 -s ASM1
BTW
it seems that this database/instances were manually added to OCR
because DBCA adds dependency automatically