1) requiretty commented out in /etc/sudoers file

2) Following sudo commands added on all hosts for oracrs:

sudo –u oraoem /oracle/product/1120/crs/script/agentstartup.sh

3) Create the file /oracle/product/1120/crs/crs/script/agentstartup.sh containing:

#!/bin/bash

#

ORACLE_BASE=/oracle/product/middleware

ORACLE_HOME=/oracle/product/middleware/agent12c

ORACLE_SID=agent12c

LD_LIBRARY_PATH=$ORACLE_HOME/lib

PATH=$ORACLE_HOME/bin:$PATH

AGENT_HOME=/oracle/product/middleware/agent12c

export ORACLE_BASE

export ORACLE_HOME

export ORACLE_SID

export LD_LIBRARY_PATH

export PATH

export AGENT_HOME

agent_start () {

$AGENT_HOME/bin/emctl start agent

}

agent_stop () {

$AGENT_HOME/bin/emctl stop agent

}

agent_check () {

$AGENT_HOME/bin/emctl status agent

}

case “$1” in

start)

agent_start

;;

stop)

agent_stop

;;

check)

agent_check

;;

clean)

agent_clean $(ps -C emagent -o pid=)

;;

*)

echo $”Usage: ‘basename $0’ {start|stop|status|clean}”

exit 1

esac

 

4) Create the file /oracle/product/1120/crs/crs/script/crs_agent12c.sh containing:

#!/bin/bash

#

# dbcagent.sh – scriot to start and stop the EMC 12c agent

#

ORACLE_BASE=/oracle/product/middleware

ORACLE_HOME=/oracle/product/middleware/agent12c

ORACLE_SID=agent12c

LD_LIBRARY_PATH=$ORACLE_HOME/lib

PATH=$ORACLE_HOME/bin:$PATH

export ORACLE_BASE

export ORACLE_HOME

export LD_LIBRARY_PATH

export ORACLE_SID

export PATH

agent_start () {

sudo -u oraoem /oracle/product/1120/crs/crs/script/agentstartup.sh start

}

agent_stop () {

sudo -u oraoem /oracle/product/1120/crs/crs/script/agentstartup.sh stop

}

agent_check () {

sudo -u oraoem /oracle/product/1120/crs/crs/script/agentstartup.sh check

}

case “$1” in

start)

agent_start

;;

stop)

agent_stop

;;

check)

agent_check

;;

clean)

agent_clean $(ps -C emagent -o pid=)

;;

*)

echo $”Usage: ‘basename $0’ {start|stop|status|clean}”

exit 1

esac

 

5) chmod 755 /oracle/product/1120/crs/crs/script/*

6) ON NODE

crsctl add resource app.agent_NODE -type application -attr “AUTO_START=restore, ACTION_SCRIPT=/oracle/product/1120/crs/crs/script/crs_agent12c.sh, CHECK_INTERVAL=60,FAILOVER_DELAY=0, FAILURE_INTERVAL=0,FAILURE_THRESHOLD=0,HOSTING_MEMBERS=NODE,PLACEMENT=restricted,RESTART_ATTEMPTS=10,SCRIPT_TIMEOUT=360”

7)

crsctl stop res app.agent_NODE etc all now works.