See & modify the attributes of Oracle Restart resources with crsctl

I am presently teaching 11gR2 New Features for DBAs on a Private Event, where one attendee asked how we could retrieve and possibly modify the restart attempts, ohasd is trying for a resource, governed by Oracle Restart. My first guess was that this should be possible similar as with the Grid Infrastructure clusterware utility crsctl, but the commands are not listed in the Online Documentation about Oracle Restart. So I investigated a little and that is what I found out:

$ crsctl status res ora.orcl.db -f
NAME=ora.orcl.db
TYPE=ora.database.type
STATE=OFFLINE
TARGET=ONLINE
ACL=owner:oracle:--x,pgrp:dba:--x,other::r--,group:oinstall:r-x,user:oracle:rwx
ACTION_FAILURE_TEMPLATE=
ACTION_SCRIPT=
ACTIVE_PLACEMENT=1
AGENT_FILENAME=%CRS_HOME%/bin/oraagent%CRS_EXE_SUFFIX%
AUTO_START=restore
CARDINALITY=1
CARDINALITY_ID=0
CHECK_INTERVAL=1
CHECK_TIMEOUT=600
CLUSTER_DATABASE=false
CREATION_SEED=16
CURRENT_RCOUNT=0
DB_UNIQUE_NAME=orcl
DEFAULT_TEMPLATE=PROPERTY(RESOURCE_CLASS=database) PROPERTY(DB_UNIQUE_NAME= CONCAT(PARSE(%NAME%, ., 2), %USR_ORA_DOMAIN%, .)) ELEMENT(INSTANCE_NAME= %GEN_USR_ORA_INST_NAME%)
DEGREE=1
DESCRIPTION=Oracle Database resource
ENABLED=1
FAILOVER_DELAY=0
FAILURE_COUNT=0
FAILURE_HISTORY=
FAILURE_INTERVAL=60
FAILURE_THRESHOLD=1
GEN_AUDIT_FILE_DEST=/u01/app/oracle/admin/orcl/adump
GEN_USR_ORA_INST_NAME=orcl
HOSTING_MEMBERS=
ID=ora.orcl.db
INCARNATION=0
INSTANCE_FAILOVER=0
LAST_FAULT=0
LAST_RESTART=0
LAST_SERVER=
LOAD=1
LOGGING_LEVEL=1
MANAGEMENT_POLICY=AUTOMATIC
NLS_LANG=
NOT_RESTARTING_TEMPLATE=
OFFLINE_CHECK_INTERVAL=0
ORACLE_HOME=/u01/app/oracle/acfsmounts/acfs_db1
PLACEMENT=balanced
PROFILE_CHANGE_TEMPLATE=
RESTART_ATTEMPTS=2
ROLE=PRIMARY
SCRIPT_TIMEOUT=60
SERVER_POOLS=
SPFILE=+DATA/orcl/spfileorcl.ora
START_DEPENDENCIES=hard(ora.DATA.dg,ora.FRA.dg) weak(type:ora.listener.type,uniform:ora.ons,uniform:ora.eons) pullup(ora.DATA.dg,ora.FRA.dg)
START_TIMEOUT=600
STATE_CHANGE_TEMPLATE=
STATE_CHANGE_VERS=0
STATE_DETAILS=
STOP_DEPENDENCIES=hard(intermediate:ora.asm,shutdown:ora.DATA.dg,shutdown:ora.FRA.dg)
STOP_TIMEOUT=600
UPTIME_THRESHOLD=1h
USR_ORA_DB_NAME=orcl
USR_ORA_DOMAIN=
USR_ORA_ENV=
USR_ORA_FLAGS=
USR_ORA_INST_NAME=orcl
USR_ORA_OPEN_MODE=open
USR_ORA_OPI=false
USR_ORA_STOP_MODE=immediate
VERSION=11.2.0.1.0

We see amongst others the highlighted Restart Attempts and the Uptime Threshold of the Database resource orcl with their default values. We can also modify them as follows:

$ crsctl modify res ora.orcl.db -attr "RESTART_ATTEMPTS=1"

Now if within 1 hour, the Database Instance fails more than 1 times, ohasd will no longer try to restart it. This can be watched in the ohasd logfile. I open a second terminal to monitor the ohasd logfile and kill the smon of the orcl instance from the first terminal. After the second kill -9 on the smon process, ohasd refuses to restart the instance, with this entry:

$ cat /u01/app/oracle/product/11.2.0/grid/log/edd2r6p0/ohasd/ohasd.log | grep attempt
2011-11-08 16:05:26.944: [   CRSPE][2781559696] No Local Restart of [ora.orcl.db 1 1], restart attempt exhausted

