How to Start/Stop script for Oracle Enterprise Manager 12C

The scripts can automate start and stop routines.  make sure you have this setup so you do not waste time when something goes bad and you have to do maintenance on your Oracle Enterprise Management System.

  • Script to start the Oracle Enterprise Manager 12C

#!/bin/bash
export ORACLE_SID="DBNAME"
export ORACLE_HOME=/u00/app/oracle/product/11.2.0/db1
export OMS_HOME=/u01/app/oracle/oms12cr2/oms
export AGENT_HOME=/u01/app/oracle/agent12cr2/core/12.1.0.2.0

# Start everything
$ORACLE_HOME/bin/dbstart $ORACLE_HOME

$OMS_HOME/bin/emctl start oms

$AGENT_HOME/bin/emctl start agent
Make sure the you alter the script to match with your environment.
  • Script to stop the Oracle Enterprise Manager 12C

#!/bin/bash
export ORACLE_SID="DBNAME"
export ORACLE_HOME=/u00/app/oracle/product/11.2.0/db1
export OMS_HOME=/u01/app/oracle/oms12cr2/oms
export AGENT_HOME=/u01/app/oracle/agent12cr2/core/12.1.0.2.0

# Stop everything
$ORACLE_HOME/bin/dbshut $ORACLE_HOME

$OMS_HOME/bin/emctl stop oms -all

$AGENT_HOME/bin/emctl stop agent
Make sure the you alter the script to match with your environment.

See video tutorial here as well