Wednesday, September 16, 2015

How to disable autostart for some particular CRS resource

How to disable autostart for some particular CRS resource

posted May 25, 2009, 8:02 AM by Lalit Verma   [ updated Dec 11, 2009, 12:37 AM ]
[oracle@rc1.myrac.com] # . setcrs

[oracle@rc1.myrac.com] # env | grep ORA

ORACLE_SID=rdb1
ORACLE_BASE=/u01/app/oracle/product
ORACLE_HOME=/u01/app/oracle/product/crs

[oracle@rc1.myrac.com] # cst
HA Resource                                   Target     State
-----------                                   ------     -----
ora.rc1.ASM1.asm                              ONLINE     ONLINE on rc1
ora.rc1.LISTENER_DB_RC1.lsnr                  ONLINE     ONLINE on rc1
ora.rc1.LISTENER_RC1.lsnr                     ONLINE     ONLINE on rc1
ora.rc1.gsd                                   ONLINE     ONLINE on rc1
ora.rc1.ons                                   ONLINE     ONLINE on rc1
ora.rc1.vip                                   ONLINE     ONLINE on rc1
ora.rc2.ASM2.asm                              ONLINE     ONLINE on rc2
ora.rc2.LISTENER_DB_RC2.lsnr                  ONLINE     ONLINE on rc2
ora.rc2.LISTENER_RC2.lsnr                     ONLINE     ONLINE on rc2
ora.rc2.gsd                                   ONLINE     ONLINE on rc2
ora.rc2.ons                                   ONLINE     ONLINE on rc2
ora.rc2.vip                                   ONLINE     ONLINE on rc2
ora.rdb.db                                    ONLINE     ONLINE on rc1
ora.rdb.rdb1.inst                             ONLINE     ONLINE on rc1
ora.rdb.rdb2.inst                             ONLINE     ONLINE on rc2
ora.rdb.serv1.cs                              ONLINE     ONLINE on rc1
ora.rdb.serv1.rdb1.srv                        ONLINE     ONLINE on rc1

[oracle@rc1.myrac.com] # crs_stat -p ora.rc1.LISTENER_DB_RC1.lsnr
NAME=ora.rc1.LISTENER_DB_RC1.lsnr
TYPE=application
ACTION_SCRIPT=/u01/app/oracle/product/db/bin/racgwrap
ACTIVE_PLACEMENT=0
AUTO_START=1
CHECK_INTERVAL=600
DESCRIPTION=CRS application for listener on node
FAILOVER_DELAY=0
FAILURE_INTERVAL=0
FAILURE_THRESHOLD=0
HOSTING_MEMBERS=rc1
OPTIONAL_RESOURCES=
PLACEMENT=restricted
REQUIRED_RESOURCES=ora.rc1.vip
RESTART_ATTEMPTS=5
SCRIPT_TIMEOUT=600
START_TIMEOUT=0
STOP_TIMEOUT=0
UPTIME_THRESHOLD=7d
USR_ORA_ALERT_NAME=
USR_ORA_CHECK_TIMEOUT=0
USR_ORA_CONNECT_STR=/ as sysdba
USR_ORA_DEBUG=0
USR_ORA_DISCONNECT=false
USR_ORA_FLAGS=
USR_ORA_IF=
USR_ORA_INST_NOT_SHUTDOWN=
USR_ORA_LANG=
USR_ORA_NETMASK=
USR_ORA_OPEN_MODE=
USR_ORA_OPI=false
USR_ORA_PFILE=
USR_ORA_PRECONNECT=none
USR_ORA_SRV=
USR_ORA_START_TIMEOUT=0
USR_ORA_STOP_MODE=immediate
USR_ORA_STOP_TIMEOUT=0
USR_ORA_VIP=

As you saw above the -p switch is uesd to list properties of particular CRS resource. CRS uses profiles for its resources for any change to be implemented, the next time it will be started. These profiles are under $ORA_CRS_HOME/crs/public