The Uptime Threshold will start anew after the command

$ srvctl start database -d orcl



,

  1. #1 von BLM am Januar 4, 2012 - 18:29

    hi,
    could you tell me what does „VERSION=11.2.0.1“ parameter means in the result of „crsctl status res ora.orcl.db -f “ command?

    Resource version (= database version) ?
    OR
    Clusterware version?

    thx

  2. #2 von Uwe Hesse am Januar 9, 2012 - 08:56

    BLM,
    I suppose it’s the version of the resource. The version of the Grid Infrastructure can be found with
    crsctl query crs activeversion
    and it would be somewhat redundant to display it for every resource. Could not find it documented, though.
    Maybe a reader with a resource of a lower version running on an 11.2.0.x Grid Infrastructure can confirm that? That would be great 🙂

  3. #3 von Sridhar am Januar 30, 2013 - 08:56

    Hey Uwe, I have a 2 node RAC cluster running on 11.2.0.2. All good with the default RAC workings OOTB. Here is my ‚wierd‘ requirement. ‚Wierd‘ as I do not endorse it but have been asked to work on achieving the following:

    0. Instance 1 running on Node 1 and Instance 2 running on Node 2
    1. The database will ONLY be functional on one of the 2 nodes. In other words, only one Instance will be up all the time.
    2. For all the time when Instance 1 is up, Node 2 is up with all its Grid components. HAS, CRS, Nodeapps except the Instance 2.
    3. On-demand move from Instance 1 to Instance 2 is fine and this not the issue
    4. Upon a fail-over, when Node 1 ‚powers-off‘, we need to instantiate Instance 2 auto’magically‘. I have been trying to do this but am not succeeding.

    To achieve 4, I tried setting the AUTO_START attribute from ‚restore‘ to ‚always‘. This has helped achieve Instance 2 to come up upon a Node restart. But I want to do this instantiation of Instance 2 when Instance 1 dies or Node 1 powers down. Not by restarting Node 2.

    Is this possible?

    Regards

    Sridhar

  4. #4 von Uwe Hesse am Februar 4, 2013 - 09:25

    Sridar, from what you say, my impression is that you actually don’t need normal RAC but something like RAC One Node (a different product). An instance is not a cluster resource and cannot failover therefore in normal RAC as a service could. In short: I’m not aware of a standard functionality in normal RAC that suits your requirement.

  5. #5 von Suresh am Mai 22, 2013 - 12:01

    Hi Sridhar and Uwe,

    Can’t we use oracle callout directory :$CRS_HOME/racg/usrco. I have a very rough idea about this directory but do not know in depth details.

    Thanks,
    Suresh.

  6. #6 von Uwe Hesse am Mai 27, 2013 - 08:23

    I don’t think that callouts will work with Oracle Restart because that is a feature of Grid Infrastructure for Clusters aka Clusterware.

  7. #7 von Owen Ireland am Juli 3, 2013 - 00:44

    Hi Uwe
    You can also check the actual count of restart attempts with
    $ crsctl status res ora.orcl.db -v | grep ^RESTART
    RESTART_COUNT=0

    And the old „crs_stat -t -v“ still works on Restart to give you the R/RA columns (restart count & restart attempts).
    Owen

  8. #8 von Uwe Hesse am Juli 9, 2013 - 20:13

    Owen, thanks for sharing this information

  9. #9 von Google am September 27, 2014 - 20:00

    If some one needs to be updated with most up-to-date technologies after that he must be
    visit this web page and be up to date all the time.

  10. #10 von Dan S am April 18, 2018 - 17:46

    Hi Uwe,
    Is it possible to modify a resource in a RAC configuration so the database changes dependencies from one ACFS volume to another?

    $ crsctl modify resource ora.dbame.db -attr „START_DEPENDENCIES=’hard(ora.DG_DATA.dg) weak(type:ora.listener.type,global:type:ora.scan_listener.type,uniform:ora.ons,uniform:ora.eons) pullup(ora.DG_DATA.dg)'“ -f

    The above command fails consistently with CRS-4995, then suggesting to use srvctl (how?)

    Thanks a lot.
    Dan

  11. #11 von stockpickrr am April 18, 2018 - 21:14

    Thanks for this note…exactly what I was looking for….
    Have been reading the crsctl -h notes for last two/three hours…and it was no help…

  1. Clustered Resource AUTO_START | LEARNING DBA
  2. Clustered Resource AUTO_START | LEARNING DBA

Hinterlasse einen Kommentar

Diese Seite verwendet Akismet, um Spam zu reduzieren. Erfahre, wie deine Kommentardaten verarbeitet werden..