Home > Oracle in general > Integrate EM Console Startup/Shutdown into Clusterware Control

Integrate EM Console Startup/Shutdown into Clusterware Control

When installing a RAC clusterware is responsible for starting and stopping required resources automatically and in required order. Under normal circumstances every resource is integrated with one exception: EM Control.

So this is a short guide on how to integrate EM Console startup/shutdown into Clusterware resource control.

First of all you need a startup/shutdown script:

#!/bin/sh
 case $1 in
 'start')
 /u01/app/oracle/product/11.2.0/db_1/bin/emctl start dbconsole
 RET=$?
 ;;
 'stop')
 /u01/app/oracle/product/11.2.0/db_1/bin/emctl stop dbconsole
 RET=$?
 ;;
 'check')
 /u01/app/oracle/product/11.2.0/db_1/bin/emctl status dbconsole
 RET=$?
 ;;
 esac
 exit $RET

After creating the script and placing is under /scripts you need to add the resource:

#crsctl add resource crs_dbconsole type cluster_resource -attr " ACTION SCRIPT= '/scripts/crs_dbconsole.sh' ,
PLACEMENT= 'restricted' , HOSTING_MEMBERS= 'node1' , CHECK_INTERVAL='30' , 
START_DEPENDENICES= 'hard(appsvip)' ,STOP_DEPENDENCIES= 'hard(appsvip)' , RESTART_ATTEMPTS='2' "
Categories: Oracle in general Tags:
  1. May 4th, 2010 at 10:37 | #1

    great post as usual!

  2. Wissem
    July 6th, 2011 at 14:57 | #2

    Ronny,
    How to make it work for a single instance, grid standalone? I have tried your method but doesn’t work!

    [root@db ~]# /opt/11.2.0/grid/bin/crsctl start resource crs_dbconsole
    CRS-2672: Attempting to start ‘crs_dbconsole’ on ‘db’
    CRS-2674: Start of ‘crs_dbconsole’ on ‘db’ failed
    CRS-2679: Attempting to clean ‘crs_dbconsole’ on ‘db’
    CRS-2678: ‘crs_dbconsole’ on ‘db’ has experienced an unrecoverable failure
    CRS-0267: Human intervention required to resume its availability.
    CRS-5802: Unable to start the agent process
    CRS-4000: Command Start failed, or completed with errors.

    I have add the resource with root user:

    [root@db ~]# /opt/11.2.0/grid/bin/crsctl add resource crs_dbconsole -type local_resource -attr ” ACTION_SCRIPT= ‘/opt/11.2.0/grid/crs/script/crs_dbconsole.sh’ ,
    DESCRIPTION=Auto restart db console, DEGREE=1, ENABLED=1, CHECK_INTERVAL=’60’ ,
    AUTO_START=restore, START_TIMEOUT=0, UPTIME_THRESHOLD=1h,
    STOP_TIMEOUT=0, SCRIPT_TIMEOUT=300, RESTART_ATTEMPTS=3, OFFLINE_CHECK_INTERVAL=60 ”

    the crs_dbconsole.sh script:

    [root@db ~]# cat /opt/11.2.0/grid/crs/script/crs_dbconsole.sh
    #!/bin/sh
    case $1 in
    ‘start’)
    /opt/app/oracle/product/11.2.0/db_1/bin/emctl start dbconsole
    RET=$?
    ;;
    ‘stop’)
    /opt/app/oracle/product/11.2.0/db_1/bin/emctl stop dbconsole
    RET=$?
    ;;
    ‘check’)
    /opt/app/oracle/product/11.2.0/db_1/bin/emctl status dbconsole
    RET=$?
    ;;
    esac
    exit $RET
    [root@db ~]#

    and i chmod 755 crs_dbconsole.sh.

    AS I said before, I am in Standalone grid Infrstaructure, for a single 11.2.0.2 instance

  3. Ronny Egner
    August 19th, 2011 at 09:22 | #3

    Hi,

    sorry for the delay. You need to check the oraagent log files for error. Or you could add some debugging output to the script.

  4. John
    November 1st, 2011 at 03:13 | #4

    With regards to single instance,Do you think we should set dependencies (database,listener) if we want to enable dbconsole into oracle restart ?

  1. April 29th, 2010 at 20:43 | #1