[oracle@rc1.myrac.com] # cd $ORA_CRS_HOME/crs/public
[oracle@rc1.myrac.com] # pwd
/u01/app/oracle/product/crs/crs/public
[oracle@rc1.myrac.com] # ls -ltr
total 8
-rwxr-x--- 1 oracle oinstall 3396 Aug  3  2004 action_scr.scr
-rw-r----- 1 oracle oinstall  820 May 12 19:27 ora.rc1.LISTENER_RC1.lsnr.cap


Now let us modify the resource ora.rc1.LISTENER_DB_RC1.lsnr so that it would not be restarted automatically.

(A)    Create the Profile for ora.rc1.LISTENER_DB_RC1.lsnr under $ORA_CRS_HOME/crs/public

[oracle@rc1.myrac.com] #  crs_stat -p ora.rc1.LISTENER_DB_RC1.lsnr >$ORA_CRS_HOME/crs/public/
ora.rc1.LISTENER_DB_RC1.lsnr.cap

[oracle@rc1.myrac.com] # crs_stat -p ora.rc1.LISTENER_DB_RC1.lsnr > $ORA_CRS_HOME/crs/public/ora.rc1.LISTENER_DB_RC1.lsnr.cap
[oracle@rc1.myrac.com] # cd $ORA_CRS_HOME/crs/public/
[oracle@rc1.myrac.com] # ls -ltr
total 12
-rwxr-x--- 1 oracle oinstall 3396 Aug  3  2004 action_scr.scr
-rw-r----- 1 oracle oinstall  820 May 12 19:27 ora.rc1.LISTENER_RC1.lsnr.cap
-rw-r--r-- 1 oracle oinstall  822 May 25 20:36 ora.rc1.LISTENER_DB_RC1.lsnr.cap

[oracle@rc1.myrac.com] # cat ora.rc1.LISTENER_DB_RC1.lsnr.cap
NAME=ora.rc1.LISTENER_DB_RC1.lsnr
TYPE=application
ACTION_SCRIPT=/u01/app/oracle/product/db/bin/racgwrap
ACTIVE_PLACEMENT=0
AUTO_START=1
CHECK_INTERVAL=600
DESCRIPTION=CRS application for listener on node
FAILOVER_DELAY=0
FAILURE_INTERVAL=0
FAILURE_THRESHOLD=0
HOSTING_MEMBERS=rc1
OPTIONAL_RESOURCES=
PLACEMENT=restricted
REQUIRED_RESOURCES=ora.rc1.vip
RESTART_ATTEMPTS=5
SCRIPT_TIMEOUT=600
START_TIMEOUT=0
STOP_TIMEOUT=0
UPTIME_THRESHOLD=7d
USR_ORA_ALERT_NAME=
USR_ORA_CHECK_TIMEOUT=0
USR_ORA_CONNECT_STR=/ as sysdba
USR_ORA_DEBUG=0
USR_ORA_DISCONNECT=false
USR_ORA_FLAGS=
USR_ORA_IF=
USR_ORA_INST_NOT_SHUTDOWN=
USR_ORA_LANG=
USR_ORA_NETMASK=
USR_ORA_OPEN_MODE=
USR_ORA_OPI=false
USR_ORA_PFILE=
USR_ORA_PRECONNECT=none
USR_ORA_SRV=
USR_ORA_START_TIMEOUT=0
USR_ORA_STOP_MODE=immediate
USR_ORA_STOP_TIMEOUT=0
USR_ORA_VIP=

(B)    vi  $ORA_CRS_HOME/crs/public/ora.rc1.LISTENER_DB_RC1.lsnr.cap

Modify 
"AUTO_START=1" to "AUTO_START=2"  and "RESTART_ATTEMPTS=5" to "RESTART_ATTEMPTS=0"


(C)    Register the configuration changes done on STEP (B) in the resource profile.   

    [oracle@rc1.myrac.com] # crs_register -u ora.rc1.LISTENER_DB_RC1.lsnr


So next time when CRS will try to make this resource up, it will see the profile and will skip this resource and will not start it automatically as we just disabled the autostart and reduced the RESTART_ATTEMPTS by CRS to start this resource to 0.

No comments:

Post a Comment

  How to Change Instance Type & Security Group of EC2 in AWS By David Taylor Updated April 29, 2023 EC2 stands for Elastic Compute Cloud...